From 3b4159e1e3364651f2712d47728538c96f824059 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Fri, 13 Nov 2009 16:34:04 +0100 Subject: Apply #212 New functions: void DoAddAuraToAllHostilePlayers & void DoCastToAllHostilePlayers patch by Maanuel --HG-- branch : trunk --- src/game/UnitAI.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/game/UnitAI.cpp') 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& threatlist = me->getThreatManager().getThreatList(); + for (std::list::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& threatlist = me->getThreatManager().getThreatList(); + for (std::list::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; -- cgit v1.2.3