Postado Março 23, 2018 7 anos olá gostaria de ajuda com essa spell ela empurra o alvo 1 sqm e quem usou ela é teleportado no lugar do alvo.. porem se não tem alvo o player que usou a magia fica no mesmo lugar.. queria que o player que usou andasse 1 sqm dependendo da direção que esta olhando.. por ex se está olhando para o norte andar 1 sqm pro norte e assim por diante.. sem precisar do ''doTeleportThing(uid, fromPosition, true)'' obs: essa spell e do nightwolf só diminui a área e coloquei pro player andar tmb. eis o script : local function doPushCreature(target, uid) if target > 0 then if not isNpc(target) then local direction =getPlayerLookDir(cid) local postarg = getCreaturePosition(target) local position = getThingPosition(uid) local positionone = {x = position.x+1, y = position.y, z = position.z} local fromPosition = getThingPosition(target) local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1)) local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1)) local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z} if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then doTeleportThing(target, toPosition, true) doTeleportThing(uid, fromPosition, true) end end end end local spell = {} spell.config = { [1] = { damageType = 1, areaEffect = 2, area = { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 3, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } } } spell.combats = {} for _, config in ipairs(spell.config) do local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType) setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4, 0, -4.7, 0) function onTargetCreature(cid, target) doPushCreature(target, cid) end setCombatCallback(combat, 4, "onTargetCreature") setCombatArea(combat, createCombatArea(config.area)) table.insert(spell.combats, combat) end function onCastSpell(cid, var) for n = 1, #spell.combats do addEvent(doCombat, (n * 120), cid, spell.combats[n], var) end return true end Editado Março 23, 2018 7 anos por Jeanzim (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.