TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SmartGameObjectAI Class Reference

#include <SmartAI.h>

Public Member Functions

 SmartGameObjectAI (GameObject *g)
 
 ~SmartGameObjectAI ()
 
void UpdateAI (uint32 diff) override
 
void InitializeAI () override
 
void Reset () override
 
SmartScriptGetScript ()
 
bool GossipHello (Player *player) override
 
bool GossipSelect (Player *player, uint32 sender, uint32 action) override
 
bool GossipSelectCode (Player *, uint32, uint32, const char *) override
 
bool QuestAccept (Player *player, Quest const *quest) override
 
bool QuestReward (Player *player, Quest const *quest, uint32 opt) override
 
void Destroyed (Player *player, uint32 eventId) override
 
void SetData (uint32 id, uint32 value) override
 
void SetScript9 (SmartScriptHolder &e, uint32 entry, Unit *invoker)
 
void OnGameEvent (bool start, uint16 eventId) override
 
void OnStateChanged (uint32 state, Unit *unit) override
 
void EventInform (uint32 eventId) override
 
- Public Member Functions inherited from GameObjectAI
 GameObjectAI (GameObject *g)
 
virtual ~GameObjectAI ()
 
virtual void DoAction (int32)
 
virtual void SetGUID (uint64, int32)
 
virtual uint64 GetGUID (int32) const
 
virtual uint32 GetDialogStatus (Player *)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint64 GetData64 (uint32) const
 

Static Public Member Functions

static int Permissible (const GameObject *g)
 
- Static Public Member Functions inherited from GameObjectAI
static int Permissible (GameObject const *go)
 

Private Attributes

SmartScript mScript
 

Additional Inherited Members

- Protected Attributes inherited from GameObjectAI
GameObject *const go
 

Constructor & Destructor Documentation

SmartGameObjectAI::SmartGameObjectAI ( GameObject g)
inline
236 : GameObjectAI(g) { }
GameObjectAI(GameObject *g)
Definition: GameObjectAI.h:34
SmartGameObjectAI::~SmartGameObjectAI ( )
inline
237 { }

Member Function Documentation

void SmartGameObjectAI::Destroyed ( Player player,
uint32  eventId 
)
overridevirtual

Reimplemented from GameObjectAI.

876 {
877  GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, NULL, go);
878 }
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:110
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
GameObject *const go
Definition: GameObjectAI.h:32

+ Here is the call graph for this function:

void SmartGameObjectAI::EventInform ( uint32  eventId)
overridevirtual

Reimplemented from GameObjectAI.

903 {
905 }
Definition: SmartScriptMgr.h:175
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83

+ Here is the call graph for this function:

SmartScript* SmartGameObjectAI::GetScript ( )
inline
242 { return &mScript; }
SmartScript mScript
Definition: SmartAI.h:258

+ Here is the caller graph for this function:

bool SmartGameObjectAI::GossipHello ( Player player)
overridevirtual

Reimplemented from GameObjectAI.

841 {
842  TC_LOG_DEBUG("scripts.ai", "SmartGameObjectAI::GossipHello");
843  GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0, 0, false, NULL, go);
844  return false;
845 }
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: SmartScriptMgr.h:168
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
GameObject *const go
Definition: GameObjectAI.h:32

+ Here is the call graph for this function:

bool SmartGameObjectAI::GossipSelect ( Player player,
uint32  sender,
uint32  action 
)
overridevirtual

Reimplemented from GameObjectAI.

849 {
850  GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action, false, NULL, go);
851  return false;
852 }
Definition: SmartScriptMgr.h:166
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
GameObject *const go
Definition: GameObjectAI.h:32

+ Here is the call graph for this function:

bool SmartGameObjectAI::GossipSelectCode ( Player ,
uint32  ,
uint32  ,
const char *   
)
overridevirtual

Reimplemented from GameObjectAI.

856 {
857  return false;
858 }
void SmartGameObjectAI::InitializeAI ( )
overridevirtual

