obliteration_bomb.lua

main 144 lines · 4.7 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1SPELL_ID = 00
2local min = 0
3local max = 0
4
5-- =============== COMBAT VARS ===============
6-- Areas/Combat for 100ms
7local combat1_Brush = createCombatObject()
8setCombatParam(combat1_Brush, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
9setCombatParam(combat1_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
10setCombatArea(combat1_Brush,createCombatArea({{1, 1, 1, 1, 1, 1, 1},
11{1, 0, 0, 0, 0, 0, 1},
12{1, 0, 0, 0, 0, 0, 1},
13{1, 0, 0, 2, 0, 0, 1},
14{1, 0, 0, 0, 0, 0, 1},
15{1, 0, 0, 0, 0, 0, 1},
16{1, 1, 1, 1, 1, 1, 1}}))
17function getDmg_Brush(cid, level, maglevel)
18
19 return -min, -max
20end
21setCombatCallback(combat1_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
22
23-- Areas/Combat for 0ms
24local combat0_Brush = createCombatObject()
25setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
26setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
27setCombatArea(combat0_Brush,createCombatArea({{1, 1, 1, 1, 1, 1, 1, 1, 1},
28{1, 0, 0, 0, 0, 0, 0, 0, 1},
29{1, 0, 0, 0, 0, 0, 0, 0, 1},
30{1, 0, 0, 0, 0, 0, 0, 0, 1},
31{1, 0, 0, 0, 2, 0, 0, 0, 1},
32{1, 0, 0, 0, 0, 0, 0, 0, 1},
33{1, 0, 0, 0, 0, 0, 0, 0, 1},
34{1, 0, 0, 0, 0, 0, 0, 0, 1},
35{1, 1, 1, 1, 1, 1, 1, 1, 1}}))
36function getDmg_Brush(cid, level, maglevel)
37
38 return -min, -max
39end
40setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
41
42-- Areas/Combat for 200ms
43local combat2_Brush = createCombatObject()
44setCombatParam(combat2_Brush, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
45setCombatParam(combat2_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
46setCombatArea(combat2_Brush,createCombatArea({{1, 1, 1, 1, 1},
47{1, 0, 0, 0, 1},
48{1, 0, 2, 0, 1},
49{1, 0, 0, 0, 1},
50{1, 1, 1, 1, 1}}))
51function getDmg_Brush(cid, level, maglevel)
52
53 return -min, -max
54end
55setCombatCallback(combat2_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
56
57-- Areas/Combat for 300ms
58local combat3_Brush = createCombatObject()
59setCombatParam(combat3_Brush, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
60setCombatParam(combat3_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
61setCombatArea(combat3_Brush,createCombatArea({{1, 1, 1},
62{1, 2, 1},
63{1, 1, 1}}))
64function getDmg_Brush(cid, level, maglevel)
65
66 return -min, -max
67end
68setCombatCallback(combat3_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
69
70-- Areas/Combat for 600ms
71local combat6_Brush_2 = createCombatObject()
72setCombatParam(combat6_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA)
73setCombatParam(combat6_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
74setCombatArea(combat6_Brush_2,createCombatArea({{1, 1, 1, 0, 0, 0, 1, 1, 1},
75{1, 1, 1, 1, 1, 1, 1, 1, 1},
76{1, 1, 1, 1, 1, 1, 1, 1, 1},
77{0, 1, 1, 1, 1, 1, 1, 1, 0},
78{0, 1, 1, 1, 2, 1, 1, 1, 0},
79{0, 1, 1, 1, 1, 1, 1, 1, 0},
80{1, 1, 1, 1, 1, 1, 1, 1, 1},
81{1, 1, 1, 1, 1, 1, 1, 1, 1},
82{1, 1, 1, 0, 0, 0, 1, 1, 1}}))
83function getDmg_Brush_2(cid, level, maglevel)
84
85 return -min, -max
86end
87setCombatCallback(combat6_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")
88
89-- =============== CORE FUNCTIONS ===============
90local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
91 if (isCreature(cid)) then
92 doCombat(cid, c, var)
93 if (dirList ~= nil) then -- Emit distance effects
94 local i = 2;
95 while (i < #dirList) do
96 doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
97 i = i + 2
98 end
99 end
100 end
101end
102function checkSpell38(cid)
103 local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01)
104 local CHECK_SLOT_01 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04)
105 local CHECK_SLOT_02 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05)
106 local CHECK_SLOT_03 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_06)
107 SPELL_ID = 38
108
109 if GUN_ID > 0 then
110 if CHECK_SLOT_01 == SPELL_ID then
111 cid:sendCancelMessage("@SpellCooldown 01")
112 return true
113 elseif CHECK_SLOT_02 == SPELL_ID then
114 cid:sendCancelMessage("@SpellCooldown 02")
115 return true
116 elseif CHECK_SLOT_03 == SPELL_ID then
117 cid:sendCancelMessage("@SpellCooldown 03")
118 return true
119 else
120 return false
121 end
122 else
123 return false
124 end
125end
126function onCastSpell(cid, var)
127 if checkSpell38(cid) or cid:getGroup():getAccess() then
128 local startPos = getCreaturePosition(cid)
129 local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01)
130 local starGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_03)
131 local levelGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_07)
132 min = onDamage(cid, GUN_ID, levelGun, starGun, "SKILL_MIN", SPELL_ID)
133 max = min
134 addEvent(RunPart,100,combat1_Brush,cid.uid,var)
135 RunPart(combat0_Brush,cid,var)
136 addEvent(RunPart,200,combat2_Brush,cid.uid,var)
137 addEvent(RunPart,300,combat3_Brush,cid.uid,var)
138 addEvent(RunPart,600,combat6_Brush_2,cid.uid,var)
139 return true
140 else
141 cid:getPosition():sendMagicEffect(03)
142 return false
143 end
144end
Top