Core/Spells: Implemented spell effect 225 (SPELL_EFFECT_GRANT_BATTLEPET_LEVEL)

Port From (https://github.com/TrinityCore/TrinityCore/commit/ddc71206de653d05aed479b82260bcf55dd72445)
This commit is contained in:
hondacrx
2022-02-24 15:46:20 -05:00
parent 57bded1def
commit a03149d9b4
3 changed files with 71 additions and 1 deletions
+16
View File
@@ -5101,6 +5101,22 @@ namespace Game.Spells
garrison.ActivateBuilding((uint)effectInfo.MiscValue);
}
[SpellEffectHandler(SpellEffectName.GrantBattlepetLevel)]
void EffectGrantBattlePetLevel()
{
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
Player playerCaster = m_caster.ToPlayer();
if (playerCaster == null)
return;
if (unitTarget == null || !unitTarget.IsCreature())
return;
playerCaster.GetSession().GetBattlePetMgr().GrantBattlePetLevel(unitTarget.GetBattlePetCompanionGUID(), (ushort)damage);
}
[SpellEffectHandler(SpellEffectName.HealBattlepetPct)]
void EffectHealBattlePetPct()
{