Ir para conteúdo
  • 0

Exp Amulet 90%


dustot

Pergunta

Bom, o script está td certo, funcionou certinho aqui MAS... é o seguindo: Ele não é de usar e sim de clicar. Você clica nele, ae fala: "Your extra experience rate is now: " 3x+". It will last for "5" hours." ta blz..Triplico o normal que eu tava ganhando. Ae se eu morro, ou logo o char a exp volta pro normal, mas se eu tento usar o amuleto denovo fala: "You still have extra experience time left.". O que eu quero? -> "Que toda vez que o player logar ou morrer ele continue com a exp até o perido acaba, e sempre que ele logar aparecer a msg : You still have "15" minuts left of your expirence rate e que o player tenha um comando para saber o quanto ele ainda tem de exp time" O Item usado é Shockwave Amulet ID: 10221.

 

data/actions/expamulet.lua

local config = {
   	rate = 3, -- 4x More Experience
   	time = 5, -- Hours of Exp Time
   	storage = 20012
}
local function endExpRate(cid)
   	if isPlayer(cid) == TRUE then
           	doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
           	setPlayerStorageValue(cid, config.storage, -1)
           	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
   	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
   	if(getPlayerStorageValue(cid, config.storage) < 0) then
           	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
           	doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
           	setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
           	addEvent(endExpRate, config.time * 3600 * 1000, cid)
           	doRemoveItem(item.uid, 1)
   	else
           	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
   	end
   	return TRUE
end

data/actions/actions.xml

 

	<action itemid="10221" event="script" value="expamulet.lua"/> 

 

Agradeço a ajuda de quem arrumar! Obrigado

Editado por small201
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

Ai Vodkart, Eu coloquei o Seguinte Arquivo na PAsta Mods, junto co makeles arquivos que vc me falou ali em cima!

 

Meu script ta assim:

itemexp.xml

<?xml version="1.0" encoding="UTF-8"?> 
<mod name="itemexp" version="1.0" author="vodka" contact="xtibia.com" enabled="yes"> 
       <config name="itemexp"><![CDATA[ 
info = {  
       rate = 0.5, 
       time = 5, -- Hours 
       storage = 20012  
}  
function endExpRate(cid)  
       if isPlayer(cid) == TRUE then  
               doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate  
               setPlayerStorageValue(cid, info.storage, -1)  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')  
       end  
end 

]]></config> 
<event type="login" name="check_rate" event="script"><![CDATA[ 
domodlib('itemexp') 
function onLogin(cid) 
               if getPlayerStorageValue(cid, info.storage) >= os.time() then 
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate) 
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. math.floor((getPlayerStorageValue(cid, info.storage) - os.time())/(3600)) ..' hours.')  
               addEvent(endExpRate, math.floor(getPlayerStorageValue(cid, info.storage) - os.time())*3600*1000, cid) 
             end 
        return true 
end]]></event> 
       <action itemid="5937" event="script"><![CDATA[ 
       domodlib('itemexp') 
       function onUse(cid, item, frompos, item2, topos)  
       if (getPlayerStorageValue(cid, info.storage) <= os.time()) then 
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. info.time ..' hours.')  
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)  
               setPlayerStorageValue(cid, info.storage, os.time()+info.time*3600)  
               addEvent(endExpRate, info.time *3600*1000, cid)  
               doRemoveItem(item.uid, 1)  
       else  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')  
       end  
   return true 
end]]></action> 
</mod>

 

e Quando eu dou use no item 5937 no meu ot, aparece isso : You cannot use this object!

 

eu n sei qq ta errado !!

Esse script só fnciona se for amulet ??

 

Aguardo Resposta, Obrigado!!

Link para o comentário
Compartilhar em outros sites

  • 0

não sei,eu testei com esse seu item e deu o.O

 

11:01 Your extra experience rate is now: 0.5. It will last for 5 hours.

 

ve em actions.xml se não está duplicado o id do item...

Link para o comentário
Compartilhar em outros sites

  • 0

