diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2024-03-28 19:29:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 19:29:22 +0100 |
commit | be11f42a16d1fa0482e9572bf54e99e4dedd3c78 (patch) | |
tree | 3d33413d7ed5cada34d7ced7f430380731160d5b /src/server/scripts/EasternKingdoms | |
parent | 78635f640ee3b632a487a50dcf492ae62c2a0933 (diff) |
Core/Battlegrounds: Move to scripts (#29799)
* Introduce new BattlegroundScript class for map/bg specific scripts
* Remove all sub, zone specific, battleground classes except Arena
* Move all bg zone scripts to new BattlegroundScripts class in script folder
* Remove ZoneScript from Battleground class
* Remove some unused hooks from Battleground
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
7 files changed, 0 insertions, 851 deletions
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp deleted file mode 100644 index 629be86a525..00000000000 --- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "ScriptMgr.h" -#include "BattlegroundAV.h" -#include "GameObject.h" -#include "GameObjectAI.h" -#include "Player.h" -#include "ScriptedCreature.h" - -#include <chrono> - -enum Spells -{ - SPELL_CHARGE = 22911, - SPELL_CLEAVE = 40504, - SPELL_DEMORALIZING_SHOUT = 23511, - SPELL_ENRAGE = 8599, - SPELL_WHIRLWIND = 13736 -}; - -enum Creatures -{ - NPC_NORTH_MARSHAL = 14762, - NPC_SOUTH_MARSHAL = 14763, - NPC_ICEWING_MARSHAL = 14764, - NPC_STONEHEARTH_MARSHAL = 14765, - NPC_EAST_FROSTWOLF_WARMASTER = 14772, - NPC_ICEBLOOD_WARMASTER = 14773, - NPC_TOWER_POINT_WARMASTER = 14776, - NPC_WEST_FROSTWOLF_WARMASTER = 14777 -}; - -enum Events -{ - EVENT_CHARGE_TARGET = 1, - EVENT_CLEAVE = 2, - EVENT_DEMORALIZING_SHOUT = 3, - EVENT_WHIRLWIND = 4, - EVENT_ENRAGE = 5, - EVENT_CHECK_RESET = 6 -}; - -struct npc_av_marshal_or_warmaster : public ScriptedAI -{ - npc_av_marshal_or_warmaster(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - events.Reset(); - events.ScheduleEvent(EVENT_CHARGE_TARGET, 2s, 12s); - events.ScheduleEvent(EVENT_CLEAVE, 1s, 11s); - events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, 2s); - events.ScheduleEvent(EVENT_WHIRLWIND, 5s, 20s); - events.ScheduleEvent(EVENT_ENRAGE, 5s, 20s); - events.ScheduleEvent(EVENT_CHECK_RESET, 5s); - } - - void JustAppeared() override - { - Reset(); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_CHARGE_TARGET: - DoCastVictim(SPELL_CHARGE); - events.ScheduleEvent(EVENT_CHARGE, 10s, 25s); - break; - case EVENT_CLEAVE: - DoCastVictim(SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, 10s, 16s); - break; - case EVENT_DEMORALIZING_SHOUT: - DoCast(me, SPELL_DEMORALIZING_SHOUT); - events.ScheduleEvent(EVENT_DEMORALIZING_SHOUT, 10s, 15s); - break; - case EVENT_WHIRLWIND: - DoCast(me, SPELL_WHIRLWIND); - events.ScheduleEvent(EVENT_WHIRLWIND, 10s, 25s); - break; - case EVENT_ENRAGE: - DoCast(me, SPELL_ENRAGE); - events.ScheduleEvent(EVENT_ENRAGE, 10s, 30s); - break; - case EVENT_CHECK_RESET: - { - Position const& _homePosition = me->GetHomePosition(); - if (me->GetDistance2d(_homePosition.GetPositionX(), _homePosition.GetPositionY()) > 50.0f) - { - EnterEvadeMode(); - return; - } - events.ScheduleEvent(EVENT_CHECK_RESET, 5s); - break; - } - } - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - } - } - -private: - EventMap events; -}; - -struct go_av_capturable_object : public GameObjectAI -{ - go_av_capturable_object(GameObject* go) : GameObjectAI(go) { } - - void Reset() override - { - me->setActive(true); - } - - bool OnGossipHello(Player* player) override - { - if (me->GetGoState() != GO_STATE_READY) - return true; - - if (ZoneScript* zonescript = me->GetZoneScript()) - { - zonescript->DoAction(ACTION_AV_INTERACT_CAPTURABLE_OBJECT, player, me); - return false; - } - - return true; - } -}; - -struct go_av_contested_object : public go_av_capturable_object -{ - go_av_contested_object(GameObject* go) : go_av_capturable_object(go) { } - - void Reset() override - { - go_av_capturable_object::Reset(); - _scheduler.Schedule(4min, [&](TaskContext) - { - if (ZoneScript* zonescript = me->GetZoneScript()) - zonescript->DoAction(ACTION_AV_CAPTURE_CAPTURABLE_OBJECT, me, me); - }); - } - - void UpdateAI(uint32 diff) override - { - _scheduler.Update(diff); - } - -private: - TaskScheduler _scheduler; -}; - -class at_av_exploit : public AreaTriggerScript -{ -public: - at_av_exploit() : AreaTriggerScript("at_av_exploit") { } - - bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override - { - if (Battleground* battleground = player->GetBattleground()) - if (battleground->GetStatus() == STATUS_WAIT_JOIN) - battleground->TeleportPlayerToExploitLocation(player); - - return true; - } -}; - -void AddSC_alterac_valley() -{ - RegisterCreatureAI(npc_av_marshal_or_warmaster); - RegisterGameObjectAI(go_av_capturable_object); - RegisterGameObjectAI(go_av_contested_object); - new at_av_exploit(); -} diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp deleted file mode 100644 index 38987c82428..00000000000 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "ScriptMgr.h" -#include "ObjectAccessor.h" -#include "ScriptedCreature.h" - -enum Spells -{ - SPELL_ARCANE_EXPLOSION = 46608, - SPELL_CONE_OF_COLD = 38384, - SPELL_FIREBALL = 46988, - SPELL_FROSTBOLT = 46987, - SPELL_SUMMON_WATER_ELEMENTAL = 45067, - SPELL_ICEBLOCK = 46604 -}; - -enum Texts -{ - SAY_AGGRO = 0, - SAY_EVADE = 1, - SAY_SALVATION = 2, -}; - -enum Action -{ - ACTION_BUFF_YELL = -30001 // shared from Battleground -}; - -enum Events -{ - // Balinda - EVENT_ARCANE_EXPLOSION = 1, - EVENT_CONE_OF_COLD, - EVENT_FIREBOLT, - EVENT_FROSTBOLT, - EVENT_SUMMON_WATER_ELEMENTAL, - EVENT_CHECK_RESET, // Checks if Balinda or the Water Elemental are outside of building. -}; - -struct boss_balinda : public ScriptedAI -{ - boss_balinda(Creature* creature) : ScriptedAI(creature), summons(me) - { - Initialize(); - } - - void Initialize() - { - WaterElementalGUID.Clear(); - HasCastIceblock = false; - } - - void Reset() override - { - Initialize(); - events.Reset(); - summons.DespawnAll(); - } - - void JustEngagedWith(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 5s, 15s); - events.ScheduleEvent(EVENT_CONE_OF_COLD, 8s); - events.ScheduleEvent(EVENT_FIREBOLT, 1s); - events.ScheduleEvent(EVENT_FROSTBOLT, 4s); - events.ScheduleEvent(EVENT_SUMMON_WATER_ELEMENTAL, 3s); - events.ScheduleEvent(EVENT_CHECK_RESET, 5s); - } - - void JustSummoned(Creature* summoned) override - { - summoned->AI()->AttackStart(SelectTarget(SelectTargetMethod::Random, 0, 50, true)); - summoned->SetFaction(me->GetFaction()); - WaterElementalGUID = summoned->GetGUID(); - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature* summoned) override - { - summons.Despawn(summoned); - } - - void JustDied(Unit* /*killer*/) override - { - summons.DespawnAll(); - } - - void DoAction(int32 actionId) override - { - if (actionId == ACTION_BUFF_YELL) - Talk(SAY_AGGRO); - } - - void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override - { - if (me->HealthBelowPctDamaged(40, damage) && !HasCastIceblock) - { - DoCast(SPELL_ICEBLOCK); - HasCastIceblock = true; - } - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_ARCANE_EXPLOSION: - DoCastVictim(SPELL_ARCANE_EXPLOSION); - events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 5s, 15s); - break; - case EVENT_CONE_OF_COLD: - DoCastVictim(SPELL_CONE_OF_COLD); - events.ScheduleEvent(EVENT_CONE_OF_COLD, 10s, 20s); - break; - case EVENT_FIREBOLT: - DoCastVictim(SPELL_FIREBALL); - events.ScheduleEvent(EVENT_FIREBOLT, 5s, 9s); - break; - case EVENT_FROSTBOLT: - DoCastVictim(SPELL_FROSTBOLT); - events.ScheduleEvent(EVENT_FROSTBOLT, 4s, 12s); - break; - case EVENT_SUMMON_WATER_ELEMENTAL: - if (summons.empty()) - DoCast(SPELL_SUMMON_WATER_ELEMENTAL); - events.ScheduleEvent(EVENT_SUMMON_WATER_ELEMENTAL, 50s); - break; - case EVENT_CHECK_RESET: - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - Talk(SAY_EVADE); - } - if (Creature* elemental = ObjectAccessor::GetCreature(*me, WaterElementalGUID)) - if (elemental->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - elemental->AI()->EnterEvadeMode(); - events.ScheduleEvent(EVENT_CHECK_RESET, 5s); - break; - default: - break; - } - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - } - } - -private: - EventMap events; - SummonList summons; - ObjectGuid WaterElementalGUID; - bool HasCastIceblock; -}; - -void AddSC_boss_balinda() -{ - RegisterCreatureAI(boss_balinda); -} diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp deleted file mode 100644 index f7ec0bb3da9..00000000000 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum Spells -{ - SPELL_WHIRLWIND = 15589, - SPELL_WHIRLWIND2 = 13736, - SPELL_KNOCKDOWN = 19128, - SPELL_FRENZY = 8269, - SPELL_SWEEPING_STRIKES = 18765, // not sure - SPELL_CLEAVE = 20677, // not sure - SPELL_WINDFURY = 35886, // not sure - SPELL_STORMPIKE = 51876 // not sure -}; - -enum Texts -{ - SAY_AGGRO = 0, - SAY_EVADE = 1, - SAY_RESPAWN = 2, - SAY_RANDOM = 3 -}; - -enum Events -{ - EVENT_WHIRLWIND = 1, - EVENT_WHIRLWIND2, - EVENT_KNOCKDOWN, - EVENT_FRENZY, - EVENT_RANDOM_YELL -}; - -struct boss_drekthar : public ScriptedAI -{ - boss_drekthar(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - events.Reset(); - } - - void JustEngagedWith(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - events.ScheduleEvent(EVENT_WHIRLWIND, 1s, 20s); - events.ScheduleEvent(EVENT_WHIRLWIND2, 1s, 20s); - events.ScheduleEvent(EVENT_KNOCKDOWN, 12s); - events.ScheduleEvent(EVENT_FRENZY, 6s); - events.ScheduleEvent(EVENT_RANDOM_YELL, 20s, 30s); - } - - void JustAppeared() override - { - Reset(); - Talk(SAY_RESPAWN); - } - - bool CheckInRoom() override - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - Talk(SAY_EVADE); - return false; - } - - return true; - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_WHIRLWIND: - DoCastVictim(SPELL_WHIRLWIND); - events.ScheduleEvent(EVENT_WHIRLWIND, 8s, 18s); - break; - case EVENT_WHIRLWIND2: - DoCastVictim(SPELL_WHIRLWIND2); - events.ScheduleEvent(EVENT_WHIRLWIND2, 7s, 25s); - break; - case EVENT_KNOCKDOWN: - DoCastVictim(SPELL_KNOCKDOWN); - events.ScheduleEvent(EVENT_KNOCKDOWN, 10s, 15s); - break; - case EVENT_FRENZY: - DoCastVictim(SPELL_FRENZY); - events.ScheduleEvent(EVENT_FRENZY, 20s, 30s); - break; - case EVENT_RANDOM_YELL: - Talk(SAY_RANDOM); - events.ScheduleEvent(EVENT_RANDOM_YELL, 20s, 30s); - break; - default: - break; - } - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - } - } - - private: - EventMap events; -}; - -void AddSC_boss_drekthar() -{ - RegisterCreatureAI(boss_drekthar); -} diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp deleted file mode 100644 index 741387ec033..00000000000 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum Spells -{ - SPELL_CLEAVE = 15284, - SPELL_FRIGHTENING_SHOUT = 19134, - SPELL_WHIRLWIND1 = 15589, - SPELL_WHIRLWIND2 = 13736, - SPELL_MORTAL_STRIKE = 16856 -}; - -enum Texts -{ - SAY_AGGRO = 0, - SAY_EVADE = 1, - SAY_BUFF = 2 -}; - -enum Events -{ - EVENT_CLEAVE = 1, - EVENT_FRIGHTENING_SHOUT, - EVENT_WHIRLWIND1, - EVENT_WHIRLWIND2, - EVENT_MORTAL_STRIKE -}; - -enum Action -{ - ACTION_BUFF_YELL = -30001 // shared from Battleground -}; - -struct boss_galvangar : public ScriptedAI -{ - boss_galvangar(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - events.Reset(); - } - - void JustEngagedWith(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - events.ScheduleEvent(EVENT_CLEAVE, 1s, 9s); - events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, 2s, 19s); - events.ScheduleEvent(EVENT_WHIRLWIND1, 1s, 13s); - events.ScheduleEvent(EVENT_WHIRLWIND2, 5s, 20s); - events.ScheduleEvent(EVENT_MORTAL_STRIKE, 5s, 20s); - } - - void DoAction(int32 actionId) override - { - if (actionId == ACTION_BUFF_YELL) - Talk(SAY_BUFF); - } - - bool CheckInRoom() override - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - Talk(SAY_EVADE); - return false; - } - - return true; - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_CLEAVE: - DoCastVictim(SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, 10s, 16s); - break; - case EVENT_FRIGHTENING_SHOUT: - DoCastVictim(SPELL_FRIGHTENING_SHOUT); - events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, 10s, 15s); - break; - case EVENT_WHIRLWIND1: - DoCastVictim(SPELL_WHIRLWIND1); - events.ScheduleEvent(EVENT_WHIRLWIND1, 6s, 10s); - break; - case EVENT_WHIRLWIND2: - DoCastVictim(SPELL_WHIRLWIND2); - events.ScheduleEvent(EVENT_WHIRLWIND2, 10s, 25s); - break; - case EVENT_MORTAL_STRIKE: - DoCastVictim(SPELL_MORTAL_STRIKE); - events.ScheduleEvent(EVENT_MORTAL_STRIKE, 10s, 30s); - break; - default: - break; - } - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - } - } - -private: - EventMap events; -}; - -void AddSC_boss_galvangar() -{ - RegisterCreatureAI(boss_galvangar); -} diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp deleted file mode 100644 index 83c1fcc813e..00000000000 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum Yells -{ - YELL_AGGRO = 0, - YELL_EVADE = 1, - //YELL_RESPAWN1 = -1810010, // Missing in database - //YELL_RESPAWN2 = -1810011, // Missing in database - YELL_RANDOM = 2, - YELL_SPELL = 3, -}; - -enum Spells -{ - SPELL_AVATAR = 19135, - SPELL_THUNDERCLAP = 15588, - SPELL_STORMBOLT = 20685 // not sure -}; - -struct boss_vanndar : public ScriptedAI -{ - boss_vanndar(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - _scheduler.CancelAll(); - } - - void JustEngagedWith(Unit* /*who*/) override - { - _scheduler - .Schedule(3s, [this](TaskContext task) - { - DoCastVictim(SPELL_AVATAR); - task.Repeat(15s, 20s); - }) - .Schedule(4s, [this](TaskContext task) - { - DoCastVictim(SPELL_THUNDERCLAP); - task.Repeat(5s, 15s); - }) - .Schedule(6s, [this](TaskContext task) - { - DoCastVictim(SPELL_STORMBOLT); - task.Repeat(10s, 25s); - }) - .Schedule(20s, 30s, [this](TaskContext task) - { - Talk(YELL_RANDOM); - task.Repeat(20s, 30s); - }) - .Schedule(5s, [this](TaskContext task) - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - Talk(YELL_EVADE); - } - task.Repeat(); - }); - - Talk(YELL_AGGRO); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - _scheduler.Update(diff); - } - -private: - TaskScheduler _scheduler; -}; - -void AddSC_boss_vanndar() -{ - RegisterCreatureAI(boss_vanndar); -} diff --git a/src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp b/src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp deleted file mode 100644 index 4a30195833f..00000000000 --- a/src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "Map.h" -#include "MotionMaster.h" -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "SpellScript.h" - -enum ArathiBasinGryphonBatRiderLeaderData -{ - PATH_GRYPHON_RIDER_LEADER = 800000059, - PATH_BAT_RIDER_LEADER = 800000058, -}; - -// 150513 - Arathor Gryphon Rider -// 150459 - Defiler Bat Rider -template<uint32 Path> -struct npc_bg_ab_gryphon_bat_rider_leader : public ScriptedAI -{ - npc_bg_ab_gryphon_bat_rider_leader(Creature* creature) : ScriptedAI(creature) { } - - void WaypointPathEnded(uint32 /*nodeId*/, uint32 pathId) override - { - if (pathId != Path) - return; - - // despawn formation group - std::list<Creature*> followers; - me->GetCreatureListWithEntryInGrid(followers, me->GetEntry()); - for (Creature* follower : followers) - follower->DespawnOrUnsummon(500ms); - - me->DespawnOrUnsummon(500ms); - } -}; - -// 261985 - Blacksmith Working -class spell_bg_ab_blacksmith_working : public AuraScript -{ - static constexpr uint32 ITEM_BLACKSMITH_HAMMER = 5956; - - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - GetTarget()->SetVirtualItem(0, ITEM_BLACKSMITH_HAMMER); - } - - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Creature* creature = GetTarget()->ToCreature()) - creature->LoadEquipment(creature->GetOriginalEquipmentId()); - } - - void Register() override - { - AfterEffectApply += AuraEffectRemoveFn(spell_bg_ab_blacksmith_working::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_bg_ab_blacksmith_working::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } -}; - -void AddSC_arathi_basin() -{ - new GenericCreatureScript<npc_bg_ab_gryphon_bat_rider_leader<PATH_GRYPHON_RIDER_LEADER>>("npc_bg_ab_arathor_gryphon_rider_leader"); - new GenericCreatureScript<npc_bg_ab_gryphon_bat_rider_leader<PATH_BAT_RIDER_LEADER>>("npc_bg_ab_defiler_bat_rider_leader"); - - RegisterSpellScript(spell_bg_ab_blacksmith_working); -} diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index 673f1e9bfad..b818c1e6f10 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -16,12 +16,6 @@ */ // This is where scripts' loading functions should be declared: -void AddSC_alterac_valley(); //Alterac Valley -void AddSC_boss_balinda(); -void AddSC_boss_drekthar(); -void AddSC_boss_galvangar(); -void AddSC_boss_vanndar(); -void AddSC_arathi_basin(); //Arathi Basin void AddSC_boss_alizabal(); //Baradin Hold void AddSC_boss_occuthar(); void AddSC_boss_argaloth(); @@ -211,12 +205,6 @@ void AddSC_undercity(); // void Add${NameOfDirectory}Scripts() void AddEasternKingdomsScripts() { - AddSC_alterac_valley(); //Alterac Valley - AddSC_boss_balinda(); - AddSC_boss_drekthar(); - AddSC_boss_galvangar(); - AddSC_boss_vanndar(); - AddSC_arathi_basin(); //Arathi Basin AddSC_boss_alizabal(); //Baradin Hold AddSC_boss_occuthar(); AddSC_boss_argaloth(); |