Core/Spells: Implemented spell effect 204 (SPELL_EFFECT_CHANGE_BATTLEPET_QUALITY)
Port From (https://github.com/TrinityCore/TrinityCore/commit/c4fee8c5cf85aeddc45aad18d7a944efa59022bd)
This commit is contained in:
@@ -5083,6 +5083,36 @@ namespace Game.Spells
|
||||
player.GetSession().GetBattlePetMgr().UnlockSlot(BattlePetSlots.Slot0);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.ChangeBattlepetQuality)]
|
||||
void EffectChangeBattlePetQuality()
|
||||
{
|
||||
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
|
||||
return;
|
||||
|
||||
Player playerCaster = m_caster.ToPlayer();
|
||||
if (playerCaster == null)
|
||||
return;
|
||||
|
||||
if (unitTarget == null || !unitTarget.IsCreature())
|
||||
return;
|
||||
|
||||
var quality = BattlePetBreedQuality.Poor;
|
||||
switch (damage)
|
||||
{
|
||||
case 85:
|
||||
quality = BattlePetBreedQuality.Rare;
|
||||
break;
|
||||
case 75:
|
||||
quality = BattlePetBreedQuality.Uncommon;
|
||||
break;
|
||||
default:
|
||||
// Ignore Epic Battle-Stones
|
||||
break;
|
||||
}
|
||||
|
||||
playerCaster.GetSession().GetBattlePetMgr().ChangeBattlePetQuality(unitTarget.GetBattlePetCompanionGUID(), quality);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.LaunchQuestChoice)]
|
||||
void EffectLaunchQuestChoice()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user