mirror of
https://github.com/opentibiabr/canary
synced 2026-08-16 06:26:09 -04:00
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.
38 lines
1 KiB
Lua
38 lines
1 KiB
Lua
local spell = Spell("instant")
|
|
|
|
function spell.onCastSpell(creature, var)
|
|
local position = creature:getPosition()
|
|
position:sendMagicEffect(CONST_ME_POFF)
|
|
|
|
local tile = Tile(position)
|
|
if not tile:isRopeSpot() then
|
|
creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
|
|
return false
|
|
end
|
|
|
|
tile = Tile(position:moveUpstairs())
|
|
if not tile then
|
|
creature:sendCancelMessage(RETURNVALUE_NOTENOUGHROOM)
|
|
return false
|
|
end
|
|
|
|
creature:teleportTo(position, false)
|
|
position:sendMagicEffect(CONST_ME_TELEPORT)
|
|
return true
|
|
end
|
|
|
|
spell:name("Magic Rope")
|
|
spell:words("exani tera")
|
|
spell:group("support")
|
|
spell:vocation("druid;true", "elder druid;true", "knight;true", "elite knight;true", "paladin;true", "royal paladin;true", "sorcerer;true", "master sorcerer;true", "monk;true", "exalted monk;true")
|
|
spell:castSound(SOUND_EFFECT_TYPE_SPELL_MAGIC_ROPE)
|
|
spell:id(76)
|
|
spell:cooldown(2 * 1000)
|
|
spell:groupCooldown(2 * 1000)
|
|
spell:level(9)
|
|
spell:mana(20)
|
|
spell:isSelfTarget(true)
|
|
spell:isAggressive(false)
|
|
spell:isPremium(true)
|
|
|
|
spell:register()
|