summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-05-03 15:40:57 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-05-03 15:40:57 +0200
commited8fba0a47d2e498267cbfbf1271bacb76c400e9 (patch)
treed9e2bec54c051edb9d6c4175c3e5e5532e8d35ce /example
parent769030e6bd22faeb760731172c221ae801c04dcc (diff)
parentf6f27a9ffaf72f9856240db1bb788a9efa3e86f0 (diff)
downloadmanaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.gz
manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.bz2
manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.xz
manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.zip
Merge branch 'master' into lpc2012
Diffstat (limited to 'example')
-rw-r--r--example/scripts/maps/desert.lua4
-rw-r--r--example/scripts/npcs/banker.lua14
-rw-r--r--example/scripts/npcs/debugger.lua4
-rw-r--r--example/settings.xml1
4 files changed, 12 insertions, 11 deletions
diff --git a/example/scripts/maps/desert.lua b/example/scripts/maps/desert.lua
index 759dbb51..5f7f2d28 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
diff --git a/example/scripts/npcs/banker.lua b/example/scripts/npcs/banker.lua
index ce352a0c..a9375736 100644
--- a/example/scripts/npcs/banker.lua
+++ b/example/scripts/npcs/banker.lua
@@ -37,16 +37,16 @@ function Banker(npc, ch)
result = 1
while (result < 3) do --While they've choosen a valid option that isn't "Never mind"
account = tonumber(chr_get_quest(ch, "BankAccount")) --Why do I need to convert this?
- say("Your balance: " .. account .. ".\nYour money: " .. chr_money(ch) .. ".")
+ say("Your balance: " .. account .. ".\nYour money: " .. ch:money() .. ".")
result = ask("Deposit", "Withdraw", "Never mind")
if (result == 1) then --Deposit
- money = chr_money(ch);
+ money = ch:money();
if (money > 0) then --Make sure they have money to deposit
say("How much would you like to deposit? (0 will cancel)")
- input = ask_integer(0, money, 1)
- money = chr_money(ch)
+ input = ask_number(0, money, 1)
+ money = ch:money()
if (input > 0 and input <= money) then --Make sure something weird doesn't happen and they try to deposit more than they have
- chr_money_change(ch, -input)
+ ch:change_money(-input)
chr_set_quest(ch, "BankAccount", account + input)
say(input .. " GP deposited.")
elseif (input > money) then --Chosen more than they have
@@ -58,9 +58,9 @@ function Banker(npc, ch)
elseif (result == 2) then --Withdraw
if (account > 0) then --Make sure they have money to withdraw
say("How much would you like to withdraw? (0 will cancel)")
- input = ask_integer(0, account, 1)
+ input = ask_number(0, account, 1)
if (input > 0 and input <= account) then --Make sure something weird doesn't happen and they try to withdraw more than they have
- chr_money_change(ch, input)
+ ch:change_money(input)
chr_set_quest(ch, "BankAccount", account - input)
say(input .. " GP withdrawn.")
elseif (input > account) then --Chosen more than they have
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
diff --git a/example/settings.xml b/example/settings.xml
index 5641d71f..ebe7a717 100644
--- a/example/settings.xml
+++ b/example/settings.xml
@@ -1,4 +1,5 @@
<settings>
+ <include file="maps.xml" />
<include file="attributes.xml" />
<include file="skills.xml" />
<include file="specials.xml" />