AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_mistress_nagmara Struct Reference
Inheritance diagram for npc_mistress_nagmara:
CreatureAI UnitAI

Public Member Functions

 npc_mistress_nagmara (Creature *creature)
 
void Reset () override
 
void sGossipSelect (Player *player, uint32 menuId, uint32 gossipListId) override
 
void SetData (uint32 id, uint32 value) override
 
void DoAction (int32 action) override
 
void MovementInform (uint32 type, uint32 pointId) override
 
void WaypointReached (uint32 pointId, uint32 pathId) override
 
void PathEndReached (uint32 pathId) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Member Functions

Creature * FindNearestPatron () const
 
void MoveToApproachPoint ()
 
void MoveToGreetingPosition ()
 
void GreetRocknot (TaskContext &context)
 
void CastLovePotion (TaskContext &context)
 
void StartLoversRoute (TaskContext &context)
 
bool OpenBarDoor ()
 
void TryOpenBarDoor (TaskContext &context)
 
void ContinueAfterDoor ()
 
void ReachLoversStop (TaskContext &context)
 
void KissRocknot (TaskContext &context)
 
void ScheduleKiss ()
 
void CancelLovePotionTasks ()
 
void AbortLovePotionEvent (bool notifyRocknot)
 
void AbortLovePotionEvent (bool notifyRocknot, TaskContext &context)
 
void ResetLovePotionEvent (bool notifyRocknot)
 

Private Attributes

InstanceScript * _instance
 
TaskScheduler _ambientScheduler
 
ObjectGuid _rocknotGuid
 
uint8 _doorOpenAttempts
 
bool _lovePotionEvent
 
bool _lovePotionComplete
 
bool _doorOpenedByEvent
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_mistress_nagmara()

npc_mistress_nagmara::npc_mistress_nagmara ( Creature *  creature)
inline
702 : CreatureAI(creature), _instance(creature->GetInstanceScript()),
704 _lovePotionComplete(false), _doorOpenedByEvent(false) { }
Definition CreatureAI.h:69
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
bool _lovePotionEvent
Definition blackrock_depths.cpp:1091
bool _lovePotionComplete
Definition blackrock_depths.cpp:1092
uint8 _doorOpenAttempts
Definition blackrock_depths.cpp:1090
InstanceScript * _instance
Definition blackrock_depths.cpp:1087
bool _doorOpenedByEvent
Definition blackrock_depths.cpp:1093

Member Function Documentation

◆ AbortLovePotionEvent() [1/2]

void npc_mistress_nagmara::AbortLovePotionEvent ( bool  notifyRocknot)
inlineprivate
1046 {
1048 return;
1049
1051 ResetLovePotionEvent(notifyRocknot);
1052 }
void CancelLovePotionTasks()
Definition blackrock_depths.cpp:1039
void ResetLovePotionEvent(bool notifyRocknot)
Definition blackrock_depths.cpp:1064

References _lovePotionComplete, _lovePotionEvent, CancelLovePotionTasks(), and ResetLovePotionEvent().

Referenced by CastLovePotion(), DoAction(), GreetRocknot(), ReachLoversStop(), Reset(), sGossipSelect(), StartLoversRoute(), and TryOpenBarDoor().

◆ AbortLovePotionEvent() [2/2]

void npc_mistress_nagmara::AbortLovePotionEvent ( bool  notifyRocknot,
TaskContext &  context 
)
inlineprivate
1055 {
1057 return;
1058
1061 ResetLovePotionEvent(notifyRocknot);
1062 }
@ GROUP_NAGMARA_KISS
Definition blackrock_depths.cpp:671
@ GROUP_NAGMARA_MOVEMENT_TIMEOUT
Definition blackrock_depths.cpp:669
@ GROUP_NAGMARA_LOVE_SEQUENCE
Definition blackrock_depths.cpp:668
TaskContext & CancelGroupsOf(std::vector< TaskScheduler::group_t > const &groups)
Definition TaskScheduler.cpp:268

