Apply #212
New functions: void DoAddAuraToAllHostilePlayers & void DoCastToAllHostilePlayers patch by Maanuel --HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -68,8 +68,10 @@ class TRINITY_DLL_SPEC UnitAI
|
||||
|
||||
void AttackStartCaster(Unit *victim, float dist);
|
||||
|
||||
void DoAddAuraToAllHostilePlayers(uint32 spellid);
|
||||
void DoCast(uint32 spellId);
|
||||
void DoCast(Unit* victim, uint32 spellId, bool triggered = false);
|
||||
void DoCastToAllHostilePlayers(uint32 spellid, bool triggered = false);
|
||||
void DoCastVictim(uint32 spellId, bool triggered = false);
|
||||
void DoCastAOE(uint32 spellId, bool triggered = false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user