SarioYana 0 Postado Junho 11, 2012 Share Postado Junho 11, 2012 (editado) Bom galera esses tempos andei num ot ai e vi a magia chamada dash ela pula 3 quadrinhos sera q tem como faze ela lembrando que ela nao passa em cima de paredes eu n queria habilita o /a para os player queria faze essa magia si alguem souber ajuda aii Editado Junho 12, 2012 por Vilden Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/ Compartilhar em outros sites More sharing options...
0 Oneshot 732 Postado Junho 12, 2012 Share Postado Junho 12, 2012 (editado) sarioyana, Para correto funcionamento do código deste post, siga as instruções com exatidão, prestando atenção para salvar as extensões pedidas corretamente. - Abra o arquivo 050-function.lua com um Bloco de Notas em /data/lib e, no final, adicione o seguinte código: function isWalkable(position, cid) position.stackpos = 0 if getTileThingByPos(position).uid ~= 0 then local tile = getTileInfo(position) if tile.protection == false and tile.house == false and getTopCreature(position).uid == 0 and doTileQueryAdd(cid, position) == RETURNVALUE_NOERROR then return true end end return false end - Crie um novo arquivo chamado dash.lua em /data/spells/scripts e adicione o seguinte código function onCastSpell(cid, var) local direction = getCreatureLookDirection(cid) local size = 3 local toPosition = getPositionByDirection(getThingPosition(cid), direction, size) if isWalkable(toPosition, cid) then doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) doTeleportThing(cid, toPosition) doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end return true end - Abra o arquivo spells.xml e adicione a seguinte linha: <instant name="Dash" words="dash" lvl="20" mana="18" exhaustion="2000" needlearn="0" event="script" value="dash.lua"/> Antes de: </spells> Reporte no tópico quaisquer resultados. Editado Junho 12, 2012 por Oneshot Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276419 Compartilhar em outros sites More sharing options...
0 fagundes14 7 Postado Junho 12, 2012 Share Postado Junho 12, 2012 @Oneshot Como Eu Adapto Essa Magia Paraa 8.0 Ja Que Nao Possui Lib? ABRASS Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276423 Compartilhar em outros sites More sharing options...
0 SarioYana 0 Postado Junho 12, 2012 Autor Share Postado Junho 12, 2012 kara olha os erros que ta dando [12/06/2012 10:18:12] [Error - Spell Interface] [12/06/2012 10:18:12] data/spells/scripts/dash.lua:onCastSpell [12/06/2012 10:18:12] Description: [12/06/2012 10:18:12] data/lib/032-position.lua:49: attempt to index local 'position' (a number value) [12/06/2012 10:18:12] stack traceback: [12/06/2012 10:18:12] data/lib/032-position.lua:49: in function 'getPositionByDirection' [12/06/2012 10:18:12] data/spells/scripts/dash.lua:5: in function <data/spells/scripts/dash.lua:1> isso ta bugado nao é para 8.0 é para 8.60 Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276588 Compartilhar em outros sites More sharing options...
0 Vilden 137 Postado Junho 12, 2012 Share Postado Junho 12, 2012 Titulo do tópico renomeado para melhor entendimento, quando criar um tópico deixe o titulo mais expressivo possível. Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276590 Compartilhar em outros sites More sharing options...
0 Oneshot 732 Postado Junho 12, 2012 Share Postado Junho 12, 2012 Desculpe, foi um erro meu e este já foi consertado. Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276603 Compartilhar em outros sites More sharing options...
0 SarioYana 0 Postado Junho 12, 2012 Autor Share Postado Junho 12, 2012 olha agora o bug [12/06/2012 13:09:54] [Error - Spell Interface] [12/06/2012 13:09:54] data/spells/scripts/dash.lua:onCastSpell [12/06/2012 13:09:54] Description: [12/06/2012 13:09:54] (luaDoTileQueryAdd) Thing not found Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276678 Compartilhar em outros sites More sharing options...
0 Oneshot 732 Postado Junho 12, 2012 Share Postado Junho 12, 2012 Tente agora. function onCastSpell(cid, var) local direction = getCreatureLookDirection(cid) local size = 3 local toPosition = getPositionByDirection(getThingPosition(cid), direction, size) if isWalkable(toPosition, cid) then doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) doTeleportThing(cid, toPosition) doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) end return true end Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276705 Compartilhar em outros sites More sharing options...
0 SarioYana 0 Postado Junho 12, 2012 Autor Share Postado Junho 12, 2012 (editado) olha kara aparece esse outro erro [12/06/2012 14:43:06] [Warning - Spells::registerEvent] Duplicate registered instant spell with words: dash mais quando vc fala no ot dash ele aparece sorry,not possible sendo que o char nao ta encostado nenhuma parede e quando solta ela n acontece nada lembrando que eu nao to na zona de proteçao alguem ajuda ae?? Editado Junho 12, 2012 por sarioyana Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276765 Compartilhar em outros sites More sharing options...
0 jhon992 371 Postado Junho 12, 2012 Share Postado Junho 12, 2012 (editado) Tava com preguiça de analisar a magia do @Oneshot, tão fiz essa: local quantSqm = 3 -- quantidade de sqms function teleportPlayer(cid, position) if (isPlayer(cid)) then local o = 0 local positions = {} for i=1, quantSqm do if getPlayerLookDir(cid) == 0 then position = {x=position.x, y=position.y-i, z=position.z} elseif getPlayerLookDir(cid) == 1 then position = {x=position.x+i, y=position.y, z=position.z} elseif getPlayerLookDir(cid) == 2 then position = {x=position.x, y=position.y+i, z=position.z} elseif getPlayerLookDir(cid) == 3 then position = {x=position.x-i, y=position.y, z=position.z} end positions[#positions] = position if isWalkable(position) then o = o+1 end end if o == 3 then doTeleportThing(cid, position) for i=1, #positions do doSendMagicEffect(positions[i], CONST_ME_TELEPORT) end return true else doPlayerSendCancel(cid, "Você não pode atravesar isso!") return false end end end function isWalkable(pos, creature, pz, proj) -- nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onCastSpell(cid, var) if teleportPlayer(cid, getPlayerPosition(cid)) then return true end end Ja ta testada. Editado Junho 12, 2012 por Jhon992 Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276839 Compartilhar em outros sites More sharing options...
0 SarioYana 0 Postado Junho 12, 2012 Autor Share Postado Junho 12, 2012 nuss kara ta pulando uns 8 sendo que ali ta 3 como arruma isso ah eu queria nos 3 sqm que ele pulasse dasse o efeito Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276905 Compartilhar em outros sites More sharing options...
0 jhon992 371 Postado Junho 12, 2012 Share Postado Junho 12, 2012 Arrumei ali em cima pra soltar effect em todos os tiles, mais aqui ta pulando 3 certinho então n arrumei o oque você disse que pula 8. Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276919 Compartilhar em outros sites More sharing options...
0 SarioYana 0 Postado Junho 13, 2012 Autor Share Postado Junho 13, 2012 (editado) ele ta pulando 5 na verdade e agr n ta aparecendo efeito em nenhum tile ajuda ae e passa a lista dos efeitos pra min ae vlww q tag tu usou?? olhe o que eu quero galera Editado Junho 12, 2012 por sarioyana Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1276928 Compartilhar em outros sites More sharing options...
0 jhon992 371 Postado Junho 13, 2012 Share Postado Junho 13, 2012 (editado) local quantSqm = 3 -- quantidade de sqms function teleportPlayer(cid, position) if (isPlayer(cid)) then local o = 1 local positions = {} for i=1, quantSqm do if getPlayerLookDir(cid) == 0 then position = {x=position.x, y=position.y-1, z=position.z} elseif getPlayerLookDir(cid) == 1 then position = {x=position.x+1, y=position.y, z=position.z} elseif getPlayerLookDir(cid) == 2 then position = {x=position.x, y=position.y+1, z=position.z} elseif getPlayerLookDir(cid) == 3 then position = {x=position.x-1, y=position.y, z=position.z} end if isWalkable(position) then o = o+1 end positions[#positions+1] = position end if o > quantSqm then doTeleportThing(cid, position) for i=1, #positions do doSendMagicEffect(positions[i], CONST_ME_TELEPORT) end return true else doPlayerSendCancel(cid, "Você não pode atravesar isso!") return false end end end function isWalkable(pos, creature, pz, proj) -- nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onCastSpell(cid, var) if teleportPlayer(cid, getPlayerPosition(cid)) then return true end end Editado Junho 13, 2012 por Jhon992 Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1277483 Compartilhar em outros sites More sharing options...
0 SarioYana 0 Postado Junho 13, 2012 Autor Share Postado Junho 13, 2012 vlw deu certo Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1277745 Compartilhar em outros sites More sharing options...
0 Critical 70 Postado Junho 13, 2012 Share Postado Junho 13, 2012 Duvida sanada; tópico movido. Atenciosamente, Critical. Link para o comentário https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/#findComment-1277784 Compartilhar em outros sites More sharing options...
Pergunta
SarioYana 0
Bom galera
esses tempos
andei num ot ai
e vi
a magia chamada dash ela pula 3 quadrinhos
sera q tem como faze ela
lembrando que ela nao passa em cima
de paredes
eu n queria habilita o /a
para os player
queria faze
essa magia
si alguem souber ajuda aii
Editado por VildenLink para o comentário
https://xtibia.com/forum/topic/187796-magia-pula-3-sqm/Compartilhar em outros sites
18 respostass a esta questão
Posts Recomendados