diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 12:56:16 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 12:56:29 +0200 |
commit | eb9fdd6852fced4ca9125b93585b95eb319dce18 (patch) | |
tree | 840aab10aedcdb1f67064310995d1f767e0b6a5e /example/scripts/npcs/debugger.lua | |
parent | 0261eb73e5588f5732aef5df753311d488c45d06 (diff) | |
download | manaserv-eb9fdd6852fced4ca9125b93585b95eb319dce18.tar.gz manaserv-eb9fdd6852fced4ca9125b93585b95eb319dce18.tar.bz2 manaserv-eb9fdd6852fced4ca9125b93585b95eb319dce18.tar.xz manaserv-eb9fdd6852fced4ca9125b93585b95eb319dce18.zip |
Made member function tables available as a globals
This way the scripts can add or replace existing member functions, which
can be useful. As demonstration chr_money and chr_money_change are now
added as Entity.money and Entity.change_money.
Also fixed the banker to use ask_number instead of ask_integer (I had
decided to rename this and apparently forgot the banker).
Mantis-issue: 503
Reviewed-by: Ablu
Diffstat (limited to 'example/scripts/npcs/debugger.lua')
-rw-r--r-- | example/scripts/npcs/debugger.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/example/scripts/npcs/debugger.lua b/example/scripts/npcs/debugger.lua index 390f8f29..e65bf236 100644 --- a/example/scripts/npcs/debugger.lua +++ b/example/scripts/npcs/debugger.lua @@ -50,8 +50,8 @@ function npc1_talk(npc, ch) end elseif v == 3 then - if chr_money_change(ch, -100) then - say(string.format("Thank you for you patronage! You are left with %d GP.", chr_money(ch))) + if ch:change_money(-100) then + say(string.format("Thank you for you patronage! You are left with %d GP.", ch:money())) local g = tonumber(chr_get_quest(ch, "001_donation")) if not g then g = 0 end g = g + 100 |