Postado Dezembro 27, 2016 8 anos Boa tarde, peguei um script de base daqui do Tibiaking o sistema de aura. Base: Porém eu gostaria de fazer com que a pessoa só usasse a aura se tivesse feito a quest. Scripts da quest já estão feitos: Bau.lua function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerStorageValue(cid, 25950) == -1) then doPlayerSendTextMessage(cid,22,"Aura Level 1") setPlayerStorageValue(cid, 25950, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE) else doPlayerSendTextMessage(cid,22,"O bau esta vazio.") end return true end Creio que é aqui que muda algo: function onSay(cid, words, param, channel) if(param=="on") then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura novamente.") else if(getPlayerStorageValue(cid, aurastr)==2) then doPlayerSendCancel(cid,"Sua Aura Level 1 já está habilitada.") elseif(getPlayerStorageValue(cid, aurastr)==-1) then doPlayerSendCancel(cid,"Aura ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura(1,tempo/8,cid) end end elseif(param=="off") then if(getPlayerStorageValue(cid, aurastr)==2) then setPlayerStorageValue(cid, estr, os.time()+2) setPlayerStorageValue(cid, aurastr, -1) doPlayerSendCancel(cid,"Aura Level 1 desligada!") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite '!aura on' para ligar sua aura, e '!aura off' para desligá-la.") end return TRUE end Também tentei modificar o creaturescript porém não deu certo. function onLogin(cid) aurastr = 25950 -- storage da aura if getPlayerStorageValue(cid, 25950) == 1 then setPlayerStorageValue(cid, aurastr, -1) return TRUE end end Agradeço desde já. Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
Postado Dezembro 27, 2016 8 anos function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 25950) <= 0 then doPlayerSendCancel(cid, "Você precisa ter feito a quest.") return true end if(param=="on") then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura novamente.") else if(getPlayerStorageValue(cid, aurastr)==2) then doPlayerSendCancel(cid,"Sua Aura Level 1 já está habilitada.") elseif(getPlayerStorageValue(cid, aurastr)==-1) then doPlayerSendCancel(cid,"Aura ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura(1,tempo/8,cid) end end elseif(param=="off") then if(getPlayerStorageValue(cid, aurastr)== 2) then setPlayerStorageValue(cid, estr, os.time()+2) setPlayerStorageValue(cid, aurastr, -1) doPlayerSendCancel(cid,"Aura Level 1 desligada!") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite '!aura on' para ligar sua aura, e '!aura off' para desligá-la.") end return true end Editado Dezembro 27, 2016 8 anos por Vodkart (veja o histórico de edições) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Dezembro 27, 2016 8 anos Autor 1 hora atrás, Vodkart disse: function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 25950) <= 0 then doPlayerSendCancel(cid, "Você precisa ter feito a quest.") return true end if(param=="on") then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura novamente.") else if(getPlayerStorageValue(cid, aurastr)==2) then doPlayerSendCancel(cid,"Sua Aura Level 1 já está habilitada.") elseif(getPlayerStorageValue(cid, aurastr)==-1) then doPlayerSendCancel(cid,"Aura ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura(1,tempo/8,cid) end end elseif(param=="off") then if(getPlayerStorageValue(cid, aurastr)== 2) then setPlayerStorageValue(cid, estr, os.time()+2) setPlayerStorageValue(cid, aurastr, -1) doPlayerSendCancel(cid,"Aura Level 1 desligada!") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite '!aura on' para ligar sua aura, e '!aura off' para desligá-la.") end return true end Funcionou perfeitamente, porém tem o problema de logar e ter que diminuir a storage: function onLogin(cid) aurastr = 25950 -- storage da aura if getPlayerStorageValue(cid, 25950) == 1 then setPlayerStorageValue(cid, aurastr, -1) return TRUE end end Encontrei outro erro. Tentei fazer outra aura, mas elas não são independentes. Se eu uso !aura1 on ela liga a mais forte que no caso é a aura 3 Editado Dezembro 27, 2016 8 anos por moviebr (veja o histórico de edições) Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
Postado Dezembro 29, 2016 8 anos Autor UP Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
Postado Dezembro 29, 2016 8 anos Autor Consegui arrumar. Para quem tem dúvida é só mudar o nome das storages. Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
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.