Sorry for my bad english and i'm really a newbie there.
One of my first work is a Safe Teleport Home, it's important to use the wonderfull LoG Framework from JKos with the use of the t.lua (with the lua object testpoint).
The idea is to propose the player on a dungeon something like a complete appartment where he can stack his goods, have safe rest, a cosy room from where he can get back to the dungeon (for now only by different teleporters to each level).
First, the definition of the scroll and the spell:
SpoilerShow
defineSpell{
name = "leomunds_secure_shelter",
uiName = "Leomund's Secure Shelter",
skill = "spellcraft",
level = 5,
runes = "ACGI",
manaCost = 20,
onCast = function(party)
testpoint_1.run(testpoint_1)
end,
}
defineObject{
name = "leomunds_secure_shelter_scroll",
class = "Item",
uiName = "Leomund's Secure Shelter Scroll",
model = "assets/models/items/scroll_spell.fbx",
gfxIndex = 113,
scroll = true,
spell = "leomunds_secure_shelter",
weight = 0.3,
}
name = "leomunds_secure_shelter",
uiName = "Leomund's Secure Shelter",
skill = "spellcraft",
level = 5,
runes = "ACGI",
manaCost = 20,
onCast = function(party)
testpoint_1.run(testpoint_1)
end,
}
defineObject{
name = "leomunds_secure_shelter_scroll",
class = "Item",
uiName = "Leomund's Secure Shelter Scroll",
model = "assets/models/items/scroll_spell.fbx",
gfxIndex = 113,
scroll = true,
spell = "leomunds_secure_shelter",
weight = 0.3,
}
SpoilerShow
function run(testpoint)
if type(testpoint) ~= 'table' or testpoint.name ~= 'testpoint' then
print('Invalid testpoint')
return
end
t.to(testpoint)
if testpoint.activate then
testpoint.activate()
end
end
if type(testpoint) ~= 'table' or testpoint.name ~= 'testpoint' then
print('Invalid testpoint')
return
end
t.to(testpoint)
if testpoint.activate then
testpoint.activate()
end
end