mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[8743] Fix cooldowns for passive spells
Passive spell cooldowns only for client show. It sets by non passive spells with same category triggered from passive spell auras or in code explictly. * Ignore cooldown at cast passive spells * Not set coldowns at passive spell cast itself.
This commit is contained in:
parent
15ab6794d3
commit
a4e3b3e6aa
2 changed files with 6 additions and 5 deletions
|
|
@ -2756,8 +2756,8 @@ void Spell::SendSpellCooldown()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// have infinity cooldown but set at aura apply
|
// (1) have infinity cooldown but set at aura apply, (2) passive cooldown at triggering
|
||||||
if(m_spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
if(m_spellInfo->Attributes & (SPELL_ATTR_DISABLED_WHILE_ACTIVE | SPELL_ATTR_PASSIVE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
|
_player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
|
||||||
|
|
@ -3851,8 +3851,9 @@ void Spell::CastPreCastSpells(Unit* target)
|
||||||
|
|
||||||
SpellCastResult Spell::CheckCast(bool strict)
|
SpellCastResult Spell::CheckCast(bool strict)
|
||||||
{
|
{
|
||||||
// check cooldowns to prevent cheating
|
// check cooldowns to prevent cheating (ignore passive spells, that client side visual only)
|
||||||
if(m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
if (m_caster->GetTypeId()==TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE) &&
|
||||||
|
((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
|
||||||
{
|
{
|
||||||
if(m_triggeredByAuraSpell)
|
if(m_triggeredByAuraSpell)
|
||||||
return SPELL_FAILED_DONT_REPORT;
|
return SPELL_FAILED_DONT_REPORT;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8742"
|
#define REVISION_NR "8743"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue