TrinityCore
zone_tol_barad.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "Battlefield.h"
20#include "Containers.h"
22#include "DB2Stores.h"
23#include "ObjectMgr.h"
24#include "Player.h"
25#include "ScriptedCreature.h"
26#include "ScriptedGossip.h"
27#include "ScriptSystem.h"
28#include "SpellScript.h"
29
31{
38};
39
41{
42 npc_tb_spirit_guide(Creature* creature) : ScriptedAI(creature) { }
43
44 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
45 {
46 player->PlayerTalkClass->SendCloseGossip();
47
48 uint32 areaId = 0;
49 switch (gossipListId)
50 {
52 areaId = TB_GY_SLAGWORKS;
53 break;
56 break;
58 areaId = TB_GY_WARDENS_VIGIL;
59 break;
61 areaId = TB_GY_EAST_SPIRE;
62 break;
64 areaId = TB_GY_WEST_SPIRE;
65 break;
67 areaId = TB_GY_SOUTH_SPIRE;
68 break;
69 default:
70 return true;
71 }
72
73 if (WorldSafeLocsEntry const* safeLoc = sObjectMgr->GetWorldSafeLoc(areaId))
74 player->TeleportTo(safeLoc->Loc);
75
76 return false;
77 }
78};
79
80// 85123 - Siege Cannon - selects random target
82{
83public:
84 spell_siege_cannon() : SpellScriptLoader("spell_siege_cannon") { }
85
87 {
88 void SelectRandomTarget(std::list<WorldObject*>& targets)
89 {
90 if (targets.empty())
91 return;
92
94 targets.clear();
95 targets.push_back(target);
96 }
97
98 void Register() override
99 {
101 }
102 };
103
104 SpellScript* GetSpellScript() const override
105 {
107 }
108};
109
111{
113 new spell_siege_cannon();
114}
@ TB_GY_EAST_SPIRE
@ TB_GY_IRONCLAD_GARRISON
@ TB_GY_WARDENS_VIGIL
@ TB_GY_SOUTH_SPIRE
@ TB_GY_SLAGWORKS
@ TB_GY_WEST_SPIRE
uint32_t uint32
Definition: Define.h:142
#define sObjectMgr
Definition: ObjectMgr.h:1946
#define RegisterCreatureAI(ai_name)
Definition: ScriptMgr.h:1380
@ EFFECT_0
Definition: SharedDefines.h:30
@ TARGET_UNIT_SRC_AREA_ENTRY
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={})
Definition: Player.cpp:1250
std::unique_ptr< PlayerMenu > PlayerTalkClass
Definition: Player.h:2380
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
void SelectRandomTarget(std::list< WorldObject * > &targets)
SpellScript * GetSpellScript() const override
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
npc_tb_spirit_guide(Creature *creature)
TBSpiritGuide
@ GOSSIP_OPTION_ID_WEST_SPIRE
@ GOSSIP_OPTION_ID_IRONCLAD_GARRISON
@ GOSSIP_OPTION_ID_WARDENS_VIGIL
@ GOSSIP_OPTION_ID_EAST_SPIRE
@ GOSSIP_OPTION_ID_SLAGWORKS
@ GOSSIP_OPTION_ID_SOUTH_SPIRE
void AddSC_tol_barad()