Core/Scripts/SmartAI: add test for TextMgr (temp)

Core/CreatureTextMgr: added basic chat function, you can now experiment with it if bored

--HG--
branch : trunk
This commit is contained in:
Rat
2010-09-25 23:52:17 +02:00
parent a1358880c2
commit 9ea9effadd
4 changed files with 158 additions and 4 deletions
+8 -1
View File
@@ -25,15 +25,17 @@
#include "ObjectDefines.h"
#include "GridDefines.h"
#include "ConditionMgr.h"
#include "CreatureTextMgr.h"
void SmartAIMgr::LoadSmartAIFromDB()
{
//Drop Existing SmartAI List
}
SmartAI::SmartAI(Creature *c) : CreatureAI(c), me(c)
SmartAI::SmartAI(Creature *c) : CreatureAI(c)
{
// copy script to local (pretection for table reload)
mTestTimer = 0;
}
int SmartAI::Permissible(const Creature *creature)
@@ -45,6 +47,11 @@ int SmartAI::Permissible(const Creature *creature)
void SmartAI::UpdateAI(const uint32 diff)
{
if (mTestTimer < diff)
{
mTestTimer = 60000;
sCreatureTextMgr.SendChat(me,"CHAT_TYPE_SAY", CHAT_TYPE_SAY);
} else mTestTimer -= diff;
}
void SmartAI::JustRespawned()
+3 -3
View File
@@ -50,6 +50,8 @@ void setinhabittype
event change flags
need a local SendChat()
*/
//temp copied from eai, will be modded
@@ -247,9 +249,6 @@ class SmartAIMgr
class SmartAI : public CreatureAI
{
protected:
Creature * const me;
public:
~SmartAI(){};
explicit SmartAI(Creature *c);
@@ -363,6 +362,7 @@ class SmartAI : public CreatureAI
void SetMovePathEndAction(SMARTAI_ACTION action = SMART_ACTION_FORCE_DESPAWN);
private:
uint32 mTestTimer;
};
#define sSmartAIMgr (*ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance())