aboutsummaryrefslogtreecommitdiff
path: root/src/game/UnitAI.cpp
diff options
context:
space:
mode:
authorKudlaty <none@none>2009-11-13 16:34:04 +0100
committerKudlaty <none@none>2009-11-13 16:34:04 +0100
commit3b4159e1e3364651f2712d47728538c96f824059 (patch)
treec9ece5d0e917b8c946a55076720faeae0e887c8d /src/game/UnitAI.cpp
parentf04da1b620c3510cb9329d8efdb4efeebd83cf48 (diff)
Apply #212
New functions: void DoAddAuraToAllHostilePlayers & void DoCastToAllHostilePlayers patch by Maanuel --HG-- branch : trunk
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;