References _lovePotionComplete, _lovePotionEvent, TaskContext::CancelGroupsOf(), GROUP_NAGMARA_KISS, GROUP_NAGMARA_LOVE_SEQUENCE, GROUP_NAGMARA_MOVEMENT_TIMEOUT, and ResetLovePotionEvent().

◆ CancelLovePotionTasks()

void npc_mistress_nagmara::CancelLovePotionTasks ( )
inlineprivate
1040 {
1043 }
TaskScheduler scheduler
Definition CreatureAI.h:74
TaskScheduler & CancelGroupsOf(std::vector< group_t > const &groups)
Definition TaskScheduler.cpp:62

References TaskScheduler::CancelGroupsOf(), GROUP_NAGMARA_KISS, GROUP_NAGMARA_LOVE_SEQUENCE, GROUP_NAGMARA_MOVEMENT_TIMEOUT, and CreatureAI::scheduler.

Referenced by AbortLovePotionEvent(), and Reset().

◆ CastLovePotion()

void npc_mistress_nagmara::CastLovePotion ( TaskContext &  context)
inlineprivate
932 {
934
935 // The potion casts for 1 second, then she waits 2.2 seconds before leaving.
937 {
938 context.Schedule(3200ms, GROUP_NAGMARA_LOVE_SEQUENCE, [this](TaskContext context)
939 {
940 StartLoversRoute(context);
941 });
942 }
943 else
944 AbortLovePotionEvent(false, context);
945 }
@ SPELL_POTION_LOVE
Definition blackrock_depths.cpp:611
Creature *const me
Definition CreatureAI.h:71
Definition TaskScheduler.h:422
TaskContext & Schedule(std::chrono::duration< _Rep, _Period > const &time, TaskScheduler::task_handler_t const &task)
Definition TaskScheduler.h:534
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:175
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
void StartLoversRoute(TaskContext &context)
Definition blackrock_depths.cpp:947
void AbortLovePotionEvent(bool notifyRocknot)
Definition blackrock_depths.cpp:1045
ObjectGuid _rocknotGuid
Definition blackrock_depths.cpp:1089

References _rocknotGuid, AbortLovePotionEvent(), UnitAI::DoCast(), ObjectAccessor::GetCreature(), GROUP_NAGMARA_LOVE_SEQUENCE, CreatureAI::me, TaskContext::Schedule(), SPELL_POTION_LOVE, and StartLoversRoute().

Referenced by GreetRocknot().

◆ ContinueAfterDoor()

void npc_mistress_nagmara::ContinueAfterDoor ( )
inlineprivate
997 {
999 if (rocknot->AI())
1000 rocknot->AI()->DoAction(ACTION_RESUME_AFTER_BAR_DOOR);
1001
1002 me->ResumeMovement();
1003 }
@ ACTION_RESUME_AFTER_BAR_DOOR
Definition blackrock_depths.cpp:657
Definition Creature.h:47
void ResumeMovement(uint32 timer=0, uint8 slot=0)
Definition Unit.cpp:12739

References _rocknotGuid, ACTION_RESUME_AFTER_BAR_DOOR, ObjectAccessor::GetCreature(), CreatureAI::me, and Unit::ResumeMovement().

Referenced by TryOpenBarDoor().

◆ DoAction()

void npc_mistress_nagmara::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

