Core/Unit: allow pets and totems to drop mod charges in owner auras.

Needed for Cobra Strikes (re)implementation
This commit is contained in:
ariel- authored and roc13x committed 2017-05-04 01:10:51 +01:00
1 parent 60b390a3e8
commit c131f68f63
1 file changed
+15
+15
View File
@@ -10675,6 +10675,21 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin
{
AuraApplicationProcContainer myAurasTriggeringProc;
GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, nullptr, myProcEventInfo);
// needed for example for Cobra Strikes, pet does the attack, but aura is on owner
if (Player* modOwner = GetSpellModOwner())
{
if (modOwner != this && spell)
{
AuraApplicationList modAuras;
for (auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
{
if (spell->m_appliedMods.count(itr->second->GetBase()) != 0)
modAuras.push_back(itr->second);
}
modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
}
}
TriggerAurasProcOnEvent(myProcEventInfo, myAurasTriggeringProc);
}