diff options
Diffstat (limited to 'src/server/scripts/Events')
| -rw-r--r-- | src/server/scripts/Events/childrens_week.cpp | 85 |
1 files changed, 68 insertions, 17 deletions
diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 25257848192..021714e3055 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -150,9 +150,12 @@ class npc_winterfin_playmate : public CreatureScript struct npc_winterfin_playmateAI : public ScriptedAI { - npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) { } + npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { timer = 0; phase = 0; @@ -160,6 +163,11 @@ class npc_winterfin_playmate : public CreatureScript orphanGUID = 0; } + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -249,9 +257,12 @@ class npc_snowfall_glade_playmate : public CreatureScript struct npc_snowfall_glade_playmateAI : public ScriptedAI { - npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) { } + npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { timer = 0; phase = 0; @@ -259,6 +270,11 @@ class npc_snowfall_glade_playmate : public CreatureScript orphanGUID = 0; } + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -349,10 +365,11 @@ class npc_the_biggest_tree : public CreatureScript { npc_the_biggest_treeAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); me->SetDisplayId(DISPLAY_INVISIBLE); } - void Reset() override + void Initialize() { timer = 1000; phase = 0; @@ -360,8 +377,12 @@ class npc_the_biggest_tree : public CreatureScript orphanGUID = 0; } - void MoveInLineOfSight(Unit* who) override + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { if (!phase && who && who->GetDistance2d(me) < 10.0f) if (Player* player = who->ToPlayer()) @@ -437,9 +458,12 @@ class npc_high_oracle_soo_roo : public CreatureScript struct npc_high_oracle_soo_rooAI : public ScriptedAI { - npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) { } + npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { timer = 0; phase = 0; @@ -447,6 +471,11 @@ class npc_high_oracle_soo_roo : public CreatureScript orphanGUID = 0; } + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -526,9 +555,12 @@ class npc_elder_kekek : public CreatureScript struct npc_elder_kekekAI : public ScriptedAI { - npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) { } + npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { timer = 0; phase = 0; @@ -536,6 +568,11 @@ class npc_elder_kekek : public CreatureScript orphanGUID = 0; } + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { @@ -615,9 +652,12 @@ class npc_the_etymidian : public CreatureScript struct npc_the_etymidianAI : public ScriptedAI { - npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) { } + npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { timer = 0; phase = 0; @@ -625,8 +665,12 @@ class npc_the_etymidian : public CreatureScript orphanGUID = 0; } - void MoveInLineOfSight(Unit* who) override + void Reset() override + { + Initialize(); + } + void MoveInLineOfSight(Unit* who) override { if (!phase && who && who->GetDistance2d(me) < 10.0f) if (Player* player = who->ToPlayer()) @@ -711,9 +755,12 @@ class npc_alexstraza_the_lifebinder : public CreatureScript struct npc_alexstraza_the_lifebinderAI : public ScriptedAI { - npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) { } + npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { timer = 0; phase = 0; @@ -721,6 +768,11 @@ class npc_alexstraza_the_lifebinder : public CreatureScript orphanGUID = 0; } + void Reset() override + { + Initialize(); + } + void SetData(uint32 type, uint32 data) override { // Existing SmartAI @@ -871,7 +923,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript public: at_bring_your_orphan_to() : AreaTriggerScript("at_bring_your_orphan_to") { } - bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) + bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override { if (player->isDead() || !player->HasAura(SPELL_ORPHAN_OUT)) return false; @@ -934,7 +986,6 @@ class npc_cw_area_trigger : public CreatureScript } void MoveInLineOfSight(Unit* who) override - { if (who && me->GetDistance2d(who) < 20.0f) if (Player* player = who->ToPlayer()) |
