Core/Spell: Undefined SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION attr for now - Some function renames - Used in some client checks but not 100% sure of its usage (eg in CGUnit_C::CheckAndReportSpellInhibitFlags but not in Spell_C::IsUsableAction)
This commit is contained in:
@@ -1553,7 +1553,7 @@ namespace Framework.Constants
|
||||
Unk17 = 0x20000, // 17 Only 27965 (Suicide) Spell.
|
||||
HasChargeEffect = 0x40000, // 18 Only Spells That Have Charge Among Effects.
|
||||
ZoneTeleport = 0x80000, // 19 Teleports To Specific Zones.
|
||||
UsableInStunFearConfusion = 0x100000, // 20 Blink, Divine Shield, Ice Block
|
||||
Unk20 = 0x100000, // 20 Blink, Divine Shield, Ice Block
|
||||
Unk21 = 0x200000, // 21 Not Set
|
||||
Unk22 = 0x400000, // 22
|
||||
Unk23 = 0x800000, // 23 Motivate, Mutilate, Shattering Throw
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Game.DataStorage
|
||||
CliDB.CharSectionsStorage.Clear();
|
||||
|
||||
foreach (var outfit in CliDB.CharStartOutfitStorage.Values)
|
||||
_charStartOutfits[(uint)(outfit.RaceID | (outfit.ClassID << 8) | (outfit.GenderID << 16))] = outfit;
|
||||
_charStartOutfits[(uint)((byte)outfit.RaceID | (outfit.ClassID << 8) | (outfit.GenderID << 16))] = outfit;
|
||||
|
||||
var powers = new List<ChrClassesXPowerTypesRecord>();
|
||||
foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Game.Entities
|
||||
{
|
||||
case Class.Deathknight:
|
||||
{
|
||||
for (byte i = 0; i < PlayerConst.TaxiMaskSize; ++i)
|
||||
for (int i = 0; i < PlayerConst.TaxiMaskSize; ++i)
|
||||
m_taximask[i] |= (byte)(CliDB.OldContinentsNodesMask[i] & factionMask[i]);
|
||||
break;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace Game.Entities
|
||||
{
|
||||
var split = new StringArray(data, ' ');
|
||||
|
||||
byte index = 0;
|
||||
int index = 0;
|
||||
for (var i = 0; index < PlayerConst.TaxiMaskSize && i != split.Length; ++i, ++index)
|
||||
{
|
||||
// load and set bits only for existing taxi nodes
|
||||
|
||||
@@ -1703,7 +1703,7 @@ namespace Game
|
||||
|
||||
|
||||
var factionMask = newTeamId == TeamId.Horde ? CliDB.HordeTaxiNodesMask : CliDB.AllianceTaxiNodesMask;
|
||||
for (byte i = 0; i < PlayerConst.TaxiMaskSize; ++i)
|
||||
for (int i = 0; i < PlayerConst.TaxiMaskSize; ++i)
|
||||
{
|
||||
// i = (315 - 1) / 8 = 39
|
||||
// m = 1 << ((315 - 1) % 8) = 4
|
||||
|
||||
+29
-35
@@ -5469,13 +5469,6 @@ namespace Game.Spells
|
||||
bool usableWhileStunned = m_spellInfo.HasAttribute(SpellAttr5.UsableWhileStunned);
|
||||
bool usableWhileFeared = m_spellInfo.HasAttribute(SpellAttr5.UsableWhileFeared);
|
||||
bool usableWhileConfused = m_spellInfo.HasAttribute(SpellAttr5.UsableWhileConfused);
|
||||
if (m_spellInfo.HasAttribute(SpellAttr7.UsableInStunFearConfusion))
|
||||
{
|
||||
usableWhileStunned = true;
|
||||
usableWhileFeared = true;
|
||||
usableWhileConfused = true;
|
||||
}
|
||||
|
||||
|
||||
// Check whether the cast should be prevented by any state you might have.
|
||||
SpellCastResult result = SpellCastResult.SpellCastOk;
|
||||
@@ -5485,18 +5478,18 @@ namespace Game.Spells
|
||||
{
|
||||
Unit charmer = m_caster.GetCharmer();
|
||||
if (charmer)
|
||||
if (charmer.GetUnitBeingMoved() != m_caster && CheckCasterNotImmunedCharmAuras(ref param1))
|
||||
if (charmer.GetUnitBeingMoved() != m_caster && !CheckSpellCancelsCharm(ref param1))
|
||||
result = SpellCastResult.Charmed;
|
||||
}
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Stunned) && !usableWhileStunned && CheckCasterNotImmunedStunAuras(ref param1))
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Stunned) && !usableWhileStunned && !CheckSpellCancelsStun(ref param1))
|
||||
result = SpellCastResult.Stunned;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Silenced) && m_spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence) && CheckCasterNotImmunedSilenceAuras(ref param1))
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Silenced) && m_spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence) && !CheckSpellCancelsSilence(ref param1))
|
||||
result = SpellCastResult.Silenced;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Pacified) && m_spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Pacify) && CheckCasterNotImmunedPacifyAuras(ref param1))
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Pacified) && m_spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Pacify) && !CheckSpellCancelsPacify(ref param1))
|
||||
result = SpellCastResult.Pacified;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Fleeing) && !usableWhileFeared && CheckCasterNotImmunedFearAuras(ref param1))
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Fleeing) && !usableWhileFeared && !CheckSpellCancelsFear(ref param1))
|
||||
result = SpellCastResult.Fleeing;
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Confused) && !usableWhileConfused && CheckCasterNotImmunedDisorientAuras(ref param1))
|
||||
else if (unitflag.HasAnyFlag(UnitFlags.Confused) && !usableWhileConfused && !CheckSpellCancelsConfuse(ref param1))
|
||||
result = SpellCastResult.Confused;
|
||||
else if (m_caster.HasFlag(UnitFields.Flags2, UnitFlags2.NoActions) && m_spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.NoActions))
|
||||
result = SpellCastResult.NoActions;
|
||||
@@ -5507,60 +5500,61 @@ namespace Game.Spells
|
||||
return SpellCastResult.SpellCastOk;
|
||||
}
|
||||
|
||||
// based on sub_00804430 from 12340 client
|
||||
bool CheckCasterHasNotImmunedAuraType(AuraType auraType, ref uint param1)
|
||||
bool CheckSpellCancelsAuraEffect(AuraType auraType, ref uint param1)
|
||||
{
|
||||
// Checking auras is needed now, because you are prevented by some state but the spell grants immunity.
|
||||
var auraEffects = m_caster.GetAuraEffectsByType(auraType);
|
||||
if (auraEffects.Empty())
|
||||
return false;
|
||||
return true;
|
||||
|
||||
foreach (AuraEffect aurEff in auraEffects)
|
||||
{
|
||||
if (m_spellInfo.CanSpellCastOverrideAuraEffect(aurEff))
|
||||
if (m_spellInfo.SpellCancelsAuraEffect(aurEff))
|
||||
continue;
|
||||
|
||||
param1 = (uint)aurEff.GetSpellEffectInfo().Mechanic;
|
||||
if (param1 == 0)
|
||||
param1 = (uint)aurEff.GetSpellInfo().Mechanic;
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckCasterNotImmunedCharmAuras(ref uint param1)
|
||||
bool CheckSpellCancelsCharm(ref uint param1)
|
||||
{
|
||||
return CheckCasterHasNotImmunedAuraType(AuraType.ModCharm, ref param1) ||
|
||||
CheckCasterHasNotImmunedAuraType(AuraType.AoeCharm, ref param1) ||
|
||||
CheckCasterHasNotImmunedAuraType(AuraType.ModPossess, ref param1);
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModCharm, ref param1) ||
|
||||
CheckSpellCancelsAuraEffect(AuraType.AoeCharm, ref param1) ||
|
||||
CheckSpellCancelsAuraEffect(AuraType.ModPossess, ref param1);
|
||||
}
|
||||
|
||||
bool CheckCasterNotImmunedStunAuras(ref uint param1)
|
||||
bool CheckSpellCancelsStun(ref uint param1)
|
||||
{
|
||||
return CheckCasterHasNotImmunedAuraType(AuraType.ModStun, ref param1);
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModStun, ref param1) &&
|
||||
CheckSpellCancelsAuraEffect(AuraType.Strangulate, ref param1);
|
||||
}
|
||||
|
||||
bool CheckCasterNotImmunedSilenceAuras(ref uint param1)
|
||||
bool CheckSpellCancelsSilence(ref uint param1)
|
||||
{
|
||||
return CheckCasterHasNotImmunedAuraType(AuraType.ModSilence, ref param1) ||
|
||||
CheckCasterHasNotImmunedAuraType(AuraType.ModPacifySilence, ref param1);
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModSilence, ref param1) ||
|
||||
CheckSpellCancelsAuraEffect(AuraType.ModPacifySilence, ref param1);
|
||||
}
|
||||
|
||||
bool CheckCasterNotImmunedPacifyAuras(ref uint param1)
|
||||
bool CheckSpellCancelsPacify(ref uint param1)
|
||||
{
|
||||
return CheckCasterHasNotImmunedAuraType(AuraType.ModPacify, ref param1) ||
|
||||
CheckCasterHasNotImmunedAuraType(AuraType.ModPacifySilence, ref param1);
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModPacify, ref param1) ||
|
||||
CheckSpellCancelsAuraEffect(AuraType.ModPacifySilence, ref param1);
|
||||
}
|
||||
|
||||
bool CheckCasterNotImmunedFearAuras(ref uint param1)
|
||||
bool CheckSpellCancelsFear(ref uint param1)
|
||||
{
|
||||
return CheckCasterHasNotImmunedAuraType(AuraType.ModFear, ref param1);
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModFear, ref param1);
|
||||
}
|
||||
|
||||
bool CheckCasterNotImmunedDisorientAuras(ref uint param1)
|
||||
bool CheckSpellCancelsConfuse(ref uint param1)
|
||||
{
|
||||
return CheckCasterHasNotImmunedAuraType(AuraType.ModConfuse, ref param1);
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModConfuse, ref param1);
|
||||
}
|
||||
|
||||
SpellCastResult CheckArenaAndRatedBattlegroundCastRules()
|
||||
|
||||
@@ -2465,8 +2465,7 @@ namespace Game.Spells
|
||||
return false;
|
||||
}
|
||||
|
||||
// based on client sub_007FDFA0
|
||||
public bool CanSpellCastOverrideAuraEffect(AuraEffect aurEff)
|
||||
public bool SpellCancelsAuraEffect(AuraEffect aurEff)
|
||||
{
|
||||
if (!HasAttribute(SpellAttr1.DispelAurasOnImmunity))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user