diff options
author | Kudlaty <none@none> | 2009-11-13 16:34:04 +0100 |
---|---|---|
committer | Kudlaty <none@none> | 2009-11-13 16:34:04 +0100 |
commit | 3b4159e1e3364651f2712d47728538c96f824059 (patch) | |
tree | c9ece5d0e917b8c946a55076720faeae0e887c8d /src/game/UnitAI.cpp | |
parent | f04da1b620c3510cb9329d8efdb4efeebd83cf48 (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.cpp | 30 |
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; |