Hi im trying to use LUA to make spells and monsters instead of XML. Monsters are working fine but i cant figure out how to run the spell.
So i tried the default example from repo in data/scripts/spells/example.lua But server wont start it just get stuck for few seconds on
Loading lua scripts ... and then just restarts without any Error.
So im having trouble figuring out the reason.
Also checked the lua file syntax with "luajit -bl". It was ok.
I also tried @Xikini code from tfs-1-3-how-to-create-an-instant-spell-in-spell-folder-revscripts, also my own script that i tried:
Server just wont load with any .lua script in data/scripts/spells/ unless its commented#. Thanks for the help.
EDIT: in my code there should be
Spell(SPELL_INSTANT) instead of Spell("instant") (I was just trying a lot of examples and changes and forgot to change back)
So i tried the default example from repo in data/scripts/spells/example.lua But server wont start it just get stuck for few seconds on
Loading lua scripts ... and then just restarts without any Error.
So im having trouble figuring out the reason.
Also checked the lua file syntax with "luajit -bl". It was ok.
I also tried @Xikini code from tfs-1-3-how-to-create-an-instant-spell-in-spell-folder-revscripts, also my own script that i tried:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
combat:setArea(createCombatArea(AREA_SQUAREWAVE6))
function onGetFormulaValues(player, level, magicLevel)
local min = 520
local max = 680
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local spell = Spell("instant")
spell:name("frost poison wave")
-- spell:words("####0001")
-- spell:id(101)
-- spell:direction(1)
function spell.onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
spell:register()
Server just wont load with any .lua script in data/scripts/spells/ unless its commented#. Thanks for the help.
Post automatically merged:
EDIT: in my code there should be
Spell(SPELL_INSTANT) instead of Spell("instant") (I was just trying a lot of examples and changes and forgot to change back)