Core/BattlePets: Misc fixes

Port From (https://github.com/TrinityCore/TrinityCore/commit/924182f692bde38d8fed85d5dbe7531a09790501)
This commit is contained in:
hondacrx
2022-01-07 13:20:16 -05:00
parent 56b2c4e0a4
commit e0340e7c07
7 changed files with 86 additions and 37 deletions
+10 -2
View File
@@ -20,6 +20,7 @@ using Framework.Database;
using Game.DataStorage;
using Game.Entities;
using Game.Networking.Packets;
using Game.Spells;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -659,10 +660,17 @@ namespace Game.BattlePets
if (speciesEntry == null)
return;
// TODO: set proper CreatureID for spell SPELL_SUMMON_BATTLE_PET (default EffectMiscValueA is 40721 - Murkimus the Gladiator)
Player player = _owner.GetPlayer();
player.SetBattlePetData(pet);
player.CastSpell(_owner.GetPlayer(), speciesEntry.SummonSpellID != 0 ? speciesEntry.SummonSpellID : SharedConst.SpellSummonBattlePet);
CastSpellExtraArgs args = new();
uint summonSpellId = speciesEntry.SummonSpellID;
if (summonSpellId == 0)
{
summonSpellId = SharedConst.SpellSummonBattlePet;
args.AddSpellMod(SpellValueMod.BasePoint0, (int)speciesEntry.CreatureID);
}
player.CastSpell(_owner.GetPlayer(), summonSpellId, args);
}
public void DismissPet()