void StartDefense() { Player* player = getNearestPlayer(); if (player == nullptr) return; //Don't do anything with horde players if (player->IsTeamHorde()) return; float player_x = player->GetPositionX(); float player_y = player->GetPositionY(); float player_z = player->GetPositionZ(); //hardcoded values... // the guards should cast the spell if someone is behind them... if (player_x < 5891.88f && player_x >5858.89f && player_y < 594.99f && player_y >565.51f && player_z > 635.0f) { getCreature()->setTargetGuid(player->getGuid()); getCreature()->EventCastSpell(player, sSpellCustomizations.GetSpellInfo(54029)); } else { getCreature()->setTargetGuid(0); //Reset target... ugly } }
void StartDefense() { Player* player = getNearestPlayer(); if (player == nullptr) return; //Don't do anything with alliance players if (player->IsTeamAlliance()) return; float player_x = player->GetPositionX(); float player_y = player->GetPositionY(); float player_z = player->GetPositionZ(); //hardcoded values... // the guards should cast the spell if someone is behind them... if (player_x < 5761.9f && player_x >5738.68f && player_y < 732.12f && player_y >712.09f && player_z > 635.0f) { getCreature()->setTargetGuid(player->getGuid()); getCreature()->EventCastSpell(player, sSpellCustomizations.GetSpellInfo(54028)); } else { getCreature()->setTargetGuid(0); //Reset target... ugly } }
void OnLoad() override { getCreature()->addUnitFlags(UNIT_FLAG_IGNORE_PLAYER_COMBAT); Player* pTarget = getNearestPlayer(); if (pTarget != nullptr) getCreature()->GetAIInterface()->AttackReaction(pTarget, 50, 0); }
void OnLoad() override { Player* pTarget = getNearestPlayer(); if (pTarget != nullptr) getCreature()->GetAIInterface()->AttackReaction(pTarget, 50, 0); }
void OnLoad() override { setRooted(true); plr = getNearestPlayer(); }