803 {
804 if (action == ACTION_CANCEL_LOVE_POTION)
807 {
809 if (!rocknot || !rocknot->AI())
810 {
812 return;
813 }
814
815 me->SetFacingToObject(rocknot);
816 rocknot->SetFacingToObject(me);
818 _lovePotionEvent = false;
819 _lovePotionComplete = true;
820 _doorOpenedByEvent = false;
824 if (_instance)
826 me->setActive(false);
827 }
828 }
@ DONE
Definition InstanceScript.h:61
@ ACTION_COMPLETE_LOVE_POTION
Definition blackrock_depths.cpp:655
@ ACTION_ROCKNOT_AT_LOVERS_STOP
Definition blackrock_depths.cpp:654
@ ACTION_CANCEL_LOVE_POTION
Definition blackrock_depths.cpp:651
@ DATA_LOVE_POTION_EVENT
Definition blackrock_depths.h:87
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:347
CreatureAI * AI() const
Definition Creature.h:143
TaskScheduler & CancelAll()
Definition TaskScheduler.cpp:45
virtual void DoAction(int32)
Definition UnitAI.h:217
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16167
void setActive(bool isActiveObject)
Definition Object.cpp:1091
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
void GetPosition(float &x, float &y) const
Definition Position.h:126
TaskScheduler _ambientScheduler
Definition blackrock_depths.cpp:1088

References _ambientScheduler, _doorOpenedByEvent, _instance, _lovePotionComplete, _lovePotionEvent, _rocknotGuid, AbortLovePotionEvent(), ACTION_CANCEL_LOVE_POTION, ACTION_COMPLETE_LOVE_POTION, ACTION_ROCKNOT_AT_LOVERS_STOP, Creature::AI(), TaskScheduler::CancelAll(), TaskScheduler::CancelGroupsOf(), DATA_LOVE_POTION_EVENT, UnitAI::DoAction(), DONE, ObjectAccessor::GetCreature(), Position::GetPosition(), GROUP_NAGMARA_LOVE_SEQUENCE, GROUP_NAGMARA_MOVEMENT_TIMEOUT, CreatureAI::me, CreatureAI::scheduler, WorldObject::setActive(), ZoneScript::SetData(), Unit::SetFacingToObject(), and Creature::SetHomePosition().

◆ FindNearestPatron()

Creature * npc_mistress_nagmara::FindNearestPatron ( ) const
inlineprivate
893 {
895 if (Creature* guzzlingPatron = me->FindNearestCreature(NPC_GUZZLING_PATRON, 50.0f);
896 guzzlingPatron && (!patron || me->GetExactDist2d(guzzlingPatron) < me->GetExactDist2d(patron)))
897 patron = guzzlingPatron;
898
899 return patron;
900 }
@ NPC_GRIM_PATRON
Definition blackrock_depths.cpp:644
@ NPC_GUZZLING_PATRON
Definition blackrock_depths.cpp:645
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2565
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170

References WorldObject::FindNearestCreature(), Position::GetExactDist2d(), CreatureAI::me, NPC_GRIM_PATRON, and NPC_GUZZLING_PATRON.

Referenced by SetData().

◆ GreetRocknot()

void npc_mistress_nagmara::GreetRocknot ( TaskContext &  context)
inlineprivate
914 {
916 if (!rocknot || !me->IsWithinDistInMap(rocknot, 6.0f))
917 {
918 AbortLovePotionEvent(true, context);
919 return;
920 }
921
923 me->SetFacingToObject(rocknot);
924 rocknot->SetFacingToObject(me);
925 context.Schedule(300ms, GROUP_NAGMARA_LOVE_SEQUENCE, [this](TaskContext context)
926 {
927 CastLovePotion(context);
928 });
929 }
void MoveIdle()
Definition MotionMaster.cpp:235
MotionMaster * GetMotionMaster()
Definition Unit.h:1774
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1386
void CastLovePotion(TaskContext &context)
Definition blackrock_depths.cpp:931

References _rocknotGuid, AbortLovePotionEvent(), CastLovePotion(), ObjectAccessor::GetCreature(), Unit::GetMotionMaster(), GROUP_NAGMARA_LOVE_SEQUENCE, WorldObject::IsWithinDistInMap(), CreatureAI::me, MotionMaster::MoveIdle(), TaskContext::Schedule(), and Unit::SetFacingToObject().

Referenced by MovementInform().

◆ KissRocknot()

