Postado Outubro 22, 2017 7 anos @TheKiler na tag da primeira spell você deixa needtarget="1" na spell2 deixa isso: Spoiler local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 2) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -9.0, -30, -10.0, 4) local arr = { {1,1,1}, {1,3,1}, {1,1,1} } local area = createCombatArea(arr) setCombatArea(combat, area) function canWalk(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)) and (hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end return true end function onCastSpell(cid) for x=-1,1 do for y =-1,1 do local pos = getThingPos(cid) pos.x = pos.x + x pos.y = pos.y + y local m = getTopCreature(pos).uid if m ~= 0 then pos.x = pos.x + x pos.y = pos.y + y if canWalk(pos) == true then doTeleportThing(m,pos) end end end end doCombat(cid, combat, var) return true end Editado Outubro 22, 2017 7 anos por antharaz (veja o histórico de edições)
Postado Outubro 22, 2017 7 anos Autor 24 minutos atrás, antharaz disse: @TheKiler na tag da primeira spell você deixa needtarget="1" na spell2 deixa isso: Ocultar conteúdo local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 2) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -9.0, -30, -10.0, 4) local area = { {1,1,1}, {1,3,1}, {1,1,1} } local area = createCombatArea(arr) setCombatArea(combat, area) function canWalk(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)) and (hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end return true end function onCastSpell(cid) for x=-1,1 do for y =-1,1 do local pos = getThingPos(cid) pos.x = pos.x + x pos.y = pos.y + y local m = getTopCreature(pos).uid if m ~= 0 then pos.x = pos.x + x pos.y = pos.y + y if canWalk(pos) == true then doTeleportThing(m,pos) end end end end doCombat(cid, combat, var) return true end VLW MANO! REP+, Mas aonde está o needtarget? @antharaz 32 minutos atrás, antharaz disse: @TheKiler na tag da primeira spell você deixa needtarget="1" na spell2 deixa isso: Mostrar conteúdo oculto local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 2) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -9.0, -30, -10.0, 4) local area = { {1,1,1}, {1,3,1}, {1,1,1} } local area = createCombatArea(arr) setCombatArea(combat, area) function canWalk(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)) and (hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end return true end function onCastSpell(cid) for x=-1,1 do for y =-1,1 do local pos = getThingPos(cid) pos.x = pos.x + x pos.y = pos.y + y local m = getTopCreature(pos).uid if m ~= 0 then pos.x = pos.x + x pos.y = pos.y + y if canWalk(pos) == true then doTeleportThing(m,pos) end end end end doCombat(cid, combat, var) return true end Na 2° Spell deu isto: [Error - Spell Interface] [15:43:13.030] data/spells/scripts/teste/2spell.lua [15:43:13.031] Description: [15:43:13.031] (luaSetCombatArea) Area not found Editado Outubro 22, 2017 7 anos por TheKiler (veja o histórico de edições)
Postado Outubro 22, 2017 7 anos @TheKiler Se não tiver, você coloca na tag do xml. na 2º usa esse daqui: Spoiler local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 2) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -9.0, -30, -10.0, 4) local arr = { {1,1,1}, {1,3,1}, {1,1,1} } local area = createCombatArea(arr) setCombatArea(combat, area) function canWalk(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)) and (hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end return true end function onCastSpell(cid) for x=-1,1 do for y =-1,1 do local pos = getThingPos(cid) pos.x = pos.x + x pos.y = pos.y + y local m = getTopCreature(pos).uid if m ~= 0 then pos.x = pos.x + x pos.y = pos.y + y if canWalk(pos) == true then doTeleportThing(m,pos) end end end end doCombat(cid, combat, var) 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.