Core/Auras: Update AuraState enum and implement missing new ones

Port From (https://github.com/TrinityCore/TrinityCore/commit/69e0b9a98516a0cac14bc3f985a2deb2fe79205f)
This commit is contained in:
hondacrx
2021-03-17 21:51:55 -04:00
parent 97a89d0c8c
commit 76d79ff2e6
8 changed files with 98 additions and 105 deletions
+25 -25
View File
@@ -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-not (t) used in target aura state-not
None = 0, // C |
Defense = 1, // C |
HealthLess20Percent = 2, // CcT |
Berserking = 3, // C T |
Frozen = 4, // c t| frozen target
Judgement = 5, // C |
//UNKNOWN6 = 6, // | not used
HunterParry = 7, // C |
//UNKNOWN7 = 7, // c | creature cheap shot / focused bursts spells
//UNKNOWN8 = 8, // t| test spells
//UNKNOWN9 = 9, // |
WarriorVictoryRush = 10, // C | warrior victory rush
//UNKNOWN11 = 11, // C t| 60348 - Maelstrom Ready!, test spells
FaerieFire = 12, // c t|
HealthLess35Percent = 13, // C T |
Conflagrate = 14, // T |
Swiftmend = 15, // T |
DeadlyPoison = 16, // T |
Enrage = 17, // C |
Bleeding = 18, // T|
Unk19 = 19, // |
//UNKNOWN20 = 20, // c | only (45317 Suicide)
//UNKNOWN21 = 21, // | not used
Unk22 = 22, // C t| varius spells (63884, 50240)
HealthAbove75Percent = 23, // C |
Defensive = 1, // Cctt|
Wounded20Percent = 2, // Cct |
Unbalanced = 3, // Cct | Nyi
Frozen = 4, // C T|
Marked = 5, // C T| Nyi
Wounded25Percent = 6, // T |
Defensive2 = 7, // Cc | Nyi
Banished = 8, // C | Nyi
Dazed = 9, // T|
Victorious = 10, // C |
Rampage = 11, // | Nyi
FaerieFire = 12, // C T|
Wounded35Percent = 13, // Cct |
RaidEncounter2 = 14, // Ct |
DruidPeriodicHeal = 15, // T |
RoguePoisoned = 16, // |
Enraged = 17, // C |
Bleed = 18, // T |
Vulnerable = 19, // | Nyi
ArenaPreparation = 20, // C |
WoundHealth20_80 = 21, // T |
RaidEncounter = 22, // Cctt|
Healthy75Percent = 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:
+2 -3
View File
@@ -343,9 +343,8 @@ namespace Framework.Constants
public enum ReactiveType
{
Defense = 0,
HunterParry = 1,
OverPower = 2,
Max = 3
Defense2 = 1,
Max = 2
}
public enum SpellValueMod
+9 -15
View File
@@ -1729,16 +1729,12 @@ namespace Game.Entities
switch (reactive)
{
case ReactiveType.Defense:
if (HasAuraState(AuraStateType.Defense))
ModifyAuraState(AuraStateType.Defense, false);
if (HasAuraState(AuraStateType.Defensive))
ModifyAuraState(AuraStateType.Defensive, false);
break;
case ReactiveType.HunterParry:
if (GetClass() == Class.Hunter && HasAuraState(AuraStateType.HunterParry))
ModifyAuraState(AuraStateType.HunterParry, false);
break;
case ReactiveType.OverPower:
if (GetClass() == Class.Warrior && IsTypeId(TypeId.Player))
ToPlayer().ClearComboPoints();
case ReactiveType.Defense2:
if (HasAuraState(AuraStateType.Defensive2))
ModifyAuraState(AuraStateType.Defensive2, false);
break;
}
}
@@ -1836,12 +1832,10 @@ namespace Game.Entities
for (ReactiveType i = 0; i < ReactiveType.Max; ++i)
m_reactiveTimer[i] = 0;
if (HasAuraState(AuraStateType.Defense))
ModifyAuraState(AuraStateType.Defense, false);
if (GetClass() == Class.Hunter && HasAuraState(AuraStateType.HunterParry))
ModifyAuraState(AuraStateType.HunterParry, false);
if (GetClass() == Class.Warrior && IsTypeId(TypeId.Player))
ToPlayer().ClearComboPoints();
if (HasAuraState(AuraStateType.Defensive))
ModifyAuraState(AuraStateType.Defensive, false);
if (HasAuraState(AuraStateType.Defensive2))
ModifyAuraState(AuraStateType.Defensive2, false);
}
public virtual bool CanUseAttackType(WeaponAttackType attacktype)
+6 -24
View File
@@ -242,7 +242,7 @@ namespace Game.Entities
// Drain Soul - increased damage for targets under 20% HP
if (spellProto.Id == 198590)
if (HasAuraState(AuraStateType.HealthLess20Percent))
if (HasAuraState(AuraStateType.Wounded20Percent))
DoneTotalMod *= 2;
break;
}
@@ -1851,41 +1851,23 @@ namespace Game.Entities
// Update AURA_STATE on dodge
if (GetClass() != Class.Rogue) // skip Rogue Riposte
{
ModifyAuraState(AuraStateType.Defense, true);
ModifyAuraState(AuraStateType.Defensive, true);
StartReactiveTimer(ReactiveType.Defense);
}
}
// if victim and parry attack
if (hitMask.HasAnyFlag(ProcFlagsHit.Parry))
{
// For Hunters only Counterattack (skip Mongoose bite)
if (GetClass() == Class.Hunter)
{
ModifyAuraState(AuraStateType.HunterParry, true);
StartReactiveTimer(ReactiveType.HunterParry);
}
else
{
ModifyAuraState(AuraStateType.Defense, true);
StartReactiveTimer(ReactiveType.Defense);
}
ModifyAuraState(AuraStateType.Defensive, true);
StartReactiveTimer(ReactiveType.Defense);
}
// if and victim block attack
if (hitMask.HasAnyFlag(ProcFlagsHit.Block))
{
ModifyAuraState(AuraStateType.Defense, true);
ModifyAuraState(AuraStateType.Defensive, true);
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;
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);
}
}
+6 -3
View File
@@ -184,9 +184,12 @@ namespace Game.Entities
if (IsAlive())
{
ModifyAuraState(AuraStateType.HealthLess20Percent, HealthBelowPct(20));
ModifyAuraState(AuraStateType.HealthLess35Percent, HealthBelowPct(35));
ModifyAuraState(AuraStateType.HealthAbove75Percent, HealthAbovePct(75));
ModifyAuraState(AuraStateType.Wounded20Percent, HealthBelowPct(20));
ModifyAuraState(AuraStateType.Wounded25Percent, HealthBelowPct(25));
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);
+2
View File
@@ -3986,6 +3986,8 @@ namespace Game.Spells
return;
target.RemoveUnitFlag(UnitFlags.Preparation);
}
target.ModifyAuraState(AuraStateType.ArenaPreparation, apply);
}
[AuraEffectHandler(AuraType.NoReagentUse)]
+47 -34
View File
@@ -1354,45 +1354,25 @@ namespace Game.Spells
{
_auraState = AuraStateType.None;
// Seals
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)
// Faerie Fire
if (GetCategory() == 1133)
_auraState = AuraStateType.FaerieFire;
// Victorious
if (SpellFamilyName == SpellFamilyNames.Warrior && SpellFamilyFlags[1].HasAnyFlag(0x40000u))
_auraState = AuraStateType.WarriorVictoryRush;
// Swiftmend state on Regrowth & Rejuvenation
if (SpellFamilyName == SpellFamilyNames.Druid && SpellFamilyFlags[0].HasAnyFlag(0x50u))
_auraState = AuraStateType.Swiftmend;
// Swiftmend state on Regrowth, Rejuvenation, Wild Growth
if (SpellFamilyName == SpellFamilyNames.Druid && (SpellFamilyFlags[0].HasAnyFlag(0x50u) || SpellFamilyFlags[1].HasAnyFlag(0x4000000u)))
_auraState = AuraStateType.DruidPeriodicHeal;
// Deadly poison aura state
if (SpellFamilyName == SpellFamilyNames.Rogue && SpellFamilyFlags[0].HasAnyFlag(0x10000u))
_auraState = AuraStateType.DeadlyPoison;
_auraState = AuraStateType.RoguePoisoned;
// Enrage aura state
if (Dispel == DispelType.Enrage)
_auraState = AuraStateType.Enrage;
_auraState = AuraStateType.Enraged;
// Bleeding aura state
if (Convert.ToBoolean(GetAllEffectsMechanicMask() & 1 << (int)Mechanics.Bleed))
_auraState = AuraStateType.Bleeding;
_auraState = AuraStateType.Bleed;
if (Convert.ToBoolean(GetSchoolMask() & SpellSchoolMask.Frost))
{
@@ -1403,16 +1383,49 @@ namespace Game.Spells
switch (Id)
{
case 1064: // Dazed
_auraState = AuraStateType.Dazed;
break;
case 32216: // Victorious
_auraState = AuraStateType.Victorious;
break;
case 71465: // Divine Surge
case 50241: // Evasive Charges
_auraState = AuraStateType.Unk22;
_auraState = AuraStateType.RaidEncounter;
break;
case 9991: // Touch of Zanzil
case 35325: // Glowing Blood
case 35328: // Lambent Blood
case 35329: // Vibrant Blood
case 35331: // Black Blood
case 49163: // Perpetual Instability
case 6950: // Faerie Fire
case 9806: // Phantom Strike
case 9991: // Touch of Zanzil
case 13424: // Faerie Fire
case 13752: // Faerie Fire
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;
break;
default:
+1 -1
View File
@@ -469,7 +469,7 @@ namespace Scripts.Spells.Warrior
if (damageInfo != null)
{
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
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, true, null, aurEff);