1SPELL_ID = 00
2local min = 0
3local max = 0
4
5-- =============== COMBAT VARS ===============
6-- Areas/Combat for 0ms
7local combat0_Brush = createCombatObject()
8setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
9setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
10setCombatArea(combat0_Brush,createCombatArea({{0, 0, 0, 1, 0, 0, 0},
11{0, 0, 0, 1, 0, 0, 0},
12{0, 0, 1, 1, 1, 0, 0},
13{1, 1, 1, 2, 1, 1, 1},
14{0, 0, 1, 1, 1, 0, 0},
15{0, 0, 0, 1, 0, 0, 0},
16{0, 0, 0, 1, 0, 0, 0}}))
17function getDmg_Brush(cid, level, maglevel)
18
19 return -min, -max
20end
21setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
22
23-- =============== CORE FUNCTIONS ===============
24local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
25 if (isCreature(cid)) then
26 doCombat(cid, c, var)
27 if (dirList ~= nil) then -- Emit distance effects
28 local i = 2;
29 while (i < #dirList) do
30 doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
31 i = i + 2
32 end
33 end
34 end
35end
36function checkSpell46(cid)
37 local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01)
38 local CHECK_SLOT_01 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04)
39 local CHECK_SLOT_02 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05)
40 local CHECK_SLOT_03 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_06)
41 SPELL_ID = 46
42
43 if GUN_ID > 0 then
44 if CHECK_SLOT_01 == SPELL_ID then
45 cid:sendCancelMessage("@SpellCooldown 01")
46 return true
47 elseif CHECK_SLOT_02 == SPELL_ID then
48 cid:sendCancelMessage("@SpellCooldown 02")
49 return true
50 elseif CHECK_SLOT_03 == SPELL_ID then
51 cid:sendCancelMessage("@SpellCooldown 03")
52 return true
53 else
54 return false
55 end
56 else
57 return false
58 end
59end
60function onCastSpell(cid, var)
61 if checkSpell46(cid) or cid:getGroup():getAccess() then
62 local startPos = getCreaturePosition(cid)
63 local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01)
64 local starGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_03)
65 local levelGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_07)
66 min = onDamage(cid, GUN_ID, levelGun, starGun, "SKILL_MIN", SPELL_ID)
67 max = min
68 RunPart(combat0_Brush,cid,var)
69 return true
70 else
71 cid:getPosition():sendMagicEffect(03)
72 return false
73 end
74end