From 65598fe2333472adb9a9eaa80ff4d5d3f62cce10 Mon Sep 17 00:00:00 2001 From: krz Date: Fri, 5 Jun 2009 02:02:50 +0200 Subject: [PATCH] Backported from TC2: allow Water Elemental to cast Freeze while casting Water Bolt --HG-- branch : trunk --- src/game/PetHandler.cpp | 5 ++++- src/game/Spell.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 350c390d86..8ffe252922 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -632,7 +632,10 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket ) } if (caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->GetGlobalCooldown() > 0) + { + caster->SendPetCastFail(spellid, SPELL_FAILED_NOT_READY); return; + } SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid); if(!spellInfo) @@ -651,7 +654,7 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket ) caster->clearUnitState(UNIT_STAT_FOLLOW); - Spell *spell = new Spell(caster, spellInfo, false); + Spell *spell = new Spell(caster, spellInfo, spellid == 33395); // water elemental can cast freeze as triggered spell->m_targets = targets; int16 result = spell->PetCanCast(NULL); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index d8cf24c293..88bee99482 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4269,7 +4269,7 @@ int16 Spell::PetCanCast(Unit* target) if(!m_caster->isAlive()) return SPELL_FAILED_CASTER_DEAD; - if(m_caster->IsNonMeleeSpellCasted(false)) //prevent spellcast interruption by another spellcast + if(m_caster->IsNonMeleeSpellCasted(false) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast return SPELL_FAILED_SPELL_IN_PROGRESS; if(m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo)) return SPELL_FAILED_AFFECTING_COMBAT;