Hi, yesterday i found the script:
lua_register(m_luaState, "selfAttackCreature", NpcScriptInterface::luaActionAttackCreature);
int32_t NpcScriptInterface::luaActionAttackCreature(lua_State* L){
int id=(int)lua_tonumber(L, -1);
Npc* npc = getNpc(popNumber(L));
if(npc)
npc->doAttack(id);
return 0;
}
The code is to create functions for attacking creatures by npc
and so there was an error in the compilation
[2648] npc.cpp `getNpc' was not declared in this scope
How to fix it?
lua_register(m_luaState, "selfAttackCreature", NpcScriptInterface::luaActionAttackCreature);
int32_t NpcScriptInterface::luaActionAttackCreature(lua_State* L){
int id=(int)lua_tonumber(L, -1);
Npc* npc = getNpc(popNumber(L));
if(npc)
npc->doAttack(id);
return 0;
}
The code is to create functions for attacking creatures by npc
and so there was an error in the compilation
[2648] npc.cpp `getNpc' was not declared in this scope
How to fix it?