BOM DIA/TARDE/NOITE GOSTARIA DE UM SCRIPT PARECIDO COM O TELETRANSPORTE DO GOKU, TEM ALGO PARECIDO NO PROPRIO SERVER QUE É O TALKALCTION /C
QUE TELEPORTA O GM E O ADM PARA QUALQUER PLAYER, MAS NESSE CASO EU QUERIA QUE FOSSE UMA SPELL QUE CASO ATIVADA COM O COMANDO "TELETRANSPORTE NOME DO PLAYER" TELETRANSPORTASSE O PLAYER PARA QUALQUER OUTRO PLAYER QUE ESTEJA NA MESMA PARTY.
UTILIZAR ESSE TALKACTION NÃO IRIA FUNCIONAR POIS CASO O PLAYER SE TELETRANSPORTASSE PARA ALGUEM QUE ESTIVESSE DENTRO DE UMA HOUSE POR EXEMPLO PODERIA ACABAR ROUBANDO OS ITENS.
DESDE JÁ AGRADEÇO!
(Pedido) Script de teletransporte em membros da party

local config = { effect = 65, -- efeito cost = 1000 -- mana necessaria } function onCastSpell(cid, var) local mana = getPlayerMana(cid) local players = getPartyMembers(cid) if isPlayer(cid) and mana < config.cost then doCreatureAddHealth(cid, -(config.cost-mana)) end if not isInParty(cid) then doPlayerSendCancel(cid, "Você ainda não está em party.") end if isCreature(cid) then for i, k in ipairs(players) do doTeleportThing(cid, getThingPos(k)) doSendMagicEffect(getThingPos(cid), config.effect) doPlayerAddSpentMana(cid, -mana) doPlayerAddMana(cid, -mana) doSendMagicEffect(getThingPos(cid), config.effect) end end return true end
se o player nao tiver mana, vai comer da life dele.. se o player estiver em PZ/house, n tem como usar a spell.
spells.xml:
<instant name="Puff!" words="teletransporte" lvl="100" mana="1000" prem="0" aggressive="0" selftarget="1" params="1" exhaustion="2000" needlearn="0" event="script" value="teste.lua"> <vocation id="1"/> </instant>
testa ae ^^
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
DICA
Utilize botão @UP, no início de seu tópico, para atualizar o destaque de seu tópico em "Tópicos Recentes" na index, fará com que mais pessoas o vejam.
11 minutos atrás, Deadpool disse:local config = { effect = 65, -- efeito cost = 1000 -- mana necessaria } function onCastSpell(cid, var) local mana = getPlayerMana(cid) local players = getPartyMembers(cid) if isPlayer(cid) and mana < config.cost then doCreatureAddHealth(cid, -(config.cost-mana)) end if not isInParty(cid) then doPlayerSendCancel(cid, "Você ainda não está em party.") end if isCreature(cid) then for i, k in ipairs(players) do doTeleportThing(cid, getThingPos(k)) doSendMagicEffect(getThingPos(cid), config.effect) doPlayerAddSpentMana(cid, -mana) doPlayerAddMana(cid, -mana) doSendMagicEffect(getThingPos(cid), config.effect) end end return true end
se o player nao tiver mana, vai comer da life dele.. se o player estiver em PZ/house, n tem como usar a spell.
spells.xml:
<instant name="Puff!" words="teletransporte" lvl="100" mana="1000" prem="0" aggressive="0" selftarget="1" params="1" exhaustion="2000" needlearn="0" event="script" value="teste.lua"> <vocation id="1"/> </instant>testa ae ^^
Deu certinho mano vlw mesmo, so que deu um probleminha e surgiu uma duvida.
Quando eu me teletransporto para algum player que ta na pt meu magiclevel sobe para 150 da um up muito alto do nada.
e a duvida é caso tenha mais de algum player na party tem como escolher para qual vai ser o teletransporte?
2 minutos atrás, Sugismundo disse:Deu certinho mano vlw mesmo, so que deu um probleminha e surgiu uma duvida.
Quando eu me teletransporto para algum player que ta na pt meu magiclevel sobe para 150 da um up muito alto do nada.
e a duvida é caso tenha mais de algum player na party tem como escolher para qual vai ser o teletransporte?
[Error - Spell Interface]
[22:52:43.398] data/spells/scripts/Goku/teletransporte.lua:onCastSpell
[22:52:43.400] Description:
[22:52:43.401] data/spells/scripts/Goku/teletransporte.lua:21: bad argument #1 to 'ipairs' (table expected, got boolean)
[22:52:43.402] stack traceback:
[22:52:43.402] [C]: in function 'ipairs'
[22:52:43.403] data/spells/scripts/Goku/teletransporte.lua:21: in function <data/spells/scripts/Goku/teletransporte.lua:7>
deu bem esse erro na distro
local config =
{
effect = 65, -- efeito
}
function onCastSpell(cid, var)
local players = getPartyMembers(cid)
if not isInParty(cid) then
doPlayerSendCancel(cid, "Você ainda não está em party.")
end
if isCreature(cid) then
for i, k in ipairs(players) do
doTeleportThing(cid, getThingPos(k))
doSendMagicEffect(getThingPos(cid), config.effect)
doSendMagicEffect(getThingPos(cid), config.effect)
end
end
return true
end
testea, me manda o xml que tu add
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
DICA
Utilize botão @UP, no início de seu tópico, para atualizar o destaque de seu tópico em "Tópicos Recentes" na index, fará com que mais pessoas o vejam.
13 minutos atrás, Deadpool disse:local config = { effect = 65, -- efeito } function onCastSpell(cid, var) local players = getPartyMembers(cid) if not isInParty(cid) then doPlayerSendCancel(cid, "Você ainda não está em party.") end if isCreature(cid) then for i, k in ipairs(players) do doTeleportThing(cid, getThingPos(k)) doSendMagicEffect(getThingPos(cid), config.effect) doSendMagicEffect(getThingPos(cid), config.effect) end end return true endtestea, me manda o xml que tu add
<instant name="Teletransporte" words="teletransporte" lvl="10" mana="1000" prem="0" aggressive="0" selftarget="1" params="1" exhaustion="2000" needlearn="0" event="script" value="Goku/teletransporte.lua">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="3"/>
</instant>
adcionei esse que vc me mandou, a respeito do teletransporte ele sempre vai no ultimo membro que deu entrou na party, tem como alterar para mim escolher em quem ir?
O teletransporte em si ta certinho agora, não esta upando mais o ml para o maximo, e mais essa duvida mesmo agora
1 minuto atrás, Sugismundo disse:<instant name="Teletransporte" words="teletransporte" lvl="10" mana="1000" prem="0" aggressive="0" selftarget="1" params="1" exhaustion="2000" needlearn="0" event="script" value="Goku/teletransporte.lua">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="3"/>
</instant>
adcionei esse que vc me mandou, a respeito do teletransporte ele sempre vai no ultimo membro que deu entrou na party, tem como alterar para mim escolher em quem ir?
O teletransporte em si ta certinho agora, não esta upando mais o ml para o maximo, e mais essa duvida mesmo agora
rapaz, achei que era aleatorio, tem sim, mas agora n vou poder fazer, assim q eu fazer eu posto
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
DICA
Utilize botão @UP, no início de seu tópico, para atualizar o destaque de seu tópico em "Tópicos Recentes" na index, fará com que mais pessoas o vejam.
13 minutos atrás, Deadpool disse:rapaz, achei que era aleatorio, tem sim, mas agora n vou poder fazer, assim q eu fazer eu posto
Tranquilo, fico no aguardo, obrigado!
Tem algum motivo plausível para você querer como uma spell? Por que não pode ser por talkaction?
Em 03/04/2021 em 00:50, Yan18 disse:Tem algum motivo plausível para você querer como uma spell? Por que não pode ser por talkaction?
Sim, pois é uma habilidade do Goku, e quero que apareça na lista de spells dele. Não gosto de talkaction para esse tipo de coisa
17 horas atrás, Sugismundo disse:Sim, pois é uma habilidade do Goku, e quero que apareça na lista de spells dele. Não gosto de talkaction para esse tipo de coisa
Eu tinha pensado que o seu ot era um Tibia rs, mas como é Dragon Ball Tibia, faz sentido até.
Crie um arquivo na pasta Spells (se tiver uma subpasta de party adiciona dentro dela) chamado teleportation.lua e adiciona o código dentro:
-- SCRIPT DE TELETRANSPORTE FEITO POR YAN18 -- local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DA MENSAGEM local effect = 36 -- EFEITO DO TELETRANSPORTE local mana = 150 -- TANTO DE MANA QUE VAI GASTAR PARA TELEPORTAR. SE QUISER SEM CUSTO, COLOQUE O VALOR 0 -- FUNÇÃO LOCAL PARA TELETRANSPORTAR -- local function Teleportation(cid, index) if not cid then return true end if not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") end if index < 1 then return doPlayerSendTextMessage(cid, message_color, "There are not players available in your party for you teleport to him.") else local player = getPartyMembers(cid)[index] if getCreatureName(cid) ~= getCreatureName(player) then if string.lower(getCreatureName(player)) == string.lower(getCreatureName(player)) then if not getTileInfo(getThingPos(player)).house then doSendMagicEffect(getThingPos(cid), effect) doTeleportThing(cid, getThingPos(player)) doSendMagicEffect(getThingPos(cid), effect) doCreatureSay(cid, "TELEPORTATION!") doPlayerSendTextMessage(cid, message_color, "You had been teleportation to " .. getCreatureName(player) .. ".") return true end end end addEvent(Teleportation, 10, cid, index - 1) end end --------------------- CÓDIGO --------------------- function onCastSpell(cid, var) if not cid then return true elseif not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") else if getCreatureMana(cid) >= mana then Teleportation(cid, #getPartyMembers(cid)) else return doPlayerSendTextMessage(cid, message_color, "You need to have " .. mana .. " mana to use this ability.") end end end
Agora abra o arquivo spells.xml e adicione a tag:
<instant name="Teletransporte" words="teleportation" lvl="1" mana="1" prem="0" aggressive="0" selftarget="1" exhaustion="0" needlearn="0" event="script" value="party/teleportation.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> </instant>
Na tag xml da spell você configura certinho os atributos como custo de mana (eu deixei no próprio script um custo, se quiser deixar 0 no xml e configurar por lá, também dá!) se precisa de premium e as vocations que pode usar. E não esqueça de verificar o diretório.
Eu testei aqui e funcionou! O teletransporte sempre vai para o último membro da lista de membros da party e se ele estiver dentro de uma house ele vai para o penúltimo e assim sucessivamente. O script vai fazer recursão até o primeiro membro da lista (tirando o próprio player que usa a spell) e se não encontrar nenhum disponível ele manda uma mensagem avisando.
Não sei se tem a sprite do efeito de teletransporte no seu client, mas se não tiver, uma opção é nos poketibias, que tem uma sprite da passiva Evasion que tem um efeito similar ao teletransporte, é bem legal!
Em 04/04/2021 em 22:08, Yan18 disse:
Eu tinha pensado que o seu ot era um Tibia rs, mas como é Dragon Ball Tibia, faz sentido até.
Crie um arquivo na pasta Spells (se tiver uma subpasta de party adiciona dentro dela) chamado teleportation.lua e adiciona o código dentro:
-- SCRIPT DE TELETRANSPORTE FEITO POR YAN18 -- local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DA MENSAGEM local effect = 36 -- EFEITO DO TELETRANSPORTE local mana = 150 -- TANTO DE MANA QUE VAI GASTAR PARA TELEPORTAR. SE QUISER SEM CUSTO, COLOQUE O VALOR 0 -- FUNÇÃO LOCAL PARA TELETRANSPORTAR -- local function Teleportation(cid, index) if not cid then return true end if not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") end if index < 1 then return doPlayerSendTextMessage(cid, message_color, "There are not players available in your party for you teleport to him.") else local player = getPartyMembers(cid)[index] if getCreatureName(cid) ~= getCreatureName(player) then if string.lower(getCreatureName(player)) == string.lower(getCreatureName(player)) then if not getTileInfo(getThingPos(player)).house then doSendMagicEffect(getThingPos(cid), effect) doTeleportThing(cid, getThingPos(player)) doSendMagicEffect(getThingPos(cid), effect) doCreatureSay(cid, "TELEPORTATION!") doPlayerSendTextMessage(cid, message_color, "You had been teleportation to " .. getCreatureName(player) .. ".") return true end end end addEvent(Teleportation, 10, cid, index - 1) end end --------------------- CÓDIGO --------------------- function onCastSpell(cid, var) if not cid then return true elseif not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") else if getCreatureMana(cid) >= mana then Teleportation(cid, #getPartyMembers(cid)) else return doPlayerSendTextMessage(cid, message_color, "You need to have " .. mana .. " mana to use this ability.") end end end
Agora abra o arquivo spells.xml e adicione a tag:
<instant name="Teletransporte" words="teleportation" lvl="1" mana="1" prem="0" aggressive="0" selftarget="1" exhaustion="0" needlearn="0" event="script" value="party/teleportation.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> </instant>
Na tag xml da spell você configura certinho os atributos como custo de mana (eu deixei no próprio script um custo, se quiser deixar 0 no xml e configurar por lá, também dá!) se precisa de premium e as vocations que pode usar. E não esqueça de verificar o diretório.
Eu testei aqui e funcionou! O teletransporte sempre vai para o último membro da lista de membros da party e se ele estiver dentro de uma house ele vai para o penúltimo e assim sucessivamente. O script vai fazer recursão até o primeiro membro da lista (tirando o próprio player que usa a spell) e se não encontrar nenhum disponível ele manda uma mensagem avisando.
Não sei se tem a sprite do efeito de teletransporte no seu client, mas se não tiver, uma opção é nos poketibias, que tem uma sprite da passiva Evasion que tem um efeito similar ao teletransporte, é bem legal!
Show de bola, funcionou certinho, tem como adcionar um cowndown de 5 min? com mensagem informando o tempo necessario?
15 horas atrás, Sugismundo disse:Show de bola, funcionou certinho, tem como adcionar um cowndown de 5 min? com mensagem informando o tempo necessario?
Sim, troque o código por esse:
-- SCRIPT DE TELETRANSPORTE FEITO POR YAN18 -- local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DA MENSAGEM local effect = 36 -- EFEITO DO TELETRANSPORTE local mana = 150 -- TANTO DE MANA QUE VAI GASTAR PARA TELEPORTAR. SE QUISER SEM CUSTO, COLOQUE O VALOR 0 local storage_time = 55454 -- STORAGE PARA VERIFICAR SE PODE USAR A SPELL local minutes = 5 -- MINUTOS PARA USAR A SPELL NOVAMENTE -- FUNÇÃO LOCAL PARA TELETRANSPORTAR -- local function Teleportation(cid, index) if not cid then return true end if not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") end if index < 1 then return doPlayerSendTextMessage(cid, message_color, "There are not players available in your party for you teleport to him.") else local player = getPartyMembers(cid)[index] if getCreatureName(cid) ~= getCreatureName(player) then if string.lower(getCreatureName(player)) == string.lower(getCreatureName(player)) then if not getTileInfo(getThingPos(player)).house then doSendMagicEffect(getThingPos(cid), effect) doTeleportThing(cid, getThingPos(player)) doSendMagicEffect(getThingPos(cid), effect) doCreatureSay(cid, "TELEPORTATION!") doPlayerSendTextMessage(cid, message_color, "You had been teleportation to " .. getCreatureName(player) .. ".") setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) return true end end end addEvent(Teleportation, 10, cid, index - 1) end end --------------------- CÓDIGO --------------------- function onCastSpell(cid, var) if not cid then return true elseif not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") else if getPlayerStorageValue(cid, storage_time) <= os.time() then if getCreatureMana(cid) >= mana then Teleportation(cid, #getPartyMembers(cid)) return true else return doPlayerSendTextMessage(cid, message_color, "You need to have " .. mana .. " mana to use this ability.") end else return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this ability again.") end end end
8 minutos atrás, Yan18 disse:Sim, troque o código por esse:
-- SCRIPT DE TELETRANSPORTE FEITO POR YAN18 -- local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DA MENSAGEM local effect = 36 -- EFEITO DO TELETRANSPORTE local mana = 150 -- TANTO DE MANA QUE VAI GASTAR PARA TELEPORTAR. SE QUISER SEM CUSTO, COLOQUE O VALOR 0 local storage_time = 55454 -- STORAGE PARA VERIFICAR SE PODE USAR A SPELL local minutes = 5 -- MINUTOS PARA USAR A SPELL NOVAMENTE -- FUNÇÃO LOCAL PARA TELETRANSPORTAR -- local function Teleportation(cid, index) if not cid then return true end if not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") end if index < 1 then return doPlayerSendTextMessage(cid, message_color, "There are not players available in your party for you teleport to him.") else local player = getPartyMembers(cid)[index] if getCreatureName(cid) ~= getCreatureName(player) then if string.lower(getCreatureName(player)) == string.lower(getCreatureName(player)) then if not getTileInfo(getThingPos(player)).house then doSendMagicEffect(getThingPos(cid), effect) doTeleportThing(cid, getThingPos(player)) doSendMagicEffect(getThingPos(cid), effect) doCreatureSay(cid, "TELEPORTATION!") doPlayerSendTextMessage(cid, message_color, "You had been teleportation to " .. getCreatureName(player) .. ".") return true end end end addEvent(Teleportation, 10, cid, index - 1) end end --------------------- CÓDIGO --------------------- function onCastSpell(cid, var) if not cid then return true elseif not isInParty(cid) then return doPlayerSendTextMessage(cid, message_color, "You need to be in a party to teleport. But if you are in a party, please report this problem.") else if getPlayerStorageValue(cid, storage_time) <= os.time() then if getCreatureMana(cid) >= mana then Teleportation(cid, #getPartyMembers(cid)) setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) return true else return doPlayerSendTextMessage(cid, message_color, "You need to have " .. mana .. " mana to use this ability.") end else return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this ability again.") end end end
Deu certinho, muito obrigado!
15 horas atrás, Sugismundo disse:Deu certinho, muito obrigado!
De nada! Que bom que deu certo ?.
------------- EDIT ------------
@Sugismundo Eu editei o post que você marcou como melhor resposta, copia o código dele. Pois, do jeito que estava antes, se o player fosse usar a spell e não tivesse nenhum player disponível da party, ele ia considerar mesmo assim o cooldown de 5 minutos, mas agora arrumei para começar o cooldown assim que teleportar para o player.