void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (GetTarget()->GetTypeId() != TYPEID_PLAYER) return; Player* pTarget = GetTarget()->ToPlayer(); oldAI = pTarget->AI(); oldAIState = pTarget->IsAIEnabled; GetTarget()->SetAI(new player_overlord_brandAI(pTarget, GetCasterGUID())); GetTarget()->IsAIEnabled = true; }
void UpdateAI(const uint32 diff) { if(InciteChaos) { if(InciteChaosWait_Timer < diff) { InciteChaos = false; DoZoneInCombat(); DoResetThreat(); Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true); if(target) AttackStart(target); } else InciteChaosWait_Timer -= diff; return; } if (!UpdateVictim()) return; else TrashAggro(); if(InciteChaos_Timer < diff) { DoCast(me, SPELL_INCITE_CHAOS); Map *map = me->GetMap(); Map::PlayerList const &PlayerList = map->GetPlayers(); if(PlayerList.isEmpty()) return; for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { Player *plr = i->getSource(); Player *target = (Player*)SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true, plr->GetGUID()); if(plr && plr->IsAIEnabled && target) plr->AI()->AttackStart(target); } //DoResetThreat(); InciteChaos = true; InciteChaos_Timer = 40000; InciteChaosWait_Timer = 16000; return; } else InciteChaos_Timer -= diff; //Charge_Timer if (Charge_Timer < diff) { if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true)) DoCast(target, SPELL_CHARGE); Charge_Timer = 25000; } else Charge_Timer -= diff; //Knockback_Timer if (Knockback_Timer < diff) { DoCast(me, SPELL_WAR_STOMP); Knockback_Timer = 20000; } else Knockback_Timer -= diff; DoMeleeAttackIfReady(); }