aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author_manuel_ <manue.l@live.com.ar>2010-02-26 03:14:30 -0300
committer_manuel_ <manue.l@live.com.ar>2010-02-26 03:14:30 -0300
commitda7e5cba120f46561e30c6c2a7465644a55b2e65 (patch)
tree0fa82c55bd966c88a54e7c094c141e3980c1d6ed
parentea0df87c97d08f8d427d1a78775a0d30c05f9268 (diff)
Implemented script for npc Argent Valiant. Last script to support quest The Aspirant's Challenge. For a full fix see TDB Forum - Core related DB content.
--HG-- branch : trunk
-rw-r--r--src/scripts/northrend/icecrown.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/scripts/northrend/icecrown.cpp b/src/scripts/northrend/icecrown.cpp
index 92ea4145db5..a912653099d 100644
--- a/src/scripts/northrend/icecrown.cpp
+++ b/src/scripts/northrend/icecrown.cpp
@@ -172,6 +172,78 @@ bool GossipSelect_npc_squire_david(Player* pPlayer, Creature* pCreature, uint32
return true;
}
+enum eArgentValiant
+{
+ SPELL_CHARGE = 63010,
+ SPELL_SHIELD_BREAKER = 65147,
+
+ NPC_ARGENT_VALIANT_CREDIT = 24108
+};
+
+struct npc_argent_valiantAI : public ScriptedAI
+{
+ npc_argent_valiantAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ pCreature->GetMotionMaster()->MovePoint(0,8599.258,963.951,547.553);
+ pCreature->setFaction(35); //wrong faction in db?
+ }
+
+ uint32 uiChargeTimer;
+ uint32 uiShieldBreakerTimer;
+
+ void Reset()
+ {
+ uiChargeTimer = 7000;
+ uiShieldBreakerTimer = 10000;
+ }
+
+ void MovementInform(uint32 uiType, uint32 uiId)
+ {
+ if (uiType != POINT_MOTION_TYPE)
+ return;
+
+ m_creature->setFaction(14);
+ }
+
+ void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
+ {
+ if (uiDamage > m_creature->GetHealth() && pDoneBy->GetTypeId() == TYPEID_PLAYER)
+ {
+ uiDamage = 0;
+ CAST_PLR(pDoneBy)->KilledMonsterCredit(NPC_ARGENT_VALIANT_CREDIT,0);
+ m_creature->setFaction(35);
+ m_creature->ForcedDespawn(5000);
+ m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
+ EnterEvadeMode();
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (uiChargeTimer <= uiDiff)
+ {
+ DoCastVictim(SPELL_CHARGE);
+ uiChargeTimer = 7000;
+ } else uiChargeTimer -= uiDiff;
+
+ if (uiShieldBreakerTimer <= uiDiff)
+ {
+ DoCastVictim(SPELL_SHIELD_BREAKER);
+ uiShieldBreakerTimer = 10000;
+ } else uiShieldBreakerTimer -= uiDiff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_argent_valiant(Creature* pCreature)
+{
+ return new npc_argent_valiantAI (pCreature);
+}
+
void AddSC_icecrown()
{
Script *newscript;
@@ -192,4 +264,10 @@ void AddSC_icecrown()
newscript->Name = "npc_squire_david";
newscript->pGossipHello = &GossipHello_npc_squire_david;
newscript->pGossipSelect = &GossipSelect_npc_squire_david;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_argent_valiant";
+ newscript->GetAI = &GetAI_npc_argent_valiant;
+ newscript->RegisterSelf();
}