Core/Scripts: Remove hook GetAuraEffectTriggerTarget from CreatureAI.h
The hook was made for one obsolete script, which turned out to not work anyways.
This commit is contained in:
@@ -116,9 +116,6 @@ class CreatureAI : public UnitAI
|
|||||||
// Called when spell hits a target
|
// Called when spell hits a target
|
||||||
virtual void SpellHitTarget(Unit* /*target*/, SpellEntry const* /*spell*/) {}
|
virtual void SpellHitTarget(Unit* /*target*/, SpellEntry const* /*spell*/) {}
|
||||||
|
|
||||||
// Called to get trigger target for aura effect
|
|
||||||
virtual Unit* GetAuraEffectTriggerTarget(uint32 /*spellId*/, uint8 /*effIndex*/) { return NULL; }
|
|
||||||
|
|
||||||
// Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
|
// Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
|
||||||
//virtual void AttackedBy(Unit* attacker);
|
//virtual void AttackedBy(Unit* attacker);
|
||||||
virtual bool IsEscorted() { return false; }
|
virtual bool IsEscorted() { return false; }
|
||||||
|
|||||||
@@ -2149,22 +2149,12 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* AuraEffect::GetTriggerTarget(Unit * target) const
|
|
||||||
{
|
|
||||||
if (target->GetTypeId() == TYPEID_UNIT)
|
|
||||||
{
|
|
||||||
if (Unit * trigger = target->ToCreature()->AI()->GetAuraEffectTriggerTarget(GetId(), GetEffIndex()))
|
|
||||||
return trigger;
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
|
void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
|
||||||
{
|
{
|
||||||
if (!caster || !target)
|
if (!caster || !target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Unit* triggerTarget = GetTriggerTarget(target);
|
Unit* triggerTarget = target;
|
||||||
|
|
||||||
// generic casting code with custom spells and target/caster customs
|
// generic casting code with custom spells and target/caster customs
|
||||||
uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[GetEffIndex()];
|
uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[GetEffIndex()];
|
||||||
@@ -2468,7 +2458,7 @@ void AuraEffect::TriggerSpellWithValue(Unit * target, Unit * caster) const
|
|||||||
if (!caster || !target)
|
if (!caster || !target)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Unit* triggerTarget = GetTriggerTarget(target);
|
Unit* triggerTarget = target;
|
||||||
|
|
||||||
uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[m_effIndex];
|
uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[m_effIndex];
|
||||||
SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(triggerSpellId);
|
SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(triggerSpellId);
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ class AuraEffect
|
|||||||
|
|
||||||
void PeriodicTick(AuraApplication * aurApp, Unit * caster) const;
|
void PeriodicTick(AuraApplication * aurApp, Unit * caster) const;
|
||||||
void PeriodicDummyTick(Unit * target, Unit * caster) const;
|
void PeriodicDummyTick(Unit * target, Unit * caster) const;
|
||||||
Unit* GetTriggerTarget(Unit * target) const;
|
|
||||||
void TriggerSpell(Unit * target, Unit * caster) const;
|
void TriggerSpell(Unit * target, Unit * caster) const;
|
||||||
void TriggerSpellWithValue(Unit * target, Unit * caster) const;
|
void TriggerSpellWithValue(Unit * target, Unit * caster) const;
|
||||||
|
|
||||||
|
|||||||
@@ -255,39 +255,6 @@ public:
|
|||||||
CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability);
|
CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit *GetHatedManaUser() const
|
|
||||||
{
|
|
||||||
std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList();
|
|
||||||
for (std::list<HostileReference*>::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
|
||||||
if (Unit* unit = (*i)->getTarget())
|
|
||||||
if (unit->getPowerType() == POWER_MANA)
|
|
||||||
return unit;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Unit* GetAuraEffectTriggerTarget(uint32 spellId, uint8 /*effIndex*/)
|
|
||||||
{
|
|
||||||
switch (spellId)
|
|
||||||
{
|
|
||||||
case SPELL_KNOCK_BUFF:
|
|
||||||
case SPELL_THUNDER_BUFF:
|
|
||||||
case SPELL_MSTRIKE_BUFF:
|
|
||||||
case SPELL_STORM_BUFF:
|
|
||||||
return me->getVictim();
|
|
||||||
|
|
||||||
case SPELL_MANAB_BUFF:
|
|
||||||
return GetHatedManaUser();
|
|
||||||
|
|
||||||
case SPELL_MENDING_BUFF:
|
|
||||||
case SPELL_REFLECTAF_BUFF:
|
|
||||||
case SPELL_REFLECTSFr_BUFF:
|
|
||||||
case SPELL_THORNS_BUFF:
|
|
||||||
default:
|
|
||||||
return me;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user