mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7183] Updated spell casting pushback system.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
be64293da3
commit
9e52b0f748
6 changed files with 32 additions and 17 deletions
|
|
@ -5182,18 +5182,22 @@ void Spell::Delayed()
|
|||
if (m_spellState == SPELL_STATE_DELAYED)
|
||||
return; // spell is active and can't be time-backed
|
||||
|
||||
if(isDelayableNoMore()) // Spells may only be delayed twice
|
||||
return;
|
||||
|
||||
// spells not loosing casting time ( slam, dynamites, bombs.. )
|
||||
if(!(m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_DAMAGE))
|
||||
return;
|
||||
|
||||
//check resist chance
|
||||
int32 resistChance = 100; //must be initialized to 100 for percent modifiers
|
||||
((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME,resistChance, this);
|
||||
resistChance += m_caster->GetTotalAuraModifier(SPELL_AURA_RESIST_PUSHBACK) - 100;
|
||||
if (roll_chance_i(resistChance))
|
||||
//check pushback reduce
|
||||
int32 delaytime = 500; // spellcasting delay is normally 500ms
|
||||
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
|
||||
((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
|
||||
delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
|
||||
if(delayReduce >= 100)
|
||||
return;
|
||||
|
||||
int32 delaytime = GetNextDelayAtDamageMsTime();
|
||||
delaytime = delaytime * (100 - delayReduce) / 100;
|
||||
|
||||
if(int32(m_timer) + delaytime > m_casttime)
|
||||
{
|
||||
|
|
@ -5217,14 +5221,18 @@ void Spell::DelayedChannel()
|
|||
if(!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER || getState() != SPELL_STATE_CASTING)
|
||||
return;
|
||||
|
||||
//check resist chance
|
||||
int32 resistChance = 100; //must be initialized to 100 for percent modifiers
|
||||
((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME,resistChance, this);
|
||||
resistChance += m_caster->GetTotalAuraModifier(SPELL_AURA_RESIST_PUSHBACK) - 100;
|
||||
if (roll_chance_i(resistChance))
|
||||
if(isDelayableNoMore()) // Spells may only be delayed twice
|
||||
return;
|
||||
|
||||
int32 delaytime = GetNextDelayAtDamageMsTime();
|
||||
//check pushback reduce
|
||||
int32 delaytime = GetSpellDuration(m_spellInfo) * 25 / 100; // channeling delay is normally 25% of its time per hit
|
||||
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
|
||||
((Player*)m_caster)->ApplySpellMod(m_spellInfo->Id,SPELLMOD_NOT_LOSE_CASTING_TIME,delayReduce, this);
|
||||
delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
|
||||
if(delayReduce >= 100)
|
||||
return;
|
||||
|
||||
delaytime = delaytime * (100 - delayReduce) / 100;
|
||||
|
||||
if(int32(m_timer) < delaytime)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue