aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-11-21 23:18:10 +0200
committerGitHub <noreply@github.com>2021-11-21 23:18:10 +0200
commit542c10094f8660302708e24cf3c8b2903ac25607 (patch)
tree081a1ec600ae05cd5fbd5d2160ef1501c8c539a7 /src/server/scripts/Kalimdor
parent3d9a2d5603434392d28d7616decae61d433c37c7 (diff)
Scripts/Misc: Migrate world event scripts to separate files (#27284)
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/zone_moonglade.cpp161
1 files changed, 0 insertions, 161 deletions
diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp
index d6a9a6a3724..43c92e36920 100644
--- a/src/server/scripts/Kalimdor/zone_moonglade.cpp
+++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp
@@ -15,19 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Moonglade
-SD%Complete: 100
-SDComment: Quest support: 10965
-SDCategory: Moonglade
-EndScriptData */
-
-/* ContentData
-npc_clintar_spirit
-npc_omen
-npc_giant_spotlight
-EndContentData */
-
#include "ScriptMgr.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
@@ -389,155 +376,7 @@ public:
};
-/*####
-# npc_omen
-####*/
-
-enum Omen
-{
- NPC_OMEN = 15467,
-
- SPELL_OMEN_CLEAVE = 15284,
- SPELL_OMEN_STARFALL = 26540,
- SPELL_OMEN_SUMMON_SPOTLIGHT = 26392,
- SPELL_ELUNE_CANDLE = 26374,
-
- GO_ELUNE_TRAP_1 = 180876,
- GO_ELUNE_TRAP_2 = 180877,
-
- EVENT_CAST_CLEAVE = 1,
- EVENT_CAST_STARFALL = 2,
- EVENT_DESPAWN = 3,
-};
-
-class npc_omen : public CreatureScript
-{
-public:
- npc_omen() : CreatureScript("npc_omen") { }
-
- struct npc_omenAI : public ScriptedAI
- {
- npc_omenAI(Creature* creature) : ScriptedAI(creature)
- {
- me->SetImmuneToPC(true);
- me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f);
- }
-
- EventMap events;
-
- void MovementInform(uint32 type, uint32 pointId) override
- {
- if (type != POINT_MOTION_TYPE)
- return;
-
- if (pointId == 1)
- {
- me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
- me->SetImmuneToPC(false);
- if (Player* player = me->SelectNearestPlayer(40.0f))
- AttackStart(player);
- }
- }
-
- void JustEngagedWith(Unit* /*attacker*/) override
- {
- events.Reset();
- events.ScheduleEvent(EVENT_CAST_CLEAVE, 3s, 5s);
- events.ScheduleEvent(EVENT_CAST_STARFALL, 8s, 10s);
- }
-
- void JustDied(Unit* /*killer*/) override
- {
- DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT);
- }
-
- void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
- {
- if (spellInfo->Id == SPELL_ELUNE_CANDLE)
- {
- if (me->HasAura(SPELL_OMEN_STARFALL))
- me->RemoveAurasDueToSpell(SPELL_OMEN_STARFALL);
-
- events.RescheduleEvent(EVENT_CAST_STARFALL, 14s, 16s);
- }
- }
-
- void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim())
- return;
-
- events.Update(diff);
-
- switch (events.ExecuteEvent())
- {
- case EVENT_CAST_CLEAVE:
- DoCastVictim(SPELL_OMEN_CLEAVE);
- events.ScheduleEvent(EVENT_CAST_CLEAVE, 8s, 10s);
- break;
- case EVENT_CAST_STARFALL:
- if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
- DoCast(target, SPELL_OMEN_STARFALL);
- events.ScheduleEvent(EVENT_CAST_STARFALL, 14s, 16s);
- break;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_omenAI(creature);
- }
-};
-
-class npc_giant_spotlight : public CreatureScript
-{
-public:
- npc_giant_spotlight() : CreatureScript("npc_giant_spotlight") { }
-
- struct npc_giant_spotlightAI : public ScriptedAI
- {
- npc_giant_spotlightAI(Creature* creature) : ScriptedAI(creature) { }
-
- EventMap events;
-
- void Reset() override
- {
- events.Reset();
- events.ScheduleEvent(EVENT_DESPAWN, 5min);
- }
-
- void UpdateAI(uint32 diff) override
- {
- events.Update(diff);
-
- if (events.ExecuteEvent() == EVENT_DESPAWN)
- {
- if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_1, 5.0f))
- trap->RemoveFromWorld();
-
- if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_2, 5.0f))
- trap->RemoveFromWorld();
-
- if (Creature* omen = me->FindNearestCreature(NPC_OMEN, 5.0f, false))
- omen->DespawnOrUnsummon();
-
- me->DespawnOrUnsummon();
- }
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_giant_spotlightAI(creature);
- }
-};
-
void AddSC_moonglade()
{
new npc_clintar_spirit();
- new npc_omen();
- new npc_giant_spotlight();
}