forgottenserver/data/scripts/spells/support/magic_rope.lua
Ranieri Althoff 25df9cfd38
Move spells to scripts folder (#4755)
* Move runes to dedicated folder
* Redirect old XML and lib folder to new location
* Drop unused custom spells
2024-09-20 00:13:59 +02:00

35 lines
996 B
Lua

local spell = Spell(SPELL_INSTANT)
function spell.onCastSpell(creature, variant)
local position = creature:getPosition()
position:sendMagicEffect(CONST_ME_POFF)
local tile = Tile(position)
if not table.contains(ropeSpots, tile:getGround():getId()) and not tile:getItemById(14435) 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:group("support")
spell:id(76)
spell:name("Magic Rope")
spell:words("exani tera")
spell:level(9)
spell:mana(20)
spell:isAggressive(false)
spell:isSelfTarget(true)
spell:cooldown(2000)
spell:groupCooldown(2000)
spell:vocation("sorcerer;true", "druid;true", "paladin;true", "knight;true", "master sorcerer;true", "elder druid;true", "royal paladin;true", "elite knight;true")
spell:register()