void GetOtherSentinels(Unit* who) { bool *chosenAbilities = new bool[9]; memset(chosenAbilities, 0, 9*sizeof(bool)); selectAbility(pickAbilityRandom(chosenAbilities)); ClearBuddyList(); AddSentinelsNear(me); int bli; for (bli = 0; bli < 3; ++bli) { if (!NearbyGUID[bli]) break; Creature* pNearby = Unit::GetCreature(*me, NearbyGUID[bli]); if (!pNearby) break; AddSentinelsNear(pNearby); CAST_AI(aqsentinelAI, pNearby->AI())->gatherOthersWhenAggro = false; CAST_AI(aqsentinelAI, pNearby->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); } /*if (bli < 3) DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ SendMyListToBuddies(); CallBuddiesToAttack(who); delete[] chosenAbilities; }
void Reset() { if (!me->isDead()) { for (int i=0; i<3; ++i) { if (!NearbyGUID[i]) continue; if (Creature* pNearby = Unit::GetCreature(*me, NearbyGUID[i])) { if (pNearby->isDead()) pNearby->Respawn(); } } } ClearBuddyList(); gatherOthersWhenAggro = true; }
aqsentinelAI(Creature* c) : ScriptedAI(c) { ClearBuddyList(); abselected = 0; // just initialization of variable }
void Initialize() { ClearBuddyList(); gatherOthersWhenAggro = true; }