What should I do to make function DoPlayerAddSkillTry removing skills instead of adding?
Code:
int32_t LuaScriptInterface::luaDoPlayerAddSkillTry(lua_State* L)
{
//doPlayerAddSkillTry(uid, skillid, n)
int32_t n = popNumber(L), skillid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
if(Player* player = env->getPlayerByUID(popNumber(L)))
{
player->addSkillAdvance((skills_t)skillid, n);
lua_pushboolean(L, true);
}
else
{
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}