Postado Setembro 25, 2013 11 anos Tente isso aqui... Substitua o script anterior por esse : Mostrar conteúdo oculto local config = { rate = 2, -- 4x More Experience time = 2, -- Hours of Exp Time storage = 21123 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerStorageValue(cid, config.storage) < 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.") setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600) local ex = getPlayerRates(cid)[SKILL__LEVEL] doPlayerSetRate(cid, SKILL__LEVEL, (config.rate)) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.") end return TRUE end ...e na pasta creaturescript > scripts > login.lua depois da function onLogin(cid) adicione isso : Mostrar conteúdo oculto if(getPlayerStorageValue(cid, 21123) > 0) then -- você muda a storage de acordo com o script da action doPlayerSetRate(cid, SKILL__LEVEL, 2) -- você muda o valor de acordo com o script da action end registerCreatureEvent(cid, "Checkextraexp") Crie um arquivo chamado checkextraexp.lua na pasta de script de creaturescript e cole isso : Mostrar conteúdo oculto function onThink(cid) if(getPlayerStorageValue(cid, 21123) <= 0) then doPlayerSetRate(cid, SKILL__LEVEL, 1) setPlayerStorageValue(cid, 21123, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your extra experience rate time has ended.") end return true end E por último, a tag do creaturescript no arquivo creaturescript.xml : <event type="think" name="Checkextraexp" event="script" value="checkextraexp.lua"/> Não sei se vai funcionar, fiz agora. 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Setembro 25, 2013 11 anos Autor Não apresento nenhum erro no distro..... Sera que funciono jovem?
Postado Setembro 26, 2013 11 anos Autor Não funciono ainda alguém poderia me dar 1 luz de double exp funcional?
Postado Setembro 26, 2013 11 anos vai em mod e crie um arquivo com o nome doubleexp.lua e cole isso: <?xml version="1.0" encoding="UTF-8"?> <mod name="AdvancedExpPotionSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com"> <!-- Configs and Functions --> <config name="PotionExpConfigs"><![CDATA[ ------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE configs = { time = 120---- TIME IN MINUTES needpa = TRUE, needlvl = {TRUE, level = 50}, costmana = {TRUE, mana = 300}, addrate = 20, -- Exp que vai adicionar em % removeonuse = TRUE } function getTime(s) local n = math.floor(s / 60) s = s - (60 * n) return n, s end CreatureEventChecker = function(event, ...) -- Colex if isCreature(arg[1]) then event(unpack(arg)) end end creatureEvent = function(event, delay, ...) -- Colex addEvent(CreatureEventChecker, delay, event, unpack(arg)) end function getPlayerExtraExpRate(cid) -- By MatheusMkalo return (getPlayerRates(cid)[8]-1)*100 end ]]></config> <!-- exppotion.lua --> <action itemid="7440" event="script"><![CDATA[ domodlib('PotionExpConfigs') if getPlayerStorageValue(cid, 62164) >= 1 then return doPlayerSendCancel(cid, "You are already taking effect from this item.") end if configs.needpa and not isPremium(cid) then return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.") end if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.") end if configs.costmana[1] then if getCreatureMana(cid) < configs.costmana.mana then return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.") else doCreatureAddMana(cid, -configs.costmana.mana) end end if configs.removeonuse then doRemoveItem(item.uid, 1) end for i = configs.time*60, 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == configs.time*60 then creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the exp potion end.") end creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "The effect of the exp potion will end in "..a..".") end doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) doPlayerSendTextMessage(cid, 22, "Agora voce ira receber mais exp por matar os mosntros.") setPlayerStorageValue(cid, 62164, os.time()) creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0) return TRUE ]]></action> <creaturescript type="login" name="ExpPotion" event="script"><![CDATA[ domodlib('PotionExpConfigs') local time = configs.time if os.time()-getPlayerStorageValue(cid, 62164) < time *60 then doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000 , cid, 62164, 0) for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62164))), 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) then creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62164)))*1000, cid, "The effect of the exp potion end.") end creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "The effect of the exp potion will end in "..a..".") end end return TRUE ]]></creaturescript> </mod> ali em : configs = { time = 120, -- tempo em minutos needpa = TRUE, -- se precisa se premium para usar se nao coloque false needlvl = {TRUE, level = 50}, -- o lvl que precisa se nao coloque false costmana = {TRUE, mana = 300}, se vai custar mana se nao coloque false addrate = 20, -- Exp que vai adicionar em % removeonuse = TRUE -- remove ao da use } edite a seu gosto e aki: <action itemid="7440" event="script"><![CDATA[ -- coloque o id do item
Postado Setembro 26, 2013 11 anos Autor esse ai tb buga.... o cara fica sem pode usar novamente, nossa não existe sera 1 script que funga legal gente ?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.