void npc_mistress_nagmara::KissRocknot ( TaskContext &  context)
inlineprivate
1025 {
1028 context.Repeat(11s, 21s);
1029 }
@ EMOTE_NAGMARA
Definition blackrock_depths.cpp:619
@ SPELL_NAGMARA_ROCKNOT
Definition blackrock_depths.cpp:612
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition TaskScheduler.h:494
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
Talk
Definition hyjal.cpp:82

References UnitAI::DoCastSelf(), EMOTE_NAGMARA, TaskContext::Repeat(), and SPELL_NAGMARA_ROCKNOT.

Referenced by ReachLoversStop(), and ScheduleKiss().

◆ MovementInform()

void npc_mistress_nagmara::MovementInform ( uint32  type,
uint32  pointId 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

831 {
832 if (type != POINT_MOTION_TYPE || !_lovePotionEvent)
833 return;
834
836
837 if (pointId == POINT_APPROACH_GREETING)
838 {
840 {
841 GreetRocknot(context);
842 });
843 }
844 else if (pointId == POINT_APPROACH)
845 {
847 {
849 });
850 }
851 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ POINT_APPROACH
Definition blackrock_depths.cpp:681
@ POINT_APPROACH_GREETING
Definition blackrock_depths.cpp:682
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:233
TaskScheduler & RescheduleGroup(group_t const group, std::chrono::duration< _Rep, _Period > const &duration)
Reschedule all tasks of a group with the given duration.
Definition TaskScheduler.h:353
void MoveToGreetingPosition()
Definition blackrock_depths.cpp:908
void GreetRocknot(TaskContext &context)
Definition blackrock_depths.cpp:913

References _lovePotionEvent, GreetRocknot(), GROUP_NAGMARA_LOVE_SEQUENCE, GROUP_NAGMARA_MOVEMENT_TIMEOUT, MoveToGreetingPosition(), POINT_APPROACH, POINT_APPROACH_GREETING, POINT_MOTION_TYPE, TaskScheduler::RescheduleGroup(), TaskScheduler::Schedule(), and CreatureAI::scheduler.

◆ MoveToApproachPoint()

void npc_mistress_nagmara::MoveToApproachPoint ( )
inlineprivate
903 {
905 FORCED_MOVEMENT_NONE, 0.0f, false);
906 }
@ FORCED_MOVEMENT_NONE
Definition MotionMaster.h:86
Position const NagmaraApproachPosition
Definition blackrock_depths.cpp:694
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:241

References FORCED_MOVEMENT_NONE, Unit::GetMotionMaster(), CreatureAI::me, MotionMaster::MovePoint(), NagmaraApproachPosition, and POINT_APPROACH.

Referenced by sGossipSelect().

◆ MoveToGreetingPosition()

void npc_mistress_nagmara::MoveToGreetingPosition ( )
inlineprivate

◆ OpenBarDoor()

bool npc_mistress_nagmara::OpenBarDoor ( )
inlineprivate
967 {
968 if (!_instance)
969 return false;
970
972 if (!door)
973 return false;
974
975 // players can open this door with the Grim Guzzler Key, so only close it again if we opened it
978 return true;
979 }
@ GO_STATE_READY
Definition GameObjectData.h:709
@ GO_STATE_ACTIVE
Definition GameObjectData.h:708
@ DATA_GO_BAR_DOOR
Definition blackrock_depths.h:57
Definition GameObject.h:125
void SetGoState(GOState state)
Definition GameObject.cpp:2582
GOState GetGoState() const
Definition GameObject.h:211
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:121
Map * instance
Definition InstanceScript.h:149
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:2447

References _doorOpenedByEvent, _instance, DATA_GO_BAR_DOOR, Map::GetGameObject(), GameObject::GetGoState(), InstanceScript::GetGuidData(), GO_STATE_ACTIVE, GO_STATE_READY, InstanceScript::instance, and GameObject::SetGoState().

Referenced by TryOpenBarDoor().

◆ PathEndReached()

void npc_mistress_nagmara::PathEndReached ( uint32  pathId)
inlineoverridevirtual

