mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-13 11:34:07 -04:00
*Do not let Steady shot pause autoshot timer.
--HG-- branch : trunk
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -1885,7 +1885,7 @@ Unit* Creature::SelectNearestTarget(float dist) const
|
||||
return target;
|
||||
}
|
||||
|
||||
void Creature::CallAssistence()
|
||||
void Creature::CallAssistance()
|
||||
{
|
||||
if( !m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed())
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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) );
|
||||
|
||||
Reference in New Issue
Block a user