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

Public Member Functions

 npc_time_rift (Creature *creature)
 
void Reset () override
 
void JustSummoned (Creature *creature) override
 
void DoSummonAtRift (uint32 entry)
 
void DoSelectSummon ()
 
void SummonedCreatureDies (Creature *creature, Unit *) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void JustStartedThreateningMe (Unit *) override
 
void JustEnteredCombat (Unit *) override
 Called when the unit enters combat.
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed.
 
- 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 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 IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
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 MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
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 InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
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 sGossipSelect (Player *, uint32, uint32)
 
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 Attributes

EventMap _events
 
InstanceScript * _instance
 
ObjectGuid _riftKeeperGUID
 
std::vector< uint32 > waveMobs
 
uint8 waveMobIndex
 

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 NullCreatureAI
static int32 Permissible (Creature const *creature)
 
- 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)
 
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_time_rift()

npc_time_rift::npc_time_rift ( Creature *  creature)
inline
252 : NullCreatureAI(creature)
253 {
254 _instance = creature->GetInstanceScript();
255 }
Definition PassiveAI.h:56
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
InstanceScript * _instance
Definition the_black_morass.cpp:408

References _instance, and WorldObject::GetInstanceScript().

Member Function Documentation

◆ DoSelectSummon()

void npc_time_rift::DoSelectSummon ( )
inline
304 {
306 if (entry == NPC_INFINITE_WHELP)
307 {
308 DoSummonAtRift(entry);
309 DoSummonAtRift(entry);
310 DoSummonAtRift(entry);
311 }
312 else
313 {
314 if (urand(0, 1))
315 {
316 switch (entry)
317 {
320 break;
323 break;
326 break;
329 break;
330 default:
331 break;
332 }
333 }
334
335 DoSummonAtRift(entry);
336 }
337
338 if (++waveMobIndex >= waveMobs.size())
339 {
340 waveMobIndex = 0;
341 }
342 }
std::uint32_t uint32
Definition Define.h:107
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
void DoSummonAtRift(uint32 entry)
Definition the_black_morass.cpp:287
std::vector< uint32 > waveMobs
Definition the_black_morass.cpp:410
uint8 waveMobIndex
Definition the_black_morass.cpp:411
@ NPC_INFINITE_ASSASSIN_2
Definition the_black_morass.h:78
@ NPC_INFINITE_EXECUTIONER_2
Definition the_black_morass.h:80
@ NPC_INFINITE_EXECUTIONER
Definition the_black_morass.h:75
@ NPC_INFINITE_WHELP
Definition the_black_morass.h:73
@ NPC_INFINITE_VANQUISHER
Definition the_black_morass.h:76
@ NPC_INFINITE_VANQUISHER_2
Definition the_black_morass.h:81
@ NPC_INFINITE_ASSASSIN
Definition the_black_morass.h:72
@ NPC_INFINITE_CHRONOMANCER
Definition the_black_morass.h:74
@ NPC_INFINITE_CHRONOMANCER_2
Definition the_black_morass.h:79

References DoSummonAtRift(), NPC_INFINITE_ASSASSIN, NPC_INFINITE_ASSASSIN_2, NPC_INFINITE_CHRONOMANCER, NPC_INFINITE_CHRONOMANCER_2, NPC_INFINITE_EXECUTIONER, NPC_INFINITE_EXECUTIONER_2, NPC_INFINITE_VANQUISHER, NPC_INFINITE_VANQUISHER_2, NPC_INFINITE_WHELP, urand(), waveMobIndex, and waveMobs.

Referenced by UpdateAI().

◆ DoSummonAtRift()

