diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/include/sc_creature.cpp | 4 | ||||
-rw-r--r-- | src/game/Creature.cpp | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 5 | ||||
-rw-r--r-- | src/game/SharedDefines.h | 4 | ||||
-rw-r--r-- | src/game/Spell.cpp | 10 | ||||
-rw-r--r-- | src/game/Spell.h | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 3 |
7 files changed, 16 insertions, 14 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index a74b59c872c..415ab7f9185 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -190,7 +190,7 @@ void ScriptedAI::DoStartNoMovement(Unit* victim) void ScriptedAI::DoMeleeAttackIfReady() { //Make sure our attack is ready and we aren't currently casting before checking distance - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + if (m_creature->isAttackReady() && !m_creature->hasUnitState(UNIT_STAT_CASTING)) { //If we are within range melee the target if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE)) @@ -199,7 +199,7 @@ void ScriptedAI::DoMeleeAttackIfReady() m_creature->resetAttackTimer(); } } - if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->IsNonMeleeSpellCasted(false)) + if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->hasUnitState(UNIT_STAT_CASTING)) { //If we are within range melee the target if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE)) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 9daab97da38..623b13f9dd2 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1885,7 +1885,7 @@ Unit* Creature::SelectNearestTarget(float dist) const return target; } -void Creature::CallAssistence() +void Creature::CallAssistance() { if( !m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed()) { diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6e51e368281..307dc6c7407 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1048,10 +1048,9 @@ void Player::Update( uint32 p_time ) } } - if (hasUnitState(UNIT_STAT_MELEE_ATTACKING)) + if (hasUnitState(UNIT_STAT_MELEE_ATTACKING) && !hasUnitState(UNIT_STAT_CASTING)) { - Unit *pVictim = getVictim(); - if( !IsNonMeleeSpellCasted(false) && pVictim) + if(Unit *pVictim = getVictim()) { // default combat reach 10 // TODO add weapon,skill check diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index dc22b3affbc..af0fada8626 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -280,8 +280,8 @@ enum ItemQualities #define SPELL_ATTR_EX2_UNK13 0x00002000 // 13 #define SPELL_ATTR_EX2_UNK14 0x00004000 // 14 #define SPELL_ATTR_EX2_UNK15 0x00008000 // 15 not set in 2.4.2 -#define SPELL_ATTR_EX2_UNK16 0x00010000 // 16 -#define SPELL_ATTR_EX2_UNK17 0x00020000 // 17 Hunters Shot and Stings only have this flag +#define SPELL_ATTR_EX2_TAME_BEAST 0x00010000 // 16 +#define SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT 0x00020000 // 17 Hunters Shot and Stings only have this flag #define SPELL_ATTR_EX2_UNK18 0x00040000 // 18 Only Revive pet - possible req dead pet #define SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT 0x00080000 // 19 does not necessarly need shapeshift #define SPELL_ATTR_EX2_UNK20 0x00100000 // 20 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 5cdbef26eed..0999862f74f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2745,15 +2745,17 @@ void Spell::finish(bool ok) } } - /*if (IsMeleeAttackResetSpell()) + if (IsMeleeAttackResetSpell()) { m_caster->resetAttackTimer(BASE_ATTACK); if(m_caster->haveOffhandWeapon()) m_caster->resetAttackTimer(OFF_ATTACK); - }*/ + if(!(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT)) + m_caster->resetAttackTimer(RANGED_ATTACK); + } - /*if (IsRangedAttackResetSpell()) - m_caster->resetAttackTimer(RANGED_ATTACK);*/ + //if (IsRangedAttackResetSpell()) + // m_caster->resetAttackTimer(RANGED_ATTACK); // Clear combo at finish state if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo)) diff --git a/src/game/Spell.h b/src/game/Spell.h index 2a724d41b68..bd2d198f330 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -395,7 +395,7 @@ class Spell } bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsMeleeAttackResetSpell() const { return !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK); } - bool IsRangedAttackResetSpell() const { return !m_IsTriggeredSpell && IsRangedSpell() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK); } + bool IsRangedAttackResetSpell() const { return !m_IsTriggeredSpell && /*IsRangedSpell() &&*/ !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT); } bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; } void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index c227eece88c..3e09fefdd95 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -283,7 +283,8 @@ void Unit::Update( uint32 p_time ) } } - if(!hasUnitState(UNIT_STAT_CASTING)) + //not implemented before 3.0.2 + //if(!hasUnitState(UNIT_STAT_CASTING)) { if(uint32 base_att = getAttackTimer(BASE_ATTACK)) setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time) ); |