Ir para conteúdo

Featured Replies

Postado
  • Autor
4 horas atrás, Vodkart disse:

n testei

 


<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
	[2152] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.2},
	[2124] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.1}, -- 10%
	[12609] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.1} -- 10%
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         local rates = getPlayerRates(cid)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL] + ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         local rates = getPlayerRates(cid)
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]- ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates[ret.skill] - ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="2152;2124;12609" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not Potions_Rates[item.itemid] then return true end
	local ret = Potions_Rates[item.itemid]
	if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
	end
	local rates = getPlayerRates(cid)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
	setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
	setPlayerStorageValue(cid, ret.storages[2], 1)
	if ret.skill == SKILL__LEVEL then
		doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+ret.new_rate)
	else
		doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate)
	end
	registerCreatureEvent(cid, "ExpPotionThink")
	doRemoveItem(item.uid)
	return true
end]]></action>
</mod>

 

Vou testar agora mesmo, agradeço a Atenção Vodkart

4 horas atrás, Vodkart disse:

n testei

 


<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
	[2152] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.2},
	[2124] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.1}, -- 10%
	[12609] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.1} -- 10%
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         local rates = getPlayerRates(cid)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL] + ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         local rates = getPlayerRates(cid)
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]- ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates[ret.skill] - ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="2152;2124;12609" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not Potions_Rates[item.itemid] then return true end
	local ret = Potions_Rates[item.itemid]
	if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
	end
	local rates = getPlayerRates(cid)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
	setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
	setPlayerStorageValue(cid, ret.storages[2], 1)
	if ret.skill == SKILL__LEVEL then
		doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+ret.new_rate)
	else
		doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate)
	end
	registerCreatureEvent(cid, "ExpPotionThink")
	doRemoveItem(item.uid)
	return true
end]]></action>
</mod>

 

22:36 fist fighting Suas Rates mudaram de 20.10000038147x para 20x. Suas Rates: [ Magic Level: 4x | Fist: 20x | Club: 45x |  Sword: 45x | Axe: 45x |  Distance: 20x | Shielding: 40x | Fishing: 1x ]

 

Sem erros na distro, coloquei  0.9 nas rates pra testar e não facilitou o up, testei todas as skills, mudei o ID dos itens encima e embaixo, porém sem sucesso. 

o script ficou assim:

 

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
    [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.9},
    [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.9}, -- 10%
    [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.9} -- 10%
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         local rates = getPlayerRates(cid)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL] + ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         local rates = getPlayerRates(cid)
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]- ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates[ret.skill] - ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="14562;14565;14566" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not Potions_Rates[item.itemid] then return true end
    local ret = Potions_Rates[item.itemid]
    if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
    end
    local rates = getPlayerRates(cid)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
    setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
    setPlayerStorageValue(cid, ret.storages[2], 1)
    if ret.skill == SKILL__LEVEL then
        doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+ret.new_rate)
    else
        doPlayerSetRate(cid, ret.skill, rates[ret.skill] + ret.new_rate)
    end
    registerCreatureEvent(cid, "ExpPotionThink")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

OBS: o  resto do script funciona perfeitamente:

 

image.png.0f995e9444661848e480f39cb6397c7a.png

 

image.thumb.png.8b20c93fa48ce2ad7a889468635a5b89.png

  • Respostas 14
  • Visualizações 1.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • que estranho, no meu server funcionou, testei num baiak 8.6...   pode ser que a função seja diferente, tenta colocar 2 desse jeito para ver se aumenta a taxa de up     <?xml

  • Creio que se editar essa parte da skill resulte: doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate) SKILL__LEVEL para a skill desejada, confere se está adicionando uma skill e

  • n testei   <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes"> <config name="exppot

Posted Images

Postado

@AidanNarutoHellDust

 