Reimplemented from CreatureAI.

875 {
876 if (_lovePotionEvent && pathId == PATH_NAGMARA_LOVERS)
878 {
879 ReachLoversStop(context);
880 });
881 }
@ PATH_NAGMARA_LOVERS
Definition blackrock_depths.cpp:688
void ReachLoversStop(TaskContext &context)
Definition blackrock_depths.cpp:1005

References _lovePotionEvent, GROUP_NAGMARA_LOVE_SEQUENCE, PATH_NAGMARA_LOVERS, ReachLoversStop(), TaskScheduler::Schedule(), and CreatureAI::scheduler.

◆ ReachLoversStop()

void npc_mistress_nagmara::ReachLoversStop ( TaskContext &  context)
inlineprivate
1006 {
1008
1010 if (rocknot->AI())
1011 {
1013 context.Schedule(1ms, GROUP_NAGMARA_KISS, [this](TaskContext context)
1014 {
1015 KissRocknot(context);
1016 });
1017 rocknot->AI()->DoAction(ACTION_MOVE_TO_LOVERS_STOP);
1018 return;
1019 }
1020
1021 AbortLovePotionEvent(false, context);
1022 }
Position const RocknotFinalPosition
Definition blackrock_depths.cpp:698
@ ACTION_MOVE_TO_LOVERS_STOP
Definition blackrock_depths.cpp:653
void SetFacingTo(float ori)
Definition Unit.cpp:16157
float GetAngle(Position const *pos) const
Definition Position.cpp:85
void KissRocknot(TaskContext &context)
Definition blackrock_depths.cpp:1024

References _rocknotGuid, AbortLovePotionEvent(), ACTION_MOVE_TO_LOVERS_STOP, Position::GetAngle(), ObjectAccessor::GetCreature(), Unit::GetMotionMaster(), GROUP_NAGMARA_KISS, KissRocknot(), CreatureAI::me, MotionMaster::MoveIdle(), RocknotFinalPosition, TaskContext::Schedule(), and Unit::SetFacingTo().

Referenced by PathEndReached().

◆ Reset()

void npc_mistress_nagmara::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

707 {
709 {
710 me->setActive(false);
714 return;
715 }
716
718 {
723 _lovePotionEvent = false;
724 _lovePotionComplete = true;
725 _doorOpenedByEvent = false;
727 Position const& finalPosition = NagmaraFinalPosition;
728 me->NearTeleportTo(finalPosition.GetPositionX(), finalPosition.GetPositionY(),
729 finalPosition.GetPositionZ(), finalPosition.GetOrientation());
730 me->SetHomePosition(finalPosition);
733 ScheduleKiss();
735 me->setActive(false);
736 return;
737 }
738
740 {
742 return;
743 }
744
748 _doorOpenedByEvent = false;
749 }
@ UNIT_NPC_FLAG_NONE
Definition UnitDefines.h:321
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
Position const NagmaraFinalPosition
Definition blackrock_depths.cpp:697
void Clear(bool reset=true)
Definition MotionMaster.h:194
void Clear()
Definition ObjectGuid.h:141
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:15650
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:754
void ReplaceAllNpcFlags(NPCFlags flags)
Definition Unit.h:772
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
Definition Position.h:27
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void ScheduleKiss()
Definition blackrock_depths.cpp:1031

References _ambientScheduler, _doorOpenAttempts, _doorOpenedByEvent, _instance, _lovePotionComplete, _lovePotionEvent, _rocknotGuid, AbortLovePotionEvent(), TaskScheduler::CancelAll(), CancelLovePotionTasks(), ObjectGuid::Clear(), MotionMaster::Clear(), DATA_LOVE_POTION_EVENT, DONE, ZoneScript::GetData(), Unit::GetMotionMaster(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), CreatureAI::me, MotionMaster::MoveIdle(), NagmaraFinalPosition, Unit::NearTeleportTo(), Unit::ReplaceAllNpcFlags(), ScheduleKiss(), CreatureAI::scheduler, WorldObject::setActive(), Creature::SetHomePosition(), Unit::SetUnitFlag(), UNIT_FLAG_NOT_SELECTABLE, and UNIT_NPC_FLAG_NONE.

