Muito bom cara, ja tinha visto alguns mais eram todos bugados
vlw =D
Por MatheusGlad, 21 de set. de 2010 em Mods, funções e outros
Muito bom cara, ja tinha visto alguns mais eram todos bugados
vlw =D
info
Grupo: Herói
Registrado: 07/01/08
Posts: 2.3k
Reputação: +514
Gênero: Masculino
Char no Tibia: Tonynh

LoL
Curti demais as novas funções
Congratz
+REP =]
info
Grupo: Conde
Registrado: 09/09/09
Posts: 528
Reputação: +424
Char no Tibia: Emekalo Makalo

As funçoes que tao ali CreatureEventChecker e creatureEvent sao do Colex.
info
Grupo: Herói
Registrado: 07/01/08
Posts: 2.3k
Reputação: +514
Gênero: Masculino
Char no Tibia: Tonynh

-- Colex
Eu tinha notado rs
Mas, ficou bem melhor o sript, Literalmente.
info
Grupo: Campones
Registrado: 09/06/10
Posts: 80
Reputação: +78
Char no Tibia: Dardnyti Elfresso

foda foda !
noiix s2 hahaha
REP+
info
Grupo: Campones
Registrado: 01/12/08
Posts: 24
Reputação: +1
Char no Tibia: Disturbed Bear

Nossa muinto bom msm ;D
so que axo que falto so 1 coisa aparecer uma mensagem pro player quando acaba o tempo e uma mensagem quando começa e falando o tempo que ele tem
REP+
Editado Setembro 24 por greXDXD
info
Grupo: Conde
Registrado: 09/09/09
Posts: 528
Reputação: +424
Char no Tibia: Emekalo Makalo

A pedido do greXDXD, botei pra aparecer o tempo em que sua potion ira acabar.
Preview:

Obrigado pelos elogios e dicas.
Editado Setembro 24 por MatheusMkalo
info
Grupo: Campones
Registrado: 01/12/08
Posts: 24
Reputação: +1
Char no Tibia: Disturbed Bear

A pedido do greXDXD, botei pra aparecer o tempo em que sua potion ira acabar.
Preview:
Obrigado pelos elogios e dicas.
Nossa ja era bom o script agora fiko melhor ainda ;D vlw ai msm vo usar no meu ot parabéns
info
Grupo: Visconde
Registrado: 20/08/06
Posts: 250
Reputação: +146

Bom script.
Conseguiu fazer o texto do tempo, ficou legal o resultado ![]()
Editado Setembro 24 por kydrai
info
Grupo: Campones
Registrado: 01/12/08
Posts: 24
Reputação: +1
Char no Tibia: Disturbed Bear

Tipo tem exhausted? pq quando eu uso acaba fika dando que eu to usando ainda ;s
info
Grupo: Conde
Registrado: 09/09/09
Posts: 528
Reputação: +424
Char no Tibia: Emekalo Makalo

Tenta muda o numero das storages:
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 onUse(cid,item,frompos,item2,topos)
------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE
configs = {
time = 1, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {TRUE, level = 50},
costmana = {TRUE, mana = 300},
removeonuse = TRUE
}
----------------------------------
--------- Nao Mude --------------
if getPlayerStorageValue(cid, 62165) >= 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 double exp potion end.")
end
creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "The effect of the double exp will end in "..a..".")
end
doPlayerSetExperienceRate(cid, 2)
creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1)
doPlayerSendTextMessage(cid, 22, "Agora voce ira receber o dobro de exp por matar os mosntros.")
setPlayerStorageValue(cid, 62165, os.time())
creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62165, 0)
return TRUE
end
-------------------------------------
E a creaturescript:
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 onLogin(cid)
time = 1 ------ TIME IN MINUTES
if os.time()-getPlayerStorageValue(cid, 62165) < time *60 then
doPlayerSetExperienceRate(cid, 2)
creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62165))) * 1000, cid, 1)
creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62165))) * 1000 , cid, 62165, 0)
for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62165))), 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, 62165))) then
creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62165)))*1000, cid, "The effect of the double exp potion end.")
end
creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62165)))-i)*1000, cid, "The effect of the double exp will end in "..a..".")
end
end
return TRUE
end
Editado Setembro 24 por MatheusMkalo
Cara gostei mesmo, mais teria como vc fazer para ela tipo: quando ela acabar dar de re-utilizar?
Pois quando ela acaba e vc tenta usar de novo ela da a msg
"You are already taking effect from this item."
Se tivesse como vc arruma eu agradeceria, eu tentei tira essas linhas:
if getPlayerStorageValue(cid, 62165) >= 1 thenreturn doPlayerSendCancel(cid, "You are already taking effect from this item.")
end
Mas dai se vc da use, ela funciona, porém se vc der use de novo fica correndo 2 tempos e se vc ficar clicando sem para fica correndo todos os tempos que vc clicou
Editado Dezembro 12 por Pandemoniun666
info
Grupo: Campones
Registrado: 07/12/10
Posts: 53
Reputação: +2

legal
vou colocar no meu ot
info
Grupo: Campones
Registrado: 01/10/10
Posts: 19
Reputação: +5
Char no Tibia: Quiksilver

como faço para ele dura uma hora ?
info
Grupo: Conde
Registrado: 09/09/09
Posts: 528
Reputação: +424
Char no Tibia: Emekalo Makalo
Item ou potion de double exp.
By: MatheusMkalo
Primeiramente vamos ver oque o script tem de diferente dos outros:
AGORA O SCRIPT SOH ESTA DISPONIVEL EM MOD:
Vá na pasta mods e adicione um arquivo.xml com o nome de ExpPotion.xml e bote 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 = 1, ---- 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>Tudo pronto, exp potion funcionando!
O ID da potion usada no script foi o: 7440 (Mastermind Potion)
Para usa-lo voce precisa tirar a linha no actions.xml da potion porque se nao vai bugar.
Para trocar o id da potion eh so mudar essa linha:
Resposta para o Topico: Aew Galera Preciso Scripting Da Double Exp
Potion
Editado Abril 10 por CyberBot