SPELL_ID = 00 local min = 0 local max = 0 -- =============== COMBAT VARS =============== -- Areas/Combat for 400ms local combat4_Brush_2 = createCombatObject() setCombatParam(combat4_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat4_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatArea(combat4_Brush_2,createCombatArea({{0, 1, 0}, {1, 2, 1}, {0, 1, 0}})) function getDmg_Brush_2(cid, level, maglevel) return -min, -max end setCombatCallback(combat4_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2") -- Areas/Combat for 0ms local combat0_Brush = createCombatObject() setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST) setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatArea(combat0_Brush,createCombatArea({{0, 0, 1, 0, 0}, {0, 0, 0, 0, 0}, {1, 0, 2, 0, 1}, {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}})) function getDmg_Brush(cid, level, maglevel) return -min, -max end setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush") -- Areas/Combat for 1300ms local combat13_Brush = createCombatObject() setCombatParam(combat13_Brush, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST) setCombatParam(combat13_Brush, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatArea(combat13_Brush,createCombatArea({{0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 2, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}})) function getDmg_Brush(cid, level, maglevel) return -min, -max end setCombatCallback(combat13_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush") -- Areas/Combat for 1600ms local combat16_Brush_2 = createCombatObject() setCombatParam(combat16_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat16_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatArea(combat16_Brush_2,createCombatArea({{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}})) function getDmg_Brush_2(cid, level, maglevel) return -min, -max end setCombatCallback(combat16_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2") -- Areas/Combat for 2600ms local combat26_Brush = createCombatObject() setCombatParam(combat26_Brush, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST) setCombatParam(combat26_Brush, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatArea(combat26_Brush,createCombatArea({{0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 2, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0}})) function getDmg_Brush(cid, level, maglevel) return -min, -max end setCombatCallback(combat26_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush") -- Areas/Combat for 2800ms local combat28_Brush_2 = createCombatObject() setCombatParam(combat28_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat28_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatArea(combat28_Brush_2,createCombatArea({{0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 2, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 0}})) function getDmg_Brush_2(cid, level, maglevel) return -min, -max end setCombatCallback(combat28_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2") -- =============== CORE FUNCTIONS =============== local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part if (isCreature(cid)) then doCombat(cid, c, var) if (dirList ~= nil) then -- Emit distance effects local i = 2; while (i < #dirList) do doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1]) i = i + 2 end end end end function checkSpell64(cid) local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01) local CHECK_SLOT_01 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04) local CHECK_SLOT_02 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05) local CHECK_SLOT_03 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_06) SPELL_ID = 64 if GUN_ID > 0 then if CHECK_SLOT_01 == SPELL_ID then cid:sendCancelMessage("@SpellCooldown 01") return true elseif CHECK_SLOT_02 == SPELL_ID then cid:sendCancelMessage("@SpellCooldown 02") return true elseif CHECK_SLOT_03 == SPELL_ID then cid:sendCancelMessage("@SpellCooldown 03") return true else return false end else return false end end function onCastSpell(cid, var) if checkSpell64(cid) or cid:getGroup():getAccess() then local startPos = getCreaturePosition(cid) local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01) local starGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_03) local levelGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_07) min = onDamage(cid, GUN_ID, levelGun, starGun, "SKILL_MIN", SPELL_ID) max = min addEvent(RunPart,400,combat4_Brush_2,cid.uid,var) RunPart(combat0_Brush,cid,var) addEvent(RunPart,1300,combat13_Brush,cid.uid,var) addEvent(RunPart,1600,combat16_Brush_2,cid.uid,var) addEvent(RunPart,2600,combat26_Brush,cid.uid,var) addEvent(RunPart,2800,combat28_Brush_2,cid.uid,var) return true else cid:getPosition():sendMagicEffect(03) return false end end