◆ ResetLovePotionEvent()

void npc_mistress_nagmara::ResetLovePotionEvent ( bool  notifyRocknot)
inlineprivate
1065 {
1069 door->SetGoState(GO_STATE_READY);
1070
1072 _lovePotionEvent = false;
1074 _doorOpenedByEvent = false;
1075 me->setActive(false);
1078 me->GetMotionMaster()->Clear();
1082
1083 if (notifyRocknot && rocknot && rocknot->AI())
1085 }
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:322
@ UNIT_NPC_FLAG_QUESTGIVER
Definition UnitDefines.h:323
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition MotionMaster.cpp:262
void InitDefault()
Definition MotionMaster.cpp:90
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:770
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4969
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:755

References _doorOpenAttempts, _doorOpenedByEvent, _instance, _lovePotionEvent, _rocknotGuid, ACTION_CANCEL_LOVE_POTION, Creature::AI(), ObjectGuid::Clear(), MotionMaster::Clear(), DATA_GO_BAR_DOOR, UnitAI::DoAction(), ObjectAccessor::GetCreature(), Map::GetGameObject(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), GO_STATE_READY, MotionMaster::InitDefault(), InstanceScript::instance, CreatureAI::me, MotionMaster::MoveTargetedHome(), Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), WorldObject::setActive(), Unit::SetNpcFlag(), SPELL_NAGMARA_ROCKNOT, UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.

Referenced by AbortLovePotionEvent(), and AbortLovePotionEvent().

◆ ScheduleKiss()

void npc_mistress_nagmara::ScheduleKiss ( )
inlineprivate
1032 {
1033 scheduler.Schedule(1ms, GROUP_NAGMARA_KISS, [this](TaskContext context)
1034 {
1035 KissRocknot(context);
1036 });
1037 }

References GROUP_NAGMARA_KISS, KissRocknot(), TaskScheduler::Schedule(), and CreatureAI::scheduler.

Referenced by Reset().

◆ SetData()

void npc_mistress_nagmara::SetData ( uint32  id,
uint32  value 
)
inlineoverridevirtual

Reimplemented from UnitAI.

790 {
791 if (!_lovePotionComplete && id == DATA_AMBIENT_ORDER && value == 1 &&
793 {
795 {
796 if (Creature* patron = FindNearestPatron())
797 Talk(SAY_NAGMARA_AMBIENT, patron);
798 });
799 }
800 }
@ DATA_AMBIENT_ORDER
Definition blackrock_depths.cpp:639
@ GROUP_NAGMARA_AMBIENT_REPLY
Definition blackrock_depths.cpp:670
@ SAY_NAGMARA_AMBIENT
Definition blackrock_depths.cpp:617
bool IsGroupScheduled(group_t const group)
Check if the group exists and is currently scheduled.
Definition TaskScheduler.cpp:122
Creature * FindNearestPatron() const
Definition blackrock_depths.cpp:892

References _ambientScheduler, _lovePotionComplete, DATA_AMBIENT_ORDER, FindNearestPatron(), GROUP_NAGMARA_AMBIENT_REPLY, TaskScheduler::IsGroupScheduled(), SAY_NAGMARA_AMBIENT, and TaskScheduler::Schedule().

◆ sGossipSelect()

void npc_mistress_nagmara::sGossipSelect ( Player *  player,
uint32  menuId,
uint32  gossipListId 
)
inlineoverridevirtual

Reimplemented from UnitAI.

