TrinityCore
Loading...
Searching...
No Matches
zone_orderhall_rogue.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 "AreaTrigger.h"
20#include "AreaTriggerAI.h"
21#include "ObjectAccessor.h"
22#include "ScriptedCreature.h"
23#include "Player.h"
24
31
32// XXX - Areatrigger
34{
36
37 void OnUnitEnter(Unit* unit) override
38 {
39 Player* player = unit->ToPlayer();
41 return;
42
43 Creature* miltonObject = GetClosestCreatureWithOptions(player, 30.0f, { .CreatureId = NPC_MILTON_BEATS_ORDERHALL, .IgnorePhases = true });
44 if (!miltonObject)
45 return;
46
47 TempSummon* miltonClone = miltonObject->SummonPersonalClone(miltonObject->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
48 if (!miltonClone)
49 return;
50 }
51};
52
@ TEMPSUMMON_MANUAL_DESPAWN
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:150
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
Creature * GetClosestCreatureWithOptions(WorldObject *source, float maxSearchRange, FindCreatureOptions const &options)
Player * ToPlayer()
Definition Object.h:126
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15962
Definition Unit.h:635
TempSummon * SummonPersonalClone(Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, Player *privateObjectOwner=nullptr)
Definition Object.cpp:1421
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
at_hall_of_shadows_call_of_the_uncrowned_clone_milton(AreaTrigger *areatrigger)
void AddSC_orderhall_rogue()
CallOfTheUncrownedATData
@ QUEST_CALL_OF_THE_UNCROWNED
@ NPC_MILTON_BEATS_ORDERHALL