mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11605] Prevent use talent 33206 in stun without glyph 45760
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
d99e9dc611
commit
a59dc76774
2 changed files with 12 additions and 3 deletions
|
|
@ -5750,12 +5750,21 @@ SpellCastResult Spell::CheckCasterAuras() const
|
|||
|
||||
// Check whether the cast should be prevented by any state you might have.
|
||||
SpellCastResult prevented_reason = SPELL_CAST_OK;
|
||||
bool spellUsableWhileStunned = m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED;
|
||||
|
||||
// Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out
|
||||
uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state
|
||||
if (unitflag & UNIT_FLAG_STUNNED)
|
||||
{
|
||||
// Pain Suppression (have SPELL_ATTR_EX5_USABLE_WHILE_STUNNED that must be used only with glyph)
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellInfo->SpellIconID == 2178)
|
||||
{
|
||||
if (!m_caster->HasAura(63248)) // Glyph of Pain Suppression
|
||||
spellUsableWhileStunned = false;
|
||||
}
|
||||
|
||||
// spell is usable while stunned, check if caster has only mechanic stun auras, another stun types must prevent cast spell
|
||||
if (m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED)
|
||||
if (spellUsableWhileStunned)
|
||||
{
|
||||
bool is_stun_mechanic = true;
|
||||
Unit::AuraList const& stunAuras = m_caster->GetAurasByType(SPELL_AURA_MOD_STUN);
|
||||
|
|
@ -5822,7 +5831,7 @@ SpellCastResult Spell::CheckCasterAuras() const
|
|||
switch(aura->GetModifier()->m_auraname)
|
||||
{
|
||||
case SPELL_AURA_MOD_STUN:
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED) || !aura->HasMechanic(MECHANIC_STUN))
|
||||
if (!spellUsableWhileStunned || !aura->HasMechanic(MECHANIC_STUN))
|
||||
return SPELL_FAILED_STUNNED;
|
||||
break;
|
||||
case SPELL_AURA_MOD_CONFUSE:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11604"
|
||||
#define REVISION_NR "11605"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue