Okay ive just started learning CreatureAI. Followed guides etc on Sun++ Wiki.
I get these errors on compile.
Errors:
Source:Code:1>..\src\DiabloMountains\Wolvie.cpp(16) : error C2504: 'MoonScriptCreatureAI' : base class undefined 1>..\src\DiabloMountains\Wolvie.cpp(17) : error C2061: syntax error : identifier 'MoonScriptCreatureAI' 1>..\src\DiabloMountains\Wolvie.cpp(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>..\src\DiabloMountains\Wolvie.cpp(17) : warning C4183: 'MOONSCRIPT_FACTORY_FUNCTION': missing return type; assumed to be a member function returning 'int' 1>..\src\DiabloMountains\Wolvie.cpp(18) : error C2061: syntax error : identifier 'Creature' 1>..\src\DiabloMountains\Wolvie.cpp(18) : error C2065: 'pCreature' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(19) : error C2614: 'WolvieAI' : illegal member initialization: 'MoonScriptCreatureAI' is not a base or member 1>..\src\DiabloMountains\Wolvie.cpp(20) : error C2065: 'Target_Current' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(20) : error C3861: 'AddSpell': identifier not found 1>..\src\DiabloMountains\Wolvie.cpp(21) : error C2065: 'Target_Current' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(21) : error C3861: 'AddSpell': identifier not found 1>..\src\DiabloMountains\Wolvie.cpp(22) : error C2065: 'Target_Current' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(22) : error C3861: 'AddSpell': identifier not found 1>..\src\DiabloMountains\Wolvie.cpp(23) : error C2065: 'Target_RandomPlayer' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(23) : error C3861: 'AddSpell': identifier not found 1>..\src\DiabloMountains\Wolvie.cpp(28) : error C2065: 'Unit' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(28) : error C2065: 'pTarget' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(29) : error C2448: 'OnCombatStart' : function-style initializer appears to be a function definition 1>..\src\DiabloMountains\Wolvie.cpp(45) : error C2065: 'Unit' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(45) : error C2065: 'mTarget' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(46) : error C2448: 'OnTargetDied' : function-style initializer appears to be a function definition 1>..\src\DiabloMountains\Wolvie.cpp(63) : error C2065: 'Unit' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(63) : error C2065: 'mTarget' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(64) : error C2448: 'OnCombatStop' : function-style initializer appears to be a function definition 1>..\src\DiabloMountains\Wolvie.cpp(71) : error C2065: 'Unit' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(71) : error C2065: 'mKiller' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(72) : error C2448: 'OnDied' : function-style initializer appears to be a function definition 1>..\src\DiabloMountains\Wolvie.cpp(77) : error C2065: 'ScriptMgr' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(77) : error C2065: 'mgr' : undeclared identifier 1>..\src\DiabloMountains\Wolvie.cpp(78) : error C2448: 'SetupDiabloMountains' : function-style initializer appears to be a function definition
Code:/*Created by Performer of MMOwned and HypnoticWoW (www.hypnotic-wow.com). All Rights Reserved. */ #include "Base.h" #include "StdAfx.h" #include "Setup.h" ///////////////////////////////////////////////////// #define CN_WOLVIE_GUARD 600005 #define WOLVIE_GUARD_WHIRLWIND 41097 #define WOLVIE_GUARD_BLOODTHIRST 35949 #define WOLVIE_GUARD_ENRAGE 38664 #define WOLVIE_GUARD_INTERCEPT 61490 /////WOLVIE AI class WolvieAI : public CreatureAIScript { MOONSCRIPT_FACTORY_FUNCTION(WolvieAI, CreatureAIScript); WolvieAI(Creature *pCreature) : CreatureAIScript(pCreature) { AddSpell(WOLVIE_GUARD_WHIRLWIND, Target_Current, 15, 0, 15, 0, 10); //15 = chance % 0 = Instantcast 1 would be not instant 15 = cooldown seconds 0, 30 = range AddSpell(WOLVIE_GUARD_BLOODTHIRST, Target_Current, 8, 0, 10, 3); AddSpell(WOLVIE_GUARD_ENRAGE, Target_Current, 100, 0, 1, 0, 10); AddSpell(WOLVIE_GUARD_INTERCEPT, Target_RandomPlayer, 10, 0, 20, 25); } }; void OnCombatStart(Unit *pTarget) { int RandomSpeach = rand()%3; switch (RandomSpeach) { case 0: _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You picked the wrong guy!"); break; case 1: _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "I'll carve the meat from your bones!"); break; case 2: _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Prepare to taste my steel!"); break; } } void OnTargetDied(Unit* mTarget) { int RandomSpeach = rand()%3; switch (RandomSpeach) { case 0: _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You failed!"); break; case 1: _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Did you taste the steel!?... Did you??"); break; case 2: _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Now for your teammates!"); break; } } void OnCombatStop(Unit *mTarget) { _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "We will not be hearing anything out of them!" _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL); _unit->GetAIInterface()->SetAIState(STATE_IDLE); RemoveAIUpdateEvent(); } void OnDied(Unit * mKiller) { _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "No..No...My Blades Have Failed Me!!!"); RemoveAIUpdateEvent(); } void SetupWolvie(ScriptMgr * mgr) { mgr->register_creature_script(CN_WOLVIE_GUARD, &WolvieAI::Create); }