Advertisement
Kaev

GameObjectScript GameObjectAI Template

Jun 9th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include "GameObjectAI.h"
  2.  
  3. /*
  4. GameObjectScript GameObjectAI Template by Kaev
  5. Made for MMONerds.com, Modcraft.io and MCore.cc
  6. */
  7.  
  8. class gameObjectAITemplate : public GameObjectScript
  9. {
  10. public:
  11.     gameObjectAITemplate() : GameObjectScript("gameObjectAITemplate") { } // GameObjectScript("gameObjectAITemplate") = Name of database entry
  12.  
  13.     struct structGameObjectAITemplate : public GameObjectAI
  14.     {
  15.         structGameObjectAITemplate(GameObject* go) : GameObjectAI(go) { }
  16.  
  17.         void Reset() OVERRIDE // Called on reset (e.g. OnSpawn) override
  18.         {
  19.  
  20.         }
  21.  
  22.         void UpdateAI(uint32 diff) override // Called every tick, mostly used for timers
  23.         {
  24.  
  25.         }
  26.     };
  27.  
  28.     GameObjectAI* GetAI(GameObject* go) const override
  29.     {
  30.         return new structGameObjectAITemplate(go);
  31.     }
  32. };
  33.  
  34. void AddSC_gameObjectAITemplate // Add this to the ScriptLoader
  35. {
  36.     new gameObjectAITemplate();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement