mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 11:55:43 +00:00
refactor(Core/Spells): Improved logic and DX Spell::EffectSummonPet (#2634)
This commit is contained in:
@@ -3130,25 +3130,24 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
|
||||
return;
|
||||
|
||||
Player* owner = NULL;
|
||||
if (m_originalCaster)
|
||||
{
|
||||
owner = m_originalCaster->ToPlayer();
|
||||
if (!owner && m_originalCaster->ToCreature()->IsTotem())
|
||||
owner = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
}
|
||||
|
||||
if (!m_originalCaster)
|
||||
return;
|
||||
|
||||
uint32 petentry = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
if (m_originalCaster)
|
||||
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
|
||||
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
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)
|
||||
{
|
||||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(67);
|
||||
if (properties && m_originalCaster)
|
||||
if (properties)
|
||||
{
|
||||
// Xinef: unsummon old guardian
|
||||
if (Guardian* oldPet = m_originalCaster->GetGuardianPet())
|
||||
|
||||
Reference in New Issue
Block a user