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:
@@ -5313,6 +5313,7 @@ namespace Game.Spells
|
||||
break;
|
||||
}
|
||||
case SpellEffectName.ChangeBattlepetQuality:
|
||||
case SpellEffectName.GrantBattlepetLevel:
|
||||
case SpellEffectName.GrantBattlepetExperience:
|
||||
{
|
||||
Player playerCaster = m_caster.ToPlayer();
|
||||
@@ -5362,7 +5363,7 @@ namespace Game.Spells
|
||||
return SpellCastResult.CantUpgradeBattlePet;
|
||||
}
|
||||
|
||||
if (spellEffectInfo.Effect == SpellEffectName.GrantBattlepetExperience)
|
||||
if (spellEffectInfo.Effect == SpellEffectName.GrantBattlepetLevel || spellEffectInfo.Effect == SpellEffectName.GrantBattlepetExperience)
|
||||
if (battlePet.PacketInfo.Level >= SharedConst.MaxBattlePetLevel)
|
||||
return SpellCastResult.GrantPetLevelFail;
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user