TrinityCore
Loading...
Searching...
No Matches
sunken_temple.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/* ScriptData
19SDName: Sunken_Temple
20SD%Complete: 100
21SDComment: Area Trigger + Puzzle event support
22SDCategory: Sunken Temple
23EndScriptData */
24
25/* ContentData
26at_malfurion_Stormrage_trigger
27EndContentData */
28
29#include "ScriptMgr.h"
30#include "GameObject.h"
31#include "GameObjectAI.h"
32#include "InstanceScript.h"
33#include "Map.h"
34#include "Player.h"
35#include "ScriptedCreature.h"
36#include "SpellAuraEffects.h"
37#include "SpellScript.h"
38#include "sunken_temple.h"
39
40/*#####
41# at_malfurion_Stormrage_trigger
42#####*/
43
50
52{
53 public:
54 at_malfurion_stormrage() : AreaTriggerScript("at_malfurion_stormrage") { }
55
63};
64
65/*#####
66# go_atalai_statue
67#####*/
68
70{
71 public:
72 go_atalai_statue() : GameObjectScript("go_atalai_statue") { }
73
75 {
76 go_atalai_statueAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
77
79
80 bool OnGossipHello(Player* /*player*/) override
81 {
83 return false;
84 }
85 };
86
87 GameObjectAI* GetAI(GameObject* go) const override
88 {
89 return GetSunkenTempleAI<go_atalai_statueAI>(go);
90 }
91};
92
98
99// 12479 - Hex of Jammal'an
101{
103
104 bool Validate(SpellInfo const* /*spellInfo*/) override
105 {
107 }
108
109 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
110 {
111 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
112 return;
113
114 Unit* target = GetTarget();
115 Unit* caster = GetCaster();
116
117 if (!caster || !caster->IsAlive())
118 return;
119
120 caster->CastSpell(target, SPELL_HEX_OF_JAMMALAN_TRANSFORM, true);
121 caster->CastSpell(target, SPELL_HEX_OF_JAMMALAN_CHARM, true);
122 }
123
128};
129
130// 12480 - Hex of Jammal'an
150
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
@ QUEST_STATUS_REWARDED
Definition QuestDef.h:110
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ EFFECT_0
@ AURA_REMOVE_BY_EXPIRE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_TRANSFORM
#define AuraEffectRemoveFn(F, I, N, M)
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Unit * GetCaster() const
Unit * GetTarget() const
GameObject *const me
uint32 GetEntry() const
Definition Object.h:81
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15642
Definition Unit.h:769
bool IsAlive() const
Definition Unit.h:1234
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2099
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
GameObjectAI * GetAI(GameObject *go) const override
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_sunken_temple_hex_of_jammalan_transform)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_sunken_temple_hex_of_jammalan)
bool Validate(SpellInfo const *) override
@ EVENT_STATE
Definition deadmines.h:50
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
bool OnGossipHello(Player *) override
MalfurionMisc
@ NPC_MALFURION_STORMRAGE
@ QUEST_ERANIKUS_TYRANT_OF_DREAMS
@ QUEST_THE_CHARGE_OF_DRAGONFLIGHTS
HexOfJammalan
@ SPELL_HEX_OF_JAMMALAN_TRANSFORM
@ SPELL_HEX_OF_JAMMALAN_CHARM
void AddSC_sunken_temple()