LU
pedido

Titulo De Skull

Por Luiiz1, 04 de out. de 2012 em Scripts

skull
tibia
script
7
1.2k
Luiiz1L
04 de outubro de 2012 às 15:39

Queria um script que o player ganha skulls conforme o level atingido ,

começando com skull branca que todos tem

ao atingir level 300 ganha skull amarela

ao atingir level 400 skull verde

700 red

900 black

15790911
04 de outubro de 2012 às 15:46

Na pasta Mod do seu ot, crie um arquivo chamado Skull System.xml e dentro coloque isso:

 

 

 

<?xml version="1.0" encoding="ISO-8859-1"?>

<mod name="Skull System" version="1.0" author="Skyforever" contact="#####.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>

 

 

 

Está bem simples de configurar:

 

[{21,25}] = 4, -- [{frags pra adquirir a skull,frags pra sair a skull}] = Skull Type (tipo da skull)

[{26,math.huge}] = 5 - Aki é o mesmo, mas o math.huge funciona como se foce um "or more" (level 26 ou mais), ou seja daí por diante é só essa skull

 

 

Depois no config.lua, nakela parte das skulls substitua isso:

___________________________________________________________

 

dailyFragsToRedSkull = 10

weeklyFragsToRedSkull = 40

monthlyFragsToRedSkull = 90

_______________________________________________________________

 

Por isso:

_______________________________________________

 

dailyFragsToBlackSkull = 9999999

weeklyFragsToBlackSkull = 9999999

monthlyFragsToBlackSkull = 9999999

_________________________________________

 

 

Agora que vi, você pediu por level neh... Bom acho que esse seria mais apropriado pra um servidor de war (creio que seu servidor é de war neh?)

Editado Outubro 4 por GuizitoG

Luiiz1L
04 de outubro de 2012 às 16:29

sim , é de war :s

15790911
04 de outubro de 2012 às 16:31

Gostou do sistema? ou ainda quer o de level?? Alguma duvida em configurar???

Luiiz1L
04 de outubro de 2012 às 19:03

quero de level , como pedi ali .

SkymagnumS
04 de outubro de 2012 às 20:31

Syforever aqui só mudar a função lol.

 

 

 

PS: Depois vou atualizar ele.

 

PS2: Tem que colocar mode pvp no config.lua não enforced nem war.

Editado Outubro 4 por Skymagnum

Luiiz1L
04 de outubro de 2012 às 21:50

o ot é de war ! :D