Core/Auras: Update AuraState enum and implement missing new ones
Port From (https://github.com/TrinityCore/TrinityCore/commit/69e0b9a98516a0cac14bc3f985a2deb2fe79205f)
This commit is contained in:
@@ -2423,32 +2423,32 @@ namespace Framework.Constants
|
|||||||
{ // (C) used in caster aura state (T) used in target aura state
|
{ // (C) used in caster aura state (T) used in target aura state
|
||||||
// (c) used in caster aura state-not (t) used in target aura state-not
|
// (c) used in caster aura state-not (t) used in target aura state-not
|
||||||
None = 0, // C |
|
None = 0, // C |
|
||||||
Defense = 1, // C |
|
Defensive = 1, // Cctt|
|
||||||
HealthLess20Percent = 2, // CcT |
|
Wounded20Percent = 2, // Cct |
|
||||||
Berserking = 3, // C T |
|
Unbalanced = 3, // Cct | Nyi
|
||||||
Frozen = 4, // c t| frozen target
|
Frozen = 4, // C T|
|
||||||
Judgement = 5, // C |
|
Marked = 5, // C T| Nyi
|
||||||
//UNKNOWN6 = 6, // | not used
|
Wounded25Percent = 6, // T |
|
||||||
HunterParry = 7, // C |
|
Defensive2 = 7, // Cc | Nyi
|
||||||
//UNKNOWN7 = 7, // c | creature cheap shot / focused bursts spells
|
Banished = 8, // C | Nyi
|
||||||
//UNKNOWN8 = 8, // t| test spells
|
Dazed = 9, // T|
|
||||||
//UNKNOWN9 = 9, // |
|
Victorious = 10, // C |
|
||||||
WarriorVictoryRush = 10, // C | warrior victory rush
|
Rampage = 11, // | Nyi
|
||||||
//UNKNOWN11 = 11, // C t| 60348 - Maelstrom Ready!, test spells
|
FaerieFire = 12, // C T|
|
||||||
FaerieFire = 12, // c t|
|
Wounded35Percent = 13, // Cct |
|
||||||
HealthLess35Percent = 13, // C T |
|
RaidEncounter2 = 14, // Ct |
|
||||||
Conflagrate = 14, // T |
|
DruidPeriodicHeal = 15, // T |
|
||||||
Swiftmend = 15, // T |
|
RoguePoisoned = 16, // |
|
||||||
DeadlyPoison = 16, // T |
|
Enraged = 17, // C |
|
||||||
Enrage = 17, // C |
|
Bleed = 18, // T |
|
||||||
Bleeding = 18, // T|
|
Vulnerable = 19, // | Nyi
|
||||||
Unk19 = 19, // |
|
ArenaPreparation = 20, // C |
|
||||||
//UNKNOWN20 = 20, // c | only (45317 Suicide)
|
WoundHealth20_80 = 21, // T |
|
||||||
//UNKNOWN21 = 21, // | not used
|
RaidEncounter = 22, // Cctt|
|
||||||
Unk22 = 22, // C t| varius spells (63884, 50240)
|
Healthy75Percent = 23, // C |
|
||||||
HealthAbove75Percent = 23, // C |
|
WoundHealth35_80 = 24, // T |
|
||||||
|
|
||||||
PerCasterAuraStateMask = (1 << (Conflagrate - 1)) | (1 << (DeadlyPoison - 1))
|
PerCasterAuraStateMask = (1 << (RaidEncounter2 - 1)) | (1 << (RoguePoisoned - 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
// target enum name consist of:
|
// target enum name consist of:
|
||||||
|
|||||||
@@ -343,9 +343,8 @@ namespace Framework.Constants
|
|||||||
public enum ReactiveType
|
public enum ReactiveType
|
||||||
{
|
{
|
||||||
Defense = 0,
|
Defense = 0,
|
||||||
HunterParry = 1,
|
Defense2 = 1,
|
||||||
OverPower = 2,
|
Max = 2
|
||||||
Max = 3
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SpellValueMod
|
public enum SpellValueMod
|
||||||
|
|||||||
@@ -1729,16 +1729,12 @@ namespace Game.Entities
|
|||||||
switch (reactive)
|
switch (reactive)
|
||||||
{
|
{
|
||||||
case ReactiveType.Defense:
|
case ReactiveType.Defense:
|
||||||
if (HasAuraState(AuraStateType.Defense))
|
if (HasAuraState(AuraStateType.Defensive))
|
||||||
ModifyAuraState(AuraStateType.Defense, false);
|
ModifyAuraState(AuraStateType.Defensive, false);
|
||||||
break;
|
break;
|
||||||
case ReactiveType.HunterParry:
|
case ReactiveType.Defense2:
|
||||||
if (GetClass() == Class.Hunter && HasAuraState(AuraStateType.HunterParry))
|
if (HasAuraState(AuraStateType.Defensive2))
|
||||||
ModifyAuraState(AuraStateType.HunterParry, false);
|
ModifyAuraState(AuraStateType.Defensive2, false);
|
||||||
break;
|
|
||||||
case ReactiveType.OverPower:
|
|
||||||
if (GetClass() == Class.Warrior && IsTypeId(TypeId.Player))
|
|
||||||
ToPlayer().ClearComboPoints();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1836,12 +1832,10 @@ namespace Game.Entities
|
|||||||
for (ReactiveType i = 0; i < ReactiveType.Max; ++i)
|
for (ReactiveType i = 0; i < ReactiveType.Max; ++i)
|
||||||
m_reactiveTimer[i] = 0;
|
m_reactiveTimer[i] = 0;
|
||||||
|
|
||||||
if (HasAuraState(AuraStateType.Defense))
|
if (HasAuraState(AuraStateType.Defensive))
|
||||||
ModifyAuraState(AuraStateType.Defense, false);
|
ModifyAuraState(AuraStateType.Defensive, false);
|
||||||
if (GetClass() == Class.Hunter && HasAuraState(AuraStateType.HunterParry))
|
if (HasAuraState(AuraStateType.Defensive2))
|
||||||
ModifyAuraState(AuraStateType.HunterParry, false);
|
ModifyAuraState(AuraStateType.Defensive2, false);
|
||||||
if (GetClass() == Class.Warrior && IsTypeId(TypeId.Player))
|
|
||||||
ToPlayer().ClearComboPoints();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool CanUseAttackType(WeaponAttackType attacktype)
|
public virtual bool CanUseAttackType(WeaponAttackType attacktype)
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// Drain Soul - increased damage for targets under 20% HP
|
// Drain Soul - increased damage for targets under 20% HP
|
||||||
if (spellProto.Id == 198590)
|
if (spellProto.Id == 198590)
|
||||||
if (HasAuraState(AuraStateType.HealthLess20Percent))
|
if (HasAuraState(AuraStateType.Wounded20Percent))
|
||||||
DoneTotalMod *= 2;
|
DoneTotalMod *= 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1851,41 +1851,23 @@ namespace Game.Entities
|
|||||||
// Update AURA_STATE on dodge
|
// Update AURA_STATE on dodge
|
||||||
if (GetClass() != Class.Rogue) // skip Rogue Riposte
|
if (GetClass() != Class.Rogue) // skip Rogue Riposte
|
||||||
{
|
{
|
||||||
ModifyAuraState(AuraStateType.Defense, true);
|
ModifyAuraState(AuraStateType.Defensive, true);
|
||||||
StartReactiveTimer(ReactiveType.Defense);
|
StartReactiveTimer(ReactiveType.Defense);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if victim and parry attack
|
// if victim and parry attack
|
||||||
if (hitMask.HasAnyFlag(ProcFlagsHit.Parry))
|
if (hitMask.HasAnyFlag(ProcFlagsHit.Parry))
|
||||||
{
|
{
|
||||||
// For Hunters only Counterattack (skip Mongoose bite)
|
ModifyAuraState(AuraStateType.Defensive, true);
|
||||||
if (GetClass() == Class.Hunter)
|
StartReactiveTimer(ReactiveType.Defense);
|
||||||
{
|
|
||||||
ModifyAuraState(AuraStateType.HunterParry, true);
|
|
||||||
StartReactiveTimer(ReactiveType.HunterParry);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ModifyAuraState(AuraStateType.Defense, true);
|
|
||||||
StartReactiveTimer(ReactiveType.Defense);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// if and victim block attack
|
// if and victim block attack
|
||||||
if (hitMask.HasAnyFlag(ProcFlagsHit.Block))
|
if (hitMask.HasAnyFlag(ProcFlagsHit.Block))
|
||||||
{
|
{
|
||||||
ModifyAuraState(AuraStateType.Defense, true);
|
ModifyAuraState(AuraStateType.Defensive, true);
|
||||||
StartReactiveTimer(ReactiveType.Defense);
|
StartReactiveTimer(ReactiveType.Defense);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // For attacker
|
|
||||||
{
|
|
||||||
// Overpower on victim dodge
|
|
||||||
if (hitMask.HasAnyFlag(ProcFlagsHit.Dodge) && IsPlayer() && GetClass() == Class.Warrior)
|
|
||||||
{
|
|
||||||
ToPlayer().AddComboPoints(1);
|
|
||||||
StartReactiveTimer(ReactiveType.OverPower);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3888,7 +3870,7 @@ namespace Game.Entities
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
SpellInfo spellProto = app.Value.GetBase().GetSpellInfo();
|
SpellInfo spellProto = app.Value.GetBase().GetSpellInfo();
|
||||||
if (app.Value.GetBase().GetCasterGUID() == GetGUID() && spellProto.CasterAuraState == flag && (spellProto.IsPassive() || flag != AuraStateType.Enrage))
|
if (app.Value.GetBase().GetCasterGUID() == GetGUID() && spellProto.CasterAuraState == flag && (spellProto.IsPassive() || flag != AuraStateType.Enraged))
|
||||||
RemoveAura(app);
|
RemoveAura(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,9 +184,12 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (IsAlive())
|
if (IsAlive())
|
||||||
{
|
{
|
||||||
ModifyAuraState(AuraStateType.HealthLess20Percent, HealthBelowPct(20));
|
ModifyAuraState(AuraStateType.Wounded20Percent, HealthBelowPct(20));
|
||||||
ModifyAuraState(AuraStateType.HealthLess35Percent, HealthBelowPct(35));
|
ModifyAuraState(AuraStateType.Wounded25Percent, HealthBelowPct(25));
|
||||||
ModifyAuraState(AuraStateType.HealthAbove75Percent, HealthAbovePct(75));
|
ModifyAuraState(AuraStateType.Wounded35Percent, HealthBelowPct(35));
|
||||||
|
ModifyAuraState(AuraStateType.WoundHealth20_80, HealthBelowPct(20) || HealthAbovePct(80));
|
||||||
|
ModifyAuraState(AuraStateType.Healthy75Percent, HealthAbovePct(75));
|
||||||
|
ModifyAuraState(AuraStateType.WoundHealth35_80, HealthBelowPct(35) || HealthAbovePct(80));
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateSplineMovement(diff);
|
UpdateSplineMovement(diff);
|
||||||
|
|||||||
@@ -3986,6 +3986,8 @@ namespace Game.Spells
|
|||||||
return;
|
return;
|
||||||
target.RemoveUnitFlag(UnitFlags.Preparation);
|
target.RemoveUnitFlag(UnitFlags.Preparation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target.ModifyAuraState(AuraStateType.ArenaPreparation, apply);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.NoReagentUse)]
|
[AuraEffectHandler(AuraType.NoReagentUse)]
|
||||||
|
|||||||
@@ -1354,45 +1354,25 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
_auraState = AuraStateType.None;
|
_auraState = AuraStateType.None;
|
||||||
|
|
||||||
// Seals
|
// Faerie Fire
|
||||||
if (GetSpellSpecific() == SpellSpecificType.Seal)
|
|
||||||
_auraState = AuraStateType.Judgement;
|
|
||||||
|
|
||||||
// Conflagrate aura state on Immolate and Shadowflame
|
|
||||||
if (SpellFamilyName == SpellFamilyNames.Warlock &&
|
|
||||||
// Immolate
|
|
||||||
(SpellFamilyFlags[0].HasAnyFlag(4u) ||
|
|
||||||
// Shadowflame
|
|
||||||
SpellFamilyFlags[2].HasAnyFlag(2u)))
|
|
||||||
_auraState = AuraStateType.Conflagrate;
|
|
||||||
|
|
||||||
// Faerie Fire (druid versions)
|
|
||||||
if (SpellFamilyName == SpellFamilyNames.Druid && SpellFamilyFlags[0].HasAnyFlag(0x400u))
|
|
||||||
_auraState = AuraStateType.FaerieFire;
|
|
||||||
|
|
||||||
// Sting (hunter's pet ability)
|
|
||||||
if (GetCategory() == 1133)
|
if (GetCategory() == 1133)
|
||||||
_auraState = AuraStateType.FaerieFire;
|
_auraState = AuraStateType.FaerieFire;
|
||||||
|
|
||||||
// Victorious
|
// Swiftmend state on Regrowth, Rejuvenation, Wild Growth
|
||||||
if (SpellFamilyName == SpellFamilyNames.Warrior && SpellFamilyFlags[1].HasAnyFlag(0x40000u))
|
if (SpellFamilyName == SpellFamilyNames.Druid && (SpellFamilyFlags[0].HasAnyFlag(0x50u) || SpellFamilyFlags[1].HasAnyFlag(0x4000000u)))
|
||||||
_auraState = AuraStateType.WarriorVictoryRush;
|
_auraState = AuraStateType.DruidPeriodicHeal;
|
||||||
|
|
||||||
// Swiftmend state on Regrowth & Rejuvenation
|
|
||||||
if (SpellFamilyName == SpellFamilyNames.Druid && SpellFamilyFlags[0].HasAnyFlag(0x50u))
|
|
||||||
_auraState = AuraStateType.Swiftmend;
|
|
||||||
|
|
||||||
// Deadly poison aura state
|
// Deadly poison aura state
|
||||||
if (SpellFamilyName == SpellFamilyNames.Rogue && SpellFamilyFlags[0].HasAnyFlag(0x10000u))
|
if (SpellFamilyName == SpellFamilyNames.Rogue && SpellFamilyFlags[0].HasAnyFlag(0x10000u))
|
||||||
_auraState = AuraStateType.DeadlyPoison;
|
_auraState = AuraStateType.RoguePoisoned;
|
||||||
|
|
||||||
// Enrage aura state
|
// Enrage aura state
|
||||||
if (Dispel == DispelType.Enrage)
|
if (Dispel == DispelType.Enrage)
|
||||||
_auraState = AuraStateType.Enrage;
|
_auraState = AuraStateType.Enraged;
|
||||||
|
|
||||||
// Bleeding aura state
|
// Bleeding aura state
|
||||||
if (Convert.ToBoolean(GetAllEffectsMechanicMask() & 1 << (int)Mechanics.Bleed))
|
if (Convert.ToBoolean(GetAllEffectsMechanicMask() & 1 << (int)Mechanics.Bleed))
|
||||||
_auraState = AuraStateType.Bleeding;
|
_auraState = AuraStateType.Bleed;
|
||||||
|
|
||||||
if (Convert.ToBoolean(GetSchoolMask() & SpellSchoolMask.Frost))
|
if (Convert.ToBoolean(GetSchoolMask() & SpellSchoolMask.Frost))
|
||||||
{
|
{
|
||||||
@@ -1403,16 +1383,49 @@ namespace Game.Spells
|
|||||||
|
|
||||||
switch (Id)
|
switch (Id)
|
||||||
{
|
{
|
||||||
|
case 1064: // Dazed
|
||||||
|
_auraState = AuraStateType.Dazed;
|
||||||
|
break;
|
||||||
|
case 32216: // Victorious
|
||||||
|
_auraState = AuraStateType.Victorious;
|
||||||
|
break;
|
||||||
case 71465: // Divine Surge
|
case 71465: // Divine Surge
|
||||||
case 50241: // Evasive Charges
|
case 50241: // Evasive Charges
|
||||||
_auraState = AuraStateType.Unk22;
|
_auraState = AuraStateType.RaidEncounter;
|
||||||
break;
|
break;
|
||||||
case 9991: // Touch of Zanzil
|
case 6950: // Faerie Fire
|
||||||
case 35325: // Glowing Blood
|
case 9806: // Phantom Strike
|
||||||
case 35328: // Lambent Blood
|
case 9991: // Touch of Zanzil
|
||||||
case 35329: // Vibrant Blood
|
case 13424: // Faerie Fire
|
||||||
case 35331: // Black Blood
|
case 13752: // Faerie Fire
|
||||||
case 49163: // Perpetual Instability
|
case 16432: // Plague Mist
|
||||||
|
case 20656: // Faerie Fire
|
||||||
|
case 25602: // Faerie Fire
|
||||||
|
case 32129: // Faerie Fire
|
||||||
|
case 35325: // Glowing Blood
|
||||||
|
case 35328: // Lambent Blood
|
||||||
|
case 35329: // Vibrant Blood
|
||||||
|
case 35331: // Black Blood
|
||||||
|
case 49163: // Perpetual Instability
|
||||||
|
case 65863: // Faerie Fire
|
||||||
|
case 79559: // Luxscale Light
|
||||||
|
case 82855: // Dazzling
|
||||||
|
case 102953: // In the Rumpus
|
||||||
|
case 127907: // Phosphorescence
|
||||||
|
case 127913: // Phosphorescence
|
||||||
|
case 129007: // Zijin Sting
|
||||||
|
case 130159: // Fae Touch
|
||||||
|
case 142537: // Spotter Smoke
|
||||||
|
case 168455: // Spotted!
|
||||||
|
case 176905: // Super Sticky Glitter Bomb
|
||||||
|
case 189502: // Marked
|
||||||
|
case 201785: // Intruder Alert!
|
||||||
|
case 201786: // Intruder Alert!
|
||||||
|
case 201935: // Spotted!
|
||||||
|
case 239233: // Smoke Bomb
|
||||||
|
case 319400: // Glitter Burst
|
||||||
|
case 321470: // Dimensional Shifter Mishap
|
||||||
|
case 331134: // Spotted
|
||||||
_auraState = AuraStateType.FaerieFire;
|
_auraState = AuraStateType.FaerieFire;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ namespace Scripts.Spells.Warrior
|
|||||||
if (damageInfo != null)
|
if (damageInfo != null)
|
||||||
{
|
{
|
||||||
SpellInfo spellInfo = damageInfo.GetSpellInfo();
|
SpellInfo spellInfo = damageInfo.GetSpellInfo();
|
||||||
if (spellInfo != null && (spellInfo.Id == SpellIds.BladestormPeriodicWhirlwind || (spellInfo.Id == SpellIds.Execute && !_procTarget.HasAuraState(AuraStateType.HealthLess20Percent))))
|
if (spellInfo != null && (spellInfo.Id == SpellIds.BladestormPeriodicWhirlwind || (spellInfo.Id == SpellIds.Execute && !_procTarget.HasAuraState(AuraStateType.Wounded20Percent))))
|
||||||
{
|
{
|
||||||
// If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage
|
// If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage
|
||||||
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, true, null, aurEff);
|
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, true, null, aurEff);
|
||||||
|
|||||||
Reference in New Issue
Block a user