Core/Spells: Extended spell required shapeshift masks to 64 bits and defined a new spell attribute

This commit is contained in:
Shauren
2015-09-01 16:59:28 +02:00
parent f5d707f1ae
commit 191d2c7262
6 changed files with 15 additions and 13 deletions
+1 -1
View File
@@ -3736,7 +3736,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
// note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell
// talent dependent passives activated at form apply have proper stance data
ShapeshiftForm form = GetShapeshiftForm();
bool need_cast = (!spellInfo->Stances || (form && (spellInfo->Stances & (1 << (form - 1)))) ||
bool need_cast = (!spellInfo->Stances || (form && (spellInfo->Stances & (UI64LIT(1) << (form - 1)))) ||
(!form && (spellInfo->HasAttribute(SPELL_ATTR2_NOT_NEED_SHAPESHIFT))));
if (spellInfo->HasAttribute(SPELL_ATTR8_MASTERY_SPECIALIZATION))
@@ -839,7 +839,7 @@ enum SpellAttr13
SPELL_ATTR13_UNK15 = 0x00008000, // 15
SPELL_ATTR13_UNK16 = 0x00010000, // 16
SPELL_ATTR13_UNK17 = 0x00020000, // 17
SPELL_ATTR13_UNK18 = 0x00040000, // 18
SPELL_ATTR13_ACTIVATES_REQUIRED_SHAPESHIFT = 0x00040000, // 18
SPELL_ATTR13_UNK19 = 0x00080000, // 19
SPELL_ATTR13_UNK20 = 0x00100000, // 20
SPELL_ATTR13_UNK21 = 0x00200000, // 21
@@ -1374,7 +1374,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if ((spellInfo->HasAttribute(SPELL_ATTR8_MASTERY_SPECIALIZATION)) && !plrTarget->IsCurrentSpecMasterySpell(spellInfo))
continue;
if (spellInfo->Stances & (1<<(GetMiscValue()-1)))
if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
target->CastSpell(target, itr->first, true, NULL, this);
}
@@ -1389,7 +1389,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)))
continue;
if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
target->CastSpell(target, glyph->SpellID, true, NULL, this);
}
}
@@ -1399,7 +1399,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (plrTarget->HasSpell(17007))
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(24932);
if (spellInfo && spellInfo->Stances & (1 << (GetMiscValue() -1)))
if (spellInfo && spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() -1)))
target->CastSpell(target, 24932, true, NULL, this);
}
@@ -1475,7 +1475,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
{
// Use the new aura to see on what stance the target will be
uint32 newStance = (1 << ((newAura ? newAura->GetMiscValue() : 0) -1));
uint64 newStance = newAura ? (UI64LIT(1) << (newAura->GetMiscValue()) - 1) : 0;
// If the stances are not compatible with the spell, remove it
if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance))
+6 -4
View File
@@ -1126,9 +1126,8 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap const& ef
// SpellShapeshiftEntry
SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift();
// TODO: 6.x these maks have 2 parts
Stances = _shapeshift ? _shapeshift->ShapeshiftMask[0] : 0;
StancesNot = _shapeshift ? _shapeshift->ShapeshiftExclude[0] : 0;
Stances = _shapeshift ? MAKE_PAIR64(_shapeshift->ShapeshiftMask[0], _shapeshift->ShapeshiftMask[1]) : 0;
StancesNot = _shapeshift ? MAKE_PAIR64(_shapeshift->ShapeshiftExclude[0], _shapeshift->ShapeshiftExclude[1]) : 0;
// SpellTargetRestrictionsEntry
SpellTargetRestrictionsEntry const* _target = GetSpellTargetRestrictions();
@@ -1668,7 +1667,10 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
(Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL || Effects[1].Effect == SPELL_EFFECT_LEARN_SPELL || Effects[2].Effect == SPELL_EFFECT_LEARN_SPELL))
return SPELL_CAST_OK;*/
uint32 stanceMask = (form ? 1 << (form - 1) : 0);
//if (HasAttribute(SPELL_ATTR13_ACTIVATES_REQUIRED_SHAPESHIFT))
// return SPELL_CAST_OK;
uint64 stanceMask = (form ? UI64LIT(1) << (form - 1) : 0);
if (stanceMask & StancesNot) // can explicitly not be cast in this stance
return SPELL_FAILED_NOT_SHAPESHIFT;
+2 -2
View File
@@ -345,8 +345,8 @@ public:
uint32 AttributesEx12;
uint32 AttributesEx13;
uint32 AttributesCu;
uint32 Stances;
uint32 StancesNot;
uint64 Stances;
uint64 StancesNot;
uint32 Targets;
uint32 TargetCreatureType;
uint32 RequiresSpellFocus;
+1 -1
View File
@@ -3481,7 +3481,7 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP;
break;
case 5420: // Tree of Life (Passive)
spellInfo->Stances = 1 << (FORM_TREE - 1);
spellInfo->Stances = UI64LIT(1) << (FORM_TREE - 1);
break;
case 49376: // Feral Charge (Cat Form)
spellInfo->AttributesEx3 &= ~SPELL_ATTR3_CANT_TRIGGER_PROC;