New functions: void DoAddAuraToAllHostilePlayers & void DoCastToAllHostilePlayers
patch by Maanuel

--HG--
branch : trunk
This commit is contained in:
Kudlaty committed 2009-11-13 16:34:04 +01:00
1 parent f04da1b620
commit 3b4159e1e3
3 files changed
+35 -13

No files matched your search

+30
View File
@@ -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;