Core/Battlegrounds: Implement mercenary system

Port From (https://github.com/TrinityCore/TrinityCore/commit/87723e32e24f03ac1d062e33edcbe935e4e59421)
This commit is contained in:
hondacrx
2022-05-31 11:46:04 -04:00
parent 6751370788
commit 1ba88f81db
9 changed files with 90 additions and 3 deletions
+11
View File
@@ -5736,6 +5736,17 @@ namespace Game.Spells
}
}
[AuraEffectHandler(AuraType.SwitchTeam)]
void HandleSwitchTeam(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasFlag(AuraEffectHandleModes.Real))
return;
Player player = aurApp.GetTarget().ToPlayer();
if (player != null)
player.SwitchToOppositeTeam(apply);
}
[AuraEffectHandler(AuraType.SetFFAPvp)]
void HandleSetFFAPvP(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
+17
View File
@@ -4338,6 +4338,23 @@ namespace Game.Entities
spellInfo.Attributes |= SpellAttr0.UnaffectedByInvulnerability;
});
// Horde / Alliance switch (BG mercenary system)
ApplySpellFix(new[] { 195838, 195843 }, spellInfo =>
{
ApplySpellEffectFix(spellInfo, 0, spellEffectInfo =>
{
spellEffectInfo.Effect = SpellEffectName.ApplyAura;
});
ApplySpellEffectFix(spellInfo, 1, spellEffectInfo =>
{
spellEffectInfo.Effect = SpellEffectName.ApplyAura;
});
ApplySpellEffectFix(spellInfo, 2, spellEffectInfo =>
{
spellEffectInfo.Effect = SpellEffectName.ApplyAura;
});
});
foreach (var spellInfo in mSpellInfoMap.Values)
{
// Fix range for trajectory triggered spell