• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling TFS 0.4 YELLOW SKULL

uke15

New Member
Joined
Aug 30, 2016
Messages
16
Reaction score
0
Hi again!

I've been looking for the c code to add yellow skull to my tfs 0.4 but i have not found anything.

Can someone help me?

Thank you in advance
 
Hmmf. Im pretty sure 0.4 should already have these functions. but from what im understanding you're in need of the functions themselves in source soo here ya go.
Test this first tho
Code:
doCreatureSetSkullType(cid, skull)
Code:
1 - White skull
2 - Green skull
3 - Yellow skull
4 - Red skull
5 - Black Skull

Luascript.cpp
Code:
    //doCreatureSetSkullType(cid, skull)
    lua_register(m_luaState, "doCreatureSetSkullType", LuaInterface::luaDoCreatureSetSkullType);
Code:
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;
}

Luascript.h
Code:
        static int32_t luaDoCreatureSetSkullType(lua_State* L);
 
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
 
I have tried with this, but nthing happens
Code:
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
 
Back
Top