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 *)
 

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
399 : GameObjectAI(gameObject),
400 timer { 0 }
401 { }
Definition: GameObjectAI.h:34
uint32 timer
Definition: go_scripts.cpp:425

Member Function Documentation

◆ UpdateAI()

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

Reimplemented from GameObjectAI.

404 {
405 timer += diff;
406 if (timer > 3000)
407 {
408 timer = 0;
409 std::list<Player*> players;
412 Cell::VisitWorldObjects(me, searcher, 0.3f);
413
414 if (players.size() > 0)
415 {
416 std::list<Player*>::iterator itr = players.begin();
417 std::advance(itr, urand(0, players.size() - 1));
418 if (Creature* trigger = me->SummonTrigger((*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), 0, 2000, true))
419 trigger->CastSpell(trigger, SPELL_HEAT);
420 }
421 }
422 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SPELL_HEAT
Definition: go_scripts.cpp:389
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:2367
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:193
Definition: GridNotifiers.h:522

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