Core/Auras: Implemented new aura type 487 (SPELL_AURA_COSMETIC_MOUNTED)

Port From (https://github.com/TrinityCore/TrinityCore/commit/a0c4a3071cebf3d755a9bdb8e07d93b17f354db3)
This commit is contained in:
hondacrx
2021-10-03 13:01:31 -04:00
parent 8ccf252ac3
commit 3c55b9e7a8
6 changed files with 383 additions and 346 deletions
@@ -508,7 +508,7 @@ namespace Framework.Constants
AllowInterruptSpell = 484, // NYI AllowInterruptSpell = 484, // NYI
ModMovementForceMagnitude = 485, ModMovementForceMagnitude = 485,
Unk486 = 486, Unk486 = 486,
Unk487 = 487, CosmeticMounted = 487,
Unk488 = 488, Unk488 = 488,
Unk489 = 489, Unk489 = 489,
Unk490 = 490, Unk490 = 490,
@@ -1159,7 +1159,7 @@ namespace Game.Entities
public UpdateField<uint> NativeDisplayID = new(32, 53); public UpdateField<uint> NativeDisplayID = new(32, 53);
public UpdateField<float> NativeXDisplayScale = new(32, 54); public UpdateField<float> NativeXDisplayScale = new(32, 54);
public UpdateField<uint> MountDisplayID = new(32, 55); public UpdateField<uint> MountDisplayID = new(32, 55);
public UpdateField<int> CosmeticMountDisplayID = new(32, 56); public UpdateField<uint> CosmeticMountDisplayID = new(32, 56);
public UpdateField<float> MinDamage = new(32, 57); public UpdateField<float> MinDamage = new(32, 57);
public UpdateField<float> MaxDamage = new(32, 58); public UpdateField<float> MaxDamage = new(32, 58);
public UpdateField<float> MinOffHandDamage = new(32, 59); public UpdateField<float> MinOffHandDamage = new(32, 59);
@@ -1319,7 +1319,7 @@ namespace Game.Entities
data.WriteUInt32(NativeDisplayID); data.WriteUInt32(NativeDisplayID);
data.WriteFloat(NativeXDisplayScale); data.WriteFloat(NativeXDisplayScale);
data.WriteUInt32(MountDisplayID); data.WriteUInt32(MountDisplayID);
data.WriteInt32(CosmeticMountDisplayID); data.WriteUInt32(CosmeticMountDisplayID);
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Owner) || fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Empath)) if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Owner) || fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Empath))
{ {
data.WriteFloat(MinDamage); data.WriteFloat(MinDamage);
@@ -1732,7 +1732,7 @@ namespace Game.Entities
} }
if (changesMask[56]) if (changesMask[56])
{ {
data.WriteInt32(CosmeticMountDisplayID); data.WriteUInt32(CosmeticMountDisplayID);
} }
if (changesMask[57]) if (changesMask[57])
{ {
@@ -1301,6 +1301,7 @@ namespace Game.Entities
public void Mount(uint mount, uint VehicleId = 0, uint creatureEntry = 0) public void Mount(uint mount, uint VehicleId = 0, uint creatureEntry = 0)
{ {
RemoveAurasByType(AuraType.CosmeticMounted);
if (mount != 0) if (mount != 0)
SetMountDisplayId(mount); SetMountDisplayId(mount);
+3 -1
View File
@@ -1791,7 +1791,9 @@ namespace Game.Entities
} }
public uint GetMountDisplayId() { return m_unitData.MountDisplayID; } public uint GetMountDisplayId() { return m_unitData.MountDisplayID; }
public void SetMountDisplayId(uint mountDisplayId) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.MountDisplayID), mountDisplayId); } public void SetMountDisplayId(uint mountDisplayId) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.MountDisplayID), mountDisplayId); }
uint GetCosmeticMountDisplayId() { return m_unitData.CosmeticMountDisplayID; }
public void SetCosmeticMountDisplayId(uint mountDisplayId) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.CosmeticMountDisplayID), mountDisplayId); }
public virtual float GetFollowAngle() { return MathFunctions.PiOver2; } public virtual float GetFollowAngle() { return MathFunctions.PiOver2; }
public override ObjectGuid GetOwnerGUID() { return m_unitData.SummonedBy; } public override ObjectGuid GetOwnerGUID() { return m_unitData.SummonedBy; }
+349 -331
View File
@@ -460,7 +460,7 @@ namespace Game.Spells
{ {
return target.SpellCritChanceTaken(caster, null, this, GetSpellInfo().GetSchoolMask(), CalcPeriodicCritChance(caster), GetSpellInfo().GetAttackType()); return target.SpellCritChanceTaken(caster, null, this, GetSpellInfo().GetSchoolMask(), CalcPeriodicCritChance(caster), GetSpellInfo().GetAttackType());
} }
public bool IsAffectingSpell(SpellInfo spell) public bool IsAffectingSpell(SpellInfo spell)
{ {
if (spell == null) if (spell == null)
@@ -544,21 +544,21 @@ namespace Game.Spells
case AuraType.ModStun: case AuraType.ModStun:
case AuraType.ModRoot: case AuraType.ModRoot:
case AuraType.Transform: case AuraType.Transform:
{ {
DamageInfo damageInfo = eventInfo.GetDamageInfo(); DamageInfo damageInfo = eventInfo.GetDamageInfo();
if (damageInfo == null || damageInfo.GetDamage() == 0) if (damageInfo == null || damageInfo.GetDamage() == 0)
return false; return false;
// Spell own damage at apply won't break CC // Spell own damage at apply won't break CC
if (spellInfo != null && spellInfo == GetSpellInfo()) if (spellInfo != null && spellInfo == GetSpellInfo())
{ {
Aura aura = GetBase(); Aura aura = GetBase();
// called from spellcast, should not have ticked yet // called from spellcast, should not have ticked yet
if (aura.GetDuration() == aura.GetMaxDuration()) if (aura.GetDuration() == aura.GetMaxDuration())
return false; return false;
}
break;
} }
break;
}
case AuraType.MechanicImmunity: case AuraType.MechanicImmunity:
case AuraType.ModMechanicResistance: case AuraType.ModMechanicResistance:
// compare mechanic // compare mechanic
@@ -578,19 +578,19 @@ namespace Game.Spells
break; break;
case AuraType.ModPowerCostSchool: case AuraType.ModPowerCostSchool:
case AuraType.ModPowerCostSchoolPct: case AuraType.ModPowerCostSchoolPct:
{ {
// Skip melee hits and spells with wrong school or zero cost // Skip melee hits and spells with wrong school or zero cost
if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue()) // School Check if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue()) // School Check
|| !eventInfo.GetProcSpell()) || !eventInfo.GetProcSpell())
return false; return false;
// Costs Check // Costs Check
var costs = eventInfo.GetProcSpell().GetPowerCost(); var costs = eventInfo.GetProcSpell().GetPowerCost();
var m = costs.Find(cost => cost.Amount > 0); var m = costs.Find(cost => cost.Amount > 0);
if (m == null) if (m == null)
return false; return false;
break; break;
} }
case AuraType.ReflectSpellsSchool: case AuraType.ReflectSpellsSchool:
// Skip melee hits and spells with wrong school // Skip melee hits and spells with wrong school
if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue())) if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue()))
@@ -598,15 +598,15 @@ namespace Game.Spells
break; break;
case AuraType.ProcTriggerSpell: case AuraType.ProcTriggerSpell:
case AuraType.ProcTriggerSpellWithValue: case AuraType.ProcTriggerSpellWithValue:
{ {
// Don't proc extra attacks while already processing extra attack spell // Don't proc extra attacks while already processing extra attack spell
uint triggerSpellId = GetSpellEffectInfo().TriggerSpell; uint triggerSpellId = GetSpellEffectInfo().TriggerSpell;
SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(triggerSpellId, GetBase().GetCastDifficulty()); SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(triggerSpellId, GetBase().GetCastDifficulty());
if (triggeredSpellInfo != null) if (triggeredSpellInfo != null)
if (aurApp.GetTarget().ExtraAttacks != 0 && triggeredSpellInfo.HasEffect(SpellEffectName.AddExtraAttacks)) if (aurApp.GetTarget().ExtraAttacks != 0 && triggeredSpellInfo.HasEffect(SpellEffectName.AddExtraAttacks))
return false; return false;
break; break;
} }
case AuraType.ModSpellCritChance: case AuraType.ModSpellCritChance:
// skip spells that can't crit // skip spells that can't crit
if (spellInfo == null || !spellInfo.HasAttribute(SpellCustomAttributes.CanCrit)) if (spellInfo == null || !spellInfo.HasAttribute(SpellCustomAttributes.CanCrit))
@@ -810,7 +810,7 @@ namespace Game.Spells
public void SetAmount(int amount) { _amount = amount; m_canBeRecalculated = false; } public void SetAmount(int amount) { _amount = amount; m_canBeRecalculated = false; }
public float? GetEstimatedAmount() { return _estimatedAmount; } public float? GetEstimatedAmount() { return _estimatedAmount; }
public int GetPeriodicTimer() { return _periodicTimer; } public int GetPeriodicTimer() { return _periodicTimer; }
public void SetPeriodicTimer(int periodicTimer) { _periodicTimer = periodicTimer; } public void SetPeriodicTimer(int periodicTimer) { _periodicTimer = periodicTimer; }
@@ -1215,15 +1215,15 @@ namespace Game.Spells
case ShapeShiftForm.FlightFormEpic: case ShapeShiftForm.FlightFormEpic:
case ShapeShiftForm.FlightForm: case ShapeShiftForm.FlightForm:
case ShapeShiftForm.MoonkinForm: case ShapeShiftForm.MoonkinForm:
{ {
// remove movement affects // remove movement affects
target.RemoveAurasByShapeShift(); target.RemoveAurasByShapeShift();
// and polymorphic affects // and polymorphic affects
if (target.IsPolymorphed()) if (target.IsPolymorphed())
target.RemoveAurasDueToSpell(target.GetTransForm()); target.RemoveAurasDueToSpell(target.GetTransForm());
break; break;
} }
default: default:
break; break;
} }
@@ -1359,57 +1359,57 @@ namespace Game.Spells
{ {
// Orb of Deception // Orb of Deception
case 16739: case 16739:
{ {
if (!target.IsTypeId(TypeId.Player)) if (!target.IsTypeId(TypeId.Player))
return; return;
switch (target.GetRace()) switch (target.GetRace())
{ {
// Blood Elf // Blood Elf
case Race.BloodElf: case Race.BloodElf:
target.SetDisplayId(target.GetGender() == Gender.Female ? 17830 : 17829u); target.SetDisplayId(target.GetGender() == Gender.Female ? 17830 : 17829u);
break; break;
// Orc // Orc
case Race.Orc: case Race.Orc:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10140 : 10139u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10140 : 10139u);
break; break;
// Troll // Troll
case Race.Troll: case Race.Troll:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10134 : 10135u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10134 : 10135u);
break; break;
// Tauren // Tauren
case Race.Tauren: case Race.Tauren:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10147 : 10136u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10147 : 10136u);
break; break;
// Undead // Undead
case Race.Undead: case Race.Undead:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10145 : 10146u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10145 : 10146u);
break; break;
// Draenei // Draenei
case Race.Draenei: case Race.Draenei:
target.SetDisplayId(target.GetGender() == Gender.Female ? 17828 : 17827u); target.SetDisplayId(target.GetGender() == Gender.Female ? 17828 : 17827u);
break; break;
// Dwarf // Dwarf
case Race.Dwarf: case Race.Dwarf:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10142 : 10141u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10142 : 10141u);
break; break;
// Gnome // Gnome
case Race.Gnome: case Race.Gnome:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10149 : 10148u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10149 : 10148u);
break; break;
// Human // Human
case Race.Human: case Race.Human:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10138 : 10137u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10138 : 10137u);
break; break;
// Night Elf // Night Elf
case Race.NightElf: case Race.NightElf:
target.SetDisplayId(target.GetGender() == Gender.Female ? 10144 : 10143u); target.SetDisplayId(target.GetGender() == Gender.Female ? 10144 : 10143u);
break; break;
default: default:
break; break;
}
break;
} }
break;
}
// Murloc costume // Murloc costume
case 42365: case 42365:
target.SetDisplayId(21723); target.SetDisplayId(21723);
@@ -1418,57 +1418,57 @@ namespace Game.Spells
case 50517: case 50517:
// Corsair Costume // Corsair Costume
case 51926: case 51926:
{ {
if (!target.IsTypeId(TypeId.Player)) if (!target.IsTypeId(TypeId.Player))
return; return;
switch (target.GetRace()) switch (target.GetRace())
{ {
// Blood Elf // Blood Elf
case Race.BloodElf: case Race.BloodElf:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25043 : 25032u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25043 : 25032u);
break; break;
// Orc // Orc
case Race.Orc: case Race.Orc:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25050 : 25039u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25050 : 25039u);
break; break;
// Troll // Troll
case Race.Troll: case Race.Troll:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25052 : 25041u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25052 : 25041u);
break; break;
// Tauren // Tauren
case Race.Tauren: case Race.Tauren:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25051 : 25040u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25051 : 25040u);
break; break;
// Undead // Undead
case Race.Undead: case Race.Undead:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25053 : 25042u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25053 : 25042u);
break; break;
// Draenei // Draenei
case Race.Draenei: case Race.Draenei:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25044 : 25033u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25044 : 25033u);
break; break;
// Dwarf // Dwarf
case Race.Dwarf: case Race.Dwarf:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25045 : 25034u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25045 : 25034u);
break; break;
// Gnome // Gnome
case Race.Gnome: case Race.Gnome:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25035 : 25046u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25035 : 25046u);
break; break;
// Human // Human
case Race.Human: case Race.Human:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25037 : 25048u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25037 : 25048u);
break; break;
// Night Elf // Night Elf
case Race.NightElf: case Race.NightElf:
target.SetDisplayId(target.GetGender() == Gender.Female ? 25038 : 25049u); target.SetDisplayId(target.GetGender() == Gender.Female ? 25038 : 25049u);
break; break;
default: default:
break; break;
}
break;
} }
break;
}
// Pygmy Oil // Pygmy Oil
case 53806: case 53806:
target.SetDisplayId(22512); target.SetDisplayId(22512);
@@ -4095,38 +4095,38 @@ namespace Game.Spells
caster.CastSpell(caster, 13138, new CastSpellExtraArgs(this)); caster.CastSpell(caster, 13138, new CastSpellExtraArgs(this));
break; break;
case 34026: // kill command case 34026: // kill command
{ {
Unit pet = target.GetGuardianPet(); Unit pet = target.GetGuardianPet();
if (pet == null) if (pet == null)
break;
target.CastSpell(target, 34027, new CastSpellExtraArgs(this));
// set 3 stacks and 3 charges (to make all auras not disappear at once)
Aura owner_aura = target.GetAura(34027, GetCasterGUID());
Aura pet_aura = pet.GetAura(58914, GetCasterGUID());
if (owner_aura != null)
{
owner_aura.SetStackAmount((byte)owner_aura.GetSpellInfo().StackAmount);
if (pet_aura != null)
{
pet_aura.SetCharges(0);
pet_aura.SetStackAmount((byte)owner_aura.GetSpellInfo().StackAmount);
}
}
break; break;
target.CastSpell(target, 34027, new CastSpellExtraArgs(this));
// set 3 stacks and 3 charges (to make all auras not disappear at once)
Aura owner_aura = target.GetAura(34027, GetCasterGUID());
Aura pet_aura = pet.GetAura(58914, GetCasterGUID());
if (owner_aura != null)
{
owner_aura.SetStackAmount((byte)owner_aura.GetSpellInfo().StackAmount);
if (pet_aura != null)
{
pet_aura.SetCharges(0);
pet_aura.SetStackAmount((byte)owner_aura.GetSpellInfo().StackAmount);
}
} }
break;
}
case 37096: // Blood Elf Illusion case 37096: // Blood Elf Illusion
{
if (caster != null)
{ {
if (caster != null) if (caster.GetGender() == Gender.Female)
{ caster.CastSpell(target, 37095, new CastSpellExtraArgs(this)); // Blood Elf Disguise
if (caster.GetGender() == Gender.Female) else
caster.CastSpell(target, 37095, new CastSpellExtraArgs(this)); // Blood Elf Disguise caster.CastSpell(target, 37093, new CastSpellExtraArgs(this));
else
caster.CastSpell(target, 37093, new CastSpellExtraArgs(this));
}
break;
} }
break;
}
case 39850: // Rocket Blast case 39850: // Rocket Blast
if (RandomHelper.randChance(20)) // backfire stun if (RandomHelper.randChance(20)) // backfire stun
target.CastSpell(target, 51581, new CastSpellExtraArgs(this)); target.CastSpell(target, 51581, new CastSpellExtraArgs(this));
@@ -4235,29 +4235,29 @@ namespace Game.Spells
} }
break; break;
case 36730: // Flame Strike case 36730: // Flame Strike
{ {
target.CastSpell(target, 36731, new CastSpellExtraArgs(this)); target.CastSpell(target, 36731, new CastSpellExtraArgs(this));
break; break;
} }
case 44191: // Flame Strike case 44191: // Flame Strike
{
if (target.GetMap().IsDungeon())
{ {
if (target.GetMap().IsDungeon()) uint spellId = (uint)(target.GetMap().IsHeroic() ? 46163 : 44190);
{
uint spellId = (uint)(target.GetMap().IsHeroic() ? 46163 : 44190);
target.CastSpell(target, spellId, new CastSpellExtraArgs(this)); target.CastSpell(target, spellId, new CastSpellExtraArgs(this));
}
break;
} }
break;
}
case 43681: // Inactive case 43681: // Inactive
{ {
if (!target.IsTypeId(TypeId.Player) || aurApp.GetRemoveMode() != AuraRemoveMode.Expire) if (!target.IsTypeId(TypeId.Player) || aurApp.GetRemoveMode() != AuraRemoveMode.Expire)
return; return;
if (target.GetMap().IsBattleground()) if (target.GetMap().IsBattleground())
target.ToPlayer().LeaveBattleground(); target.ToPlayer().LeaveBattleground();
break; break;
} }
case 42783: // Wrath of the Astromancer case 42783: // Wrath of the Astromancer
target.CastSpell(target, (uint)GetAmount(), new CastSpellExtraArgs(this)); target.CastSpell(target, (uint)GetAmount(), new CastSpellExtraArgs(this));
break; break;
@@ -4290,117 +4290,117 @@ namespace Game.Spells
switch (m_spellInfo.SpellFamilyName) switch (m_spellInfo.SpellFamilyName)
{ {
case SpellFamilyNames.Generic: case SpellFamilyNames.Generic:
{ {
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real)) if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
break;
switch (GetId())
{
// Recently Bandaged
case 11196:
target.ApplySpellImmune(GetId(), SpellImmunity.Mechanic, (uint)GetMiscValue(), apply);
break;
// Unstable Power
case 24658:
{
uint spellId = 24659;
if (apply && caster != null)
{
SpellInfo spell = Global.SpellMgr.GetSpellInfo(spellId, GetBase().GetCastDifficulty());
CastSpellExtraArgs args = new();
args.TriggerFlags = TriggerCastFlags.FullMask;
args.OriginalCaster = GetCasterGUID();
args.CastDifficulty = spell.Difficulty;
for (uint i = 0; i < spell.StackAmount; ++i)
caster.CastSpell(target, spell.Id, args);
break;
}
target.RemoveAurasDueToSpell(spellId);
break;
}
// Restless Strength
case 24661:
{
uint spellId = 24662;
if (apply && caster != null)
{
SpellInfo spell = Global.SpellMgr.GetSpellInfo(spellId, GetBase().GetCastDifficulty());
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.OriginalCaster = GetCasterGUID();
args.CastDifficulty = spell.Difficulty;
for (uint i = 0; i < spell.StackAmount; ++i)
caster.CastSpell(target, spell.Id, args);
break;
}
target.RemoveAurasDueToSpell(spellId);
break;
}
// Tag Murloc
case 30877:
{
// Tag/untag Blacksilt Scout
target.SetEntry((uint)(apply ? 17654 : 17326));
break;
}
case 57819: // Argent Champion
case 57820: // Ebon Champion
case 57821: // Champion of the Kirin Tor
case 57822: // Wyrmrest Champion
{
if (!caster || !caster.IsTypeId(TypeId.Player))
break;
uint FactionID = 0;
if (apply)
{
switch (m_spellInfo.Id)
{
case 57819:
FactionID = 1106; // Argent Crusade
break;
case 57820:
FactionID = 1098;// Knights of the Ebon Blade
break;
case 57821:
FactionID = 1090; // Kirin Tor
break;
case 57822:
FactionID = 1091; // The Wyrmrest Accord
break;
}
}
caster.ToPlayer().SetChampioningFaction(FactionID);
break;
}
// LK Intro VO (1)
case 58204:
if (target.IsTypeId(TypeId.Player))
{
// Play part 1
if (apply)
target.PlayDirectSound(14970, target.ToPlayer());
// continue in 58205
else
target.CastSpell(target, 58205, new CastSpellExtraArgs(true));
}
break;
// LK Intro VO (2)
case 58205:
if (target.IsTypeId(TypeId.Player))
{
// Play part 2
if (apply)
target.PlayDirectSound(14971, target.ToPlayer());
// Play part 3
else
target.PlayDirectSound(14972, target.ToPlayer());
}
break;
}
break; break;
switch (GetId())
{
// Recently Bandaged
case 11196:
target.ApplySpellImmune(GetId(), SpellImmunity.Mechanic, (uint)GetMiscValue(), apply);
break;
// Unstable Power
case 24658:
{
uint spellId = 24659;
if (apply && caster != null)
{
SpellInfo spell = Global.SpellMgr.GetSpellInfo(spellId, GetBase().GetCastDifficulty());
CastSpellExtraArgs args = new();
args.TriggerFlags = TriggerCastFlags.FullMask;
args.OriginalCaster = GetCasterGUID();
args.CastDifficulty = spell.Difficulty;
for (uint i = 0; i < spell.StackAmount; ++i)
caster.CastSpell(target, spell.Id, args);
break;
}
target.RemoveAurasDueToSpell(spellId);
break;
}
// Restless Strength
case 24661:
{
uint spellId = 24662;
if (apply && caster != null)
{
SpellInfo spell = Global.SpellMgr.GetSpellInfo(spellId, GetBase().GetCastDifficulty());
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.OriginalCaster = GetCasterGUID();
args.CastDifficulty = spell.Difficulty;
for (uint i = 0; i < spell.StackAmount; ++i)
caster.CastSpell(target, spell.Id, args);
break;
}
target.RemoveAurasDueToSpell(spellId);
break;
}
// Tag Murloc
case 30877:
{
// Tag/untag Blacksilt Scout
target.SetEntry((uint)(apply ? 17654 : 17326));
break;
}
case 57819: // Argent Champion
case 57820: // Ebon Champion
case 57821: // Champion of the Kirin Tor
case 57822: // Wyrmrest Champion
{
if (!caster || !caster.IsTypeId(TypeId.Player))
break;
uint FactionID = 0;
if (apply)
{
switch (m_spellInfo.Id)
{
case 57819:
FactionID = 1106; // Argent Crusade
break;
case 57820:
FactionID = 1098;// Knights of the Ebon Blade
break;
case 57821:
FactionID = 1090; // Kirin Tor
break;
case 57822:
FactionID = 1091; // The Wyrmrest Accord
break;
}
}
caster.ToPlayer().SetChampioningFaction(FactionID);
break;
}
// LK Intro VO (1)
case 58204:
if (target.IsTypeId(TypeId.Player))
{
// Play part 1
if (apply)
target.PlayDirectSound(14970, target.ToPlayer());
// continue in 58205
else
target.CastSpell(target, 58205, new CastSpellExtraArgs(true));
}
break;
// LK Intro VO (2)
case 58205:
if (target.IsTypeId(TypeId.Player))
{
// Play part 2
if (apply)
target.PlayDirectSound(14971, target.ToPlayer());
// Play part 3
else
target.PlayDirectSound(14972, target.ToPlayer());
}
break;
} }
break;
}
} }
} }
@@ -4903,47 +4903,47 @@ namespace Game.Spells
switch (GetAuraType()) switch (GetAuraType())
{ {
case AuraType.PeriodicDamage: case AuraType.PeriodicDamage:
{
if (caster != null)
damage = caster.SpellDamageBonusDone(target, GetSpellInfo(), damage, DamageEffectType.DOT, GetSpellEffectInfo(), stackAmountForBonuses);
damage = target.SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DamageEffectType.DOT);
// There is a Chance to make a Soul Shard when Drain soul does damage
if (caster != null && GetSpellInfo().SpellFamilyName == SpellFamilyNames.Warlock && GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00004000u))
{ {
if (caster != null) if (caster.IsTypeId(TypeId.Player) && caster.ToPlayer().IsHonorOrXPTarget(target))
damage = caster.SpellDamageBonusDone(target, GetSpellInfo(), damage, DamageEffectType.DOT, GetSpellEffectInfo(), stackAmountForBonuses); caster.CastSpell(caster, 95810, new CastSpellExtraArgs(this));
damage = target.SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DamageEffectType.DOT);
// There is a Chance to make a Soul Shard when Drain soul does damage
if (caster != null && GetSpellInfo().SpellFamilyName == SpellFamilyNames.Warlock && GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00004000u))
{
if (caster.IsTypeId(TypeId.Player) && caster.ToPlayer().IsHonorOrXPTarget(target))
caster.CastSpell(caster, 95810, new CastSpellExtraArgs(this));
}
else if (GetSpellInfo().SpellFamilyName == SpellFamilyNames.Generic)
{
switch (GetId())
{
case 70911: // Unbound Plague
case 72854: // Unbound Plague
case 72855: // Unbound Plague
case 72856: // Unbound Plague
damage *= (uint)Math.Pow(1.25f, _ticksDone);
break;
default:
break;
}
}
break;
} }
else if (GetSpellInfo().SpellFamilyName == SpellFamilyNames.Generic)
{
switch (GetId())
{
case 70911: // Unbound Plague
case 72854: // Unbound Plague
case 72855: // Unbound Plague
case 72856: // Unbound Plague
damage *= (uint)Math.Pow(1.25f, _ticksDone);
break;
default:
break;
}
}
break;
}
case AuraType.PeriodicWeaponPercentDamage: case AuraType.PeriodicWeaponPercentDamage:
{ {
WeaponAttackType attackType = GetSpellInfo().GetAttackType(); WeaponAttackType attackType = GetSpellInfo().GetAttackType();
damage = MathFunctions.CalculatePct(caster.CalculateDamage(attackType, false, true), GetAmount()); damage = MathFunctions.CalculatePct(caster.CalculateDamage(attackType, false, true), GetAmount());
// Add melee damage bonuses (also check for negative) // Add melee damage bonuses (also check for negative)
if (caster != null) if (caster != null)
damage = caster.MeleeDamageBonusDone(target, damage, attackType, DamageEffectType.DOT, GetSpellInfo()); damage = caster.MeleeDamageBonusDone(target, damage, attackType, DamageEffectType.DOT, GetSpellInfo());
damage = target.MeleeDamageBonusTaken(caster, damage, attackType, DamageEffectType.DOT, GetSpellInfo()); damage = target.MeleeDamageBonusTaken(caster, damage, attackType, DamageEffectType.DOT, GetSpellInfo());
break; break;
} }
case AuraType.PeriodicDamagePercent: case AuraType.PeriodicDamagePercent:
// ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner // ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
damage = (uint)Math.Ceiling(MathFunctions.CalculatePct((float)target.GetMaxHealth(), (float)damage)); damage = (uint)Math.Ceiling(MathFunctions.CalculatePct((float)target.GetMaxHealth(), (float)damage));
@@ -5383,7 +5383,7 @@ namespace Game.Spells
float critChance = modOwner.SpellCritChanceDone(null, this, GetSpellInfo().GetSchoolMask(), GetSpellInfo().GetAttackType()); float critChance = modOwner.SpellCritChanceDone(null, this, GetSpellInfo().GetSchoolMask(), GetSpellInfo().GetAttackType());
return Math.Max(0.0f, critChance); return Math.Max(0.0f, critChance);
} }
void HandleBreakableCCAuraProc(AuraApplication aurApp, ProcEventInfo eventInfo) void HandleBreakableCCAuraProc(AuraApplication aurApp, ProcEventInfo eventInfo)
{ {
int damageLeft = (int)(GetAmount() - eventInfo.GetDamageInfo().GetDamage()); int damageLeft = (int)(GetAmount() - eventInfo.GetDamageInfo().GetDamage());
@@ -5753,6 +5753,24 @@ namespace Game.Spells
else if (!playerTarget.GetSession().IsLogingOut()) else if (!playerTarget.GetSession().IsLogingOut())
playerTarget.RemoveStoredAuraTeleportLocation(GetSpellInfo().Id); playerTarget.RemoveStoredAuraTeleportLocation(GetSpellInfo().Id);
} }
[AuraEffectHandler(AuraType.StoreTeleportReturnPoint)]
void HandleCosmeticMounted(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
return;
if (apply)
aurApp.GetTarget().SetCosmeticMountDisplayId((uint)GetMiscValue());
else
aurApp.GetTarget().SetCosmeticMountDisplayId(0); // set cosmetic mount to 0, even if multiple auras are active; tested with zandalari racial + divine steed
Player playerTarget = aurApp.GetTarget().ToPlayer();
if (playerTarget == null)
return;
playerTarget.SendMovementSetCollisionHeight(playerTarget.GetCollisionHeight(), UpdateCollisionHeightReason.Force);
}
#endregion #endregion
} }
+26 -10
View File
@@ -40,9 +40,12 @@ namespace Scripts.Spells.Paladin
public const uint ConcentractionAura = 19746; public const uint ConcentractionAura = 19746;
public const uint DivinePurposeProc = 90174; public const uint DivinePurposeProc = 90174;
public const uint DivineSteedHuman = 221883; public const uint DivineSteedHuman = 221883;
public const uint DivineSteedDwarf = 276111;
public const uint DivineSteedDraenei = 221887; public const uint DivineSteedDraenei = 221887;
public const uint DivineSteedDarkIronDwarf = 276112;
public const uint DivineSteedBloodelf = 221886; public const uint DivineSteedBloodelf = 221886;
public const uint DivineSteedTauren = 221885; public const uint DivineSteedTauren = 221885;
public const uint DivineSteedZandalariTroll = 294133;
public const uint DivineStormDamage = 224239; public const uint DivineStormDamage = 224239;
public const uint EnduringLight = 40471; public const uint EnduringLight = 40471;
public const uint EnduringJudgement = 40472; public const uint EnduringJudgement = 40472;
@@ -193,7 +196,7 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
OnEffectProc .Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy)); OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
} }
} }
@@ -240,7 +243,7 @@ namespace Scripts.Spells.Paladin
{ {
public override bool Validate(SpellInfo spellInfo) public override bool Validate(SpellInfo spellInfo)
{ {
return ValidateSpellInfo(SpellIds.DivineSteedHuman, SpellIds.DivineSteedDraenei, SpellIds.DivineSteedBloodelf, SpellIds.DivineSteedTauren); return ValidateSpellInfo(SpellIds.DivineSteedHuman, SpellIds.DivineSteedDwarf, SpellIds.DivineSteedDraenei, SpellIds.DivineSteedDarkIronDwarf, SpellIds.DivineSteedBloodelf, SpellIds.DivineSteedTauren, SpellIds.DivineSteedZandalariTroll);
} }
void HandleOnCast() void HandleOnCast()
@@ -250,15 +253,28 @@ namespace Scripts.Spells.Paladin
uint spellId = SpellIds.DivineSteedHuman; uint spellId = SpellIds.DivineSteedHuman;
switch (caster.GetRace()) switch (caster.GetRace())
{ {
case Race.Human:
spellId = SpellIds.DivineSteedHuman;
break;
case Race.Dwarf:
spellId = SpellIds.DivineSteedDwarf;
break;
case Race.Draenei: case Race.Draenei:
case Race.LightforgedDraenei:
spellId = SpellIds.DivineSteedDraenei; spellId = SpellIds.DivineSteedDraenei;
break; break;
case Race.DarkIronDwarf:
spellId = SpellIds.DivineSteedDarkIronDwarf;
break;
case Race.BloodElf: case Race.BloodElf:
spellId = SpellIds.DivineSteedBloodelf; spellId = SpellIds.DivineSteedBloodelf;
break; break;
case Race.Tauren: case Race.Tauren:
spellId = SpellIds.DivineSteedTauren; spellId = SpellIds.DivineSteedTauren;
break; break;
case Race.ZandalariTroll:
spellId = SpellIds.DivineSteedZandalariTroll;
break;
default: default:
break; break;
} }
@@ -318,8 +334,8 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
DoCheckEffectProc .Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.Dummy)); DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.Dummy));
OnEffectProc .Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy)); OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
} }
} }
@@ -418,7 +434,7 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
OnHit .Add(new HitHandler(HandleOnHit)); OnHit.Add(new HitHandler(HandleOnHit));
} }
} }
@@ -439,7 +455,7 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
OnHit .Add(new HitHandler(HandleOnHit)); OnHit.Add(new HitHandler(HandleOnHit));
} }
} }
@@ -688,8 +704,8 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
DoCheckEffectProc .Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.Dummy)); DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.Dummy));
OnEffectProc .Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy)); OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
} }
} }
@@ -708,7 +724,7 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
OnEffectProc .Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy)); OnEffectProc.Add(new EffectProcHandler(HandleEffectProc, 0, AuraType.Dummy));
} }
} }
@@ -726,7 +742,7 @@ namespace Scripts.Spells.Paladin
public override void Register() public override void Register()
{ {
DoCheckEffectProc .Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.ProcTriggerSpell)); DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckEffectProc, 0, AuraType.ProcTriggerSpell));
} }
} }