Ir para conteúdo

Featured Replies

Resolvido por llucas75

Ir para solução
  • Respostas 15
  • Visualizações 2.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Ta e ....   potionexp.lua     actions.xml     perdexp.lua     creaturescript.xml     login.lua     Configure em potionexp ( tem altes comentários

  • Configurado para durar 1 dia. ------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE configs = { time = 1440, ---- TIME IN MINUTES needpa = TRUE, needlvl = {TRUE, level = 1}, costmana = {TRUE, mana = 1000

Postado
  • Solução

Ta e ....

 

potionexp.lua

 

function onUse(cid, item, frompos, item2, topos)


local pausa = 30*60*1000 -- (1000 = 1 segundos) Tempo que o script durará
local texto = "Você dobrou sua Experiencia por 30 minutos" -- Texto que irá receber ao usar a potion.
textofinal = "Acabou o potion de Experiencia." -- Texto que irá receber quando o efeito da potion acabar.
local exp = 2 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server.
expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal.
local limitedeuso = 49015
local tempo = 30*60*1000 -- 1000 = 1s então 1000 vezes 60 vezes 30 = 30 minutos
local textofinal1 = "Você já esta sob efeito da pot de experiência espere o efeito acabar."
local seuitem = 9930 -- seu item que dará double exp
local efeito1 = 13 -- efeito que ficara com o char por meia hora
local efeito2 = 35 -- efeito que acontecera no momento que usar a pot

local timeEffect = 1801 -- tempo em segundos que o efeito vai apareceer no player, 31 = 30 segundos. sempre coloque 1 segundo a mais.

function effect()
if isPlayer(cid) then
local pos = getCreaturePosition(cid)
doSendMagicEffect(pos, efeito1)
end
end

if item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() <= 0) then
doRemoveItem(item.uid,1)
doPlayerSetExperienceRate(cid,exp)
doSendMagicEffect(frompos,efeito2)
setPlayerStorageValue(cid, limitedeuso, os.time() + 30)
doPlayerSendTextMessage(cid,22,texto)
addEvent(potion,pausa,cid)

a = 1
while a ~= timeEffect do
addEvent(effect, a * 1000)
a = a + 1
end

elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then
doPlayerSendTextMessage(cid,22,textofinal1)
end


return true
end


function potion(cid)
doPlayerSetExperienceRate(cid,expfinal)
doPlayerSendTextMessage(cid,22,textofinal)
end

 

actions.xml

 

<action itemid="7488" script="potionexp.lua"/>

 

perdexp.lua

 

function onLogout(cid)
local stor = 49015
 
if getPlayerStorageValue(cid, stor) >= 1 then
setPlayerStorageValue(cid, stor, 0)
else
end
return true

end

 

creaturescript.xml

 

<event type="logout" name="perderefeito" event="script" value="perdexp.lua"/>

 

login.lua

 

registerCreatureEvent(cid, "perdereifeto")

 

Configure em potionexp ( tem altes comentários :)

Postado

Ok, pasta principal do seu servidor, pasta mods crie um arquivo com o nome de exp.xml e dentro coloque:

 

------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE
configs = {
time = 30, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {TRUE, level = 1},
costmana = {TRUE, mana = 1000},
addrate = 100, -- Exp que vai adicionar em %
removeonuse = TRUE
}
function getTime(s)
local n = math.floor(s / 60)
s = s - (60 * n)
return n, s
end
CreatureEventChecker = function(event, ...) -- Colex
if isCreature(arg[1]) then
event(unpack(arg))
end
end
creatureEvent = function(event, delay, ...) -- Colex
addEvent(CreatureEventChecker, delay, event, unpack(arg))
end
function getPlayerExtraExpRate(cid) -- By MatheusMkalo
return (getPlayerRates(cid)[8]-1)*100
end
]]>

domodlib('PotionExpConfigs')
if getPlayerStorageValue(cid, 62164) >= 1 then
return doPlayerSendCancel(cid, "You are already taking effect from this item.")
end
if configs.needpa and not isPremium(cid) then
return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.")
end
if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then
return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.")
end
if configs.costmana[1] then
if getCreatureMana(cid) < configs.costmana.mana then
return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.")
else
doCreatureAddMana(cid, -configs.costmana.mana)
end
end
if configs.removeonuse then
doRemoveItem(item.uid, 1)
end

for i = configs.time*60, 1, -1 do
local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))
if #a < 4 then
a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)
end
if i == configs.time*60 then
creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the exp potion end.")
setPlayerStorageValue(cid, 62164, 0)
end
creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "2x de experiencia!, o efeito acabara em "..a..".")
end
doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100))
creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100)))
doPlayerSendTextMessage(cid, 22, "Agora voce ira receber mais exp por matar os mosntros.")
setPlayerStorageValue(cid, 62164, os.time())
creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0)
return TRUE
]]>
domodlib('PotionExpConfigs')
local time = configs.time
if os.time()-getPlayerStorageValue(cid, 62164) < time *60 then
doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100))
creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100)))
creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000 , cid, 62164, 0)
for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62164))), 1, -1 do
local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))
if #a < 4 then
a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)
end
if i == (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) then
creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62164)))*1000, cid, "The effect of the exp potion end.")
end
creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "2x de experiencia!, o efeito acabara em "..a..".")
end
end
return TRUE
]]>

 

Como configurar:

addrate = 100, -- Exp que vai adicionar em %, no caso está DOUBLE EXP

removeonuse = TRUE - se o item vai ser infinito ou não

<action itemid="12289" event="script"><![CDATA[ - Aqui será o id do item q vc vai usar para dar a exp bonus

 

 

Entendeu?

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo