Jump to content

Scripting Poção/Item Que Aumenta Velocidade De Upar X Skill [ MODS]


Recommended Posts

Olá galera do TK

 

Bom, como o título acima aponta, eu gostaria de uma Poção ou qualquer outro Item que eu configurar no Script faça com que eu upe um certo Skill Mais rápido, como um Boost, por exemplo:

 

-Parabéns, você usou a Skill Potion e Agora sua magia está 5 por Cento mais fácil de upar--

-Parabéns, você usou a Skill Potion e Agora seu Fist está 5 por Cento mais fácil de upar--

-Parabéns, você usou a Skill Potion e Agora seu Distance está 5 por Cento mais fácil de upar--  

ETC..

 

Meu Servidor é de Narutitiba [DERIVADO] - TFS 0.4.4 - 8.60

 

Eu tentei alterar um Script do @Vodkart e Alterar, mas sem Sucesso.

OBS: O Script da Potion Exp Está funcionando perfeitamente, Eu gostaria apenas de adaptar pra Um X Skill

Pode ser Todos Skills de uma vez, ou vários Scripts, cada um aumentando x Velocidade de Upar Skill 😄

 

Segue o Script da Base da Exp Potion ---> Pasta Mods

 

Agradeço Desde Já.

 

Você tem o código disponível? Se tiver publique-o aqui: 

 <?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[
exp_info = {rate = 0.2, storage = {354870,354871,354872}, minutes = 30} -- rate 0.2 = 20%
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)
    if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then 
        registerCreatureEvent(cid, "ExpPotionThink")
        local rates = getPlayerRates(cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Ex Scroll.")
        doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate)
		setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro
    end 
	return true
end]]></event>
<event type="think" name="ExpPotionThink" event="script"><![CDATA[
domodlib('exppotion')
function onThink(cid, interval)
	if getPlayerStorageValue(cid, exp_info.storage[3]) > 0 and getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua Exp Scroll acabou!") 
		-- doPlayerSetExperienceRate(cid, getPlayerStorageValue(cid, exp_info.storage[2]))
		local rates = getPlayerRates(cid)
		doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]-exp_info.rate)
		setPlayerStorageValue(cid, exp_info.storage[3], 0) -- registro
	end
	return true
end]]></event>
<talkaction words="!XpScroll;/ExpScroll;!xp;/XpScroll" event="buffer"><![CDATA[
domodlib('exppotion')
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 and "Você não possui Exp Scroll ativa no momento." or "Você tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Xp Scroll.")]]></talkaction>
<action itemid="14562" event="script"><![CDATA[
domodlib('exppotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outra Exp Scroll. Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time())..".") return true
	end
	
	local rates = getPlayerRates(cid)
	-- setPlayerStorageValue(cid, exp_info.storage[2], rates[SKILL__LEVEL])
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou Exp Scroll por "..exp_info.minutes.." minutos! Durante este tempo, você receberá +20% Xp Extra de Qualquer Mob. Para saber o tempo, digite: /xpScroll") 
	setPlayerStorageValue(cid, exp_info.storage[1], os.time()+exp_info.minutes*60)
	setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro
	doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate)
	registerCreatureEvent(cid, "ExpPotionThink")
	doRemoveItem(item.uid,1)
	return true
end]]></action>
</mod>

 

 

 

Edited by AidanNarutoHellDust
Remover ultima Linha. (see edit history)
Link to post
Share on other sites

1 hora atrás, Nysman disse:

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 existente.

troque todos.

Agradeço a atenção.

Vou Alterar o Script e Testar, caso haja algum erro ou algo inalterado eu te retorno. 

 

Só uma dúvida, como eu já possuo o Exp Scroll, é só alterar a storage e o nome dos Eventos no Script, certo?

Link to post
Share on other sites

27 minutos atrás, AidanNarutoHellDust disse:

Agradeço a atenção.

Vou Alterar o Script e Testar, caso haja algum erro ou algo inalterado eu te retorno. 

 

Só uma dúvida, como eu já possuo o Exp Scroll, é só alterar a storage e o nome dos Eventos no Script, certo?

Exato.

Link to post
Share on other sites

20 minutos atrás, Nysman disse:

Exato.

image.thumb.png.b5459f76733a0caa137627cb1251d45f.png

 

Erro, troquei os storages e o Nome dos Eventos, mesmo assim deu bug.

só aparece a mensagem, mas não remove o Scroll também:

image.thumb.png.4229a2eace714004da78c0e2ff9c8442.png

 

