diff options
author | Manoj Srivastava <srivasta@debian.org> | 2014-05-14 23:54:09 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2014-05-14 23:54:09 -0700 |
commit | 4f8b58cc5366bfc2ea3b56fe6ff0443464d10f0f (patch) | |
tree | a0a9cad00e7916b9a97e14831fb362f21871cbef /lib/scpt/player.lua |
tome (2.3.11-ah-2) unstable; urgency=low
* Modified the install paths to deploy to the FHS compliant
/usr/games/tome and /var/games/tome, as we have always done
* This is a major change, and includes theming. Some of the options have
changed. Because of this, the manual page has been removed; there is a
command line help option and in game help until the manual page is
rewritten.
# imported from the archive
Diffstat (limited to 'lib/scpt/player.lua')
-rw-r--r-- | lib/scpt/player.lua | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/lib/scpt/player.lua b/lib/scpt/player.lua new file mode 100644 index 00000000..2a617608 --- /dev/null +++ b/lib/scpt/player.lua @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------ +----------------------- Hook to create birth objects ------------------------- +------------------------------------------------------------------------------ +function __birth_hook_objects() + -- Provide a book of blink to rangers + if get_class_name() == "Ranger" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("Phase Door") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + + -- Provide a book of Geyser to Geomancers + if get_class_name() == "Geomancer" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("Geyser") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + + -- Provide a book of prayer to priests + if get_class_name() == "Priest(Eru)" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("See the Music") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + if get_class_name() == "Priest(Manwe)" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("Manwe's Blessing") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + if get_class_name() == "Druid" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("Charm Animal") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + if get_class_name() == "Dark-Priest" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("Curse") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + if get_class_name() == "Paladin" then + local obj = create_object(TV_BOOK, 255); + obj.pval = find_spell("Divine Aim") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + if get_class_name() == "Mimic" then + local obj = create_object(TV_CLOAK, 100); + obj.pval2 = resolve_mimic_name("Mouse") + obj.ident = bor(obj.ident, IDENT_MENTAL, IDENT_KNOWN) + inven_carry(obj, FALSE) + end_object(obj) + end + + -- Start the undeads, as undeads with the corruptions + if get_subrace_name() == "Vampire" then + player.corruption(CORRUPT_VAMPIRE_TEETH, TRUE) + player.corruption(CORRUPT_VAMPIRE_STRENGTH, TRUE) + player.corruption(CORRUPT_VAMPIRE_VAMPIRE, TRUE) + end +end + +-- Register in the hook list +add_hook_script(HOOK_BIRTH_OBJECTS, "__birth_hook_objects", "__birth_hook_objects") |