• 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!

[MOD] Skull system [LUA] [WAR SERVER]

Skyforever

Member
Joined
Aug 5, 2012
Messages
4
Reaction score
6
Hello! the system is simple, depending on the quantity of frag, your skull will change color.

In folder Mods:

Skull System.xml
XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes">
<config name="SkullC_func"><![CDATA[

function setSkullColor(cid)
local t = {
[{5,10}] = 1,
[{11,15}] = 2,
[{16,20}] = 3,
[{21,25}] = 4,
[{26,math.huge}] = 5
}
for var, ret in pairs(t) do
if getPlayerFrags(cid) >= var[1] and getPlayerFrags(cid) <= var[2] then
doCreatureSetSkullType(cid, ret)
end
end
end
function getPlayerFrags(cid)
local time = os.time()
local times = {today = (time - 86400), week = (time - (7 * 86400))}
local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
if(result:getID() ~= -1) then
repeat
local content = {date = result:getDataInt("date")}
if(content.date > times.today) then
table.insert(contents.day, content)
elseif(content.date > times.week) then
table.insert(contents.week, content)
else
table.insert(contents.month, content)
end
until not result:next()
result:free()
end
local size = {day = table.maxn(contents.day),week = table.maxn(contents.week),month = table.maxn(contents.month)}
return size.day + size.week + size.month
end
]]></config>
<event type="login" name="SkullLogin" event="script"><![CDATA[
domodlib('SkullC_func')
function onLogin(cid)
registerCreatureEvent(cid, "ColorKill")
setSkullColor(cid)
return true
end]]></event>
<event type="kill" name="ColorKill" event="script"><![CDATA[
domodlib('SkullC_func')
function onKill(cid, target)
if isPlayer(cid) and isPlayer(target) then
doCreatureSetSkullType(target, 0)
addEvent(setSkullColor, 100, cid)
end
return true
end]]></event>
</mod>

open config.lua

change:
Lua:
dailyFragsToRedSkull = 10
weeklyFragsToRedSkull = 40
monthlyFragsToRedSkull = 90

to:
Lua:
dailyFragsToBlackSkull = 9999999
weeklyFragsToBlackSkull = 9999999
monthlyFragsToBlackSkull = 9999999

OBS: this system only War Server
 
Last edited by a moderator:
thats awesome, but I have one error please check this
HTML:
[13/8/2012 21:47:22] [13/8/2012 21:47:22] [Error - CreatureScript Interface] 
[13/8/2012 21:47:22] In a timer event called from: 
[13/8/2012 21:47:22] domodlib('SkullC_func')
[13/8/2012 21:47:22] function onKill(cid, target)
[13/8/2012 21:47:22] if isPlayer(cid) and isPlayer(target) then
[13/8/2012 21:47:22] doCreatureSetSkullType(target, 0)
[13/8/2012 21:47:22] addEvent(setSkullColor, 100, cid)
[13/8/2012 21:47:22] end
[13/8/2012 21:47:22] return true
[13/8/2012 21:47:22] end:onKill
[13/8/2012 21:47:22] Description: 
[13/8/2012 21:47:22] (internalGetPlayerInfo) Player not found when requesting player info #18

[13/8/2012 21:47:22] [Error - CreatureScript Interface] 
[13/8/2012 21:47:22] In a timer event called from: 
[13/8/2012 21:47:22] domodlib('SkullC_func')
[13/8/2012 21:47:22] function onKill(cid, target)
[13/8/2012 21:47:22] if isPlayer(cid) and isPlayer(target) then
[13/8/2012 21:47:22] doCreatureSetSkullType(target, 0)
[13/8/2012 21:47:22] addEvent(setSkullColor, 100, cid)
[13/8/2012 21:47:22] end
[13/8/2012 21:47:22] return true
[13/8/2012 21:47:22] end:onKill
[13/8/2012 21:47:22] Description: 
[13/8/2012 21:47:22] [string "..."]:19: attempt to concatenate a boolean value
[13/8/2012 21:47:22] stack traceback:
[13/8/2012 21:47:22] 	[string "..."]:19: in function 'getPlayerFrags'
[13/8/2012 21:47:22] 	[string "..."]:11: in function <[string "..."]:2>
 
thats awesome, but i have one error please check this
HTML:
[13/8/2012 21:47:22] [13/8/2012 21:47:22] [error - creaturescript interface] 
[13/8/2012 21:47:22] in a timer event called from: 
[13/8/2012 21:47:22] domodlib('skullc_func')
[13/8/2012 21:47:22] function onkill(cid, target)
[13/8/2012 21:47:22] if isplayer(cid) and isplayer(target) then
[13/8/2012 21:47:22] docreaturesetskulltype(target, 0)
[13/8/2012 21:47:22] addevent(setskullcolor, 100, cid)
[13/8/2012 21:47:22] end
[13/8/2012 21:47:22] return true
[13/8/2012 21:47:22] end:onkill
[13/8/2012 21:47:22] description: 
[13/8/2012 21:47:22] (internalgetplayerinfo) player not found when requesting player info #18

[13/8/2012 21:47:22] [error - creaturescript interface] 
[13/8/2012 21:47:22] in a timer event called from: 
[13/8/2012 21:47:22] domodlib('skullc_func')
[13/8/2012 21:47:22] function onkill(cid, target)
[13/8/2012 21:47:22] if isplayer(cid) and isplayer(target) then
[13/8/2012 21:47:22] docreaturesetskulltype(target, 0)
[13/8/2012 21:47:22] addevent(setskullcolor, 100, cid)
[13/8/2012 21:47:22] end
[13/8/2012 21:47:22] return true
[13/8/2012 21:47:22] end:onkill
[13/8/2012 21:47:22] description: 
[13/8/2012 21:47:22] [string "..."]:19: Attempt to concatenate a boolean value
[13/8/2012 21:47:22] stack traceback:
[13/8/2012 21:47:22] 	[string "..."]:19: In function 'getplayerfrags'
[13/8/2012 21:47:22] 	[string "..."]:11: In function <[string "..."]:2>


bumppppp
 
@up

Player Not found dude,

try this

Lua:
if isPlayer(cid) and isPlayer(target) then
doCreatureSetSkullType(target, 0)
addEvent(setSkullColor, 1, cid)
end
 
But if you get for example black skull, will it set the same limitations as the real black skull has? Or will this be another type of black skull, just visual?
 
But if you get for example black skull, will it set the same limitations as the real black skull has? Or will this be another type of black skull, just visual?


I think you have to compilate ur distro so black skulls dont lose anything when they die also spells etc..
 
Any one can change this mod to use only daily frags ?


@edit
I'll edited this if someone want just PM me.
 
Last edited:
Back
Top