[Action] Exp Ring Onuse

Beeki
Por Beeki
em Actions e Talkactions

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

Opa galera, vi esse script em outro fórum e achei legal e então irei postar para vocês, é um ring que ao ser equipado atribui double EXP ao player

 

vá em data/actions/actions/xml e adicione o seguinte arquivo.

 

local cfg = {
exhausted = 100, -- Time you are exhausted in seconds.
storage = 5858, -- Storage used for "exhaust."
exp = 2.0 -- this means 2x more experence then default
}

function onUse(cid, item)
if(getPlayerStorageValue(cid, cfg.storage) > os.time() and getPlayerStorageValue(cid, cfg.storage) < 100+os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, cfg.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, cfg.storage) - os.time()) == 1 and "" or "s") .. " to use another ring.")
else
doRemoveItem(item.uid,1)
setPlayerStorageValue(cid, cfg.storage, os.time() + cfg.exhausted)
doPlayerSetExperienceRate(cid, cfg.exp)
doPlayerSendTextMessage(cid,22,"You have extra experience for 100 seconds")
end
return true
end

 

aqui está a tag do actions.xml referente ao mesmo.

 

<action itemid="7762" event="script" value="istrinti.lua"/>

 

vá em creaturescripts.xml e adicione essa tag.

 

<event type="think" name="istrinti2" event="script" value="istrinti2.lua"/>

 

depois crie um arquivo em data/creaturescripts/scripts com o nome deistriniti2.lua

 


local cfg = {
storage = 5858, -- Storage used for "exhaust."
exp = 2.0 -- this means 2x more experence then default
}

function onThink(cid)
if(getPlayerStorageValue(cid, cfg.storage) > os.time() and getPlayerStorageValue(cid, cfg.storage) < 100+os.time()) then
doPlayerSetExperienceRate(cid, cfg.exp)
else
doPlayerSetExperienceRate(cid, 1.0)
end
return true
end[/size]

 

depois vá no seu login.lua e registre o seguinte evento.

 

registerCreatureEvent(cid, "istrinti2") -- add it near the other registers

 

créditos:

Erikas Kontenis

Beeki

Fabio Augustus - Infraestrutura

Skype: guhsvasc

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

Dahora.

 

Retira a tag [size=4] e [/size] do code senão alguem vai copiar e dar erro

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

tricksz

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 01/01/12Posts: 2Char no Tibia: Tricksz

Script ótimo, parabéns!!!! Rep + pra você ;D

lucasalisson

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 18/09/12Posts: 13

Otimo era que eu estava presisando :)