Maciel94 0 Postado Fevereiro 20, 2012 Share Postado Fevereiro 20, 2012 Criei um Exp Scroll no server com duração de 2 dias, o jogador clica e aparece o tempo em baixo que falta pra acabar a exp scroll, só quando reloga zera tudo, ai os 2 dias vai pro saco é o cara uso 1hr só lol... E também quero que mesmo deslogado ele corra os minutos. Vlws ae... Link para o comentário Compartilhar em outros sites More sharing options...
RHCP 24 Postado Fevereiro 22, 2012 Share Postado Fevereiro 22, 2012 Vá a sua pasta mods e crie expscroll.xml com: <?xml version="1.0" encoding="UTF-8"?> <mod name="Experience Stages Scroll" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes"> <action itemid="9004" event="script" value="expstagescroll.lua"/> <creatureevent type="think" name="ExpStage" event="script" value="expstagescroll.lua"/> <creatureevent type="login" name="ExpStageLogin" event="script" value="expstagescroll.lua"/> </mod> Agora vá para a pasta mods/scripts e crie expstagescroll.lua com: local config = { rate = 2, storage = 1000, expstorage = 1100, register = 1200, time = 14400, } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, config.storage) <= 0 then local rates = getPlayerRates(cid) setPlayerStorageValue(cid, config.expstorage, rates[sKILL__LEVEL]) setPlayerStorageValue(cid, config.register, 1) itemEx=itemid == 9004 doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, os.time()+config.time) doPlayerSetExperienceRate(cid, rates[sKILL__LEVEL]+config.rate) doRemoveItem(item.uid,1) registerCreatureEvent(cid, "ExpStage") else doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid) end return true end function onThink(cid, interval) if getPlayerStorageValue(cid, config.register) == 1 then if getPlayerStorageValue(cid, config.storage) <= os.time() then doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, 0) setPlayerStorageValue(cid, config.register, 0) local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp) unregisterCreatureEvent(cid, "ExpStage") end end return true end function onLogin(cid) if getPlayerStorageValue(cid, config.register) == 1 then registerCreatureEvent(cid, "ExpStage") local rates = getPlayerRates(cid) doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) if getPlayerStorageValue(cid, config.storage) > os.time() then local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp+config.rate) end end return true end Como funciona? Estabelece o a rate no config e o tempo no time, ao usar o item de id 9004, você terá o experience scroll. Não acaba quando reloga (bem eu acho). Configuração: rate = 2, --number how many time is multiple player experience rate (can be also 1.5 or 10.1) example: player basicaly rate is 1x you adding 2x then player got 3x experience rate storage = 1000, --storage to set time expstorage = 1100, --storage were is player exists rate register = 1200, --registration storage time = 14400, --time with scroll expiring (in seconds 14400=24 hours) Créditos a TomCrusher (otland) Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados