fix(Core/Spells): Set Crashin' Thrashin' Robot duration to 3 min. (#15342)

* fix(Core/Spells): Set Crashin' Thrashin' Robot duration to 3 min.

Fixes #15220

* Update.

* missing sql.

* buildfix.

* Update src/server/scripts/World/npcs_special.cpp

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
UltraNix
2023-07-27 14:05:30 +02:00
committed by GitHub
parent fcf7ceea42
commit e1f869e756
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
--
UPDATE `creature_template` SET `ScriptName`='npc_crashin_thrashin_robot' WHERE `entry`=17299;

View File

@@ -32,6 +32,7 @@
#include "ScriptedGossip.h"
#include "SmartAI.h"
#include "SpellAuras.h"
#include "TaskScheduler.h"
#include "WaypointMgr.h"
#include "World.h"
@@ -2653,6 +2654,32 @@ public:
}
};
struct npc_crashin_thrashin_robot : public ScriptedAI
{
public:
npc_crashin_thrashin_robot(Creature* creature) : ScriptedAI(creature)
{
}
void IsSummonedBy(WorldObject* /*summoner*/) override
{
_scheduler.Schedule(180s, [this](TaskContext /*context*/)
{
me->KillSelf();
});
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
ScriptedAI::UpdateAI(diff);
}
private:
TaskScheduler _scheduler;
};
void AddSC_npcs_special()
{
// Ours
@@ -2680,4 +2707,5 @@ void AddSC_npcs_special()
new npc_spring_rabbit();
new npc_stable_master();
RegisterCreatureAI(npc_arcanite_dragonling);
RegisterCreatureAI(npc_crashin_thrashin_robot);
}