aboutsummaryrefslogtreecommitdiff
path: root/src/game/UnitAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/UnitAI.cpp')
-rw-r--r--src/game/UnitAI.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/game/UnitAI.cpp b/src/game/UnitAI.cpp
index 85b8ad6abba..bafcb04a2f3 100644
--- a/src/game/UnitAI.cpp
+++ b/src/game/UnitAI.cpp
@@ -237,6 +237,36 @@ float UnitAI::DoGetSpellMaxRange(uint32 spellId, bool positive)
return GetSpellMaxRange(spellId, positive);
}
+void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid)
+{
+ if (me->isInCombat())
+ {
+ std::list<HostilReference*>& threatlist = me->getThreatManager().getThreatList();
+ for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
+ {
+ if (Unit *pTemp = Unit::GetUnit(*me,(*itr)->getUnitGuid()))
+ if (pTemp->GetTypeId() == TYPEID_PLAYER)
+ me->AddAura(spellid, pTemp);
+ }
+ }else
+ return;
+}
+
+void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
+{
+ if (me->isInCombat())
+ {
+ std::list<HostilReference*>& threatlist = me->getThreatManager().getThreatList();
+ for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
+ {
+ if (Unit *pTemp = Unit::GetUnit(*me,(*itr)->getUnitGuid()))
+ if (pTemp->GetTypeId() == TYPEID_PLAYER)
+ me->CastSpell(pTemp, spellid, triggered);
+ }
+ }else
+ return;
+}
+
void UnitAI::DoCast(uint32 spellId)
{
Unit *target = NULL;