752 {
753 if (menuId != GOSSIP_MENU_NAGMARA || gossipListId != 0 || !player->GetQuestRewardStatus(QUEST_POTION_LOVE))
754 return;
755
756 CloseGossipMenuFor(player);
757
758 if (!_instance)
759 return;
760
761 uint32 const barState = _instance->GetData(TYPE_BAR);
762 if (barState != NOT_STARTED && barState != IN_PROGRESS)
763 return;
764
766 if (!rocknot || !rocknot->AI() || !rocknot->AI()->GetData(DATA_CAN_START_LOVE_POTION))
767 return;
768
770 if (!rocknot->AI()->GetData(DATA_LOVE_POTION_ACTIVE))
771 return;
772
775 _lovePotionEvent = true;
776 _rocknotGuid = rocknot->GetGUID();
777 me->setActive(true);
778
779 me->SetWalk(false);
784 {
785 AbortLovePotionEvent(true, context);
786 });
787 }
std::uint32_t uint32
Definition Define.h:107
@ IN_PROGRESS
Definition InstanceScript.h:59
@ NOT_STARTED
Definition InstanceScript.h:58
void CloseGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:56
@ QUEST_POTION_LOVE
Definition blackrock_depths.cpp:634
@ GOSSIP_MENU_NAGMARA
Definition blackrock_depths.cpp:676
@ ACTION_START_LOVE_POTION
Definition blackrock_depths.cpp:650
@ NPC_PRIVATE_ROCKNOT
Definition blackrock_depths.cpp:605
@ SAY_NAGMARA_1
Definition blackrock_depths.cpp:618
@ DATA_CAN_START_LOVE_POTION
Definition blackrock_depths.cpp:662
@ DATA_LOVE_POTION_ACTIVE
Definition blackrock_depths.cpp:663
@ TYPE_BAR
Definition blackrock_depths.h:42
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3416
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
bool GetQuestRewardStatus(uint32 quest_id) const
Definition PlayerQuest.cpp:1489
virtual uint32 GetData(uint32) const
Definition UnitAI.h:218
void MoveToApproachPoint()
Definition blackrock_depths.cpp:902

References _instance, _lovePotionEvent, _rocknotGuid, AbortLovePotionEvent(), ACTION_START_LOVE_POTION, Creature::AI(), MotionMaster::Clear(), CloseGossipMenuFor(), DATA_CAN_START_LOVE_POTION, DATA_LOVE_POTION_ACTIVE, UnitAI::DoAction(), WorldObject::FindNearestCreature(), UnitAI::GetData(), ZoneScript::GetData(), Object::GetGUID(), Unit::GetMotionMaster(), Player::GetQuestRewardStatus(), GOSSIP_MENU_NAGMARA, GROUP_NAGMARA_MOVEMENT_TIMEOUT, IN_PROGRESS, CreatureAI::me, MoveToApproachPoint(), NOT_STARTED, NPC_PRIVATE_ROCKNOT, QUEST_POTION_LOVE, Unit::ReplaceAllNpcFlags(), SAY_NAGMARA_1, TaskScheduler::Schedule(), CreatureAI::scheduler, WorldObject::setActive(), Unit::SetUnitFlag(), Creature::SetWalk(), TYPE_BAR, UNIT_FLAG_NOT_SELECTABLE, and UNIT_NPC_FLAG_NONE.

◆ StartLoversRoute()

void npc_mistress_nagmara::StartLoversRoute ( TaskContext &  context)
inlineprivate
948 {
950 if (!rocknot || !rocknot->AI())
951 {
952 AbortLovePotionEvent(false, context);
953 return;
954 }
955
957 if (!rocknot->AI()->GetData(DATA_LOVE_POTION_ACTIVE))
958 {
959 AbortLovePotionEvent(false, context);
960 return;
961 }
962
964 }
@ ACTION_BEGIN_LOVERS_FOLLOW
Definition blackrock_depths.cpp:652
void MoveWaypoint(uint32 path_id, bool repeatable, PathSource pathSource=PathSource::WAYPOINT_MGR)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:1017

