TrinityCore
strand_of_the_ancients.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 "BattlegroundSA.h"
20#include "GameObject.h"
21#include "GameObjectAI.h"
22#include "Player.h"
23#include "SpellScript.h"
24#include "ZoneScript.h"
25
26// 191305 - Horde Banner
27// 191306 - Alliance Banner
28// 191307 - Horde Banner
29// 191308 - Alliance Banner
30// 191309 - Horde Banner
31// 191310 - Alliance Banner
33{
35
36 bool OnGossipHello(Player* player) override
37 {
39 return true;
40
41 if (ZoneScript* zonescript = me->GetZoneScript())
42 {
43 zonescript->DoAction(ACTION_SOTA_CAPTURE_GRAVEYARD, player, me);
44 return false;
45 }
46
47 return true;
48 }
49};
50
51// 52410 - Place Seaforium Charge
53{
54 enum Spells
55 {
58 };
59
60 bool Validate(SpellInfo const* /*spell*/) override
61 {
63 }
64
65 void HandleDummy(SpellEffIndex /*effIndex*/)
66 {
67 if (Player* playerCaster = GetCaster()->ToPlayer())
68 {
69 Team const team = playerCaster->GetBGTeam();
70 if (team == ALLIANCE)
71 playerCaster->CastSpell(playerCaster, SPELL_PLACE_SEAFORIUM_CHARGE_ALLIANCE, true);
72 else if (team == HORDE)
73 playerCaster->CastSpell(playerCaster, SPELL_PLACE_SEAFORIUM_CHARGE_HORDE, true);
74 }
75 }
76
77 void Register() override
78 {
80 }
81};
82
84{
87}
@ ACTION_SOTA_CAPTURE_GRAVEYARD
#define RegisterGameObjectAI(ai_name)
Definition: ScriptMgr.h:1398
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_DUMMY
Team
@ ALLIANCE
@ HORDE
@ GO_FLAG_NOT_SELECTABLE
@ GO_STATE_READY
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
GameObject *const me
Definition: GameObjectAI.h:50
GOState GetGoState() const
Definition: GameObject.h:281
bool HasFlag(GameObjectFlags flags) const
Definition: GameObject.h:273
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
ZoneScript * GetZoneScript() const
Definition: Object.h:630
bool Validate(SpellInfo const *) override
void AddSC_strand_of_the_ancients()
bool OnGossipHello(Player *player) override