mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: You should be able to revive pets from anywhere without summoning them first
Closes #1090 Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
@@ -5238,10 +5238,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
case SPELL_EFFECT_SUMMON_DEAD_PET:
|
||||
{
|
||||
Creature* pet = m_caster->GetGuardianPet();
|
||||
if (!pet)
|
||||
return SPELL_FAILED_NO_PET;
|
||||
|
||||
if (pet->isAlive())
|
||||
if (pet && pet->isAlive())
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
|
||||
break;
|
||||
@@ -5291,7 +5289,6 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
if (m_caster->GetCharmGUID())
|
||||
return SPELL_FAILED_ALREADY_HAVE_CHARM;
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
|
||||
@@ -5726,7 +5726,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
Pet* pet = player->GetPet();
|
||||
if (!pet || pet->isAlive())
|
||||
if (pet && pet->isAlive())
|
||||
return;
|
||||
|
||||
if (damage < 0)
|
||||
@@ -5734,8 +5734,16 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
|
||||
|
||||
float x, y, z;
|
||||
player->GetPosition(x, y, z);
|
||||
if (!pet)
|
||||
{
|
||||
player->SummonPet(0, x, y, z, player->GetOrientation(), SUMMON_PET, 0);
|
||||
pet = player->GetPet();
|
||||
}
|
||||
if (!pet)
|
||||
return;
|
||||
|
||||
player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation());
|
||||
|
||||
|
||||
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
pet->setDeathState(ALIVE);
|
||||
|
||||
Reference in New Issue
Block a user