Core/Auras: implemented PROC_FLAG_HEARTBEAT and moved food/drink emote mechanic into heartbeat handling
Port From (https://github.com/TrinityCore/TrinityCore/commit/d60b4e5b199d56477010941fc1d3aff9eb7064a2)
This commit is contained in:
@@ -364,6 +364,8 @@ namespace Game.Spells
|
||||
// m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs
|
||||
}
|
||||
|
||||
public virtual void Heartbeat() { }
|
||||
|
||||
public T GetScript<T>() where T : AuraScript
|
||||
{
|
||||
return (T)GetScriptByType(typeof(T));
|
||||
@@ -2863,6 +2865,28 @@ namespace Game.Spells
|
||||
_staticApplications[target.GetGUID()] |= effMask;
|
||||
}
|
||||
|
||||
void Heartbeat()
|
||||
{
|
||||
base.Heartbeat();
|
||||
|
||||
// Periodic food and drink emote animation
|
||||
HandlePeriodicFoodSpellVisualKit();
|
||||
}
|
||||
|
||||
void HandlePeriodicFoodSpellVisualKit()
|
||||
{
|
||||
SpellSpecificType specificType = GetSpellInfo().GetSpellSpecific();
|
||||
|
||||
bool food = specificType == SpellSpecificType.Food || specificType == SpellSpecificType.FoodAndDrink;
|
||||
bool drink = specificType == SpellSpecificType.Drink || specificType == SpellSpecificType.FoodAndDrink;
|
||||
|
||||
if (food)
|
||||
GetUnitOwner().SendPlaySpellVisualKit(SpellConst.VisualKitFood, 0, 0);
|
||||
|
||||
if (drink)
|
||||
GetUnitOwner().SendPlaySpellVisualKit(SpellConst.VisualKitDrink, 0, 0);
|
||||
}
|
||||
|
||||
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
|
||||
public void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
|
||||
public DiminishingGroup GetDiminishGroup() { return m_AuraDRGroup; }
|
||||
|
||||
Reference in New Issue
Block a user