Stellow
C++/C#/PHP/LUA
Code:
int LuaScriptInterface::luaSetPartySharedExperience(lua_State *L)
{
std::cout << "1" << std::endl;
//luaSetPartySharedExperience(cid)
//getPartyMembers(cid)
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
Creature* creature = env->getCreatureByUID(cid);
if(!creature){
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
std::cout << "2" << std::endl;
Player* player = creature->getPlayer();
if(!player){
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
std::cout << "3" << std::endl;
if(!player->getParty()){
lua_pushnil(L);
return 1;
}
std::cout << "4" << std::endl;
player->getParty()->setSharedExperience(player, true);
return 1;
}
Its saying:
LuaScriptInterface::LuaSetPartySharedExperience (). Creature not found