TrinityCore
Loading...
Searching...
No Matches
ruby_sanctum.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 "InstanceScript.h"
20#include "MotionMaster.h"
21#include "Player.h"
22#include "ruby_sanctum.h"
23#include "ScriptedCreature.h"
24#include "ScriptedGossip.h"
25#include "SpellScript.h"
26
39
50
52{
53 SPELL_RALLY = 75416
54};
55
56Position const xerestraszaMovePos = {3151.236f, 379.8733f, 86.31996f, 0.0f};
57
58// 40429 - Sanctum Guardian Xerestrasza
60{
61 npc_xerestrasza(Creature* creature) : ScriptedAI(creature)
62 {
63 _isIntro = true;
64 _introDone = false;
65 }
66
67 void Reset() override
68 {
69 _events.Reset();
71 }
72
99
100 void UpdateAI(uint32 diff) override
101 {
102 if (_isIntro)
103 return;
104
105 _events.Update(diff);
106
107 while (uint32 eventId = _events.ExecuteEvent())
108 {
109 switch (eventId)
110 {
113 break;
116 break;
119 break;
122 break;
125 break;
128 break;
132 me->setActive(false);
133 me->SetFarVisible(false);
134 break;
135 default:
136 break;
137 }
138 }
139 }
140
141private:
145};
146
148{
149 public:
150 at_baltharus_plateau() : OnlyOnceAreaTriggerScript("at_baltharus_plateau") { }
151
152 bool TryHandleOnce(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
153 {
154 // Only trigger once
155 if (InstanceScript* instance = player->GetInstanceScript())
156 {
157 if (Creature* xerestrasza = instance->GetCreature(DATA_XERESTRASZA))
158 xerestrasza->AI()->DoAction(ACTION_INTRO_BALTHARUS);
159
160 if (Creature* baltharus = instance->GetCreature(DATA_BALTHARUS_THE_WARBORN))
161 baltharus->AI()->DoAction(ACTION_INTRO_BALTHARUS);
162 }
163
164 return true;
165 }
166};
167
168// 75415 - Rallying Shout
201
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ALLY
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_AURA_STACK
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ UNIT_NPC_FLAG_QUESTGIVER
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1098
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:1097
bool SetWalk(bool enable)
Definition Unit.cpp:13268
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
void setActive(bool isActiveObject)
Definition Object.cpp:991
void SetFarVisible(bool on)
Definition Object.cpp:1014
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool TryHandleOnce(Player *player, AreaTriggerEntry const *) override
bool Validate(SpellInfo const *) override
void CountTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_ruby_sanctum_rallying_shout)
RubySanctumEvents
@ EVENT_XERESTRASZA_EVENT_7
@ EVENT_XERESTRASZA_EVENT_2
@ EVENT_XERESTRASZA_EVENT_4
@ EVENT_XERESTRASZA_EVENT_6
@ EVENT_XERESTRASZA_EVENT_5
@ EVENT_XERESTRASZA_EVENT_3
@ EVENT_XERESTRASZA_EVENT_1
RubySanctumTexts
@ SAY_XERESTRASZA_EVENT_3
@ SAY_XERESTRASZA_EVENT_1
@ SAY_XERESTRASZA_INTRO
@ SAY_XERESTRASZA_EVENT_5
@ SAY_XERESTRASZA_EVENT_6
@ SAY_XERESTRASZA_EVENT
@ SAY_XERESTRASZA_EVENT_2
@ SAY_XERESTRASZA_EVENT_4
@ SAY_XERESTRASZA_EVENT_7
void AddSC_ruby_sanctum()
RubySanctumSpells
@ SPELL_RALLY
Position const xerestraszaMovePos
#define RegisterRubySanctumCreatureAI(ai_name)
@ DATA_XERESTRASZA
@ DATA_BALTHARUS_THE_WARBORN
@ ACTION_INTRO_BALTHARUS
@ ACTION_BALTHARUS_DEATH
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
void Reset() override
void DoAction(int32 action) override
npc_xerestrasza(Creature *creature)
void UpdateAI(uint32 diff) override