Ir para conteúdo
  • Cadastre-se

(Resolvido)[PEDIDO] Spell que aumenta ataque speed


Ir para solução Resolvido por Mathias Kenfi,

Posts Recomendados

Bom dia tibiano, gostaria de uma pequena ajuda, gostaria de um spell que aumenta o ataquespeed que apenas pally pode usar por 10 segundos, muito obrigado pela colaboração :D

 

tfs 0.4 tibia 8.6 Linux 

Editado por DouglasVinicius (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

Aumente o attackspeed da vocacao 7 e simples

 

Segue o script \/

 

 

function onCastSpell (cid, var)
local store,exausted = 156201,30 -- exaust na talk

if getPlayerStorageValue(cid, store) >= os.time() then

doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.")

return true
end

If getPlayerVocation(cid) = 3 then
local voc = doPlayerSetVocation
addEvent(voc, 10*1000, cid, 7)
setPlayerStorageValue(cid, store, os.time()+exausted)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "ativado 10 segundos.")
else
doPlayerSendCancel(cid, "Apenas Padins utilizam esta spell")
end
return true
end

Link para o post
Compartilhar em outros sites
3 horas atrás, Joaovettor disse:

Aumente o attackspeed da vocacao 7 e simples

 

Segue o script \/

 

 

function onCastSpell (cid, var)
local store,exausted = 156201,30 -- exaust na talk

if getPlayerStorageValue(cid, store) >= os.time() then

doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.")

return true
end

If getPlayerVocation(cid) = 3 then
local voc = doPlayerSetVocation
addEvent(voc, 10*1000, cid, 7)
setPlayerStorageValue(cid, store, os.time()+exausted)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "ativado 10 segundos.")
else
doPlayerSendCancel(cid, "Apenas Padins utilizam esta spell")
end
return true
end



desculpe-me o encomodo, você poderia me explicar como que ela funciona? quantos atkspeed vai aumentar e  onde posso coloca-las? spells ou talkaction, login... @Joaovettor

 

Link para o post
Compartilhar em outros sites
37 minutos atrás, DouglasVinicius disse:

desculpe-me o encomodo, você poderia me explicar como que ela funciona? quantos atkspeed vai aumentar e  onde posso coloca-las? spells ou talkaction, login... @Joaovettor

 

 

Cria um vocação com ID 7 e coloque a attackspeed dele em "100" e edite a attackspeed da vocação de ID 3 e coloque 500

 

O script muda a vocação do player para simular uma mudança de attackspeed

 

Essa é uma maneira de burlar isso, eu não sei como mudar attackspeed sem ser desse jeito

Link para o post
Compartilhar em outros sites
Agora, Joaovettor disse:

Cria um vocação com ID 7 e coloque a attackspeed dele em "100" e edite a attackspeed da vocação de ID 3 e coloque 500

 

O script muda a vocação do player para simular uma mudança de attackspeed

 

Essa é uma maneira de burlar isso, eu não sei como mudar attackspeed sem ser desse jeito

 

@Joaovettor beleza, vou fazer as configurações, isso pode ser bem útil para mim, muito obrigado! 

Link para o post
Compartilhar em outros sites

@Joaovettor Cara, teria como fazer uma spell que quando o player usasse, ele mudaria de vocação e outfit por tempo indeterminado, e quando ele usasse uma outra spell, ele voltasse e também voltasse o outfit?? (se não tiver como voltar o outfit que tava, pode ser male um e female outro)

Link para o post
Compartilhar em outros sites
2 horas atrás, Zazeros disse:

@Joaovettor Cara, teria como fazer uma spell que quando o player usasse, ele mudaria de vocação e outfit por tempo indeterminado, e quando ele usasse uma outra spell, ele voltasse e também voltasse o outfit?? (se não tiver como voltar o outfit que tava, pode ser male um e female 

function onCastSpell(cid, var)
local tempo = 1
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
local voc = doPlayerSetVocation
if sex == 0 and getPlayerVocation(cid) == 3 then
addEvent(voc, 10*1000, cid, 7)
setPlayerStorageValue(cid, store, os.time()+exausted)
doSetCreatureOutfit(cid, male, tempo*1000) else if sex == 1 and getPlayerVocation(cid) == 3 then
addEvent(voc, 10*1000, cid, 7)
setPlayerStorageValue(cid, store, os.time()+exausted)
doSetCreatureOutfit(cid, female, tempo*1000)

end
return true
end

Editado por Joaovettor (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
13 minutos atrás, Zazeros disse:

@Joaovettor Para que seja por tempo indeterminado, eu tiro essa linha? addEvent(voc, 10*1000, cid, 7)

 

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 7)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)
doSetCreatureOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 7)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)
doSetCreatureOutfit(cid, female)
else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return doCombat(cid, combat, var)
end

Magia que cancela

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 17200) >= 1
doPlayerSetVocation(cid, 3)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 3)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, female)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return doCombat(cid, combat, var)
end

Link para o post
Compartilhar em outros sites

@Joaovettor Cara, esta dando esse erro:

 

[31/10/2018 13:19:52] [Error - LuaInterface::loadFile] data/spells/scripts/especial/mode1.lua:6: 'then' expected near 'doPlayerSetVocation'
[31/10/2018 13:19:52] [Error - Event::checkScript] Cannot load script (data/spells/scripts/especial/mode1.lua)
[31/10/2018 13:19:52] data/spells/scripts/especial/mode1.lua:6: 'then' expected near 'doPlayerSetVocation'
[31/10/2018 13:19:52] [Error - LuaInterface::loadFile] data/spells/scripts/especial/mode2.lua:7: '=' expected near 'ï'
[31/10/2018 13:19:52] [Error - Event::checkScript] Cannot load script (data/spells/scripts/especial/mode2.lua)
[31/10/2018 13:19:52] data/spells/scripts/especial/mode2.lua:7: '=' expected near 'ï'

Link para o post
Compartilhar em outros sites
1 hora atrás, Zazeros disse:

@Joaovettor Cara, esta dando esse erro:

 

[31/10/2018 13:19:52] [Error - LuaInterface::loadFile] data/spells/scripts/especial/mode1.lua:6: 'then' expected near 'doPlayerSetVocation'
[31/10/2018 13:19:52] [Error - Event::checkScript] Cannot load script (data/spells/scripts/especial/mode1.lua)
[31/10/2018 13:19:52] data/spells/scripts/especial/mode1.lua:6: 'then' expected near 'doPlayerSetVocation'
[31/10/2018 13:19:52] [Error - LuaInterface::loadFile] data/spells/scripts/especial/mode2.lua:7: '=' expected near 'ï'
[31/10/2018 13:19:52] [Error - Event::checkScript] Cannot load script (data/spells/scripts/especial/mode2.lua)
[31/10/2018 13:19:52] data/spells/scripts/especial/mode2.lua:7: '=' expected near 'ï'

 

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 7)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)
doSetCreatureOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 7)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)
doSetCreatureOutfit(cid, female)
else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return doCombat(cid, combat, var)
end

Magia que cancela

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 3)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 3)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, female)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return doCombat(cid, combat, var)
end

Link para o post
Compartilhar em outros sites

@Joaovettor Cara, quando usa a magia para ir para a outra vocação, da esse erro do outfit: (mas a vocação ta trocando)

 

[31/10/2018 15:46:16] [Error - Spell Interface] 
[31/10/2018 15:46:16] data/spells/scripts/especial/mode2.lua:onCastSpell
[31/10/2018 15:46:16] Description: 
[31/10/2018 15:46:16] attempt to index a number value
[31/10/2018 15:46:16] stack traceback:
[31/10/2018 15:46:16]     [C]: in function 'doSetCreatureOutfit'
[31/10/2018 15:46:16]     data/spells/scripts/especial/feral mode.lua:12: in function <data/spells/scripts/especial/mode2.lua:1>
 

 

 

E quando vai usar a spell pra voltar. Da esse erro: (E da a mensagem de erro, não deixando o player voltar para a vocação antiga)

 

[31/10/2018 15:47:21] [Error - Spell Interface] 
[31/10/2018 15:47:21] data/spells/scripts/especial/mode1.lua:onCastSpell
[31/10/2018 15:47:21] Description: 
[31/10/2018 15:47:21] (luaDoCombat) Combat not found

Link para o post
Compartilhar em outros sites

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 7)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)
doCreatureChangeOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 7)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)

doCreatureChangeOutfit(cid, female)

else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return true
end

Magia que cancela

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 3)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doCreatureChangeOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 3)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doCreatureChangeOutfit(cid, female)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return true
end

 

Link para o post
Compartilhar em outros sites

@Joaovettor Mano, ta tendo o mesmo problema com o outfit na primeira, e na segunda ta acontecendo quase a mesma coisa de antes, só que ele chega a castar a magia, eu gasto mana e talz, mas aparece a mensagem de cancelamento e o player não volta ao normal

Link para o post
Compartilhar em outros sites

@Joaovettor Para se transformar:

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)
doCreatureChangeOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1) 
doCreatureChangeOutfit(cid, female) 
else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return true
end

 

 

 

 

Para reverter:

 

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doCreatureChangeOutfit(cid, male)
elseif sex == 1 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doCreatureChangeOutfit(cid, female)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return true
end 

Link para o post
Compartilhar em outros sites
3 minutos atrás, Zazeros disse:

@Joaovettor Para se transformar:

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)

doSetCreatureOutfit(cid, male, -1)

elseif sex == 1 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1) 

doSetCreatureOutfit(cid, female, -1)

else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return true
end

 

 

 

 

Para reverter:

 

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)

doSetCreatureOutfit(cid, male, -1)

elseif sex == 1 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, female, -1)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return true
end 

 

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)

doSetCreatureOutfit(cid, male, -1)

elseif sex == 1 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1) 

doSetCreatureOutfit(cid, female, -1)

else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return true
end

 

 

 

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)

doSetCreatureOutfit(cid, male, -1)

elseif sex == 1 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, female, -1)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return true
end

 

SE NAO DER CERTO TENTA ESSE

Para se transformar:

function onCastSpell(cid, var)
local male = 350
local female = 351
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1)

doSetCreatureOutfit(cid, male, -1)

elseif sex == 1 and getPlayerVocation(cid) == 22 and getPlayerStorageValue(cid, 17200) <= 0 then
doPlayerSetVocation(cid, 25)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) +1) 

doSetCreatureOutfit(cid, female, -1)

else
doPlayerSendCancel(cid, "Você não é paladin ou já está com a magia ativada")
end
return doCombat(cid, combat, var)
end

 

 

 

 

Para reverter:

 

function onCastSpell(cid, var)
local male = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local female = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)

doSetCreatureOutfit(cid, male, -1)

elseif sex == 1 and getPlayerVocation(cid) == 25 and getPlayerStorageValue(cid, 17200) >= 1 then
doPlayerSetVocation(cid, 22)
setPlayerStorageValue(cid, getPlayerStorageValue(cid, 17200) -1)
doSetCreatureOutfit(cid, female, -1)
else
doPlayerSendCancel(cid, "Você não pode usar esta magia")
end
return doCombat(cid, combat, var)
end

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo