canary/data/scripts/spells/support/focus_harmony.lua
Paco def12a7fcd
feat: add configurable retro spell learning system (#3971)
Add a config boolean to enable the retro spell learning system.

Main changes:
- Add retro spell learning support behind a configuration option.
- Update all spells to respect the new config.
- Update spell-related NPCs to handle the learning system according to TibiaWiki behavior.
- Update Dawnport NPCs for the retro spell learning flow.
- Update the Rookgaard Oracle to handle Monk vocation selection.

Validation:
- Debugged and tested on tibiatales.com using the Canary/TFS Crystal server distribution.

This allows servers to enable classic spell-learning behavior via config while keeping the existing spell behavior configurable.
2026-05-29 12:17:08 -03:00

28 lines
705 B
Lua

local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
local player = creature:getPlayer()
if player and combat:execute(creature, variant) then
player:fillHarmony()
return true
end
return false
end
spell:name("Focus Harmony")
spell:words("utevo nia")
spell:group("support")
spell:vocation("monk;true", "exalted monk;true")
spell:castSound(SOUND_EFFECT_TYPE_SPELL_ULTIMATE_LIGHT)
spell:id(279)
spell:cooldown(2 * 60 * 1000) -- 2 minutes
spell:groupCooldown(2 * 1000)
spell:level(275)
spell:mana(500)
spell:isAggressive(false)
spell:isPremium(true)
spell:needLearn(true)
spell:register()