AzeorthCore 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
 
void Start ()
 
void CheckAction (uint8 a, ObjectGuid guid)
 
void SpellHit (Unit *caster, SpellInfo const *spellInfo) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32) override
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 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 EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
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
 
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 *)
 
- 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
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectTargetMethod targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
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)
 
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)
 
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)
 
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
 
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
318: 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
350 {
351 if (guid != playerGUID)
352 return;
353
354 if (a == expectedaction)
355 {
356 currentstep++;
357
359 th->HandleEmoteCommand(EMOTE_ONESHOT_CHEER_NO_SHEATHE);
360
362
363 if (currentstep >= stepcount)
364 {
366 success = true;
367 timer = 3000;
368 }
369 else
370 {
371 expectedaction = 0;
372 timer = 3000;
373 }
374 }
375 else
376 {
378 Reset();
379 }
380 }
@ SAY_MANUS_FAILED
Definition: zone_sholazar_basin.cpp:291
@ SAY_MANUS_WELL_DONE
Definition: zone_sholazar_basin.cpp:290
@ EMOTE_ONESHOT_CHEER_NO_SHEATHE
Definition: SharedDefines.h:1918
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:58
Creature *const me
Definition: CreatureAI.h:72
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:134
Creature * GetManus()
Definition: zone_sholazar_basin.cpp:320
uint8 currentstep
Definition: zone_sholazar_basin.cpp:314
ObjectGuid playerGUID
Definition: zone_sholazar_basin.cpp:309
uint8 expectedaction
Definition: zone_sholazar_basin.cpp:315
bool success
Definition: zone_sholazar_basin.cpp:308
void Reset() override
Definition: zone_sholazar_basin.cpp:322
int32 timer
Definition: zone_sholazar_basin.cpp:312
uint8 stepcount
Definition: zone_sholazar_basin.cpp:313
ObjectGuid thunderbrewGUID
Definition: zone_sholazar_basin.cpp:310

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 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from UnitAI.

337 {
338 damage = 0;
339 }

◆ 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.

323 {
324 running = false;
325 success = false;
328 tensecstimer = 0;
329 timer = 0;
330 stepcount = 0;
331 currentstep = 0;
332 expectedaction = 0;
333 playeraction = 0;
334 }
void Clear()
Definition: ObjectGuid.h:140
bool running
Definition: zone_sholazar_basin.cpp:307
int32 tensecstimer
Definition: zone_sholazar_basin.cpp:311
uint8 playeraction
Definition: zone_sholazar_basin.cpp:316

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.

383 {
384 if (running)
385 {
386 uint8 a = 0;
387 switch (spellInfo->Id)
388 {
389 case 51931:
390 a = 4;
391 break;
392 case 51932:
393 a = 3;
394 break;
395 case 51933:
396 a = 5;
397 break;
398 }
399
400 CheckAction(a, caster->GetGUID());
401 }
402 }
std::uint8_t uint8
Definition: Define.h:110
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
void CheckAction(uint8 a, ObjectGuid guid)
Definition: zone_sholazar_basin.cpp:349

References CheckAction(), and running.

◆ Start()

void npc_still_at_it_trigger::npc_still_at_it_triggerAI::Start ( )
inline
342 {
343 timer = 5000;
344 running = true;
345 stepcount = urand(5, 10);
347 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SAY_MANUS_START
Definition: zone_sholazar_basin.cpp:284

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  diff)
inlineoverridevirtual

Reimplemented from NullCreatureAI.

405 {
406 if (running)
407 {
408 if (timer)
409 {
410 timer -= diff;
411 if( timer < 0 )
412 timer = 0;
413 }
414 else if (success)
415 {
417 me->SummonGameObject(190643, 5546.55f, 5768.0f, -78.03f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0);
418 Reset();
419 }
420 else if (expectedaction != 0) // didn't make it in 10 seconds
421 {
423 Reset();
424 }
425 else // it's time to rand next move
426 {
427 expectedaction = urand(1, 5);
428 switch (expectedaction)
429 {
430 case 1:
432 break;
433 case 2:
435 break;
436 case 3:
438 break;
439 case 4:
441 break;
442 case 5:
444 break;
445 }
446 timer = 10000;
447 }
448 }
449 }
@ SAY_MANUS_PRESSUE
Definition: zone_sholazar_basin.cpp:288
@ SAY_MANUS_HEAT
Definition: zone_sholazar_basin.cpp:289
@ SAY_MANUS_PAPAYA
Definition: zone_sholazar_basin.cpp:286
@ SAY_MANUS_END
Definition: zone_sholazar_basin.cpp:292
@ SAY_MANUS_ORANGE
Definition: zone_sholazar_basin.cpp:285
@ SAY_MANUS_BANANA
Definition: zone_sholazar_basin.cpp:287
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:2317

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().