diff options
author | _manuel_ <manue.l@live.com.ar> | 2010-04-18 10:56:12 -0300 |
---|---|---|
committer | _manuel_ <manue.l@live.com.ar> | 2010-04-18 10:56:12 -0300 |
commit | f928c04734041f1078af72fe7abf8b2c2022d6a4 (patch) | |
tree | ad77e397d3431d7129709983daecc0c19b881c89 /src/scripts | |
parent | 1ba710a7bd959908adef4a5d1614efe13e7018d1 (diff) |
Improvements in npc_warmage_violetstandAI
--HG--
branch : trunk
Diffstat (limited to 'src/scripts')
-rw-r--r-- | src/scripts/northrend/crystalsong_forest.cpp | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/src/scripts/northrend/crystalsong_forest.cpp b/src/scripts/northrend/crystalsong_forest.cpp index 23fca042e17..389fa2da610 100644 --- a/src/scripts/northrend/crystalsong_forest.cpp +++ b/src/scripts/northrend/crystalsong_forest.cpp @@ -47,56 +47,50 @@ struct npc_warmage_violetstandAI : public Scripted_NoMovementAI { npc_warmage_violetstandAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature){} - uint32 m_uiTimer; //Timer until recast + uint64 uiTargetGUID; void Reset() { - m_uiTimer = 0; + uiTargetGUID = 0; } - void Aggro(Unit* pWho){} - - void AttackStart(Unit* pWho){} - void UpdateAI(const uint32 uiDiff) { - if (m_uiTimer <= uiDiff) - { - me->CastStop(); - Creature* pTarget = GetClosestCreatureWithEntry(me,NPC_TRANSITUS_SHIELD_DUMMY,32.0f); + if (me->IsNonMeleeSpellCasted(false)) + return; - switch(me->GetEntry()) + if (me->GetEntry() == NPC_WARMAGE_SARINA) + { + if (!uiTargetGUID) { - case NPC_WARMAGE_SARINA: + std::list<Creature*> orbList; + GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f); + if (!orbList.empty()) { - std::list<Creature*> orbList; - GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f); - if (!orbList.empty()) + for (std::list<Creature*>::const_iterator itr = orbList.begin(); itr != orbList.end(); ++itr) { - for (std::list<Creature*>::const_iterator itr = orbList.begin(); itr != orbList.end(); ++itr) + if (Creature* pOrb = *itr) { - if (Creature* pOrb = *itr) - if (pOrb->GetPositionY() < 1000) - DoCast(pOrb,SPELL_TRANSITUS_SHIELD_BEAM); + if (pOrb->GetPositionY() < 1000) + { + uiTargetGUID = pOrb->GetGUID(); + break; + } } } - m_uiTimer = 90000; } - break; - case NPC_WARMAGE_HALISTER: - case NPC_WARMAGE_ILSUDRIA: - if (pTarget) - DoCast(pTarget,SPELL_TRANSITUS_SHIELD_BEAM); - m_uiTimer = 90000; - break; } - } - else m_uiTimer -= uiDiff; + }else + { + if (!uiTargetGUID) + if (Creature* pOrb = GetClosestCreatureWithEntry(me,NPC_TRANSITUS_SHIELD_DUMMY,32.0f)) + uiTargetGUID = pOrb->GetGUID(); - ScriptedAI::UpdateAI(uiDiff); + } + + if (Creature* pOrb = me->GetCreature(*me,uiTargetGUID)) + DoCast(pOrb,SPELL_TRANSITUS_SHIELD_BEAM); - if (!UpdateVictim()) - return; } }; |