Ir para conteúdo
  • Cadastre-se

(Resolvido)(AJUDA) nao consigo colocar 2 exp potion


Ir para solução Resolvido por KotZletY,

Posts Recomendados

 

Galera, quero adicionar uma exp 50%  uma exp 100% no meu server as duas de 60 minutos, porem, coloquei ExpPotion e ExpPotion2 no mods, mas a 2 segue a 1, oque eu edito na 1 a 2 absorve pra ela mesmo sem eu ter alterado nada oque faz nao funcionar a 2, vou mandar as 2 mods aqui

 

exppotion

Spoiler

<?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 = 60, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {FALSE, level = 50},
costmana = {FALSE, mana = 300},
addrate = 50, -- 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="7443" 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>

 

ExpPotion2

Spoiler

<?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 = 60, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {FALSE, level = 50},
costmana = {FALSE, mana = 300},
addrate = 100, -- 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="ExpPotion2" 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>

 

Link para o post
Compartilhar em outros sites
  • Solução

@ExtremyDsgnr 

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<mod name="AdvancedExpPotionSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com">

<!-- Configs and Functions -->
<config name="PotionExpConfigs2"><![CDATA[

------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE
configs = {
time = 60, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {FALSE, level = 50},
costmana = {FALSE, mana = 300},
addrate = 100, -- 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('PotionExpConfigs2')
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="ExpPotion2" event="script"><![CDATA[
domodlib('PotionExpConfigs2')
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>

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
Agora, KotZletY disse:

@ExtremyDsgnr 

  Ocultar conteúdo


<?xml version="1.0" encoding="UTF-8"?>
<mod name="AdvancedExpPotionSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com">

<!-- Configs and Functions -->
<config name="PotionExpConfigs2"><![CDATA[

------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE
configs = {
time = 60, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {FALSE, level = 50},
costmana = {FALSE, mana = 300},
addrate = 100, -- 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('PotionExpConfigs2')
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="ExpPotion2" event="script"><![CDATA[
domodlib('PotionExpConfigs2')
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>

 

 

 

vlww

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo