diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 7d77e948c6..b34887e429 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2569,6 +2569,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) bool isClassPet = m_spellInfo->SpellFamilyName != SPELLFAMILY_GENERIC || petCreatureId == 0; + // Hunter pet handling if (petCreatureId == 0 && unitCaster->IsPlayer()) { Player* player = unitCaster->ToPlayer(); @@ -2594,6 +2595,17 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) { if (PlayerPetData* petData = player->GetPlayerPetData(key->first, key->second)) { + if (petData->TamedCreatureId) + { + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(petData->TamedCreatureId); + if (cInfo->StaticFlags.HasFlag(CREATURE_STATIC_FLAG_3_TAMEABLE_EXOTIC) && !player->CanTameExoticPets()) + { + player->GetSession()->SendStableResult(PetStableResultCode::CannotControlExoticPets); + player->GetSpellHistory()->ResetCooldown(m_spellInfo->Id, true); + return; + } + } + if (petData->SavedHealth == 0) { player->SendTamePetFailure(PET_TAME_FAILURE_DEAD_PET); @@ -2608,6 +2620,22 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) return; } } + else + { + if (PlayerPetData* petData = player->GetPlayerPetData(petSlotIndex, 0)) + { + if (petData->TamedCreatureId) + { + CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(petData->TamedCreatureId); + if (cInfo->StaticFlags.HasFlag(CREATURE_STATIC_FLAG_3_TAMEABLE_EXOTIC) && !player->CanTameExoticPets()) + { + player->GetSession()->SendStableResult(PetStableResultCode::CannotControlExoticPets); + player->GetSpellHistory()->ResetCooldown(m_spellInfo->Id, true); + return; + } + } + } + } } if (NewPet* summon = unitCaster->SummonPet(petCreatureId, petSlotIndex, m_spellInfo->Id, isClassPet, *destTarget))