forgottenserver/data/scripts/runes/#example.lua
Ranieri Althoff 25df9cfd38
Move spells to scripts folder (#4755)
* Move runes to dedicated folder
* Redirect old XML and lib folder to new location
* Drop unused custom spells
2024-09-20 00:13:59 +02:00

32 lines
958 B
Lua

local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 3.2) + 20
local max = (level / 5) + (magicLevel * 5.4) + 40
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local spell = Spell(SPELL_RUNE)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end
spell:name("test rune")
spell:runeId(2275)
spell:id(220)
spell:level(20)
spell:magicLevel(5)
spell:needTarget(true)
spell:isAggressive(false)
spell:allowFarUse(true)
spell:charges(25)
spell:vocation("sorcerer;true", "master sorcerer")
spell:register()