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 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=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
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 AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
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 ()
 
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)
 
- 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, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (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 JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
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)
 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< uint32waveMobs
 
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 AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (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
 
- 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
262 : NullCreatureAI(creature)
263 {
264 _instance = creature->GetInstanceScript();
265 }
Definition PassiveAI.h:53
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
InstanceScript * _instance
Definition the_black_morass.cpp:418

References _instance, and WorldObject::GetInstanceScript().

Member Function Documentation

◆ DoSelectSummon()

void npc_time_rift::DoSelectSummon ( )
inline
314 {
316 if (entry == NPC_INFINITE_WHELP)
317 {
318 DoSummonAtRift(entry);
319 DoSummonAtRift(entry);
320 DoSummonAtRift(entry);
321 }
322 else
323 {
324 if (urand(0, 1))
325 {
326 switch (entry)
327 {
330 break;
333 break;
336 break;
339 break;
340 default:
341 break;
342 }
343 }
344
345 DoSummonAtRift(entry);
346 }
347
348 if (++waveMobIndex >= waveMobs.size())
349 {
350 waveMobIndex = 0;
351 }
352 }
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:297
std::vector< uint32 > waveMobs
Definition the_black_morass.cpp:420
uint8 waveMobIndex
Definition the_black_morass.cpp:421
@ 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
298 {
299 Position pos = me->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
300
301 if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 150000))
302 {
304 {
305 float o = medivh->GetAngle(summon) + frand(-1.0f, 1.0f);
306 summon->SetHomePosition(medivh->GetPositionX() + 14.0f * cos(o), medivh->GetPositionY() + 14.0f * std::sin(o), medivh->GetPositionZ(), summon->GetAngle(medivh));
307 summon->GetMotionMaster()->MoveTargetedHome(true);
308 summon->SetReactState(REACT_DEFENSIVE);
309 }
310 }
311 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:51
float frand(float min, float max)
Definition Random.cpp:57
double rand_norm()
Definition Random.cpp:77
@ REACT_DEFENSIVE
Definition Unit.h:549
Creature *const me
Definition CreatureAI.h:72
Definition Creature.h:43
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2368
Position GetNearPosition(float dist, float angle)
Definition Object.cpp:2741
Definition Position.h:27
float GetAngle(const Position *pos) const
Definition Position.cpp:78
@ 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.

290 {
291 if (creature->GetEntry() != NPC_AEONUS && _riftKeeperGUID.IsEmpty())
292 {
293 _riftKeeperGUID = creature->GetGUID();
294 }
295 }
bool IsEmpty() const
Definition ObjectGuid.h:161
uint32 GetEntry() const
Definition Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
ObjectGuid _riftKeeperGUID
Definition the_black_morass.cpp:419
@ 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.

268 {
270
271 if (riftNumer < 6)
272 {
274 }
275 else if (riftNumer < 12)
276 {
278 }
279 else
280 {
282 }
283
284 waveMobIndex = 0;
285 events.ScheduleEvent(EVENT_SUMMON_AT_RIFT, 16s);
286 events.ScheduleEvent(EVENT_SUMMON_BOSS, 6s);
287 }
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:255
@ EVENT_SUMMON_AT_RIFT
Definition the_black_morass.cpp:253
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.

355 {
356 if (creature->GetGUID() == _riftKeeperGUID)
357 {
359 }
360 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2183

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.

363 {
364 events.Update(diff);
365 switch (events.ExecuteEvent())
366 {
369 {
371 events.ScheduleEvent(EVENT_SUMMON_AT_RIFT, 15000);
372 }
373 break;
375 {
376 int32 entry = 0;
378 {
379 case 6:
381 break;
382 case 12:
384 break;
385 case 18:
386 entry = NPC_AEONUS;
387 break;
388 default:
390 break;
391 }
392
393 Position pos = me->GetNearPosition(10.0f, 2 * M_PI * rand_norm());
394
395 if (Creature* summon = me->SummonCreature(std::abs(entry), pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3 * MINUTE * IN_MILLISECONDS))
396 {
397 if (entry < 0)
398 {
399 summon->SetLootMode(0);
400 }
401
402 if (summon->GetEntry() != NPC_AEONUS)
403 {
404 me->CastSpell(summon, SPELL_RIFT_CHANNEL, false);
405 }
406
407 if (summon->IsAIEnabled)
408 {
409 summon->AI()->Talk(SAY_RIFT_MOB_SUMMONED);
410 }
411 }
412 }
413 }
414 }
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:242
bool IsHeroic() const
Definition Map.h:299
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:1178
Map * GetMap() const
Definition Object.h:536
void DoSelectSummon()
Definition the_black_morass.cpp:313
@ SAY_RIFT_MOB_SUMMONED
Definition the_black_morass.cpp:257
@ 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: