TrinityCore
Loading...
Searching...
No Matches
ragefire_chasm.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 "Creature.h"
19#include "MotionMaster.h"
20#include "Player.h"
21#include "Position.h"
22#include "ScriptMgr.h"
23#include "SpellScript.h"
24#include "ragefire_chasm.h"
25
27{
28 PATH_RESCUED_1 = 6178805,
29 PATH_RESCUED_2 = 6178806,
30 PATH_RESCUED_3 = 6178807,
31
32 POINT_INTRO = 0
33};
34
36{
37 { -34.332058f, -53.474606f, -21.372412f },
38 { -33.650555f, -53.704865f, -21.371508f },
39 { -30.366037f, -39.565018f, -21.747667f },
40 { -34.273827f, -37.673744f, -21.493523f }
41};
42
43// Areatrigger - 7966
45{
46public:
47 at_rfc_cosmetic_intro() : OnlyOnceAreaTriggerScript("at_rfc_cosmetic_intro") { }
48
49 bool TryHandleOnce(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
50 {
51 if (player->IsGameMaster())
52 return false;
53
54 if (Creature* adolescentFlameHound = player->FindNearestCreatureWithOptions(80.0f, { .StringId = "npc_adolescent_flame_hound_1" }))
55 adolescentFlameHound->GetMotionMaster()->MovePoint(POINT_INTRO, AdolescentFlameHoundIntro[0]);
56
57 if (Creature* adolescentFlameHound = player->FindNearestCreatureWithOptions(80.0f, { .StringId = "npc_adolescent_flame_hound_2" }))
58 adolescentFlameHound->GetMotionMaster()->MovePoint(POINT_INTRO, AdolescentFlameHoundIntro[1]);
59
60 if (Creature* adolescentFlameHound = player->FindNearestCreatureWithOptions(80.0f, { .StringId = "npc_adolescent_flame_hound_3" }))
61 adolescentFlameHound->GetMotionMaster()->MovePoint(POINT_INTRO, AdolescentFlameHoundIntro[2]);
62
63 if (Creature* adolescentFlameHound = player->FindNearestCreatureWithOptions(80.0f, { .StringId = "npc_adolescent_flame_hound_4" }))
64 adolescentFlameHound->GetMotionMaster()->MovePoint(POINT_INTRO, AdolescentFlameHoundIntro[3]);
65
66 return true;
67 }
68};
69
70// 101163 - General Trigger 221 to Self
72{
73 void HandleDummy(SpellEffIndex /*effIndex*/)
74 {
75 Creature* casterCreature = GetCaster()->ToCreature();
76
77 if (!casterCreature)
78 return;
79
80 if (casterCreature->HasStringId("npc_rescued_cage_1"))
81 casterCreature->GetMotionMaster()->MovePath(PATH_RESCUED_1, false);
82 else if (casterCreature->HasStringId("npc_rescued_cage_2"))
83 casterCreature->GetMotionMaster()->MovePath(PATH_RESCUED_2, false);
84 else if (casterCreature->HasStringId("npc_rescued_cage_3"))
85 casterCreature->GetMotionMaster()->MovePath(PATH_RESCUED_3, false);
86 }
87
92};
93
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
#define SpellEffectFn(F, I, N)
bool HasStringId(std::string_view id) const
void MovePath(uint32 pathId, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, Optional< bool > exactSplinePath={}, bool generatePath=true, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
Creature * ToCreature()
Definition Object.h:121
bool IsGameMaster() const
Definition Player.h:1309
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHitTarget
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
Creature * FindNearestCreatureWithOptions(float range, FindCreatureOptions const &options) const
Definition Object.cpp:1526
void AddSC_ragefire_chasm()
constexpr Position AdolescentFlameHoundIntro[4]
@ PATH_RESCUED_1
@ PATH_RESCUED_2
@ POINT_INTRO
@ PATH_RESCUED_3
bool TryHandleOnce(Player *player, AreaTriggerEntry const *) override