Postado Abril 20, 2015 10 anos Tenta assim: ------[[Script by MaTTch]]------ local config = { combat = COMBAT_FIREDAMAGE, -- tipo de combat combatEffect = CONST_ME_FIREATTACK, -- efeito spellRepeat = 50, -- quantas vezes vai repetir spellDelay = 200, -- delay entre as ondas (100 = 0.1 segundo) waves = 7 -- ondas } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, config.combat) setCombatParam(combat, COMBAT_PARAM_EFFECT, config.combatEffect) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -13.8, 0, -14.0, 0) local function getWaveFromPos(wave, pos) local ret = {} for a = -wave, wave do table.insert(ret, {x=pos.x+a,y=pos.y-wave,z=pos.z}) end for a = -(wave-1), wave do table.insert(ret, {x=pos.x+wave,y=pos.y+a,z=pos.z}) end for a = -wave, (wave-1) do table.insert(ret, {x=pos.x+a,y=pos.y+wave,z=pos.z}) end for a = -(wave-1), wave do table.insert(ret, {x=pos.x-wave,y=pos.y+a,z=pos.z}) end return ret end local function doSpell(cid, a, b) b = not b and 1 or a > config.spellRepeat and (b + 1 > config.waves and 1 or b + 1) or b a = not a and 1 or a > config.spellRepeat and 1 or a if(isCreature(cid)) then for _, pos in pairs(getWaveFromPos(b, getThingPos(cid))) do doCombat(cid, combat, positionToVariant(pos)) end addEvent(doSpell, config.spellDelay, cid, a+1, b) end return true end local dontRepeat = {} -- para nao repetir a magia caso ja tenha usada function onCastSpell(cid, var) if(dontRepeat[cid] ~= nil) then return false end dontRepeat[cid] = true return doSpell(cid) end Editado Abril 20, 2015 10 anos por MaTTch (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.