hello, anyone know a c++ guide on how to add spells to a mob when he enters combat? i tried this so far, but no luck.
Code:
#include "StdAfx.h"
#include "Setup.h"
#define guardgnome 1211
#define Pyroblast 27132
class guardgnome: public CreatureAIScript
{
spells[1].info = sSpellStore.LookupEntry(Pyroblast);
spells[1].instant = true;
spells[1].cooldown = -1;
spells[1].perctrigger = 0.0f;
spells[1].attackstoptimer = 1000;
void OnCombatStart(Unit* mTarget)
{
RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
_unit->CastSpell(target, spells[1].info, spells[1].instant);
_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "u arent suppose to be here");
}
}
void Setupguardgnome(ScriptMgr * mgr)
void Setupguardgnome(ScriptMgr * mgr)
{
GossipScript * gs = (GossipScript*) new guardgnome();
mgr->register_gossip_script(1211, gs);
}
this is the error
Code:
1>..\src\GossipScripts\guardgnome.cpp(9) : error C2332: 'class' : missing tag name
1>..\src\GossipScripts\guardgnome.cpp(9) : error C2011: '<unnamed-tag>' : 'enum' type redefinition
1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\DbgHelp.h(2866) : see declaration of '<unnamed-tag>'
1>..\src\GossipScripts\guardgnome.cpp(9) : error C2143: syntax error : missing ';' before 'constant'
1>..\src\GossipScripts\guardgnome.cpp(9) : error C2059: syntax error : 'constant'
1>..\src\GossipScripts\guardgnome.cpp(9) : error C2059: syntax error : 'public'
1>..\src\GossipScripts\guardgnome.cpp(10) : error C2143: syntax error : missing ';' before '{'
1>..\src\GossipScripts\guardgnome.cpp(10) : error C2447: '{' : missing function header (old-style formal list?)
1>..\src\GossipScripts\guardgnome.cpp(34) : error C2144: syntax error : 'void' should be preceded by ';'
1>..\src\GossipScripts\guardgnome.cpp(36) : error C2059: syntax error : 'constant'
thanks in advance ^ ^
--ronald