-
-
Notifications
You must be signed in to change notification settings - Fork 666
/
Copy pathgreat_death_beam.lua
69 lines (58 loc) · 1.88 KB
/
great_death_beam.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 5.5)
local max = (level / 5) + (maglevel * 9)
return -min, -max
end
local initCombat = Combat()
initCombat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local function createCombat(combat, area)
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setArea(createCombatArea(area))
return combat
end
local combat1 = createCombat(initCombat, AREA_BEAM6)
local combat2 = createCombat(initCombat, AREA_BEAM7)
local combat3 = createCombat(initCombat, AREA_BEAM8)
local spell = Spell("instant")
local exhaust = {}
function spell.onCastSpell(creature, var)
if not creature or not creature:isPlayer() then
return false
end
local grade = creature:upgradeSpellsWOD("Great Death Beam")
if grade == WHEEL_GRADE_NONE then
creature:sendCancelMessage("You cannot cast this spell")
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
local cooldown = { 10, 8, 6 }
var.runeName = "Beam Mastery"
local executed = false
local combat = { combat1, combat2, combat3 }
executed = combat[grade]:execute(creature, var)
if executed then
local condition = Condition(CONDITION_SPELLCOOLDOWN, CONDITIONID_DEFAULT, 260)
local executedCooldown = cooldown[grade]
if executedCooldown ~= nil then
condition:setTicks((executedCooldown * 1000))
end
creature:addCondition(condition)
return true
end
return false
end
spell:group("attack")
spell:id(260)
spell:name("Great Death Beam")
spell:words("exevo max mort")
spell:level(300)
spell:mana(140)
spell:isPremium(false)
spell:needDirection(true)
spell:blockWalls(true)
spell:cooldown(1000) -- Cooldown is calculated on the casting
spell:groupCooldown(2 * 1000)
spell:needLearn(true)
spell:vocation("sorcerer;true", "master sorcerer;true")
spell:register()