Postado Setembro 26, 2020 4 anos Futuramente quando eu tiver minha bola de cristal volto com sua resposta.
Postado Setembro 26, 2020 4 anos Autor 19 horas atrás, Fabi Marzan disse: esse e primeiro local remove_time = 8 -- tempo em segundos para remover as magic wall local item_id = 12870 -- id da magic wall function removeItem(posAll) for i=1, #posAll do for j=0, 255 do pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j} removeTile = getThingfromPos(pos_stack) if removeTile.itemid == item_id then doRemoveItem(removeTile.uid) end end end end function onCastSpell(cid, var) local waittime = 30 -- Tempo de exhaustion em segundos local storage = 5853 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas! if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Espera "..exhaustion.get(cid, storage).." segundos para usar nuevamente.") return false end local pos = getThingPos(getCreatureTarget(cid)) posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1} posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1} posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1} posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1} posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1} posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1} posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1} posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1} posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8} for i=1, #posAll do if isWalkable(posAll[i]) then doCreateItem(item_id, 1, posAll[i]) end end function dotonprision(cid) if isCreature(cid) and isCreature(getCreatureTarget(cid)) then local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(position, 690) local position = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(position, 690) end end local parameters = {cid = cid, var = var, combat1 = combat1 , combat2 = combat2} for i = 1, 2 do addEvent(function() if isCreature(cid) then addEvent(dotonprision,100,cid) end end, 1 + ((i-1) * 8000)) end for i = 1, 1 do addEvent(function() if isCreature(cid) then addEvent(removeItem, remove_time*1000, posAll) end end, 1 + ((i-1) * 8000)) end exhaustion.set(cid, storage, waittime) return true end SEGUNDO local config = { wallArea = { {1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 2, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 1, 1, 1, 1, 1, 1, 1, 1}, }, effect = 3, --Efeito. wallId = 2718, --ID da parede. time = 15, --Duração da parede. cooldown = {5, 5}, --{sucessCooldown, failCooldown}, chance = 100, --Chance da spell funcionar. storage = 9571, } 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 getPosfromArea(cid, area) --by Dokmos icenter = math.floor(table.getn(area)/2)+1 jcenter = math.floor(table.getn(area[1])/2)+1 center = area[icenter] ivar = table.getn(area) jvar = table.getn(area[1]) i = table.getn(area)^2 j = table.getn(area[1])^2 local mydir = isCreature(getCreatureTarget(cid)) and getCreatureDirectionToTarget(cid, getCreatureTarget(cid)) or getCreatureLookDir(cid) setPlayerStorageValue(cid, 21101, -1) if center[jcenter] == 3 then if mydir == 0 then signal = {-1,1,1,2} elseif mydir == 1 then signal = {1,-1,2,1} elseif mydir == 2 then signal = {1,-1,1,2} elseif mydir == 3 then signal = {-1,1,2,1} end else signal = {-1,1,1,2} end POSITIONS = {} P = 0 repeat pvar = {0,0} I = area[ivar] J = I[jvar] i = i-1 j = j-1 if J == 1 then if jvar < jcenter then pvar[signal[3]] = signal[1]*math.abs((jcenter-jvar)) elseif jvar > jcenter then pvar[signal[3]] = signal[2]*math.abs((jcenter-jvar)) end if ivar < icenter then pvar[signal[4]] = signal[1]*math.abs((icenter-ivar)) elseif ivar > icenter then pvar[signal[4]] = signal[2]*math.abs((icenter-ivar)) end end if jvar > 1 then jvar = (jvar-1) elseif ivar > 1 then jvar = table.getn(area[1]) ivar = (ivar-1) end local pos = getThingPos(cid) local areapos = {x=pos.x+(pvar[1]),y=pos.y+(pvar[2]),z=pos.z} if pos.x ~= areapos.x or pos.y ~= areapos.y then P = P+1 POSITIONS[P] = areapos end until i <= 0 and j <= 0 return POSITIONS end function onCastSpell(cid) if getPlayerStorageValue(cid, config.storage) > os.time() then doPlayerSendCancel(cid, "Wait "..getPlayerStorageValue(cid, config.storage) - os.time().." second(s).") doCreatureSay(cid, "Voce precisa aguardar para usar novamente!!.", TALKTYPE_MONSTER) else if math.random(1, 100) > config.chance then doPlayerSendCancel(cid, "Your spell failed.") doSendAnimatedText(getThingPos(cid), "FAIL!", 215) setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[2]) else local positions = {} setPlayerStorageValue(cid, config.storage, os.time() + config.cooldown[1]) for _, pos in pairs(getPosfromArea(cid, config.wallArea)) do if isWalkable(pos) and not getTileInfo(pos).protection then doCreateItem(config.wallId, 1, pos) doSendMagicEffect(pos, config.effect) table.insert(positions, pos) end end if #positions > 0 then addEvent(function() for i = 1, #positions do local item = getTileItemById(positions[i], config.wallId).uid if item > 0 then doRemoveItem(item) end end end, config.time * 1000) end end end return true end Obrigado !
Postado Setembro 27, 2020 4 anos Em 25/09/2020 em 21:24, H3ITORR disse: Como o nto ultimate fez pro hashirama então? eu acho que é um item normal onde todos pode passar por cima e entao ele criou em movements um scirpt que só hashirama possar andar. Algo assim: Spoiler function onStepIn(cid, item, position, fromPosition) if isMonster(cid) then doTeleportThing(cid, fromPosition, true) end if getPlayerVocationName(cid) == "Hashirama" then doSendMagicEffect(position, 131) else doTeleportThing(cid, fromPosition) end return true end Editado Setembro 28, 2020 4 anos por BangxD (veja o histórico de edições)
Postado Setembro 28, 2020 4 anos 19 minutos atrás, BangxD disse: eu acho que é um item normal onde todos pode passar por cima e entao ele criou em movements um scirpt que só hashirama possar andar. Como eu poderia fazer esse movements? Acho que só o player não a vocation tlgd
Postado Setembro 28, 2020 4 anos Agora, H3ITORR disse: Como eu poderia fazer esse movements? Acho que só o player não a vocation tlgd Melhor cria outro topico, porque esse ja foi resolvido. Algo assim: Spoiler function onStepIn(cid, item, position, fromPosition) if isMonster(cid) then doTeleportThing(cid, fromPosition, true) end if getPlayerVocationName(cid) == "Hashirama" then doSendMagicEffect(position, 131) else doTeleportThing(cid, fromPosition) end return true end
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.