diff options
| author | Jeremy <Golrag@users.noreply.github.com> | 2023-07-05 23:52:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-05 23:52:22 +0200 |
| commit | cc08aa8e249c5cd33f6b09a766cf6131c42566b9 (patch) | |
| tree | ad5197150562f40cebb6a9bb4ef187c73e0e2592 /src/server/scripts | |
| parent | d70d1d24a52816d6fb8f657afc609c15aeff4fea (diff) | |
Core/Battlegrounds: Implement Arathi Basin from Battle for Azeroth (#28369)
Co-authored-by: ModoX <moardox@gmail.com>
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp | 83 | ||||
| -rw-r--r-- | src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp | 2 |
2 files changed, 85 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp b/src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp new file mode 100644 index 00000000000..f3d6a928d91 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ArathiBasin/arathi_basin.cpp @@ -0,0 +1,83 @@ +/* + * 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 +{ + PrepareAuraScript(spell_bg_ab_blacksmith_working); + + 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 d300c894b33..128880dd0f8 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -21,6 +21,7 @@ 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_pit_lord_argaloth(); @@ -213,6 +214,7 @@ void AddEasternKingdomsScripts() AddSC_boss_drekthar(); AddSC_boss_galvangar(); AddSC_boss_vanndar(); + AddSC_arathi_basin(); //Arathi Basin AddSC_boss_alizabal(); //Baradin Hold AddSC_boss_occuthar(); AddSC_boss_pit_lord_argaloth(); |
