From eb9fdd6852fced4ca9125b93585b95eb319dce18 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 3 May 2013 12:56:16 +0200 Subject: 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 --- example/scripts/maps/desert.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'example/scripts/maps') diff --git a/example/scripts/maps/desert.lua b/example/scripts/maps/desert.lua index 759dbb5..5f7f2d2 100644 --- a/example/scripts/maps/desert.lua +++ b/example/scripts/maps/desert.lua @@ -79,8 +79,8 @@ function Harmony(npc, ch, list) --- Give the player 100 units of money the first time. if harmony_have_talked_to_someone == false then say("Here is some money for you to find some toys to play with.\nEh Eh!") - chr_money_change(ch, 100) - say(string.format("You now have %d shiny coins!", chr_money(ch))) + ch:change_money(100) + say(string.format("You now have %d shiny coins!", ch:money())) harmony_have_talked_to_someone = true say(string.format("Try to come back with a better level than %i.", ch:level())) else -- cgit