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

Public Member Functions

 npc_still_at_it_triggerAI (Creature *pCreature)
 
CreatureGetManus ()
 
void Reset () override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void Start ()
 
void CheckAction (uint8 a, ObjectGuid guid)
 
void SpellHit (Unit *caster, SpellInfo const *spellInfo) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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() More...
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed. More...
 
- 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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
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 AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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
 

Public Attributes

bool running
 
bool success
 
ObjectGuid playerGUID
 
ObjectGuid thunderbrewGUID
 
int32 tensecstimer
 
int32 timer
 
uint8 stepcount
 
uint8 currentstep
 
uint8 expectedaction
 
uint8 playeraction
 

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)
 
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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_still_at_it_triggerAI()

npc_still_at_it_trigger::npc_still_at_it_triggerAI::npc_still_at_it_triggerAI ( Creature pCreature)
inline
310: NullCreatureAI(pCreature) {}
Definition: PassiveAI.h:53

Member Function Documentation

◆ CheckAction()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::CheckAction ( uint8  a,
ObjectGuid  guid 
)
inline
342 {
343 if (guid != playerGUID)
344 return;
345
346 if (a == expectedaction)
347 {
348 currentstep++;
349
351 th->HandleEmoteCommand(EMOTE_ONESHOT_CHEER_NO_SHEATHE);
352
354
355 if (currentstep >= stepcount)
356 {
358 success = true;
359 timer = 3000;
360 }
361 else
362 {
363 expectedaction = 0;
364 timer = 3000;
365 }
366 }
367 else
368 {
370 Reset();
371 }
372 }
@ SAY_MANUS_FAILED
Definition: zone_sholazar_basin.cpp:283
@ SAY_MANUS_WELL_DONE
Definition: zone_sholazar_basin.cpp:282
@ EMOTE_ONESHOT_CHEER_NO_SHEATHE
Definition: SharedDefines.h:1946
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
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.
Definition: CreatureAI.cpp:50
Creature *const me
Definition: CreatureAI.h:73
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:143
Creature * GetManus()
Definition: zone_sholazar_basin.cpp:312
uint8 currentstep
Definition: zone_sholazar_basin.cpp:306
ObjectGuid playerGUID
Definition: zone_sholazar_basin.cpp:301
uint8 expectedaction
Definition: zone_sholazar_basin.cpp:307
bool success
Definition: zone_sholazar_basin.cpp:300
void Reset() override
Definition: zone_sholazar_basin.cpp:314
int32 timer
Definition: zone_sholazar_basin.cpp:304
uint8 stepcount
Definition: zone_sholazar_basin.cpp:305
ObjectGuid thunderbrewGUID
Definition: zone_sholazar_basin.cpp:302

References Creature::AI(), currentstep, EMOTE_ONESHOT_CHEER_NO_SHEATHE, expectedaction, ObjectAccessor::GetCreature(), GetManus(), CreatureAI::me, playerGUID, Reset(), SAY_MANUS_FAILED, SAY_MANUS_WELL_DONE, stepcount, success, CreatureAI::Talk(), thunderbrewGUID, and timer.

Referenced by SpellHit().

◆ DamageTaken()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

329 {
330 damage = 0;
331 }

◆ GetManus()

Creature * npc_still_at_it_trigger::npc_still_at_it_triggerAI::GetManus ( )
inline

◆ Reset()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

315 {
316 running = false;
317 success = false;
320 tensecstimer = 0;
321 timer = 0;
322 stepcount = 0;
323 currentstep = 0;
324 expectedaction = 0;
325 playeraction = 0;
326 }
void Clear()
Definition: ObjectGuid.h:138
bool running
Definition: zone_sholazar_basin.cpp:299
int32 tensecstimer
Definition: zone_sholazar_basin.cpp:303
uint8 playeraction
Definition: zone_sholazar_basin.cpp:308

References ObjectGuid::Clear(), currentstep, expectedaction, playeraction, playerGUID, running, stepcount, success, tensecstimer, thunderbrewGUID, and timer.

Referenced by CheckAction(), and UpdateAI().