Segue o Script:

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Taijutsu Potion" version="1.0" author="Vodkart" contact="DISCORD: vodkart#6090" enabled="yes">
<config name="fistpotion"><![CDATA[
exp_info = {rate = 0.2, storage = {354875,354876,354877}, minutes = 30} -- rate 0.2 = 20%
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="Taijutsupotionlogin" event="script"><![CDATA[
domodlib('fistpotion')
function onLogin(cid)
    if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then 
        registerCreatureEvent(cid, "FistPotionThink")
        local rates = getPlayerRates(cid)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Ex Scroll.")
        doPlayerSetExperienceRate(cid, rates[SKILL__FIST]+exp_info.rate)
        setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro
    end 
    return true
end]]></event>
<event type="think" name="FistPotionThink" event="script"><![CDATA[
domodlib('fistpotion')
function onThink(cid, interval)
    if getPlayerStorageValue(cid, exp_info.storage[3]) > 0 and getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua Taijutsu Scroll acabou!") 
        -- doPlayerSetExperienceRate(cid, getPlayerStorageValue(cid, exp_info.storage[2]))
        local rates = getPlayerRates(cid)
        doPlayerSetExperienceRate(cid, rates[SKILL__FIST]-exp_info.rate)
        setPlayerStorageValue(cid, exp_info.storage[3], 0) -- registro
    end
    return true
end]]></event>
<talkaction words="!TaijutsuScroll;/TaijutsuScroll;!Tj;/TaijutsuScroll" event="buffer"><![CDATA[
domodlib('fistpotion')
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 and "Você não possui Taijutsu Scroll ativa no momento." or "Você tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Xp Scroll.")]]></talkaction>
<action itemid="14565" event="script"><![CDATA[
domodlib('fistpotion')
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar outro Taijutsu Scroll. Você já possui uma Ativa. E Ainda restam: "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time())..".") return true
    end
    
    local rates = getPlayerRates(cid)
    -- setPlayerStorageValue(cid, exp_info.storage[2], rates[SKILL__FIST])
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você ativou o Taijutsu Scroll por "..exp_info.minutes.." minutos! Durante este tempo, você irá Upar Taijutsu +20% Mais Rápido Para saber o tempo, digite: /TaijutsuScroll") 
    setPlayerStorageValue(cid, exp_info.storage[1], os.time()+exp_info.minutes*60)
    setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro
    doPlayerSetExperienceRate(cid, rates[SKILL__FIST]+exp_info.rate)
    registerCreatureEvent(cid, "FistPotionThink")
    doRemoveItem(item.uid,1)
    return true
end]]></action>
</mod>

Link to post
Share on other sites

Tenta não mudar isso:

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

e testa ai

dps dou uma olhada no script, não faço ideia qual nome das suas skill ou id

Link to post
Share on other sites

37 minutos atrás, Nysman disse:

Tenta não mudar isso:

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

e testa ai

dps dou uma olhada no script, não faço ideia qual nome das suas skill ou id

Sem sucesso.

 

Link to post
Share on other sites

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>

 

vodkart_logo.png

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

 

Dota System 8.6 Com Buffs Automáticos + MAPA (100%) - PVP

Link para Downloadhttps://www.4shared.com/rar/SMta8CQ8fi/Dota_Venda.html?

 

[+]--------------------------------------[+]-------------------------------------------[+]

 

DISCORDvodkart#6090

 

Link to post
Share on other sites

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

Link to post
Share on other sites

@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.*]

 

Dota System 8.6 Com Buffs Automáticos + MAPA (100%) - PVP

Link para Downloadhttps://www.4shared.com/rar/SMta8CQ8fi/Dota_Venda.html?

 

[+]--------------------------------------[+]-------------------------------------------[+]

 

DISCORDvodkart#6090

 

Link to post
Share on other sites

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

Link to post
Share on other sites

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.*]

 

Dota System 8.6 Com Buffs Automáticos + MAPA (100%) - PVP

Link para Downloadhttps://www.4shared.com/rar/SMta8CQ8fi/Dota_Venda.html?

 

[+]--------------------------------------[+]-------------------------------------------[+]

 

DISCORDvodkart#6090

 

Link to post
Share on other sites

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:

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By iTzBrHue3
      .Qual servidor ou website você utiliza como base?  OTX 2.8
       
      Qual o motivo deste tópico? Duvida
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
          -- HP --
          conditionHP = createConditionObject(CONDITION_ATTRIBUTES)
          setConditionParam(conditionHP, CONDITION_PARAM_TICKS, -1)
          setConditionParam(conditionHP, CONDITION_PARAM_STAT_MAXHEALTH, n)
          setConditionParam(conditionHP, CONDITION_PARAM_BUFF, true)
          setConditionParam(conditionHP, CONDITION_PARAM_SUBID, 90)
          -- MANA --
          conditionMP = createConditionObject(CONDITION_ATTRIBUTES)
          setConditionParam(conditionMP, CONDITION_PARAM_TICKS, -1)
          setConditionParam(conditionMP, CONDITION_PARAM_STAT_MAXMANA, 9999)
          setConditionParam(conditionMP, CONDITION_PARAM_BUFF, true)
          setConditionParam(conditionMP, CONDITION_PARAM_SUBID, 91)
          -- Magic Level --
          conditionML = createConditionObject(CONDITION_ATTRIBUTES)
          setConditionParam(conditionML, CONDITION_PARAM_TICKS, -1)
          setConditionParam(conditionML, CONDITION_PARAM_STAT_MAGICLEVEL, 99)
          setConditionParam(conditionML, CONDITION_PARAM_BUFF, true)
          setConditionParam(conditionML, CONDITION_PARAM_SUBID, 92)
          -- MELEE --
          conditionMELEE = createConditionObject(CONDITION_ATTRIBUTES)
          setConditionParam(conditionMELEE, CONDITION_PARAM_TICKS, -1)
          setConditionParam(conditionMELEE, CONDITION_PARAM_SKILL_CLUB, 99)
          setConditionParam(conditionMELEE, CONDITION_PARAM_SKILL_SWORD, 99)
          setConditionParam(conditionMELEE, CONDITION_PARAM_SKILL_AXE, 99)
          setConditionParam(conditionMELEE, CONDITION_PARAM_BUFF, true)
          setConditionParam(conditionMELEE, CONDITION_PARAM_SUBID, 93)
          -- Shield --
          conditionSHI = createConditionObject(CONDITION_ATTRIBUTES)
          setConditionParam(conditionSHI, CONDITION_PARAM_TICKS, -1)
          setConditionParam(conditionSHI, CONDITION_PARAM_SKILL_SHIELD, 99)
          setConditionParam(conditionSHI, CONDITION_PARAM_BUFF, true)
          setConditionParam(conditionSHI, CONDITION_PARAM_SUBID, 94)
          -- Dist --
          conditionDIST = createConditionObject(CONDITION_ATTRIBUTES)
          setConditionParam(conditionDIST, CONDITION_PARAM_TICKS, -1)
          setConditionParam(conditionDIST, CONDITION_PARAM_SKILL_DISTANCE, 99)
          setConditionParam(conditionDIST, CONDITION_PARAM_BUFF, true)
          setConditionParam(conditionDIST, CONDITION_PARAM_SUBID, 95)
      function onLogin(cid)
          doAddCondition(cid, conditionHP)
          doAddCondition(cid, conditionMP)
          doAddCondition(cid, conditionML)
          doAddCondition(cid, conditionMELEE)
          doAddCondition(cid, conditionSHI)
          doAddCondition(cid, conditionDIST)
          return true
      end
       
       
      Como eu faço pra adcionar os valores das condition vindo de um storage do player?
       
    • By Myalitth
      .Qual servidor ou website você utiliza como base? 
       
      OTX -  TFS 1.2
       
      Boa Noite, eu gostaria de um script que fizesse com que um item x sumisse de determinado SQM quando um player pise em um determinado tile (sqm) e reaparecer quando o player sair do tile...
      Se possivel com um exausted entre efeitos (ações).
       
      Exemplo a ilha da Spike Sword em Rookgaard, só que com um tile proximo em que possa sumir o item ao pisar.
       
      Eu tentei porém não obtive exito
       
       
    • By Nto Avus Official
      Opa rapazeada queria uma ajuda pra colocar esse script de akatsuki pra dar a outfit e dar dano, pros jogadores, queria que não desse hp e sim dano tipo uns 2000 de dano.
       
      Script
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • By Nother
      Olá, gostaria de um sistema de baú donate, onde a pessoa faz o donate, e eu como adm entro no game e coloco os pontos(itens) nesse baú, e somente essa pessoa que eu determinei que vai poder retirar esses itens.
      Esse baú vai funcionar para todos os player mas somente os que eu determinar os itens que poderão retirar. Desde já agradeço
      Meu tfs é 0.4
      Ate disponibilizaria algum código para facilitar mas não faço a menor ideia qual codigo se aproxima mais disso
      Ja vi esse sistema funcionando no Wodbo Wars
       
       

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...

Important Information

Confirmação de Termo