void OnCombatStart(Unit* pTarget) { SetDisplayWeapon(true, true); ParentClass::OnCombatStart(pTarget); mAliveAdds = 0; mLastYell = -1; for (int i = 0; i < 4; ++i) { Unit* pAdd = ForceCreatureFind(Adds[i]); if (pAdd != NULL && pAdd->isAlive()) { Unit* pTarget = GetBestPlayerTarget(); if (pTarget != NULL) { pAdd->GetAIInterface()->AttackReaction(pTarget, 200); } ++mAliveAdds; } } if (mAliveAdds > 1) { SetCanEnterCombat(false); SetBehavior(Behavior_Spell); SetCanMove(false); } }
void OnLoad() { RegisterAIUpdateEvent(500); _unit->SetUInt32Value(UNIT_FIELD_FLAGS, 33024); // from database _unit->SetFaction(7); _unit->SetStandState( uint8(STANDSTATE_KNEEL) ); SetDisplayWeapon(false, false); state = -1; anchorGuid = 0; ParentClass::OnLoad(); }