Postado Novembro 11, 2020 4 anos Preciso de 3 jutsus diferentes de Trap se alguem conseguir me ajudar. Primeiro: seria um trap que tu criaria no chao uma arvore se o cara passar por cima ou descer uma escada e cair em cima ficar paralyzado. Segundo: o Trap seria no target e iria fechando um monte de arvores nele. Terceiro: o Trap seria criado em area e paralyzaria todos os players menos quem usou o jutsu.
Postado Novembro 11, 2020 4 anos PRIMEIRO: SPELL local config = { itemid = 2344, -- id da bomba duration = 50, -- duration antes de ser removida actionid = 13246, -- actionid que sera setado na bomba (pro movements) effect = 951, -- efeito que sai ao colocar a bomba } function removeBomba(pos, id) local item = getTileItemById(pos, id) if item.uid > 0 then doRemoveItem(item.uid) end return true end function Explosive(cid, text) if not isPlayer(cid) then return end doSendAnimatedText(getCreaturePosition(cid), "Trap..", 215) end function onCastSpell(cid, var) local waittime = 20 -- Tempo de exhaustion local storage = 1 -- não mecha if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Usted esta cansado.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Tendras que esperar " .. exhaustion.get(cid, storage) .. " min para colocar otra trampa.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local position = getCreaturePosition(cid) local item = doCreateItem(config.itemid, 1, position) setItemAid(item, config.actionid) doItemSetAttribute(item, 'ref', getCreatureName(cid)) doSendMagicEffect(position, config.effect) addEvent(Explosive, 100, cid, "Trap!") addEvent(removeBomba, config.duration * 1000, position, config.itemid) exhaustion.set(cid, 2500, 1) exhaustion.set(cid, storage, waittime) return true end MOVEMENTS: local t = { tempo = 2 -- tempo em segundos } function onStepIn(cid, item, frompos, itemEx, topos) doRemoveItem(item.uid) doCreatureSetNoMove(cid, true) addEvent(function() if isPlayer(cid) then doCreatureSetNoMove(cid, false) end end, t.tempo*1000) return true end SEGUNDO: local remove_time = 8 -- tempo em segundos para remover as magic wall local item_id = 5750 -- id da magic wall function isWalkable(pos, creature, pz, proj) 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 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)) addEvent(doSendAnimatedText, 100, {x = pos.x, y = pos.y, z = pos.z}, "TRAP!", 180) 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 addEvent(removeItem, remove_time*1000, posAll) exhaustion.set(cid, storage, waittime) return true end Terceiro VC TENTA MODIFICAR AI local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_EFFECT, 134) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 20000) setConditionFormula(condition, -0.5, 0, -0.5, 0) setCombatCondition(combat, condition) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH) setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 1499) arr1 = { {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}, } arr2 = { {0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 1, 1, 0, 0}, {0, 1, 1, 0, 0, 0, 1, 1, 0}, {1, 1, 0, 0, 2, 0, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1, 1, 0}, {0, 0, 1, 1, 0, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0}, } local area2 = createCombatArea(arr2) local area1 = createCombatArea(arr1) setCombatArea(combat2, area2) setCombatArea(combat, area1) function countPos(pos,tempo) if tempo > 0 then doSendAnimatedText(pos,tempo,TEXTCOLOR_ORANGE) addEvent(countPos,999,pos,tempo-1) else end end function onCastSpell(cid, var) countPos(var.pos,30) local from,to = {x = 953, y = 1128, z = 7},{x = 982, y = 1147, z = 7} if isInArea(getCreaturePosition(cid), from, to) then return doPlayerSendCancel(cid, "Não é permitido utilizar está magia no desafio dos monstros.") else doCombat(cid, combat, var) return doCombat(cid, combat2, var) end return true end Editado Novembro 11, 2020 4 anos por Fabi Marzan (veja o histórico de edições)
Postado Fevereiro 11, 2021 4 anos Autor Em 11/11/2020 em 20:45, Fabi Marzan disse: PRIMEIRO: SPELL local config = { itemid = 2344, -- id da bomba duration = 50, -- duration antes de ser removida actionid = 13246, -- actionid que sera setado na bomba (pro movements) effect = 951, -- efeito que sai ao colocar a bomba } function removeBomba(pos, id) local item = getTileItemById(pos, id) if item.uid > 0 then doRemoveItem(item.uid) end return true end function Explosive(cid, text) if not isPlayer(cid) then return end doSendAnimatedText(getCreaturePosition(cid), "Trap..", 215) end function onCastSpell(cid, var) local waittime = 20 -- Tempo de exhaustion local storage = 1 -- não mecha if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "Usted esta cansado.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Tendras que esperar " .. exhaustion.get(cid, storage) .. " min para colocar otra trampa.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local position = getCreaturePosition(cid) local item = doCreateItem(config.itemid, 1, position) setItemAid(item, config.actionid) doItemSetAttribute(item, 'ref', getCreatureName(cid)) doSendMagicEffect(position, config.effect) addEvent(Explosive, 100, cid, "Trap!") addEvent(removeBomba, config.duration * 1000, position, config.itemid) exhaustion.set(cid, 2500, 1) exhaustion.set(cid, storage, waittime) return true end MOVEMENTS: local t = { tempo = 2 -- tempo em segundos } function onStepIn(cid, item, frompos, itemEx, topos) doRemoveItem(item.uid) doCreatureSetNoMove(cid, true) addEvent(function() if isPlayer(cid) then doCreatureSetNoMove(cid, false) end end, t.tempo*1000) return true end SEGUNDO: local remove_time = 8 -- tempo em segundos para remover as magic wall local item_id = 5750 -- id da magic wall function isWalkable(pos, creature, pz, proj) 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 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)) addEvent(doSendAnimatedText, 100, {x = pos.x, y = pos.y, z = pos.z}, "TRAP!", 180) 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 addEvent(removeItem, remove_time*1000, posAll) exhaustion.set(cid, storage, waittime) return true end Terceiro VC TENTA MODIFICAR AI local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_EFFECT, 134) local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 20000) setConditionFormula(condition, -0.5, 0, -0.5, 0) setCombatCondition(combat, condition) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH) setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 1499) arr1 = { {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}, } arr2 = { {0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 1, 1, 0, 0}, {0, 1, 1, 0, 0, 0, 1, 1, 0}, {1, 1, 0, 0, 2, 0, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1, 1, 0}, {0, 0, 1, 1, 0, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0}, } local area2 = createCombatArea(arr2) local area1 = createCombatArea(arr1) setCombatArea(combat2, area2) setCombatArea(combat, area1) function countPos(pos,tempo) if tempo > 0 then doSendAnimatedText(pos,tempo,TEXTCOLOR_ORANGE) addEvent(countPos,999,pos,tempo-1) else end end function onCastSpell(cid, var) countPos(var.pos,30) local from,to = {x = 953, y = 1128, z = 7},{x = 982, y = 1147, z = 7} if isInArea(getCreaturePosition(cid), from, to) then return doPlayerSendCancel(cid, "Não é permitido utilizar está magia no desafio dos monstros.") else doCombat(cid, combat, var) return doCombat(cid, combat2, var) end return true end o segundo spell nao ta conforme eu pedi ele simplesmente fecha na volta do cara so e ele teria que tipo ir fechando grande medio e pequeno entende? e o terceiro spell nao ta certo ele cria tudo e tals mas fica espaços no meio e tipo ele teria que criar uma floresta gigante e ninguem pode se mover so o dono da floresta entende? e as spells eu uso e nao retira as wall na vdd o terceiro spell ta certo mas o dono da spell nao pode passar por cima e o primeiro ta dando erro no setitemAid!
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.