References _rocknotGuid, AbortLovePotionEvent(), ACTION_BEGIN_LOVERS_FOLLOW, Creature::AI(), DATA_LOVE_POTION_ACTIVE, UnitAI::DoAction(), ObjectAccessor::GetCreature(), UnitAI::GetData(), Unit::GetMotionMaster(), CreatureAI::me, MotionMaster::MoveWaypoint(), and PATH_NAGMARA_LOVERS.

Referenced by CastLovePotion().

◆ TryOpenBarDoor()

void npc_mistress_nagmara::TryOpenBarDoor ( TaskContext &  context)
inlineprivate
982 {
983 if (OpenBarDoor())
984 {
985 context.Schedule(3200ms, GROUP_NAGMARA_LOVE_SEQUENCE, [this](TaskContext /*context*/)
986 {
988 });
989 }
990 else if (++_doorOpenAttempts < 30)
991 context.Repeat(1s);
992 else
993 AbortLovePotionEvent(true, context);
994 }
void ContinueAfterDoor()
Definition blackrock_depths.cpp:996
bool OpenBarDoor()
Definition blackrock_depths.cpp:966

References _doorOpenAttempts, AbortLovePotionEvent(), ContinueAfterDoor(), GROUP_NAGMARA_LOVE_SEQUENCE, OpenBarDoor(), TaskContext::Repeat(), and TaskContext::Schedule().

Referenced by WaypointReached().

◆ UpdateAI()

void npc_mistress_nagmara::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

884 {
887
888 scheduler.Update(diff);
889 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27

References _ambientScheduler, _lovePotionComplete, _lovePotionEvent, CreatureAI::scheduler, and TaskScheduler::Update().

◆ WaypointReached()

void npc_mistress_nagmara::WaypointReached ( uint32  pointId,
uint32  pathId 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

854 {
855 if (!_lovePotionEvent || pathId != PATH_NAGMARA_LOVERS)
856 return;
857
859 if (pointId != POINT_NAGMARA_DOOR_WAIT)
860 return;
861
862 me->PauseMovement();
865 if (rocknot->AI())
866 rocknot->AI()->DoAction(ACTION_PAUSE_AT_BAR_DOOR);
867
869 {
870 TryOpenBarDoor(context);
871 });
872 }
@ ACTION_PAUSE_AT_BAR_DOOR
Definition blackrock_depths.cpp:656
@ POINT_NAGMARA_DOOR_WAIT
Definition blackrock_depths.cpp:689
virtual void PauseMovement(uint32 timer=0, uint8 slot=0)
Disable the unit movement by clearing UNIT_STATE_MOVING and stopping the spline.
Definition Unit.cpp:12728
void TryOpenBarDoor(TaskContext &context)
Definition blackrock_depths.cpp:981

References _doorOpenAttempts, _lovePotionEvent, _rocknotGuid, ACTION_PAUSE_AT_BAR_DOOR, ObjectAccessor::GetCreature(), GROUP_NAGMARA_LOVE_SEQUENCE, GROUP_NAGMARA_MOVEMENT_TIMEOUT, CreatureAI::me, PATH_NAGMARA_LOVERS, Unit::PauseMovement(), POINT_NAGMARA_DOOR_WAIT, TaskScheduler::RescheduleGroup(), TaskScheduler::Schedule(), CreatureAI::scheduler, and TryOpenBarDoor().

Member Data Documentation

◆ _ambientScheduler

TaskScheduler npc_mistress_nagmara::_ambientScheduler
private

Referenced by DoAction(), Reset(), SetData(), and UpdateAI().

◆ _doorOpenAttempts

uint8 npc_mistress_nagmara::_doorOpenAttempts
private

◆ _doorOpenedByEvent

bool npc_mistress_nagmara::_doorOpenedByEvent
private

◆ _instance

InstanceScript* npc_mistress_nagmara::_instance
private

◆ _lovePotionComplete

bool npc_mistress_nagmara::_lovePotionComplete
private

◆ _lovePotionEvent

◆ _rocknotGuid


The documentation for this struct was generated from the following file: