mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9944] Implement spell 633 and ranks self casting restrictions in 3.3.x
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
bca866cd8c
commit
36a76e38a9
2 changed files with 28 additions and 7 deletions
|
|
@ -2775,7 +2775,15 @@ void Spell::cast(bool skipCheck)
|
||||||
AddPrecastSpell(25771); // Forbearance
|
AddPrecastSpell(25771); // Forbearance
|
||||||
AddPrecastSpell(61987); // Avenging Wrath Marker
|
AddPrecastSpell(61987); // Avenging Wrath Marker
|
||||||
}
|
}
|
||||||
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x200000000000))
|
// Lay on Hands
|
||||||
|
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000008000))
|
||||||
|
{
|
||||||
|
// only for self cast
|
||||||
|
if (m_caster == m_targets.getUnitTarget())
|
||||||
|
AddPrecastSpell(25771); // Forbearance
|
||||||
|
}
|
||||||
|
// Avenging Wrath
|
||||||
|
else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000200000000000))
|
||||||
AddPrecastSpell(61987); // Avenging Wrath Marker
|
AddPrecastSpell(61987); // Avenging Wrath Marker
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2790,6 +2798,7 @@ void Spell::cast(bool skipCheck)
|
||||||
// Spirit Walk
|
// Spirit Walk
|
||||||
else if (m_spellInfo->Id == 58875)
|
else if (m_spellInfo->Id == 58875)
|
||||||
AddPrecastSpell(58876);
|
AddPrecastSpell(58876);
|
||||||
|
// Totem of Wrath
|
||||||
else if (m_spellInfo->Effect[EFFECT_INDEX_0]==SPELL_EFFECT_APPLY_AREA_AURA_RAID && m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000))
|
else if (m_spellInfo->Effect[EFFECT_INDEX_0]==SPELL_EFFECT_APPLY_AREA_AURA_RAID && m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000))
|
||||||
// only for main totem spell cast
|
// only for main totem spell cast
|
||||||
AddTriggeredSpell(30708); // Totem of Wrath
|
AddTriggeredSpell(30708); // Totem of Wrath
|
||||||
|
|
@ -4247,6 +4256,16 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
// Focus Magic (main spell)
|
// Focus Magic (main spell)
|
||||||
if (m_spellInfo->Id == 54646)
|
if (m_spellInfo->Id == 54646)
|
||||||
return SPELL_FAILED_BAD_TARGETS;
|
return SPELL_FAILED_BAD_TARGETS;
|
||||||
|
|
||||||
|
// Lay on Hands (self cast)
|
||||||
|
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN &&
|
||||||
|
m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000008000))
|
||||||
|
{
|
||||||
|
if (target->HasAura(25771)) // Forbearance
|
||||||
|
return SPELL_FAILED_CASTER_AURASTATE;
|
||||||
|
if (target->HasAura(61987)) // Avenging Wrath Marker
|
||||||
|
return SPELL_FAILED_CASTER_AURASTATE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check pet presents
|
// check pet presents
|
||||||
|
|
@ -4914,7 +4933,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
|
|
||||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK)
|
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK)
|
||||||
{
|
{
|
||||||
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
if (strict) //Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player)
|
||||||
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
|
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -4992,7 +5011,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
//custom check
|
//custom check
|
||||||
switch(m_spellInfo->Id)
|
switch(m_spellInfo->Id)
|
||||||
{
|
{
|
||||||
case 61336:
|
case 61336: // Survival Instincts
|
||||||
if(m_caster->GetTypeId() != TYPEID_PLAYER || !((Player*)m_caster)->IsInFeralForm())
|
if(m_caster->GetTypeId() != TYPEID_PLAYER || !((Player*)m_caster)->IsInFeralForm())
|
||||||
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
return SPELL_FAILED_ONLY_SHAPESHIFT;
|
||||||
break;
|
break;
|
||||||
|
|
@ -5217,7 +5236,9 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||||
// Flag drop spells totally immuned to caster auras
|
// Flag drop spells totally immuned to caster auras
|
||||||
// FIXME: find more nice check for all totally immuned spells
|
// FIXME: find more nice check for all totally immuned spells
|
||||||
// AttributesEx3 & 0x10000000?
|
// AttributesEx3 & 0x10000000?
|
||||||
if(m_spellInfo->Id == 23336 || m_spellInfo->Id == 23334 || m_spellInfo->Id == 34991)
|
if (m_spellInfo->Id == 23336 || // Alliance Flag Drop
|
||||||
|
m_spellInfo->Id == 23334 || // Horde Flag Drop
|
||||||
|
m_spellInfo->Id == 34991) // Summon Netherstorm Flag
|
||||||
return SPELL_CAST_OK;
|
return SPELL_CAST_OK;
|
||||||
|
|
||||||
uint8 school_immune = 0;
|
uint8 school_immune = 0;
|
||||||
|
|
@ -5240,7 +5261,7 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||||
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
|
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
|
||||||
}
|
}
|
||||||
// immune movement impairment and loss of control
|
// immune movement impairment and loss of control
|
||||||
if (m_spellInfo->Id == 42292)
|
if (m_spellInfo->Id == 42292) // PvP Trinket
|
||||||
mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
|
mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6072,7 +6093,7 @@ bool Spell::CheckTargetCreatureType(Unit* target) const
|
||||||
{
|
{
|
||||||
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
|
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
|
||||||
|
|
||||||
// Curse of Doom & Exorcism: not find another way to fix spell target check :/
|
// Curse of Doom: not find another way to fix spell target check :/
|
||||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == 1179)
|
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == 1179)
|
||||||
{
|
{
|
||||||
// not allow cast at player
|
// not allow cast at player
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9943"
|
#define REVISION_NR "9944"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue