fix(Core/Pets): Improved Revive Pet should affect dead despawned pet. (#9625)

* fix(Core/Pets): Improved Revive Pet should affect dead despawned pet.

Fixes #9589
This commit is contained in:
UltraNix
2021-12-15 09:32:16 +01:00
committed by GitHub
parent 1cc9ea83ab
commit d87d0a2ae8
7 changed files with 24 additions and 14 deletions

View File

@@ -15136,13 +15136,13 @@ Guild* Player::GetGuild() const
return guildId ? sGuildMgr->GetGuildById(guildId) : nullptr;
}
void Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration, uint32 createdBySpell, ObjectGuid casterGUID, uint8 asynchLoadType)
void Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration, uint32 createdBySpell, ObjectGuid casterGUID, uint8 asynchLoadType, int32 healthPct /*= 0*/)
{
Position pos = {x, y, z, ang};
if (!pos.IsPositionValid())
return;
AsynchPetSummon* asynchPetInfo = new AsynchPetSummon(entry, pos, petType, duration, createdBySpell, casterGUID);
AsynchPetSummon* asynchPetInfo = new AsynchPetSummon(entry, pos, petType, duration, createdBySpell, casterGUID, healthPct);
Pet::LoadPetFromDB(this, asynchLoadType, entry, 0, false, asynchPetInfo);
}

View File

@@ -1165,7 +1165,7 @@ public:
[[nodiscard]] Pet* GetPet() const;
bool IsPetDismissed();
void SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 despwtime, uint32 createdBySpell, ObjectGuid casterGUID, uint8 asynchLoadType);
void SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 despwtime, uint32 createdBySpell, ObjectGuid casterGUID, uint8 asynchLoadType, int32 healthPct = 0);
void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false);
[[nodiscard]] uint32 GetPhaseMaskForSpawn() const; // used for proper set phase for DB at GM-mode creature/GO spawn