doCreatureSetSkullType(cid, skull)
1 - White skull
2 - Green skull
3 - Yellow skull
4 - Red skull
5 - Black Skull
//doCreatureSetSkullType(cid, skull)
lua_register(m_luaState, "doCreatureSetSkullType", LuaInterface::luaDoCreatureSetSkullType);
int32_t LuaInterface::luaDoCreatureSetSkullType(lua_State* L)
{
//doCreatureSetSkullType(cid, skull)
Skulls_t skull = (Skulls_t)popNumber(L);
ScriptEnviroment* env = getEnv();
if(Creature* creature = env->getCreatureByUID(popNumber(L)))
{
creature->setSkull(skull);
g_game.updateCreatureSkull(creature);
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
static int32_t luaDoCreatureSetSkullType(lua_State* L);
How did you set up your script? Any errors?Thank you for your reply!
I also thought that yellow skull was included but when i test it, it does not work
Show me the script you've created. Unless you're using /attr?Nope, it all runs fine but no yellow skull, can you show me your script?
Ahhhhhhhhhhhhh. Why didnt you say so.But the yellow skull system is on the source code, is not it?
I mean if you attack somebody with skull you get yellow skull
function onCombat(cid, target)
local skull = getCreatureSkull(target)
local skull2 = getCreatureSkull(cid)
if isPlayer(cid) and isPlayer(target) then
if skull >= SKULL_WHITE and skull == SKULL_NONE then
doPlayerSetSkullType(cid, SKULL_YELLOW)
doBroadcastMessage("test")
end
end
return TRUE
end