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 "SpellScript.h"
25
38
49
51{
52 SPELL_RALLY = 75416
53};
54
55Position const xerestraszaMovePos = {3151.236f, 379.8733f, 86.31996f, 0.0f};
56
57// 40429 - Sanctum Guardian Xerestrasza
59{
60 npc_xerestrasza(Creature* creature) : ScriptedAI(creature)
61 {
62 _isIntro = true;
63 _introDone = false;
64 }
65
66 void Reset() override
67 {
68 _events.Reset();
70 }
71
98
99 void UpdateAI(uint32 diff) override
100 {
101 if (_isIntro)
102 return;
103
104 _events.Update(diff);
105
106 while (uint32 eventId = _events.ExecuteEvent())
107 {
108 switch (eventId)
109 {
112 break;
115 break;
118 break;
121 break;
124 break;
127 break;
131 me->setActive(false);
132 me->SetFarVisible(false);
133 break;
134 default:
135 break;
136 }
137 }
138 }
139
140private:
144};
145
147{
148 public:
149 at_baltharus_plateau() : OnlyOnceAreaTriggerScript("at_baltharus_plateau") { }
150
151 bool TryHandleOnce(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
152 {
153 // Only trigger once
154 if (InstanceScript* instance = player->GetInstanceScript())
155 {
156 if (Creature* xerestrasza = instance->GetCreature(DATA_XERESTRASZA))
157 xerestrasza->AI()->DoAction(ACTION_INTRO_BALTHARUS);
158
159 if (Creature* baltharus = instance->GetCreature(DATA_BALTHARUS_THE_WARBORN))
160 baltharus->AI()->DoAction(ACTION_INTRO_BALTHARUS);
161 }
162
163 return true;
164 }
165};
166
167// 75415 - Rallying Shout
198
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ALLY
@ SPELLVALUE_AURA_STACK
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ UNIT_NPC_FLAG_QUESTGIVER
Creature *const me
Definition CreatureAI.h:63
void Update(uint32 time)
Definition EventMap.h:77
EventId ExecuteEvent()
Definition EventMap.cpp:77
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1013
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:1012
bool SetWalk(bool enable)
Definition Unit.cpp:13422
InstanceScript * GetInstanceScript() const
Definition Object.cpp:394
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
void setActive(bool isActiveObject)
Definition Object.cpp:274
void SetFarVisible(bool on)
Definition Object.cpp:325
bool TryHandleOnce(Player *player, AreaTriggerEntry const *) override
bool Validate(SpellInfo const *) override
void CountTargets(std::list< WorldObject * > &targets)
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