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
58{
59 npc_xerestrasza(Creature* creature) : ScriptedAI(creature)
60 {
61 _isIntro = true;
62 _introDone = false;
63 }
64
65 void Reset() override
66 {
67 _events.Reset();
69 }
70
97
98 void UpdateAI(uint32 diff) override
99 {
100 if (_isIntro)
101 return;
102
103 _events.Update(diff);
104
105 while (uint32 eventId = _events.ExecuteEvent())
106 {
107 switch (eventId)
108 {
111 break;
114 break;
117 break;
120 break;
123 break;
126 break;
130 me->setActive(false);
131 me->SetFarVisible(false);
132 break;
133 default:
134 break;
135 }
136 }
137 }
138
139private:
143};
144
146{
147 public:
148 at_baltharus_plateau() : OnlyOnceAreaTriggerScript("at_baltharus_plateau") { }
149
150 bool TryHandleOnce(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
151 {
152 // Only trigger once
153 if (InstanceScript* instance = player->GetInstanceScript())
154 {
155 if (Creature* xerestrasza = instance->GetCreature(DATA_XERESTRASZA))
156 xerestrasza->AI()->DoAction(ACTION_INTRO_BALTHARUS);
157
158 if (Creature* baltharus = instance->GetCreature(DATA_BALTHARUS_THE_WARBORN))
159 baltharus->AI()->DoAction(ACTION_INTRO_BALTHARUS);
160 }
161
162 return true;
163 }
164};
165
166// 75415 - Rallying Shout
197
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
Spells
Definition PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ TARGET_UNIT_SRC_AREA_ALLY
@ SPELL_EFFECT_DUMMY
@ 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
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
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:1723
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:998
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:997
bool SetWalk(bool enable)
Definition Unit.cpp:13343
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
void setActive(bool isActiveObject)
Definition Object.cpp:276
void SetFarVisible(bool on)
Definition Object.cpp:327
bool TryHandleOnce(Player *player, AreaTriggerEntry const *) override
bool Validate(SpellInfo const *) override
void CountTargets(std::list< WorldObject * > &targets)
@ SPELL_RALLY
void AddSC_ruby_sanctum()
@ 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
Position const xerestraszaMovePos
@ 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
#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