int32_t LuaScriptInterface::luaSetCreatureOutfitRed(lua_State* L)
{
//doSetCreatureOutfitRed(cid, outfit, time)
int32_t time = (int32_t)popNumber(L);
Outfit_t outfit;
outfit.lookType = getField(L, "lookType");
outfit.lookHead = 66;
outfit.lookBody = 66;
outfit.lookLegs = 66;
outfit.lookFeet = 66;
outfit.lookAddons = getField(L, "lookAddons");
lua_pop(L, 1);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
Creature* creature = env->getCreatureByUID(cid);
if(creature){
ReturnValue ret = Spell::CreateIllusion(creature, outfit, time);
if(ret == RET_NOERROR){
lua_pushnumber(L, LUA_NO_ERROR);
}
else{
lua_pushnumber(L, LUA_ERROR);
}
}
else{
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushnumber(L, LUA_ERROR);
}
return 1;
}