Vodkart veja isto:

 

Quando uso o amuleto :

13:46 Your extra experience rate is now: 3. It will last for 5 hours.

Quando logo e entro na msm hr :

13:46 Your extra experience rate is now: 3. It will last for 4 hours.

 

Ou seja, ele ta comendo 1 hr de exp já direto quando vc loga. Dá pra fazer algo?

Ah e tu arrumou pra contar os minutos tmb?

Obrigado

Link para o comentário
Compartilhar em outros sites

  • 0

como falei cara,vai aparecer 4 horas porque?

 

vc ativa ele com 5 horas certo,ai reloga vai ficar tipo "4 horas e 59 minutos"

como está só para contar as horas fica aparecendo só "4 horas",depois coloco pra contar os minutos :p

Link para o comentário
Compartilhar em outros sites

  • 0

pronto,usa esse que está funfando 100% !

 

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">  
       <config name="expamulet"><![CDATA[  
info = {   
       rate = 3,  
       time = 5, -- Hours  
       storage = 20013   
}   
function endExpRate(cid)   
       if isPlayer(cid) == TRUE then   
               doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate   
               setPlayerStorageValue(cid, info.storage, -1)   
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')   
       end   
end  

]]></config>  
<event type="login" name="check_rate" event="script"><![CDATA[  
domodlib('expamulet')  
function onLogin(cid)  
               if getPlayerStorageValue(cid, info.storage) >= os.time() then  
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. os.date("%H", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ':' .. os.date("%M", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ' hours.')  
               addEvent(endExpRate, math.floor(getPlayerStorageValue(cid, info.storage) - os.time())*3600*1000, cid)  
             end  
        return true  
end]]></event>  
       <action itemid="10221" event="script"><![CDATA[  
       domodlib('expamulet')  
       function onUse(cid, item, frompos, item2, topos)   
       if (getPlayerStorageValue(cid, info.storage) <= os.time()) then  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. info.time ..' hours.')   
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)   
               setPlayerStorageValue(cid, info.storage, os.time()+info.time*3600*1000)   
               addEvent(endExpRate, info.time *3600*1000, cid)   
               doRemoveItem(item.uid, 1)   
       else   
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')   
       end   
   return true  
end]]></action>  
</mod>

Link para o comentário
Compartilhar em outros sites

  • 0

Desiste de mudar o id do item.... e coloquei o script do jeito que tava aqui

 

expamulet.xml

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">  
       <config name="expamulet"><![CDATA[  
info = {   
       rate = 3,  
       time = 5, -- Hours  
       storage = 20012   
}   
function endExpRate(cid)   
       if isPlayer(cid) == TRUE then   
               doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate   
               setPlayerStorageValue(cid, info.storage, -1)   
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')   
       end   
end  

]]></config>  
<event type="login" name="check_rate" event="script"><![CDATA[  
domodlib('expamulet')  
function onLogin(cid)  
               if getPlayerStorageValue(cid, info.storage) >= os.time() then  
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. math.floor((getPlayerStorageValue(cid, info.storage) - os.time())/(3600)) ..' hours.')   
               addEvent(endExpRate, math.floor(getPlayerStorageValue(cid, info.storage) - os.time())*3600*1000, cid)  
             end  
        return true  
end]]></event>  
       <action itemid="10221" event="script"><![CDATA[  
       domodlib('expamulet')  
       function onUse(cid, item, frompos, item2, topos)   
       if (getPlayerStorageValue(cid, info.storage) <= os.time()) then  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. info.time ..' hours.')   
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)   
               setPlayerStorageValue(cid, info.storage, os.time()+info.time*3600)   
               addEvent(endExpRate, info.time *3600*1000, cid)   
               doRemoveItem(item.uid, 1)   
       else   
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')   
       end   
   return true  
end]]></action>  
</mod>

 

e no

 

Itens.xml

        <item id="10221" article="a" name="Exp Amulet"> 
               <attribute key="description" value="Mais experiência para seu char." /> 
               <attribute key="weight" value="700" /> 
               <attribute key="slotType" value="necklace" /> 
       </item>


 

