diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-15 22:15:31 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-15 22:15:31 +0200 |
commit | c53bc90dbaa876a86f762a3d864b1f920e2b8071 (patch) | |
tree | 1a8174f4d1745a4799210db970aa2230df622d34 /example/scripts/npcs/barber.lua | |
parent | b89e404f85358f2e3ff87d7731376dbeacdf9778 (diff) | |
parent | 81be8dc99ba7558c8915310eed095df43e3bdbf7 (diff) | |
download | manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.tar.gz manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.tar.bz2 manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.tar.xz manaserv-c53bc90dbaa876a86f762a3d864b1f920e2b8071.zip |
Merge branch 'master' into lpc2012
Conflicts:
src/account-server/accounthandler.cpp
src/game-server/character.cpp
Diffstat (limited to 'example/scripts/npcs/barber.lua')
-rw-r--r-- | example/scripts/npcs/barber.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/example/scripts/npcs/barber.lua b/example/scripts/npcs/barber.lua index 70efb435..9521671b 100644 --- a/example/scripts/npcs/barber.lua +++ b/example/scripts/npcs/barber.lua @@ -79,11 +79,11 @@ function Barber(npc, ch, data) -- Choose an appropriate message if result == 1 then - npc_message(npc, ch, "Hello! What style would you like today?") + say("Hello! What style would you like today?") elseif result == 2 then - npc_message(npc, ch, "Hello! What color would you like today?") + say("Hello! What color would you like today?") else - npc_message(npc, ch, "Hello! What can I do for you today?") + say("Hello! What can I do for you today?") end print("#styles ==", #styles) @@ -91,7 +91,7 @@ function Barber(npc, ch, data) -- Repeat until the user selects nothing repeat if (result == 1) then -- Do styles - result = npc_choice(npc, ch, "Bald", styles, "Surprise me", "Never mind") + result = ask("Bald", styles, "Surprise me", "Never mind") result = result -1 @@ -104,16 +104,16 @@ function Barber(npc, ch, data) print("Style ==", result) if (result == 0) then - chr_set_hair_style(ch, 0) + ch:set_hair_style(0) result = 1 elseif (result <= #styles) then - chr_set_hair_style(ch, style_ids[result]) + ch:set_hair_style(style_ids[result]) result = 1 else --"Never mind" result = 3 end elseif (result == 2) then -- Do colors - result = npc_choice(npc, ch, colors, "Surprise me", "Never mind") + result = ask(colors, "Surprise me", "Never mind") --Random if (result == #colors + 1) then @@ -121,7 +121,7 @@ function Barber(npc, ch, data) end if (result <= #colors) then - chr_set_hair_color(ch, color_ids[result - 1]) + ch:set_hair_color(color_ids[result - 1]) result = 2 else --"Never mind" result = 3 @@ -130,10 +130,10 @@ function Barber(npc, ch, data) -- If we have both styles and colors, show the main menu if #styles > 0 and #colors > 0 then - result = npc_choice(npc, ch, "Change my style", "Change my color", "Never mind") + result = ask("Change my style", "Change my color", "Never mind") end until result >= 3 --While they've choosen a valid option that isn't "Never mind" -- Let's close up - npc_message(npc, ch, "Thank you. Come again!") + say("Thank you. Come again!") end |