diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-03-04 15:53:46 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-03-29 19:59:21 +0200 |
commit | a1ebb9363e31ad449377a5794f1bf93d84e25bc8 (patch) | |
tree | 3722b20555e47d8c20283b75bfc37b9eb7ba767f /lib/mods/theme/scpt/drunk.lua | |
parent | 6be64d33039bf2ece3f50b3162b2da7f74ce2e4a (diff) |
Import Theme repository into main repository
Diffstat (limited to 'lib/mods/theme/scpt/drunk.lua')
-rw-r--r-- | lib/mods/theme/scpt/drunk.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/mods/theme/scpt/drunk.lua b/lib/mods/theme/scpt/drunk.lua new file mode 100644 index 00000000..7d90af8d --- /dev/null +++ b/lib/mods/theme/scpt/drunk.lua @@ -0,0 +1,21 @@ +-- silly function that allows a drunk to take a bottle of wine/ale from the player + +function drunk_takes_wine(m_idx, item) + + m_ptr = monster(m_idx) + o_ptr = get_object(item) + + if (m_ptr.r_idx == test_monster_name("Singing, happy drunk")) + and (o_ptr.tval == TV_FOOD) and ((o_ptr.sval == 38) or (o_ptr.sval == 39)) then + + cmsg_print(TERM_YELLOW, "'Hic!'") + + inven_item_increase(item, -1) + inven_item_optimize(item) + return TRUE + else + return FALSE + end +end + +add_hook_script(HOOK_GIVE, "drunk_takes_wine", "drunk_takes_wine") |