testa assim

 

 

 

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
    [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.5}, -- 50%
    [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.5}, -- 50%
    [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.5} -- 50%
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         local rates = 1
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates + ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates + ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         local rates = 1
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates - ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates - ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="14562;14565;14566" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not Potions_Rates[item.itemid] then return true end
    local ret = Potions_Rates[item.itemid]
    if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
    end
    local rates = 1
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
    setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
    setPlayerStorageValue(cid, ret.storages[2], 1)
    if ret.skill == SKILL__LEVEL then
        doPlayerSetExperienceRate(cid, rates + ret.new_rate)
    else
        doPlayerSetRate(cid, ret.skill, rates + ret.new_rate)
    end
    registerCreatureEvent(cid, "ExpPotionThink")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor
1 hora atrás, Vodkart disse:

@AidanNarutoHellDust

 

testa assim

 

 

 


<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
    [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 0.5}, -- 50%
    [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 0.5}, -- 50%
    [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 0.5} -- 50%
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         local rates = 1
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates + ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates + ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         local rates = 1
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, rates - ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, rates - ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="14562;14565;14566" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not Potions_Rates[item.itemid] then return true end
    local ret = Potions_Rates[item.itemid]
    if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
    end
    local rates = 1
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
    setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
    setPlayerStorageValue(cid, ret.storages[2], 1)
    if ret.skill == SKILL__LEVEL then
        doPlayerSetExperienceRate(cid, rates + ret.new_rate)
    else
        doPlayerSetRate(cid, ret.skill, rates + ret.new_rate)
    end
    registerCreatureEvent(cid, "ExpPotionThink")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

 

Testei aqui e o script todo funciona, porém na hora de Upar a Skill mais rápido não funciona

Postado

que estranho, no meu server funcionou, testei num baiak 8.6...

 

pode ser que a função seja diferente, tenta colocar 2 desse jeito para ver se aumenta a taxa de up

 

 

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
    [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 2},
    [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 2},
    [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 2}
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, 1)
         else
            doPlayerSetRate(cid, ret.skill, 1)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="14562;14565;14566" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not Potions_Rates[item.itemid] then return true end
    local ret = Potions_Rates[item.itemid]
    if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
    end
    local rates = 1
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
    setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
    setPlayerStorageValue(cid, ret.storages[2], 1)
    if ret.skill == SKILL__LEVEL then
        doPlayerSetExperienceRate(cid, ret.new_rate)
    else
        doPlayerSetRate(cid, ret.skill, ret.new_rate)
    end
    registerCreatureEvent(cid, "ExpPotionThink")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

 

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor
8 horas atrás, Vodkart disse:

que estranho, no meu server funcionou, testei num baiak 8.6...

 

pode ser que a função seja diferente, tenta colocar 2 desse jeito para ver se aumenta a taxa de up

 

 


