Ir para conteúdo

[PEDIDO] Colocar magic effect no exp ring (a cada 1 segundo)

Featured Replies

  • Respostas 27
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Amigo, tentei de todos os jeitos que eu consegui pensar. Essa foi a forma final que consegui chegar, vê se dá certo: local efeito = 15 local storage = 27398 function onEquip(cid, item, slot, fromPo

Postado

Amigo, após parar e pensar um pouco mais, cheguei à isso:

Substitua seu script do ring por esse:

local storage = 27398
local efeito = 15
local playerpos = getPlayerPosition(pid)

function onEquip(cid, item, slot, fromPosition, toPosition)

doSendMagicEffect(playerpos, efeito)

local rate = {}

if getPlayerLevel(cid) <= 1000 then
rate = 2
elseif getPlayerLevel(cid) > 1001 and getPlayerLevel(cid) <= 2000 then
rate = 2
elseif getPlayerLevel(cid) > 2001 and getPlayerLevel(cid) <= 3000 then
rate = 2
elseif getPlayerLevel(cid) > 3001 and getPlayerLevel(cid) <= 4000 then
rate = 2
elseif getPlayerLevel(cid) > 4001 then
rate = 2
end

setPlayerStorageValue(cid, storage, 1)

doTransformItem(item.uid, 10309, 1)
doPlayerSendTextMessage(cid, 22, "Sua experiencia foi multiplicada (2x).")
doPlayerSetExperienceRate(cid, rate)
return TRUE
end


function onDeEquip(cid, item, slot)

setPlayerStorageValue(cid, storage, -1)

doTransformItem(item.uid, 10310, 1)
doPlayerSendTextMessage(cid, 22, "Sua experiencia esta de volta ao normal.")
doPlayerSetExperienceRate(cid, 1.0)
return TRUE
end

E adiciona essa tag em globalevents.xml:

	<globalevent name="EffectExpRing" interval="1000" event="script" value="effectExpRing.lua"/>

Agora cria um arquivo chamado effectExpRing.lua dentra da pasta data\globalevents\scripts e coloca isso dentro:

local playerpos = getPlayerPosition(pid)
local efeito = 15
local storage = 27398

function onThink(interval, lastExecution)
if getPlayerStorageValue(cid, storage) >= 1 then
doSendMagicEffect(playerpos, efeito)
end
return true
end

Pronto, tenho 90% de ctz que vai funcionar. ^^

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Postado

Boa Dani... Nem lembrava que dava pra fazer isso rsrsrs...

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Postado

Dando uma olhada rápida, tenta assim:

Script do ring:

local storage = 27398local efeito = 15local playerpos = getPlayerPosition(cid)function onEquip(cid, item, slot, fromPosition, toPosition)doSendMagicEffect(playerpos, efeito)local rate = {}if getPlayerLevel(cid) <= 1000 thenrate = 2elseif getPlayerLevel(cid) > 1001 and getPlayerLevel(cid) <= 2000 thenrate = 2elseif getPlayerLevel(cid) > 2001 and getPlayerLevel(cid) <= 3000 thenrate = 2elseif getPlayerLevel(cid) > 3001 and getPlayerLevel(cid) <= 4000 thenrate = 2elseif getPlayerLevel(cid) > 4001 thenrate = 2endsetPlayerStorageValue(cid, storage, 1)doTransformItem(item.uid, 10309, 1)doPlayerSendTextMessage(cid, 22, "Sua experiencia foi multiplicada (2x).")doPlayerSetExperienceRate(cid, rate)return TRUEendfunction onDeEquip(cid, item, slot)setPlayerStorageValue(cid, storage, -1)doTransformItem(item.uid, 10310, 1)doPlayerSendTextMessage(cid, 22, "Sua experiencia esta de volta ao normal.")doPlayerSetExperienceRate(cid, 1.0)return TRUEend
E o globalevent:

local playerpos = getPlayerPosition(cid)local efeito = 15local storage = 27398function onThink(interval, lastExecution)if getPlayerStorageValue(cid, storage) >= 1 thendoSendMagicEffect(playerpos, efeito)endreturn trueend

Editado por danihcv (veja o histórico de edições)

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

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