refactor(Core/Spells): Improved logic and DX Spell::EffectSummonPet (#2634)
This commit is contained in:
@@ -3131,24 +3131,23 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
|
|||||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player* owner = NULL;
|
if (!m_originalCaster)
|
||||||
if (m_originalCaster)
|
return;
|
||||||
{
|
|
||||||
owner = m_originalCaster->ToPlayer();
|
|
||||||
if (!owner && m_originalCaster->ToCreature()->IsTotem())
|
|
||||||
owner = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 petentry = m_spellInfo->Effects[effIndex].MiscValue;
|
uint32 petentry = m_spellInfo->Effects[effIndex].MiscValue;
|
||||||
int32 duration = m_spellInfo->GetDuration();
|
int32 duration = m_spellInfo->GetDuration();
|
||||||
if (m_originalCaster)
|
|
||||||
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||||
|
|
||||||
|
Player* owner = m_originalCaster->ToPlayer();
|
||||||
|
if (!owner && m_originalCaster->ToCreature()->IsTotem())
|
||||||
|
owner = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||||
|
|
||||||
if (!owner)
|
if (!owner)
|
||||||
{
|
{
|
||||||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(67);
|
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(67);
|
||||||
if (properties && m_originalCaster)
|
if (properties)
|
||||||
{
|
{
|
||||||
// Xinef: unsummon old guardian
|
// Xinef: unsummon old guardian
|
||||||
if (Guardian* oldPet = m_originalCaster->GetGuardianPet())
|
if (Guardian* oldPet = m_originalCaster->GetGuardianPet())
|
||||||
|
|||||||
Reference in New Issue
Block a user