Core/Player: Initial War Mode support

Port From (https://github.com/TrinityCore/TrinityCore/commit/b821a729733db0d3742b4aefe05e5a8305724f66)
This commit is contained in:
hondacrx
2022-01-07 21:49:50 -05:00
parent 73b456b5a0
commit 4c922933de
10 changed files with 304 additions and 26 deletions
+27
View File
@@ -4082,6 +4082,33 @@ namespace Scripts.Spells.Generic
}
}
// 269083 - Enlisted
[Script] // 282559 - Enlisted
class spell_gen_war_mode_enlisted : AuraScript
{
void CalcWarModeBonus(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
{
Player target = GetUnitOwner().ToPlayer();
if (target == null)
return;
if (target.GetTeamId() == Global.WorldMgr.GetWarModeDominantFaction())
return;
amount += Global.WorldMgr.GetWarModeOutnumberedFactionReward();
}
public override void Register()
{
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcWarModeBonus, SpellConst.EffectAll, AuraType.ModXpPct));
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcWarModeBonus, SpellConst.EffectAll, AuraType.ModXpQuestPct));
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcWarModeBonus, SpellConst.EffectAll, AuraType.ModCurrencyGainFromSource));
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcWarModeBonus, SpellConst.EffectAll, AuraType.ModMoneyGain));
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcWarModeBonus, SpellConst.EffectAll, AuraType.ModAnimaGain));
DoEffectCalcAmount.Add(new EffectCalcAmountHandler(CalcWarModeBonus, SpellConst.EffectAll, AuraType.Dummy));
}
}
[Script]
class spell_defender_of_azeroth_death_gate_selector : SpellScript
{