void npc_time_rift::DoSummonAtRift ( uint32  entry)
inline
288 {
289 Position pos = me->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
290
291 if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 150000))
292 {
294 {
295 float o = medivh->GetAngle(summon) + frand(-1.0f, 1.0f);
296 summon->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(o), medivh->GetPositionY() + 14.0f * std::sin(o), medivh->GetPositionZ(), summon->GetAngle(medivh));
297 summon->GetMotionMaster()->MoveTargetedHome(true);
298 summon->SetReactState(REACT_DEFENSIVE);
299 }
300 }
301 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:55
float frand(float min, float max)
Definition Random.cpp:57
double rand_norm()
Definition Random.cpp:85
@ REACT_DEFENSIVE
Definition Unit.h:568
Creature *const me
Definition CreatureAI.h:71
Definition Creature.h:47
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:120
Position GetNearPosition(float dist, float angle)
Definition Object.cpp:2854
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2453
Definition Position.h:27
float GetAngle(Position const *pos) const
Definition Position.cpp:85
@ DATA_MEDIVH
Definition the_black_morass.h:36

References _instance, DATA_MEDIVH, frand(), Position::GetAngle(), InstanceScript::GetCreature(), WorldObject::GetNearPosition(), CreatureAI::me, rand_norm(), REACT_DEFENSIVE, WorldObject::SummonCreature(), and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Referenced by DoSelectSummon().

◆ JustSummoned()

void npc_time_rift::JustSummoned ( Creature *  creature)
inlineoverridevirtual

Reimplemented from CreatureAI.

280 {
281 if (creature->GetEntry() != NPC_AEONUS && _riftKeeperGUID.IsEmpty())
282 {
283 _riftKeeperGUID = creature->GetGUID();
284 }
285 }
bool IsEmpty() const
Definition ObjectGuid.h:165
uint32 GetEntry() const
Definition Object.h:123
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
ObjectGuid _riftKeeperGUID
Definition the_black_morass.cpp:409
@ NPC_AEONUS
Definition the_black_morass.h:70

References _riftKeeperGUID, Object::GetEntry(), Object::GetGUID(), ObjectGuid::IsEmpty(), and NPC_AEONUS.

◆ Reset()

void npc_time_rift::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

258 {
260
261 if (riftNumer < 6)
262 {
264 }
265 else if (riftNumer < 12)
266 {
268 }
269 else
270 {
272 }
273
274 waveMobIndex = 0;
275 events.ScheduleEvent(EVENT_SUMMON_AT_RIFT, 16s);
276 events.ScheduleEvent(EVENT_SUMMON_BOSS, 6s);
277 }
events
Definition boss_sartura.cpp:43
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
static std::vector< uint32 > firstWave
Definition the_black_morass.cpp:48
@ EVENT_SUMMON_BOSS
Definition the_black_morass.cpp:245
@ EVENT_SUMMON_AT_RIFT
Definition the_black_morass.cpp:243
static std::vector< uint32 > secondWave
Definition the_black_morass.cpp:49
static std::vector< uint32 > thirdWave
Definition the_black_morass.cpp:50
@ DATA_RIFT_NUMBER
Definition the_black_morass.h:40

References _instance, DATA_RIFT_NUMBER, EVENT_SUMMON_AT_RIFT, EVENT_SUMMON_BOSS, firstWave, ZoneScript::GetData(), secondWave, thirdWave, waveMobIndex, and waveMobs.

◆ SummonedCreatureDies()

void npc_time_rift::SummonedCreatureDies ( Creature *  creature,
Unit *   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

345 {
346 if (creature->GetGUID() == _riftKeeperGUID)
347 {
348 me->DespawnOrUnsummon(0ms);
349 }
350 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2216

References _riftKeeperGUID, Creature::DespawnOrUnsummon(), Object::GetGUID(), and CreatureAI::me.

◆ UpdateAI()

void npc_time_rift::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

353 {
354 events.Update(diff);
355 switch (events.ExecuteEvent())
356 {
359 {
361 events.ScheduleEvent(EVENT_SUMMON_AT_RIFT, 15s);
362 }
363 break;
365 {
366 int32 entry = 0;
368 {
369 case 6:
371 break;
372 case 12:
374 break;
375 case 18:
376 entry = NPC_AEONUS;
377 break;
378 default:
380 break;
381 }
382
383 Position pos = me->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
384
385 if (Creature* summon = me->SummonCreature(std::abs(entry), pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3 * MINUTE * IN_MILLISECONDS))
386 {
387 if (entry < 0)
388 {
389 summon->SetLootMode(0);
390 }
391
392 if (summon->GetEntry() != NPC_AEONUS)
393 {
394 me->CastSpell(summon, SPELL_RIFT_CHANNEL, false);
395 }
396
397 if (summon->IsAIEnabled)
398 {
399 summon->AI()->Talk(SAY_RIFT_MOB_SUMMONED);
400 }
401 }
402 }
403 }
404 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
constexpr auto MINUTE
Definition Common.h:47
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition CreatureAIImpl.h:25
std::int32_t int32
Definition Define.h:103
@ DONE
Definition InstanceScript.h:61
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
bool IsHeroic() const
Definition Map.h:303
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1372
Map * GetMap() const
Definition Object.h:637
void DoSelectSummon()
Definition the_black_morass.cpp:303
@ SAY_RIFT_MOB_SUMMONED
Definition the_black_morass.cpp:247
@ SPELL_RIFT_CHANNEL
Definition the_black_morass.h:90
@ NPC_INFINITE_TIMEREAVER
Definition the_black_morass.h:69
@ NPC_RIFT_KEEPER_WARLOCK
Definition the_black_morass.h:61
@ NPC_INFINITE_CHRONO_LORD
Definition the_black_morass.h:67
@ NPC_RIFT_LORD_2
Definition the_black_morass.h:64
@ NPC_RIFT_LORD
Definition the_black_morass.h:63
@ NPC_TEMPORUS
Definition the_black_morass.h:68
@ NPC_RIFT_KEEPER_MAGE
Definition the_black_morass.h:62
@ NPC_CHRONO_LORD_DEJA
Definition the_black_morass.h:66
@ DATA_TEMPORUS
Definition the_black_morass.h:32
@ DATA_CHRONO_LORD_DEJA
Definition the_black_morass.h:31
@ DATA_AEONUS
Definition the_black_morass.h:33

References _instance, Unit::CastSpell(), DATA_AEONUS, DATA_CHRONO_LORD_DEJA, DATA_RIFT_NUMBER, DATA_TEMPORUS, DONE, DoSelectSummon(), EVENT_SUMMON_AT_RIFT, EVENT_SUMMON_BOSS, InstanceScript::GetBossState(), InstanceScript::GetCreature(), ZoneScript::GetData(), WorldObject::GetMap(), WorldObject::GetNearPosition(), IN_MILLISECONDS, Map::IsHeroic(), CreatureAI::me, MINUTE, NPC_AEONUS, NPC_CHRONO_LORD_DEJA, NPC_INFINITE_CHRONO_LORD, NPC_INFINITE_TIMEREAVER, NPC_RIFT_KEEPER_MAGE, NPC_RIFT_KEEPER_WARLOCK, NPC_RIFT_LORD, NPC_RIFT_LORD_2, NPC_TEMPORUS, RAND(), rand_norm(), SAY_RIFT_MOB_SUMMONED, SPELL_RIFT_CHANNEL, WorldObject::SummonCreature(), and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Member Data Documentation

◆ _events

EventMap npc_time_rift::_events
private

◆ _instance

InstanceScript* npc_time_rift::_instance
private

◆ _riftKeeperGUID

ObjectGuid npc_time_rift::_riftKeeperGUID
private

◆ waveMobIndex

uint8 npc_time_rift::waveMobIndex
private

Referenced by DoSelectSummon(), and Reset().

◆ waveMobs

std::vector<uint32> npc_time_rift::waveMobs
private

Referenced by DoSelectSummon(), and Reset().


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