meubk 257 Postado Novembro 1, 2012 Share Postado Novembro 1, 2012 (editado) Evil Spirit Olá, venho trazer esta spell Evil Spirit, que fiz baseada na magia do MuOnline. -- SPELL EVIL SPIRIT BY: XOTSERVX -- local min, max = 100, 200 -- dano 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 getPosDirs(p, dir) return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function posIgual(pos1, pos2) return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z and true or false end effect = 62 distance = 31 damage = COMBAT_DEATHDAMAGE evilspirit = { walk = function (cid, min, max, pos, rounds, ultimapos) if rounds == 0 then return true end if not isCreature(cid) then return true end posdisp = {} for _, dir in pairs({1, 5, 7, 3}) do if isWalkable(getPosDirs(pos, dir)) and not posIgual(getPosDirs(pos, dir), getThingPos(cid)) and not posIgual(getPosDirs(pos, dir), ultimapos) then table.insert(posdisp, getPosDirs(pos, dir)) end end if #posdisp < 1 then return true end posesc = posdisp[math.random(1, #posdisp)] ultimapos = pos doSendDistanceShoot(pos, posesc, distance) doAreaCombatHealth(cid, damage, posesc, 0, -min, -max, effect) addEvent(evilspirit.walk, 140, cid, -min, -max, posesc, rounds - 1, ultimapos) end } function onUse(cid,item,item2,frompos,pos,topos) evilspirit.walk(cid, 10, 20, getThingPos(cid), 40, {x=1, y=1, z=1}) for i = 1, 13 do addEvent(evilspirit.walk, i * math.random(300, 500), cid, min, max, getThingPos(cid), 40, {x=1, y=1, z=1}) end return true end As configurações está no script, vcs montam a tag agora. Ai vai um video paraver como tá: Editado Novembro 1, 2012 por xotservx Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/ Compartilhar em outros sites More sharing options...
fokus090 36 Postado Novembro 25, 2012 Share Postado Novembro 25, 2012 [Warning - Event::loadScript] Event onCastSpell not found Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1395317 Compartilhar em outros sites More sharing options...
Pmcd 1 Postado Novembro 25, 2012 Share Postado Novembro 25, 2012 (editado) Legal , voce pode me passar o server e o client ? REP + ! @EDIT Qual a tag que coloco na Spell.xml ??? Editado Novembro 25, 2012 por Pmcd Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1395765 Compartilhar em outros sites More sharing options...
IGORFS 0 Postado Novembro 28, 2012 Share Postado Novembro 28, 2012 Achei,legal so que tinha que diminuir o Tempo Dela Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1397910 Compartilhar em outros sites More sharing options...
Skymagnum 234 Postado Novembro 28, 2012 Share Postado Novembro 28, 2012 (editado) Isso não é uma spell e sim uma action estarei reportando para moverem. Editado Novembro 28, 2012 por Skymagnum Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1397914 Compartilhar em outros sites More sharing options...
Stigal 585 Postado Novembro 28, 2012 Share Postado Novembro 28, 2012 Topico Movido! Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1397964 Compartilhar em outros sites More sharing options...
BananaFight 196 Postado Março 31, 2013 Share Postado Março 31, 2013 (editado) Adaptei para talkaction e arrumei alguns bugs, adicionei para remover mana, e só com vocation poder usar : local min, max = 100, 200 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 getPosDirs(p, dir) return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function posIgual(pos1, pos2) return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z and true or false end effect = 62 distance = 31 damage = COMBAT_DEATHDAMAGE evilspirit = { walk = function (cid, min, max, pos, rounds, ultimapos) if rounds == 0 then return true end if not isCreature(cid) then return true end posdisp = {} for _, dir in pairs({1, 5, 7, 3}) do if isWalkable(getPosDirs(pos, dir)) and not posIgual(getPosDirs(pos, dir), getThingPos(cid)) and not posIgual(getPosDirs(pos, dir), ultimapos) then table.insert(posdisp, getPosDirs(pos, dir)) end end if #posdisp < 1 then return true end posesc = posdisp[math.random(1, #posdisp)] ultimapos = pos doSendDistanceShoot(pos, posesc, distance) doAreaCombatHealth(cid, damage, posesc, 0, -1000, -2000, effect) addEvent(evilspirit.walk, 140, cid, -min, -max, posesc, rounds - 1, ultimapos) end } function onSay(cid,item,item2,frompos,pos,topos) local config = { s = 11548, exhau = 60 } if (getPlayerStorageValue(cid, config.s) <= os.time()) then doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente.") setPlayerStorageValue(cid,config.s,os.time()+config.exhau) return true end if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then evilspirit.walk(cid, 10, 20, getThingPos(cid), 40, {x=1, y=1, z=1}) for i = 1, 13 do addEvent(evilspirit.walk, i * math.random(300, 500), cid, min, max, getThingPos(cid), 40, {x=1, y=1, z=1}) end setPlayerStorageValue(cid,config.s,os.time()+config.exhau) doCreatureAddMana(cid, -1300) else doPlayerSendCancel(cid, "FK YOU NOOB, THIS SPELL IS NOT FOR YOU") end return true end Editando : doAreaCombatHealth(cid, damage, posesc, 0, -1000, -2000, effect) -1000 = Minimo, -2000 = Maximo Vocações que podem usar if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then Quanto de mana vai remover doCreatureAddMana(cid, -1300) mensagem que vai enviar quando tiver exausted doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente." Tempo da exausted exhau = 60 Acho que é isso, qualquer duvida só perguntar. Editado Abril 20, 2013 por BananaFight Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1496373 Compartilhar em outros sites More sharing options...
JeanCristian 7 Postado Abril 5, 2013 Share Postado Abril 5, 2013 (editado) nossa obrigado ^^ tem exausted tambem? e sobre o level tem level para usar a magia? ah ja vi a exaust '-' Editado Abril 5, 2013 por JeanCristian Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1498803 Compartilhar em outros sites More sharing options...
BananaFight 196 Postado Abril 6, 2013 Share Postado Abril 6, 2013 (editado) sobre o level você faz o seguinte : Adiciona isso : if getPlayerLevel(cid) < 100 then doPlayerSendCancel(cid, "You dont have level for this spell") end Embaixo disso : if (getPlayerStorageValue(cid, config.s) <= os.time()) then doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente.") setPlayerStorageValue(cid,config.s,os.time()+config.exhau) return true end O 100 é o level minimo pra usar, ai se o level do player for menor que 100, ele n consegue usar. Editado Abril 20, 2013 por BananaFight Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1499010 Compartilhar em outros sites More sharing options...
Vinc 101 Postado Abril 6, 2013 Share Postado Abril 6, 2013 sobre o level você faz o seguinte : Adiciona isso : if getPlayerLevel(cid) < 100 then doPlayerSendCancel(cid, "You dont have level for this spell") end Embaixo disso : if (getPlayerStorageValue(cid, config.s) <= os.time()) then doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente.") setPlayerStorageValue(cid,config.s,os.time()+config.exhau) return end O 100 é o level minimo pra usar, ai se o level do player for menor que 100, ele n consegue usar. ... sei n se tu é melhor que o skydangerous,apesar de tudo ele n cometeria erros com os return se n coloca o return,vai só manda a mesagem mas vai usa a spell onSay(cid,item,item2,frompos,pos,topos) pó cara ta com preguisa de muda nome das varivel,as em vermelho nem vai te valor em talk. e porque n fez em spell Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1499037 Compartilhar em outros sites More sharing options...
BananaFight 196 Postado Abril 20, 2013 Share Postado Abril 20, 2013 Lord, errar é humano, não cheguei a testar e por isso não pude ver esses erros, arrumei bugs na hora de adaptar para talkactions que eu ja sabia que aconteceriam, e mais cara, achei que as alfinetadas ja deviam ter parado, para que vim aqui no tópico ficar alfinetando, Cresça e evolua... Link para o comentário https://xtibia.com/forum/topic/197935-evil-spirit/#findComment-1507144 Compartilhar em outros sites More sharing options...
Posts Recomendados