E mesmo depois de colocar esse expamulet na pasta mods... continua sem funcionar.... já não sei mais o que fazer :S:S

 

Teria outro script que o player pudece usar um item e dava + 50% de exp pra ele nas próximas 6 horas ?

 

Se tiver posta aqui pra mim porque eu vi uns outros mas todo mundo reclamando de bugs neles, ai eu fico meio perdido!!

 

Muito obrigado denovo!!

 

vlws!

Link para o comentário
Compartilhar em outros sites

  • 0

Pinpão. Ta Aqui:

 

 

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">  
       <config name="expamulet"><![CDATA[  
info = {   
       rate = 3,  
       time = 5, -- Hours  
       storage = 20013   
}   
function endExpRate(cid)   
       if isPlayer(cid) == TRUE then   
               doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate   
               setPlayerStorageValue(cid, info.storage, -1)   
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')   
       end   
end  

]]></config>  
<event type="login" name="check_rate" event="script"><![CDATA[  
domodlib('expamulet')  
function onLogin(cid)  
               if getPlayerStorageValue(cid, info.storage) >= os.time() then  
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. os.date("%H", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ':' .. os.date("%M", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ' hours.')  
               addEvent(endExpRate, math.floor(getPlayerStorageValue(cid, info.storage) - os.time())*3600*1000, cid)  
             end  
        return true  
end]]></event>  
       <action itemid="10221" event="script"><![CDATA[  
       domodlib('expamulet')  
       function onUse(cid, item, frompos, item2, topos)   
       if (getPlayerStorageValue(cid, info.storage) <= os.time()) then  
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. info.time ..' hours.')   
               doPlayerSetRate(cid, SKILL__LEVEL, info.rate)   
               setPlayerStorageValue(cid, info.storage, os.time()+info.time*3600*1000)   
               addEvent(endExpRate, info.time *3600*1000, cid)   
               doRemoveItem(item.uid, 1)   
       else   
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')   
       end   
   return true  
end]]></action>  
</mod>

 

Link para o comentário
Compartilhar em outros sites

  • 0

pronto,usa esse que está funfando 100% !

 

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">  
	<config name="expamulet"><![CDATA[  
info = {  
	rate = 3,  
	time = 5, -- Hours  
	storage = 20013  
}  
function endExpRate(cid)  
	if isPlayer(cid) == TRUE then  
			doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate  
			setPlayerStorageValue(cid, info.storage, -1)  
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')  
	end  
end  

]]></config>  
<event type="login" name="check_rate" event="script"><![CDATA[  
domodlib('expamulet')  
function onLogin(cid)  
			if getPlayerStorageValue(cid, info.storage) >= os.time() then  
			doPlayerSetRate(cid, SKILL__LEVEL, info.rate)  
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. os.date("%H", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ':' .. os.date("%M", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ' hours.')  
			addEvent(endExpRate, math.floor(getPlayerStorageValue(cid, info.storage) - os.time())*3600*1000, cid)  
		  end  
	 return true  
end]]></event>  
	<action itemid="10221" event="script"><![CDATA[  
	domodlib('expamulet')  
	function onUse(cid, item, frompos, item2, topos)  
	if (getPlayerStorageValue(cid, info.storage) <= os.time()) then  
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. info.time ..' hours.')  
			doPlayerSetRate(cid, SKILL__LEVEL, info.rate)  
			setPlayerStorageValue(cid, info.storage, os.time()+info.time*3600*1000)  
			addEvent(endExpRate, info.time *3600*1000, cid)  
			doRemoveItem(item.uid, 1)  
	else  
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')  
	end  
return true  
end]]></action>  
</mod>

 

Vodkart teria como colocar pra dar tipo 30% a mais só de exp ?

Editado por TiagoBordin1988
Link para o comentário
Compartilhar em outros sites

  • 0

