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 "Player.h"
34#include "SpellAuraEffects.h"
35#include "SpellScript.h"
36#include "sunken_temple.h"
37
38/*#####
39# at_malfurion_Stormrage_trigger
40#####*/
41
48
50{
51 public:
52 at_malfurion_stormrage() : AreaTriggerScript("at_malfurion_stormrage") { }
53
61};
62
63/*#####
64# go_atalai_statue
65#####*/
66
68{
69 public:
70 go_atalai_statue() : GameObjectScript("go_atalai_statue") { }
71
73 {
74 go_atalai_statueAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
75
77
78 bool OnGossipHello(Player* /*player*/) override
79 {
81 return false;
82 }
83 };
84
85 GameObjectAI* GetAI(GameObject* go) const override
86 {
87 return GetSunkenTempleAI<go_atalai_statueAI>(go);
88 }
89};
90
96
97// 12479 - Hex of Jammal'an
99{
100 bool Validate(SpellInfo const* /*spellInfo*/) override
101 {
103 }
104
105 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
106 {
107 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
108 return;
109
110 Unit* target = GetTarget();
111 Unit* caster = GetCaster();
112
113 if (!caster || !caster->IsAlive())
114 return;
115
116 caster->CastSpell(target, SPELL_HEX_OF_JAMMALAN_TRANSFORM, true);
117 caster->CastSpell(target, SPELL_HEX_OF_JAMMALAN_CHARM, true);
118 }
119
124};
125
126// 12480 - Hex of Jammal'an
144
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
@ QUEST_STATUS_REWARDED
Definition QuestDef.h:153
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ 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:89
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15962
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition Unit.h:635
bool IsAlive() const
Definition Unit.h:1185
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
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:1398
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1517
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
GameObjectAI * GetAI(GameObject *go) const override
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr float GetPositionZ() const
Definition Position.h:89
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()
@ EVENT_STATE