mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripts: Corrected previous commit and added a few AI hooks to GameObjectAI
This commit is contained in:
@@ -33,21 +33,24 @@ class GameObjectAI
|
||||
explicit GameObjectAI(GameObject* g) : go(g) {}
|
||||
virtual ~GameObjectAI() {}
|
||||
|
||||
virtual void UpdateAI(const uint32 /*diff*/) {}
|
||||
virtual void UpdateAI(uint32 /*diff*/) {}
|
||||
|
||||
virtual void InitializeAI() { Reset(); }
|
||||
|
||||
virtual void Reset() {};
|
||||
|
||||
static int Permissible(const GameObject* go);
|
||||
static int Permissible(GameObject const* go);
|
||||
|
||||
virtual bool GossipHello(Player* /*player*/) {return false;}
|
||||
virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) {return false;}
|
||||
virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) {return false;}
|
||||
virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) {return false;}
|
||||
virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) {return false;}
|
||||
virtual uint32 GetDialogStatus(Player* /*player*/) {return 100;}
|
||||
virtual bool GossipHello(Player* /*player*/) { return false; }
|
||||
virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) { return false; }
|
||||
virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) { return false; }
|
||||
virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) { return false; }
|
||||
virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
|
||||
virtual uint32 GetDialogStatus(Player* /*player*/) { return 100; }
|
||||
virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) {}
|
||||
virtual uint32 GetData(uint32 /*id*/) { return 0; }
|
||||
virtual void SetData64(uint32 /*id*/, uint64 /*value*/) {}
|
||||
virtual uint64 GetData64(uint32 /*id*/) { return 0; }
|
||||
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
|
||||
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {}
|
||||
virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { }
|
||||
@@ -58,8 +61,8 @@ class NullGameObjectAI : public GameObjectAI
|
||||
public:
|
||||
explicit NullGameObjectAI(GameObject* g);
|
||||
|
||||
void UpdateAI(const uint32 /*diff*/) {}
|
||||
void UpdateAI(uint32 /*diff*/) {}
|
||||
|
||||
static int Permissible(const GameObject* /*go*/) { return PERMIT_BASE_IDLE; }
|
||||
static int Permissible(GameObject const* /*go*/) { return PERMIT_BASE_IDLE; }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -854,7 +854,7 @@ int SmartGameObjectAI::Permissible(const GameObject* g)
|
||||
return PERMIT_BASE_NO;
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::UpdateAI(const uint32 diff)
|
||||
void SmartGameObjectAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
GetScript()->OnUpdate(diff);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {}
|
||||
~SmartGameObjectAI() {}
|
||||
|
||||
void UpdateAI(const uint32 diff);
|
||||
void UpdateAI(uint32 diff);
|
||||
void InitializeAI();
|
||||
void Reset();
|
||||
SmartScript* GetScript() { return &mScript; }
|
||||
|
||||
@@ -959,7 +959,7 @@ GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go)
|
||||
ASSERT(go);
|
||||
|
||||
GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL);
|
||||
tmpscript->GetAI(go);
|
||||
return tmpscript->GetAI(go);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
|
||||
Reference in New Issue
Block a user