Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define TESTSAY -1000009
- #define TESTSAY2 -1000010
- #define TESTSAY3 -1000011
- #define TESTSAY4 -1000012
- struct MANGOS_DLL_DECL beispielAI : public ScriptedAI
- {
- beispielAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
- bool HasSaid;
- uint32 m_uiSay_Timer;
- void Reset()
- {
- HasSaid=false;
- }
- void MoveInLineOfSight(Unit *pWho)
- {
- if(pWho && !HasSaid)
- {
- switch(urand(0, 3))
- {
- case 0: DoScriptText(TESTSAY, m_creature, 0);
- HasSaid=true;
- m_uiSay_Timer = 5000; break;
- case 1: DoScriptText(TESTSAY2, m_creature, 0);
- HasSaid=true;
- m_uiSay_Timer = 5000; break;
- case 2: DoScriptText(TESTSAY3, m_creature, 0);
- HasSaid=true;
- m_uiSay_Timer = 5000; break;
- case 3: DoScriptText(TESTSAY4, m_creature, 0);
- HasSaid=true;
- m_uiSay_Timer = 5000; break;
- }
- }
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if (HasSaid && m_uiSay_Timer < uiDiff)
- {
- HasSaid=false;
- }
- else
- m_uiSay_Timer -= uiDiff;
- }
- };
- CreatureAI* GetAI_beispiel_code(Creature* pCreature)
- {
- return new beispielAI(pCreature);
- }
Add Comment
Please, Sign In to add comment