<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Exp Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="exppotion"><![CDATA[

Potions_Rates = {
    [14562] = {name = "Exp Potion", skill = SKILL__LEVEL, storages = {987681, 987682}, minutes = 2, new_rate = 2},
    [14565] = {name = "Fist Potion", skill = SKILL_FIST, storages = {987683, 987684}, minutes = 2, new_rate = 2},
    [14566] = {name = "Distance Potion", skill = SKILL_DISTANCE, storages = {987685, 987686}, minutes = 2, new_rate = 2}
}


function convertTime(a)
  if(type(tonumber(a)) == "number" and a > 0) then
    if (a <= 3599) then
      local minute = math.floor(a/60)
      local second = a - (60 * minute)
      if(second == 0) then
        return ((minute)..((minute > 1) and " minutos" or " minuto"))
      else
        return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
      end
    else
      local hour = math.floor(a/3600)
      local minute = math.floor((a - (hour * 3600))/60)
      local second = (a - (3600 * hour) - (minute * 60))
      if (minute == 0 and second > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
      elseif (second == 0 and minute > 0) then
        return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
      elseif (second == 0 and minute == 0) then
        return (hour..((hour > 1) and " horas" or " hora"))
      end
      return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
    end
  end
end
]]></config>
<event type="login" name="ExpPotionLogin" event="script"><![CDATA[
domodlib('exppotion')
function onLogin(cid)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
         registerCreatureEvent(cid, "ExpPotionThink")
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de "..ret.name..".")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, ret.new_rate)
         else
            doPlayerSetRate(cid, ret.skill, ret.new_rate)
         end
         setPlayerStorageValue(cid, ret.storages[2], 1) -- registro
      end
   end
   return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
   for _, ret in pairs(Potions_Rates) do
      if getPlayerStorageValue(cid, ret.storages[2]) > 0 and getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua ".. ret.name .." acabou!")
         if ret.skill == SKILL__LEVEL then
            doPlayerSetExperienceRate(cid, 1)
         else
            doPlayerSetRate(cid, ret.skill, 1)
         end
         setPlayerStorageValue(cid, ret.storages[2], 0) -- registro
      end
   end
   return true
end]]></event>
<talkaction words="!scrolltime;/scrolltime;!tscroll;/tscroll" event="buffer"><![CDATA[
domodlib('exppotion')
local str ="# POTIONS INFO #\n\n"
for _, ret in pairs(Potions_Rates) do
str = str.."["..ret.name.."] -> "..(getPlayerStorageValue(cid, ret.storages[1]) - os.time() <= 0 and "Não ativo" or "voce tem "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time()).." de ".. ret.name).."\n"
end
return doPlayerPopupFYI(cid, str)  
]]></talkaction>
<action itemid="14562;14565;14566" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not Potions_Rates[item.itemid] then return true end
    local ret = Potions_Rates[item.itemid]
    if getPlayerStorageValue(cid, ret.storages[1]) - os.time() > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra "..ret.name..". Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, ret.storages[1]) - os.time())..".") return true
    end
    local rates = 1
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou ".. ret.name .." por "..ret.minutes.." minutos! Durante este tempo, você receberá + ".. string.format("%.1f", ret.new_rate) * 100 .."% de skill Extra de Qualquer Mob. Para saber o tempo, digite: /scrolltime") 
    setPlayerStorageValue(cid, ret.storages[1], os.time()+ret.minutes*60)
    setPlayerStorageValue(cid, ret.storages[2], 1)
    if ret.skill == SKILL__LEVEL then
        doPlayerSetExperienceRate(cid, ret.new_rate)
    else
        doPlayerSetRate(cid, ret.skill, ret.new_rate)
    end
    registerCreatureEvent(cid, "ExpPotionThink")
    doRemoveItem(item.uid)
    return true
end]]></action>
</mod>

 

O Pergmainho da XP Funciona Perfeitamente, tanto como a contagem do tempo de Potion, de todas as SKills, Porém quando eu uso o Pergaminho Distance e Fist simplesmente para de Upar, e depois de alguns ataques no Mob, ele upa só um pouco.

Video:

 

Meu Config Rates:

-- Rates
    -- NOTE: experienceStages configuration is located in data/XML/stages.xml.
    -- rateExperienceFromPlayers 0 to disable.
    experienceStages = true
    rateExperience = 2.0
    rateExperienceFromPlayers = 0
    rateSkill = 2.0
    rateMagic = 1.9
    rateLoot = 1.3
    rateSpawn = 1

 

 

Vocations.xml:

<vocation id="3" name="Sasuke Uchiha [DANO]" description="a  Sasuke Uchiha[DANO]" needpremium="0" gaincap="20" gainhp="1100" gainmana="400" gainhpticks="1" gainhpamount="150" gainmanaticks="1" gainmanaamount="250" manamultiplier="1.1" attackspeed="800" soulmax="300" gainsoulticks="60" fromvoc="3">
        
<formula meleeDamage="2.0" distDamage="2.0" wandDamage="2.0" magDamage="2.3" magHealingDamage="2.0" defense="2.0" magDefense="2.0" armor="2.0"/>
        
<skill fist="2.0" club="1.8" sword="2.7" axe="3.0" distance="2.4" shielding="3.0" fishing="3.0" experience="2.0"/>
    
</vocation>
 

 

8 horas atrás, Vodkart disse:

 

 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.3k

Informação Importante

Confirmação de Termo