Postado Agosto 8, 2016 8 anos Autor Adiciona a função isWalkable, é só ir no meu tópico da new lib e copiar a primeira função e colar no inicio desse script. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Agosto 9, 2016 8 anos Em 08/08/2016 em 07:52, xWhiteWolf disse: Adiciona a função isWalkable, é só ir no meu tópico da new lib e copiar a primeira função e colar no inicio desse script. não entendi mto bem, enfim eu fiz isso. Crie um arquivo em data/lib chamado 075 - White Wolf Functions.lua e coloque o seguinte código dentro:
Postado Agosto 9, 2016 8 anos Autor Em 09/08/2016 em 19:12, diarmaint disse: não entendi mto bem, enfim eu fiz isso. Crie um arquivo em data/lib chamado 075 - White Wolf Functions.lua e coloque o seguinte código dentro: Mostrar conteúdo oculto local config = { storage = 49708, tempo = 1.5, effect = 65 } local exception = {"Trainer", "Training Monk", "GOD"} local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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) local name = getCreatureName(getCreatureTarget(cid)) if not isInArray(exception, name) then if getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSetStorageValue(cid, config.storage, 1) doSendMagicEffect(getThingPos(cid), config.effect) doSendMagicEffect(getThingPos(variantToNumber(var)), config.effect) addEvent(function() doPlayerSetStorageValue(cid, config.storage, 0) if isCreature(cid) and isCreature(variantToNumber(var)) then if isWalkable(getCreaturePosition(variantToNumber(var)), false, true, true) then doTeleportThing(cid, getThingPos(variantToNumber(var)), true) arr = {3} doAreaCombatHealth(cid, 1, getThingPos(variantToNumber(var)), arr, -getPlayerLevel(cid), -2*(getPlayerLevel(cid)), 0) elseif isCreature(cid) and not isWalkable(getCreaturePosition(variantToNumber(var)), false, true, true) then doPlayerSendCancel(cid, "You can't reach your target") end end end, 1000*config.tempo) elseif getPlayerStorageValue (cid, config.storage) > 0 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendCancel(cid, "You've already set your target.") end else doPlayerSendCancel (cid, "You can't use this spell in this creature.") return false end return true end assim. Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Agosto 10, 2016 8 anos Em 09/08/2016 em 23:43, xWhiteWolf disse: Mostrar conteúdo oculto Mostrar conteúdo oculto local config = { storage = 49708, tempo = 1.5, effect = 65 } local exception = {"Trainer", "Training Monk", "GOD"} local function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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) local name = getCreatureName(getCreatureTarget(cid)) if not isInArray(exception, name) then if getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSetStorageValue(cid, config.storage, 1) doSendMagicEffect(getThingPos(cid), config.effect) doSendMagicEffect(getThingPos(variantToNumber(var)), config.effect) addEvent(function() doPlayerSetStorageValue(cid, config.storage, 0) if isCreature(cid) and isCreature(variantToNumber(var)) then if isWalkable(getCreaturePosition(variantToNumber(var)), false, true, true) then doTeleportThing(cid, getThingPos(variantToNumber(var)), true) arr = {3} doAreaCombatHealth(cid, 1, getThingPos(variantToNumber(var)), arr, -getPlayerLevel(cid), -2*(getPlayerLevel(cid)), 0) elseif isCreature(cid) and not isWalkable(getCreaturePosition(variantToNumber(var)), false, true, true) then doPlayerSendCancel(cid, "You can't reach your target") end end end, 1000*config.tempo) elseif getPlayerStorageValue (cid, config.storage) > 0 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendCancel(cid, "You've already set your target.") end else doPlayerSendCancel (cid, "You can't use this spell in this creature.") return false end return true end assim. Cerca de 2 segundos após usar a spell ele volta sozinho para o target.
Postado Dezembro 31, 2017 7 anos Em 17/06/2014 em 14:58, xWhiteWolf disse: Fala galera do TK, um cara tinha pedido no suporte pra eu fazer essa spell aqui http://youtu.be/ZWrsRvVYgys?t=1m54s e eu fiz rapidinho e ficou uma bosta, então eu decidi melhorar ela e postar aqui pra vocês. O vídeo é bem explicativo então eu acho que não preciso ficar prologando isso daqui, se vc não quiser ver o vídeo tente entender pelas fotos: Conteúdo Oculto Conteúdo Oculto Bom, antes de tudo vá em spells.xml e coloque isso daqui: <instant name="Tibia King" words="Hirashin ni no dan" lvl="50" mana="100" prem="1" range="6" needtarget="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="especiais/playerport.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> aqui vc configura nome da magia, palavras pra usar ela, level pra usar, mana que custa, se precisa ser premio, o alcance máximo dela, se precisa de um target (nessa magia em específico eu vou pedir pra que vc não mexa nisso), se ela é bloqueada pelas paredes (1 quer dizer que sim), a exaustão entre um uso e outro (nesse caso vc usa a magia e precisa esperar 1 segundo (1000 milisegundos) pra usá-la novamente) se ela precisa ser aprendida (0 significa que vc já vem com ela) e em value você tem o diretório em que ela vai ficar (no caso dentro da pasta spells\scripts vai ter uma pasta chamada especiais e dentro dessa pasta vai ter um arquivo chamado playerport.lua Feito isso crie o arquivo playerport.lua que deverá conter o seguinte: local config = { storage = 49708, tempo = 1.5, effect = 65 } local exception = {"Trainer", "Training Monk", "GOD"} function onCastSpell(cid, var) local name = getCreatureName(getCreatureTarget(cid)) if not isInArray(exception, name) then if getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSetStorageValue(cid, config.storage, 1) doSendMagicEffect(getThingPos(cid), config.effect) doSendMagicEffect(getThingPos(variantToNumber(var)), config.effect) addEvent(function() doPlayerSetStorageValue(cid, config.storage, 0) if isCreature(cid) and isCreature(variantToNumber(var)) then if isWalkable(getCreaturePosition(variantToNumber(var)), false, true, true) then doTeleportThing(cid, getThingPos(variantToNumber(var)), true) arr = {3} doAreaCombatHealth(cid, 1, getThingPos(variantToNumber(var)), arr, -getPlayerLevel(cid), -2*(getPlayerLevel(cid)), 0) elseif isCreature(cid) and not isWalkable(getCreaturePosition(variantToNumber(var)), false, true, true) then doPlayerSendCancel(cid, "You can't reach your target") end end end, 1000*config.tempo) elseif getPlayerStorageValue (cid, config.storage) > 0 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendCancel(cid, "You've already set your target.") end else doPlayerSendCancel (cid, "You can't use this spell in this creature.") return false end return true end Ali no começo é possível configurar algumas coisas do script: o script em si é bem fácil de se configurar. Agora pra evitar possíveis bugs você deve ir em creaturescripts\scripts\login.lua e adicionar essas linhas antes do ultimo return true: ---------- PlayerPort--------------- if getPlayerStorageValue(cid, 49708) ~= 0 then setPlayerStorageValue(cid, 49708, 0) end Lembrando que o storage no login.lua tem que ser igual ao storage no script!! OBS: a fórmula pode ser mudada nessa linha aqui: doAreaCombatHealth(cid, 1, getThingPos(variantToNumber(var)), arr, -getPlayerLevel(cid), -2*(getPlayerLevel(cid)), config.effectdamage) aqui é a fórmula: -getPlayerLevel(cid), -2*(getPlayerLevel(cid)) sendo min, max respectivamente. Em outras palavras, o mínimo que a magia tira é o level do player e o máximo que ela tira é 2x o level; Espero que vcs tenham gostado :] @xWhiteWolf mano percebi que vc mando o script do hiraishin ni no dan seal mais cade o hiraishin ni no dan (essa tecnica vc ativa o hiraishin ni no dan seal) OBS: no video da pra ver claramente que ele usa hiraishin ni no dan seal para fazer o selamento do jutsu(spell) no player e usa o hiraishin ni no dan para teleportar até o player --> e tbm como o Criador do WoNo não é burro e nem nada do tipo ele deve ter colocado 10 minutos ou maisomenos por ai para não ficar teleport infinito no player Editado Dezembro 31, 2017 7 anos por hallanehallex (veja o histórico de edições)
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.