Skip to content

Commit

Permalink
[9944] Implement spell 633 and ranks self casting restrictions in 3.3.x
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
j4r0d authored and VladimirMangos committed May 21, 2010
1 parent 6be7785 commit 6ee669d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
33 changes: 27 additions & 6 deletions src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,15 @@ void Spell::cast(bool skipCheck)
AddPrecastSpell(25771); // Forbearance
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
break;
}
Expand All @@ -2790,6 +2798,7 @@ void Spell::cast(bool skipCheck)
// Spirit Walk
else if (m_spellInfo->Id == 58875)
AddPrecastSpell(58876);
// Totem of Wrath
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
AddTriggeredSpell(30708); // Totem of Wrath
Expand Down Expand Up @@ -4247,6 +4256,16 @@ SpellCastResult Spell::CheckCast(bool strict)
// Focus Magic (main spell)
if (m_spellInfo->Id == 54646)
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
Expand Down Expand Up @@ -4914,7 +4933,7 @@ SpellCastResult Spell::CheckCast(bool strict)

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());
}
else
Expand Down Expand Up @@ -4992,7 +5011,7 @@ SpellCastResult Spell::CheckCast(bool strict)
//custom check
switch(m_spellInfo->Id)
{
case 61336:
case 61336: // Survival Instincts
if(m_caster->GetTypeId() != TYPEID_PLAYER || !((Player*)m_caster)->IsInFeralForm())
return SPELL_FAILED_ONLY_SHAPESHIFT;
break;
Expand Down Expand Up @@ -5217,7 +5236,9 @@ SpellCastResult Spell::CheckCasterAuras() const
// Flag drop spells totally immuned to caster auras
// FIXME: find more nice check for all totally immuned spells
// 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;

uint8 school_immune = 0;
Expand All @@ -5240,7 +5261,7 @@ SpellCastResult Spell::CheckCasterAuras() const
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
}
// 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;
}

Expand Down Expand Up @@ -6072,7 +6093,7 @@ bool Spell::CheckTargetCreatureType(Unit* target) const
{
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)
{
// not allow cast at player
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9943"
#define REVISION_NR "9944"
#endif // __REVISION_NR_H__

0 comments on commit 6ee669d

Please sign in to comment.