Skip to content

Commit

Permalink
Fix runes callback registration (otland#4789)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmish authored Sep 23, 2024
1 parent 55412d5 commit 2f45dc3
Show file tree
Hide file tree
Showing 36 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/avalanche_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/energy_bomb_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/energy_field_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_ENERGYFIELD_PVP)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/energy_wall_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ combat:setArea(createCombatArea(AREA_WALLFIELD, AREADIAGONAL_WALLFIELD))

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/explosion_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/fire_bomb_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/fire_field_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_FIREFIELD_PVP_FULL)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/fire_wall_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setArea(createCombatArea(AREA_WALLFIELD, AREADIAGONAL_WALLFIELD))

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/fireball_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/great_fireball_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/heavy_magic_missile_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/holy_missile_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/icicle_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/light_magic_missile_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/light_stone_shower_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/lightest_magic_missile_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/lightest_missile_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/magic_wall_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/paralyze_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ combat:addCondition(condition)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
if not combat:execute(creature, variant) then
return false
end
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/poison_bomb_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/poison_field_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_POISONFIELD_PVP)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/poison_wall_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setArea(createCombatArea(AREA_WALLFIELD, AREADIAGONAL_WALLFIELD))

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/soulfire_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
local min = (creature:getLevel() / 80) + (creature:getMagicLevel() * 0.3) + 2
local max = (creature:getLevel() / 80) + (creature:getMagicLevel() * 0.6) + 4
local rounds = math.random(math.floor(min), math.floor(max))
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/stalagmite_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/stone_shower_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/sudden_death_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/thunderstorm_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/attack/wild_growth_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_WILDGROWTH)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/healing/cure_poison_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/healing/intense_healing_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/healing/ultimate_healing_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
return combat:execute(creature, variant)
end

Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/support/animate_dead_rune.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
local position = variant:getPosition()
local tile = Tile(position)
if tile and creature:getSkull() ~= SKULL_BLACK then
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/support/chameleon_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ condition:setTicks(200000)

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
local position, item = variant:getPosition()
if position.x == CONTAINER_POSITION then
local container = creature:getContainerById(position.y - 64)
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/support/convince_creature_rune.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
local target = Creature(variant:getNumber())
if not target or not target:isMonster() then
creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/support/destroy_field_rune.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
local position = variant:getPosition()
local tile = Tile(position)
local field = tile and tile:getItemByType(ITEM_TYPE_MAGICFIELD)
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/runes/support/disintegrate_rune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local removalLimit = 500

local spell = Spell(SPELL_RUNE)

function onCastSpell(creature, variant, isHotkey)
function spell.onCastSpell(creature, variant, isHotkey)
local position = variant:getPosition()
local tile = Tile(position)
if tile then
Expand Down

0 comments on commit 2f45dc3

Please sign in to comment.