fix(Core/Player): Check if the player can summon the warlock pet on B… (#18064)
fix(Core/Player): Check if the player can summon the warlock pet on BG ress
This commit is contained in:
@@ -105,6 +105,14 @@ void Pet::AddToWorld()
|
|||||||
|
|
||||||
if (GetOwnerGUID().IsPlayer())
|
if (GetOwnerGUID().IsPlayer())
|
||||||
{
|
{
|
||||||
|
if (Player* owner = GetOwner())
|
||||||
|
{
|
||||||
|
if (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK)
|
||||||
|
{
|
||||||
|
owner->SetLastPetSpell(GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sScriptMgr->OnPetAddToWorld(this);
|
sScriptMgr->OnPetAddToWorld(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14164,24 +14164,21 @@ void Player::ResummonPetTemporaryUnSummonedIfAny()
|
|||||||
|
|
||||||
bool Player::CanResummonPet(uint32 spellid)
|
bool Player::CanResummonPet(uint32 spellid)
|
||||||
{
|
{
|
||||||
switch (getClass())
|
if (getClass() == CLASS_DEATH_KNIGHT)
|
||||||
{
|
{
|
||||||
case CLASS_DEATH_KNIGHT:
|
|
||||||
if (CanSeeDKPet())
|
if (CanSeeDKPet())
|
||||||
return true;
|
return true;
|
||||||
else if (spellid == 52150) //Raise Dead
|
else if (spellid == 52150) // Raise Dead
|
||||||
return false;
|
return false;
|
||||||
break;
|
}
|
||||||
case CLASS_MAGE:
|
else if (getClass() == CLASS_MAGE)
|
||||||
|
{
|
||||||
if (HasSpell(31687) && HasAura(70937)) //Has [Summon Water Elemental] spell and [Glyph of Eternal Water].
|
if (HasSpell(31687) && HasAura(70937)) //Has [Summon Water Elemental] spell and [Glyph of Eternal Water].
|
||||||
return true;
|
return true;
|
||||||
break;
|
}
|
||||||
case CLASS_HUNTER:
|
else if (getClass() == CLASS_HUNTER)
|
||||||
case CLASS_WARLOCK:
|
{
|
||||||
return true;
|
return true;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return HasSpell(spellid);
|
return HasSpell(spellid);
|
||||||
|
|||||||
Reference in New Issue
Block a user