@up

 

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">  
       <config name="expamulet"><![CDATA[  
info = {   
       rate = 1.3,  -- 30%
       time = 5, -- Hours  
       storages = {451201,451202}   
}    
]]></config>  
<event type="login" name="check_rate" event="script"><![CDATA[  
domodlib('expamulet')  
function onLogin(cid)  
               if getPlayerStorageValue(cid, info.storages[1]) >= os.time() then  
               doPlayerSetExperienceRate(cid, info.rate)
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: '..((info.rate - 1)*100)..'% More. the exp ends: '..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,info.storages[1]))..'.')  
             end  
        return true  
end]]></event>  
       <action itemid="10221" event="script"><![CDATA[  
       domodlib('expamulet')  
       function onUse(cid, item, frompos, item2, topos)   
       if (getPlayerStorageValue(cid, info.storages[1]) >= os.time()) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.') 
end 
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: '..((info.rate - 1)*100)..'% More. It will last for '.. info.time ..' hours.')   
               doPlayerSetExperienceRate(cid, info.rate) 
               setPlayerStorageValue(cid, info.storages[1], os.time()+info.time*3600)
               setPlayerStorageValue(cid, info.storages[2], 1)    
               doRemoveItem(item.uid, 1)  
   return true  
end]]></action>
<globalevent name="ExpAmuletCheck" interval="60" event="script"><![CDATA[
domodlib('expamulet') 
function onThink(interval, lastExecution)
local on = getPlayersOnline()
if #on > 0 then
for i = 1, #on do
if getPlayerStorageValue(on[i], info.storages[2]) == 1 and getPlayerStorageValue(on[i], info.storages[1]) <= os.time() then
doPlayerSetRate(on[i], SKILL__LEVEL, 1)
setPlayerStorageValue(on[i], info.storages[1], -1)   
setPlayerStorageValue(on[i], info.storages[2], -1)   
doPlayerSendTextMessage(on[i], MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')
end
end
end  
return true
end
]]></globalevent>
</mod>

Link para o comentário
Compartilhar em outros sites

  • 0

@up

 

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">  
	<config name="expamulet"><![CDATA[  
info = {  
	rate = 1.3,  -- 30%
	time = 5, -- Hours  
	storages = {451201,451202}  
}	
]]></config>  
<event type="login" name="check_rate" event="script"><![CDATA[  
domodlib('expamulet')  
function onLogin(cid)  
			if getPlayerStorageValue(cid, info.storages[1]) >= os.time() then  
			doPlayerSetExperienceRate(cid, info.rate)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: '..((info.rate - 1)*100)..'% More. the exp ends: '..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,info.storages[1]))..'.')  
		  end  
	 return true  
end]]></event>  
	<action itemid="10221" event="script"><![CDATA[  
	domodlib('expamulet')  
	function onUse(cid, item, frompos, item2, topos)  
	if (getPlayerStorageValue(cid, info.storages[1]) >= os.time()) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')
end
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: '..((info.rate - 1)*100)..'% More. It will last for '.. info.time ..' hours.')  
			doPlayerSetExperienceRate(cid, info.rate)
			setPlayerStorageValue(cid, info.storages[1], os.time()+info.time*3600)
			setPlayerStorageValue(cid, info.storages[2], 1)	
			doRemoveItem(item.uid, 1)  
return true  
end]]></action>
<globalevent name="ExpAmuletCheck" interval="60" event="script"><![CDATA[
domodlib('expamulet')
function onThink(interval, lastExecution)
local on = getPlayersOnline()
if #on > 0 then
for i = 1, #on do
if getPlayerStorageValue(on[i], info.storages[2]) == 1 and getPlayerStorageValue(on[i], info.storages[1]) <= os.time() then
doPlayerSetRate(on[i], SKILL__LEVEL, 1)
setPlayerStorageValue(on[i], info.storages[1], -1)  
setPlayerStorageValue(on[i], info.storages[2], -1)  
doPlayerSendTextMessage(on[i], MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')
end
end
end  
return true
end
]]></globalevent>
</mod>

 

Obrigado deu certinho =D Rep + pra você !!!!!

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...