Scripts/Battlefield: Move npc_wg_give_promotion_credit script to BattlefieldWG
Port From (https://github.com/TrinityCore/TrinityCore/commit/81a3c135a7ee688998b273034d0ba60dd7bb8158)
This commit is contained in:
@@ -22,6 +22,7 @@ using Game.Networking.Packets;
|
|||||||
using Game.Spells;
|
using Game.Spells;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Game.Scripting;
|
using Game.Scripting;
|
||||||
|
using Game.AI;
|
||||||
|
|
||||||
namespace Game.BattleFields
|
namespace Game.BattleFields
|
||||||
{
|
{
|
||||||
@@ -606,7 +607,7 @@ namespace Game.BattleFields
|
|||||||
UpdateVehicleCountWG();
|
UpdateVehicleCountWG();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandlePromotion(Player playerKiller, Unit unitKilled)
|
public void HandlePromotion(Player playerKiller, Unit unitKilled)
|
||||||
{
|
{
|
||||||
int teamId = playerKiller.GetTeamId();
|
int teamId = playerKiller.GetTeamId();
|
||||||
|
|
||||||
@@ -1646,4 +1647,22 @@ namespace Game.BattleFields
|
|||||||
return new BattlefieldWG();
|
return new BattlefieldWG();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Script]
|
||||||
|
class npc_wg_give_promotion_credit : ScriptedAI
|
||||||
|
{
|
||||||
|
public npc_wg_give_promotion_credit(Creature creature) : base(creature) { }
|
||||||
|
|
||||||
|
public override void JustDied(Unit killer)
|
||||||
|
{
|
||||||
|
if (!killer || !killer.IsPlayer())
|
||||||
|
return;
|
||||||
|
|
||||||
|
BattlefieldWG wintergrasp = (BattlefieldWG)Global.BattleFieldMgr.GetBattlefieldByBattleId(BattlefieldIds.WG);
|
||||||
|
if (wintergrasp == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wintergrasp.HandlePromotion(killer.ToPlayer(), me);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user