◆ SpellHit()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::SpellHit ( Unit caster,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

375 {
376 if (running)
377 {
378 uint8 a = 0;
379 switch (spellInfo->Id)
380 {
381 case 51931:
382 a = 4;
383 break;
384 case 51932:
385 a = 3;
386 break;
387 case 51933:
388 a = 5;
389 break;
390 }
391
392 CheckAction(a, caster->GetGUID());
393 }
394 }
std::uint8_t uint8
Definition: Define.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void CheckAction(uint8 a, ObjectGuid guid)
Definition: zone_sholazar_basin.cpp:341

References CheckAction(), and running.

◆ Start()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::Start ( )
inline
334 {
335 timer = 5000;
336 running = true;
337 stepcount = urand(5, 10);
339 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SAY_MANUS_START
Definition: zone_sholazar_basin.cpp:276

References Creature::AI(), GetManus(), running, SAY_MANUS_START, stepcount, CreatureAI::Talk(), timer, and urand().

◆ UpdateAI()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from NullCreatureAI.

397 {
398 if (running)
399 {
400 if (timer)
401 {
402 timer -= diff;
403 if (timer < 0)
404 timer = 0;
405 }
406 else if (success)
407 {
409 me->SummonGameObject(190643, 5546.55f, 5768.0f, -78.03f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
410 Reset();
411 }
412 else if (expectedaction != 0) // didn't make it in 10 seconds
413 {
415 Reset();
416 }
417 else // it's time to rand next move
418 {
419 expectedaction = urand(1, 5);
420 switch (expectedaction)
421 {
422 case 1:
424 break;
425 case 2:
427 break;
428 case 3:
430 break;
431 case 4:
433 break;
434 case 5:
436 break;
437 }
438 timer = 10000;
439 }
440 }
441 }
@ SAY_MANUS_PRESSUE
Definition: zone_sholazar_basin.cpp:280
@ SAY_MANUS_HEAT
Definition: zone_sholazar_basin.cpp:281
@ SAY_MANUS_PAPAYA
Definition: zone_sholazar_basin.cpp:278
@ SAY_MANUS_END
Definition: zone_sholazar_basin.cpp:284
@ SAY_MANUS_ORANGE
Definition: zone_sholazar_basin.cpp:277
@ SAY_MANUS_BANANA
Definition: zone_sholazar_basin.cpp:279
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2369

References Creature::AI(), expectedaction, GetManus(), CreatureAI::me, Reset(), running, SAY_MANUS_BANANA, SAY_MANUS_END, SAY_MANUS_FAILED, SAY_MANUS_HEAT, SAY_MANUS_ORANGE, SAY_MANUS_PAPAYA, SAY_MANUS_PRESSUE, success, WorldObject::SummonGameObject(), CreatureAI::Talk(), timer, and urand().

Member Data Documentation

◆ currentstep

uint8 npc_still_at_it_trigger::npc_still_at_it_triggerAI::currentstep

Referenced by CheckAction(), and Reset().

◆ expectedaction

uint8 npc_still_at_it_trigger::npc_still_at_it_triggerAI::expectedaction

Referenced by CheckAction(), Reset(), and UpdateAI().

◆ playeraction

uint8 npc_still_at_it_trigger::npc_still_at_it_triggerAI::playeraction

Referenced by Reset().

◆ playerGUID

ObjectGuid npc_still_at_it_trigger::npc_still_at_it_triggerAI::playerGUID

Referenced by CheckAction(), and Reset().

◆ running

bool npc_still_at_it_trigger::npc_still_at_it_triggerAI::running

Referenced by Reset(), SpellHit(), Start(), and UpdateAI().

◆ stepcount

uint8 npc_still_at_it_trigger::npc_still_at_it_triggerAI::stepcount

Referenced by CheckAction(), Reset(), and Start().

◆ success

bool npc_still_at_it_trigger::npc_still_at_it_triggerAI::success

Referenced by CheckAction(), Reset(), and UpdateAI().

◆ tensecstimer

int32 npc_still_at_it_trigger::npc_still_at_it_triggerAI::tensecstimer

Referenced by Reset().

◆ thunderbrewGUID

ObjectGuid npc_still_at_it_trigger::npc_still_at_it_triggerAI::thunderbrewGUID

Referenced by CheckAction(), GetManus(), and Reset().

◆ timer

int32 npc_still_at_it_trigger::npc_still_at_it_triggerAI::timer

Referenced by CheckAction(), Reset(), Start(), and UpdateAI().