mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Scripts/Vehicles): The next player entering Salvaged Siege Engine… (#10987)
… should control turret if it's not occupied.
This commit is contained in:
@@ -16,12 +16,14 @@
|
||||
*/
|
||||
|
||||
#include "ulduar.h"
|
||||
#include "CombatAI.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
class npc_ulduar_keeper : public CreatureScript
|
||||
{
|
||||
@@ -423,6 +425,31 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_salvaged_siege_engine : public VehicleAI
|
||||
{
|
||||
npc_salvaged_siege_engine(Creature* creature) : VehicleAI(creature) { }
|
||||
|
||||
bool BeforeSpellClick(Unit* clicker) override
|
||||
{
|
||||
if (Vehicle* vehicle = me->GetVehicleKit())
|
||||
{
|
||||
if (vehicle->IsVehicleInUse())
|
||||
{
|
||||
if (Unit* turret = vehicle->GetPassenger(7))
|
||||
{
|
||||
if (!turret->GetVehicleKit()->IsVehicleInUse())
|
||||
{
|
||||
turret->HandleSpellClick(clicker);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_ulduar()
|
||||
{
|
||||
new npc_ulduar_keeper();
|
||||
@@ -435,4 +462,6 @@ void AddSC_ulduar()
|
||||
|
||||
new AreaTrigger_at_celestial_planetarium_enterance();
|
||||
new go_call_tram();
|
||||
|
||||
RegisterCreatureAI(npc_salvaged_siege_engine);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user