diff options
author | Meji <alvaromegias_46@hotmail.com> | 2021-12-25 15:27:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-25 15:27:58 +0100 |
commit | 924182f692bde38d8fed85d5dbe7531a09790501 (patch) | |
tree | ec5b5c5842315ad391d1da9cd236952159a03fd4 /src/server/game/BattlePets/BattlePetMgr.cpp | |
parent | 8ac0388870519a085115454783dafed873c1535f (diff) |
Core/BattlePets: Misc fixes (#27446)
* Added script for "Summon Battle Pet" spell (118301).
* Set the saved display of the battle pet when summoning it.
* If a summon has SummonPropertiesFlags::SummonFromBattlePetJournal it will remove NpcFlag UNIT_NPC_FLAG_WILD_BATTLE_PET (Wild battle pets).
* When a creature is summoned with SummonTitle::Companion, it will check to see if it has SummonPropertiesFlags::SummonFromBattlePetJournal before updating the battle pet's update fields. (If you have a summoned battle pet and summon a creature with that SummonTitle, it will incorrectly update the battle pet's update fields with the summoned battle pet's data).
* Implemented SummonPropertiesFlags::UseCreatureLevel. If a summon has this flag, it will use the owner's level (If the summon doesn't have SummonProperties it will always use the selected level).
Diffstat (limited to 'src/server/game/BattlePets/BattlePetMgr.cpp')
-rw-r--r-- | src/server/game/BattlePets/BattlePetMgr.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server/game/BattlePets/BattlePetMgr.cpp b/src/server/game/BattlePets/BattlePetMgr.cpp index 5f5ad43154d..85ab36ef132 100644 --- a/src/server/game/BattlePets/BattlePetMgr.cpp +++ b/src/server/game/BattlePets/BattlePetMgr.cpp @@ -707,10 +707,17 @@ void BattlePetMgr::SummonPet(ObjectGuid guid) if (!speciesEntry) 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(player, speciesEntry->SummonSpellID ? speciesEntry->SummonSpellID : uint32(SPELL_SUMMON_BATTLE_PET)); + + CastSpellExtraArgs args; + uint32 summonSpellId = speciesEntry->SummonSpellID; + if (!summonSpellId) + { + summonSpellId = uint32(SPELL_SUMMON_BATTLE_PET); + args.AddSpellBP0(speciesEntry->CreatureID); + } + player->CastSpell(_owner->GetPlayer(), summonSpellId, args); } void BattlePetMgr::DismissPet() |