DU

Exp Amulet 90%

Por dustot, 23 de mar. de 2011 em Scripts

script
29
5.5k
VodkartV
25 de março de 2011 às 11:45

junto com esses

 

buypremium_command.xml

buypremium_command.xml

custommonsters.xml

customspells.xml

firstitems.xml

highscorebook.xml

mangousM
26 de março de 2011 às 00:49

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!!

VodkartV
26 de março de 2011 às 11:02

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

dustotD
26 de março de 2011 às 13:59

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

VodkartV
26 de março de 2011 às 15:54

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

dustotD
26 de março de 2011 às 15:58

Sim, depois que mandei o erro lembrei do que tu tinha falado, to aguardando os minutos heim :)

Vlw

VodkartV
26 de março de 2011 às 16:32

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>

dustotD
26 de março de 2011 às 17:54

Coloquei, asism que der shut ti falo como tá.

Obrigado

VodkartV
26 de março de 2011 às 19:11

no aguardo.

mangousM
29 de março de 2011 às 21:18

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!

dustotD
01 de abril de 2011 às 20:09

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>

 

1 ano depois...
15 de junho de 2012 às 17:13

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 Junho 15 por TiagoBordin1988

VodkartV
15 de junho de 2012 às 18:21

@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>

15 de junho de 2012 às 18:45

@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ê !!!!!