Core/Spells: Implemented battle pet experience related spell effects and auras

Port From (https://github.com/TrinityCore/TrinityCore/commit/9354b4ac8ec63f0b2ee5ceb3c8b6a3c6a75bd99f)
This commit is contained in:
hondacrx
2022-02-17 10:40:20 -05:00
parent 9db44e3a21
commit bd80047a09
7 changed files with 121 additions and 5 deletions
+16
View File
@@ -5508,6 +5508,22 @@ namespace Game.Spells
ChatMsg chatType = (ChatMsg)effectInfo.MiscValueB;
unitCaster.Talk(broadcastTextId, chatType, Global.CreatureTextMgr.GetRangeForChatType(chatType), unitTarget);
}
[SpellEffectHandler(SpellEffectName.GrantBattlepetExperience)]
void EffectGrantBattlePetExperience()
{
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
Player playerCaster = m_caster.ToPlayer();
if (playerCaster == null)
return;
if (!unitTarget || !unitTarget.IsCreature())
return;
playerCaster.GetSession().GetBattlePetMgr().GrantBattlePetExperience(unitTarget.GetBattlePetCompanionGUID(), (ushort)damage, BattlePetXpSource.SpellEffect);
}
}
public class DispelableAura