aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Pet.cpp4
-rw-r--r--src/game/Spell.cpp2
-rw-r--r--src/game/SpellEffects.cpp9
-rw-r--r--src/game/SpellHandler.cpp6
-rw-r--r--src/game/Unit.cpp10
-rw-r--r--src/game/Unit.h2
6 files changed, 25 insertions, 8 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 51570e0750a..18b2de26c70 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -459,12 +459,12 @@ void Pet::setDeathState(DeathState s) // overwrite virtual
if(!mapEntry || (mapEntry->map_type != MAP_ARENA && mapEntry->map_type != MAP_BATTLEGROUND))
ModifyPower(POWER_HAPPINESS, -HAPPINESS_LEVEL_SIZE);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
+ //SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
}
else if(getDeathState()==ALIVE)
{
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
+ //RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
CastPetAuras(true);
}
}
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 8d9cf6e5265..7f84e3a1cac 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4829,7 +4829,7 @@ SpellCastResult Spell::CheckCast(bool strict)
SpellCastResult Spell::CheckPetCast(Unit* target)
{
- if(!m_caster->isAlive())
+ if(!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD))
return SPELL_FAILED_CASTER_DEAD;
if(m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index e26c8c25827..ae84b6c4ff9 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5133,6 +5133,15 @@ void Spell::EffectScriptEffect(uint32 effIndex)
{
switch(m_spellInfo->Id)
{
+ // Heart of the Pheonix
+ case 55709:
+ {
+ int pct = 100;
+ if (unitTarget->GetTypeId()==TYPEID_UNIT && ((Creature*)unitTarget)->isPet())
+ if (Unit* owner = ((Creature*)unitTarget)->GetOwner())
+ owner->CastCustomSpell(unitTarget, 54114, &pct, NULL, NULL, true);
+ break;
+ }
// Chimera Shot
case 53209:
{
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index 62056a6806f..b3655448a1a 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -333,6 +333,12 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
}
}
+ // Client is resending autoshot cast opcode when other spell is casted during shoot rotation
+ // Skip it to prevent "interrupt" message
+ if (IsAutoRepeatRangedSpell(spellInfo) && _player->m_currentSpells[CURRENT_AUTOREPEAT_SPELL]
+ && _player->m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo == spellInfo)
+ return;
+
// can't use our own spells when we're in possession of another unit,
if(_player->isPossessing())
return;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 156a22a4b33..4992c8c3c62 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3383,7 +3383,7 @@ void Unit::_UpdateSpells( uint32 time )
void Unit::_UpdateAutoRepeatSpell()
{
//check "realtime" interrupts
- if ( (GetTypeId() == TYPEID_PLAYER && ((Player*)this)->isMoving()) || IsNonMeleeSpellCasted(false,false,true) )
+ if ( (GetTypeId() == TYPEID_PLAYER && ((Player*)this)->isMoving()) || IsNonMeleeSpellCasted(false,false,true,m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == SPELL_ID_AUTOSHOT) )
{
// cancel wand shoot
if(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != SPELL_ID_AUTOSHOT)
@@ -3515,7 +3515,7 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed, bool withInstant)
}
}
-bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat) const
+bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot) const
{
// We don't do loop here to explicitly show that melee spell is excluded.
// Maybe later some special spells will be excluded too.
@@ -3524,12 +3524,14 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
if ( m_currentSpells[CURRENT_GENERIC_SPELL] &&
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
(withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED) )
- return(true);
+ if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
+ return(true);
// channeled spells may be delayed, but they are still considered casted
else if ( !skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] &&
(m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) )
- return(true);
+ if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
+ return(true);
// autorepeat spells may be finished or delayed, but they are still considered casted
else if ( !skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL] )
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 0f75236b3c5..8a21b686692 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1436,7 +1436,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
// set withDelayed to true to account delayed spells as casted
// delayed+channeled spells are always accounted as casted
// we can skip channeled or delayed checks using flags
- bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false) const;
+ bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false) const;
// set withDelayed to true to interrupt delayed spells too
// delayed+channeled spells are always interrupted