AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_heat::go_heatAI Struct Reference
Inheritance diagram for go_heat::go_heatAI:
GameObjectAI

Public Member Functions

 go_heatAI (GameObject *gameObject)
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from GameObjectAI
 GameObjectAI (GameObject *go)
 
virtual ~GameObjectAI ()
 
virtual void UpdateAI (uint32)
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual void SetGUID (ObjectGuid, int32)
 
virtual ObjectGuid GetGUID (int32) const
 
virtual bool GossipHello (Player *, bool)
 
virtual bool GossipSelect (Player *, uint32, uint32)
 
virtual bool GossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual bool QuestAccept (Player *, Quest const *)
 
virtual bool QuestReward (Player *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *)
 
virtual void Destroyed (Player *, uint32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void OnGameEvent (bool, uint16)
 
virtual void OnStateChanged (uint32, Unit *)
 
virtual void EventInform (uint32)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual void JustSummoned (Creature *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 

Private Attributes

uint32 timer
 

Additional Inherited Members

- Static Public Member Functions inherited from GameObjectAI
static int32 Permissible (GameObject const *go)
 
- Protected Attributes inherited from GameObjectAI
GameObject *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ go_heatAI()

go_heat::go_heatAI::go_heatAI ( GameObject gameObject)
inline
376 : GameObjectAI(gameObject),
377 timer { 0 }
378 { }
Definition: GameObjectAI.h:34
uint32 timer
Definition: go_scripts.cpp:402

Member Function Documentation

◆ UpdateAI()

void go_heat::go_heatAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from GameObjectAI.

381 {
382 timer += diff;
383 if (timer > 3000)
384 {
385 timer = 0;
386 std::list<Player*> players;
389 Cell::VisitWorldObjects(me, searcher, 0.3f);
390
391 if (players.size() > 0)
392 {
393 std::list<Player*>::iterator itr = players.begin();
394 std::advance(itr, urand(0, players.size() - 1));
395 if (Creature* trigger = me->SummonTrigger((*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), 0, 2000, true))
396 trigger->CastSpell(trigger, SPELL_HEAT);
397 }
398 }
399 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SPELL_HEAT
Definition: go_scripts.cpp:366
GameObject *const me
Definition: GameObjectAI.h:36
Definition: Creature.h:46
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2404
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:193
Definition: GridNotifiers.h:525

References GameObjectAI::me, SPELL_HEAT, WorldObject::SummonTrigger(), timer, urand(), and Cell::VisitWorldObjects().

Member Data Documentation

◆ timer

uint32 go_heat::go_heatAI::timer
private

Referenced by UpdateAI().