Reimplemented from GameObjectAI.

828 {
831  //Reset();
832 }
Definition: SmartScriptMgr.h:115
SmartScript * GetScript()
Definition: SmartAI.h:242
void OnInitialize(WorldObject *obj, AreaTriggerEntry const *at=NULL)
Definition: SmartScript.cpp:3555
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
GameObject *const go
Definition: GameObjectAI.h:32

+ Here is the call graph for this function:

void SmartGameObjectAI::OnGameEvent ( bool  start,
uint16  eventId 
)
overridevirtual

Reimplemented from GameObjectAI.

893 {
895 }
Definition: SmartScriptMgr.h:173
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:172
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83

+ Here is the call graph for this function:

void SmartGameObjectAI::OnStateChanged ( uint32  state,
Unit unit 
)
overridevirtual

Reimplemented from GameObjectAI.

898 {
900 }
Definition: SmartScriptMgr.h:174
SmartScript * GetScript()
Definition: SmartAI.h:242
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83

+ Here is the call graph for this function:

int SmartGameObjectAI::Permissible ( const GameObject g)
static
816 {
817  if (g->GetAIName() == "SmartGameObjectAI")
818  return PERMIT_BASE_SPECIAL;
819  return PERMIT_BASE_NO;
820 }
Definition: CreatureAI.h:207
std::string GetAIName() const
Definition: GameObject.cpp:90
Definition: CreatureAI.h:212

+ Here is the call graph for this function:

bool SmartGameObjectAI::QuestAccept ( Player player,
Quest const quest 
)
overridevirtual

Reimplemented from GameObjectAI.

862 {
863  GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, NULL, go);
864  return false;
865 }
Definition: SmartScriptMgr.h:123
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
GameObject *const go
Definition: GameObjectAI.h:32

+ Here is the call graph for this function:

bool SmartGameObjectAI::QuestReward ( Player player,
Quest const quest,
uint32  opt 
)
overridevirtual

Reimplemented from GameObjectAI.

869 {
870  GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, NULL, go);
871  return false;
872 }
Definition: SmartScriptMgr.h:124
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
GameObject *const go
Definition: GameObjectAI.h:32

+ Here is the call graph for this function:

void SmartGameObjectAI::Reset ( )
overridevirtual

Reimplemented from GameObjectAI.

835 {
836  GetScript()->OnReset();
837 }
SmartScript * GetScript()
Definition: SmartAI.h:242
void OnReset()
Definition: SmartScript.cpp:66

+ Here is the call graph for this function:

void SmartGameObjectAI::SetData ( uint32  id,
uint32  value 
)
overridevirtual

Reimplemented from GameObjectAI.

881 {
883 }
SmartScript * GetScript()
Definition: SmartAI.h:242
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:142
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

void SmartGameObjectAI::SetScript9 ( SmartScriptHolder e,
uint32  entry,
Unit invoker 
)
886 {
887  if (invoker)
888  GetScript()->mLastInvoker = invoker->GetGUID();
889  GetScript()->SetScript9(e, entry);
890 }
SmartScript * GetScript()
Definition: SmartAI.h:242
ObjectGuid mLastInvoker
Definition: SmartScript.h:236
ObjectGuid const & GetGUID() const
Definition: Object.h:105
void SetScript9(SmartScriptHolder &e, uint32 entry)
Definition: SmartScript.cpp:3702

+ Here is the call graph for this function:

void SmartGameObjectAI::UpdateAI ( uint32  diff)
overridevirtual

Reimplemented from GameObjectAI.

823 {
824  GetScript()->OnUpdate(diff);
825 }
void OnUpdate(const uint32 diff)
Definition: SmartScript.cpp:3441
SmartScript * GetScript()
Definition: SmartAI.h:242

+ Here is the call graph for this function:

Member Data Documentation

SmartScript SmartGameObjectAI::mScript
private

The documentation for this class was generated from the following files: