Black-Tek/BlackTek-Server

Revscript spell vocation requirements not working

Silba93 opened this issue · 1 comments

Tested with each base vocation and no vocation, when trying to cast a spell created in revscript it's not possible and instead it sends
"You have the wrong vocation to cast this spell."

God char can cast the spells normally and i tested a few xml spells and they seem to be fine also.

Since i can't actually get the spell to cast on a normal character i can't know for sure if any other problems exist in revscript spells

Quick test script and the script used in the video

local spell = Spell(SPELL_INSTANT)

local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))

function onGetFormulaValues(player, level, magicLevel)
    local min, max = 5, 10
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

spell:name("test wave")
spell:words('exevo test')
spell:group('attack')
spell:vocation("paladin", "knight", "sorcerer", "druid")
spell:cooldown(200)
spell:groupCooldown(200)
spell:magicLevel(0)
spell:mana(0)
spell:isAggressive(true)
spell:needDirection(true)
spell:register()
Recording.2024-09-30.203149.mp4

Fixed with 52ab7ab