mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Battlefield: Move npc_wg_give_promotion_credit script to BattlefieldWG
The script references BattlefieldWG, which is not exported in dynamic builds.
Move the script, so it is in the same library.
(cherry picked from commit c40b897d36)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "BattlefieldWG.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "GameObject.h"
|
||||
@@ -31,6 +32,7 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "TemporarySummon.h"
|
||||
@@ -1864,7 +1866,36 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class npc_wg_give_promotion_credit : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_wg_give_promotion_credit() : CreatureScript("npc_wg_give_promotion_credit") { }
|
||||
|
||||
struct npc_wg_give_promotion_creditAI : public ScriptedAI
|
||||
{
|
||||
npc_wg_give_promotion_creditAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
if (!killer || killer->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
BattlefieldWG* wintergrasp = static_cast<BattlefieldWG*>(sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG));
|
||||
if (!wintergrasp)
|
||||
return;
|
||||
|
||||
wintergrasp->HandlePromotion(killer->ToPlayer(), me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_wg_give_promotion_creditAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_BF_wintergrasp()
|
||||
{
|
||||
new Battlefield_wintergrasp();
|
||||
new npc_wg_give_promotion_credit();
|
||||
}
|
||||
|
||||
@@ -399,34 +399,6 @@ class go_wg_vehicle_teleporter : public GameObjectScript
|
||||
}
|
||||
};
|
||||
|
||||
class npc_wg_give_promotion_credit : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_wg_give_promotion_credit() : CreatureScript("npc_wg_give_promotion_credit") { }
|
||||
|
||||
struct npc_wg_give_promotion_creditAI : public ScriptedAI
|
||||
{
|
||||
npc_wg_give_promotion_creditAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
if (!killer || killer->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
BattlefieldWG* wintergrasp = static_cast<BattlefieldWG*>(sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG));
|
||||
if (!wintergrasp)
|
||||
return;
|
||||
|
||||
wintergrasp->HandlePromotion(killer->ToPlayer(), me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_wg_give_promotion_creditAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_wintergrasp_force_building : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -663,7 +635,6 @@ void AddSC_wintergrasp()
|
||||
new npc_wg_spirit_guide();
|
||||
new npc_wg_demolisher_engineer();
|
||||
new go_wg_vehicle_teleporter();
|
||||
new npc_wg_give_promotion_credit();
|
||||
new spell_wintergrasp_force_building();
|
||||
new spell_wintergrasp_grab_passenger();
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
|
||||
Reference in New Issue
Block a user