TrinityCore
Loading...
Searching...
No Matches
zone_isle_of_dorn.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 "Containers.h"
19#include "Conversation.h"
20#include "ConversationAI.h"
21#include "CreatureAIImpl.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "ScriptMgr.h"
25#include "ScriptedCreature.h"
26#include "TemporarySummon.h"
27
39
40// 25586 - Conversation
42{
43public:
45
50
51 void OnCreate(Unit* creator) override
52 {
53 Creature* nataliaObject = GetClosestCreatureWithOptions(creator, 10.0f, { .CreatureId = NPC_NATALIA_PEARCES_FREYWOLD, .IgnorePhases = true });
54 if (!nataliaObject)
55 return;
56
57 TempSummon* nataliaClone = nataliaObject->SummonPersonalClone(nataliaObject->GetPosition(), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, creator->ToPlayer());
58 if (!nataliaClone)
59 return;
60
62
65 }
66
67 void OnStart() override
68 {
70
72 {
73 Creature* nataliaClone = conversation->GetActorCreature(0);
74 if (!nataliaClone)
75 return;
76
77 nataliaClone->GetMotionMaster()->MovePath(PATH_NATALIA_CLONE_FREYWOLD, false);
78 }, conversation->GetLastLineEndTime(privateOwnerLocale));
79 }
80};
81
82constexpr Position NataliaSpawnPos = { 568.539f, -1205.899f, 2.48101f, 1.82973f };
83
84// 25590 - Conversation
86{
87public:
89
90 void OnCreate(Unit* creator) override
91 {
92 Creature* nataliaObject = GetClosestCreatureWithOptions(creator, 60.0f, { .CreatureId = NPC_NATALIA_PEARCES_INSIDE_BASALTEOUS, .IgnorePhases = true });
93 if (!nataliaObject)
94 return;
95
96 TempSummon* nataliaClone = nataliaObject->SummonPersonalClone(NataliaSpawnPos, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, creator->ToPlayer());
97 if (!nataliaClone)
98 return;
99
101 nataliaClone->SetUninteractible(true);
103
106 }
107};
108
LocaleConstant
Definition Common.h:51
@ TEMPSUMMON_MANUAL_DESPAWN
#define RegisterConversationAI(ai_name)
Definition ScriptMgr.h:1437
Creature * GetClosestCreatureWithOptions(WorldObject *source, float maxSearchRange, FindCreatureOptions const &options)
NPCFlags
Non Player Character flags.
@ UNIT_NPC_FLAG_GOSSIP
@ UNIT_NPC_FLAG_QUESTGIVER
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
Conversation *const conversation
ConversationAI(Conversation *c, uint32 scriptId={}) noexcept
void AddActor(int32 actorId, uint32 actorIdx, ObjectGuid const &actorGuid)
LocaleConstant GetPrivateObjectOwnerLocale() const
Milliseconds GetLastLineEndTime(LocaleConstant locale) const
Creature * GetActorCreature(uint32 actorIdx) const
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
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={})
Player * ToPlayer()
Definition Object.h:126
Definition Unit.h:635
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:998
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
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
EventProcessor m_Events
Definition Object.h:561
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
PreciousGemsData
@ NPC_NATALIA_PEARCES_FREYWOLD
@ CONVO_ACTOR_NATALIA_FREYWOLD
@ NPC_NATALIA_PEARCES_INSIDE_BASALTEOUS
@ PATH_NATALIA_CLONE_FREYWOLD
@ CONVO_ACTOR_NATALIA_BASALTEOUS_CAVE
@ PATH_NATALIA_CLONE_BASALTEOUS_CAVE
void AddSC_zone_isle_of_dorn()
constexpr Position NataliaSpawnPos