death_salvo.lua

main 88 lines · 2.8 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 400ms
7local combat4_Brush = createCombatObject()
8setCombatParam(combat4_Brush, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
9setCombatParam(combat4_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
10setCombatArea(combat4_Brush,createCombatArea({{0, 0, 1, 0, 0},
11{0, 1, 1, 1, 0},
12{1, 1, 3, 1, 1},
13{0, 1, 1, 1, 0},
14{0, 0, 1, 0, 0}}))
15function getDmg_Brush(cid, level, maglevel)
16
17 return -min, -max
18end
19setCombatCallback(combat4_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
20
21-- Areas/Combat for 0ms
22local combat0_Brush_2 = createCombatObject()
23setCombatParam(combat0_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST)
24setCombatParam(combat0_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
25setCombatArea(combat0_Brush_2,createCombatArea({{0, 0, 0, 1, 0, 0, 0},
26{0, 0, 0, 0, 0, 0, 0},
27{0, 0, 0, 0, 0, 0, 0},
28{1, 0, 0, 2, 0, 0, 1},
29{0, 0, 0, 0, 0, 0, 0},
30{0, 0, 0, 0, 0, 0, 0},
31{0, 0, 0, 1, 0, 0, 0}}))
32
33local dfcombat0_Brush_2 = {CONST_ANI_SUDDENDEATH,0,3,3,0,-3,0,0,-3}
34
35-- =============== CORE FUNCTIONS ===============
36local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
37 if (isCreature(cid)) then
38 doCombat(cid, c, var)
39 if (dirList ~= nil) then -- Emit distance effects
40 local i = 2;
41 while (i < #dirList) do
42 doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
43 i = i + 2
44 end
45 end
46 end
47end
48function checkSpell30(cid)
49 local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01)
50 local CHECK_SLOT_01 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_04)
51 local CHECK_SLOT_02 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_05)
52 local CHECK_SLOT_03 = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_06)
53 SPELL_ID = 30
54
55 if GUN_ID > 0 then
56 if CHECK_SLOT_01 == SPELL_ID then
57 cid:sendCancelMessage("@SpellCooldown 01")
58 return true
59 elseif CHECK_SLOT_02 == SPELL_ID then
60 cid:sendCancelMessage("@SpellCooldown 02")
61 return true
62 elseif CHECK_SLOT_03 == SPELL_ID then
63 cid:sendCancelMessage("@SpellCooldown 03")
64 return true
65 else
66 return false
67 end
68 else
69 return false
70 end
71 return true
72end
73function onCastSpell(cid, var)
74 if checkSpell30(cid) or cid:getGroup():getAccess() then
75 local startPos = getCreaturePosition(cid)
76 local GUN_ID = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_01)
77 local starGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_03)
78 local levelGun = cid:getStorageValue(_SYSTEM.INVENTARIO[04].UID_07)
79 min = onDamage(cid, GUN_ID, levelGun, starGun, "SKILL_MIN", SPELL_ID)
80 max = min
81 addEvent(RunPart,400,combat4_Brush,cid.uid,var)
82 RunPart(combat0_Brush_2,cid,var,dfcombat0_Brush_2,startPos)
83 return true
84 else
85 cid:getPosition():sendMagicEffect(03)
86 return false
87 end
88end
Top