diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-14 15:10:06 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-14 15:10:06 +0200 |
commit | 080ddbe822b03416934a875b2d949e3afc84fb96 (patch) | |
tree | 8915d1c92fdd0e609952afc492cbc3ea1152d1ae /example/scripts/maps | |
parent | 3a132996f798dbf552ac858b06fa656b6790a501 (diff) | |
download | manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.gz manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.bz2 manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.xz manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.zip |
Removed NPC and character parameters from NPC functions
These functions can only be used in the context of a character talking
to an NPC, so these parameters can be deduced from that context rather
than passing them explicitly all the time.
Simplifies NPC scripting.
Diffstat (limited to 'example/scripts/maps')
-rw-r--r-- | example/scripts/maps/desert.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/example/scripts/maps/desert.lua b/example/scripts/maps/desert.lua index 6b761dcd..1fee2fc8 100644 --- a/example/scripts/maps/desert.lua +++ b/example/scripts/maps/desert.lua @@ -39,7 +39,7 @@ end) function Smith(npc, ch, list) local sword_count = chr_inv_count(ch, true, true, "Sword") if sword_count > 0 then - npc_message(npc, ch, "Ah! I can see you already have a sword.") + npc_message("Ah! I can see you already have a sword.") end Merchant(npc, ch, list) end @@ -54,7 +54,7 @@ function possessions_table(npc, ch) ..inventory_table[i].id..", "..inventory_table[i].name..", " ..inventory_table[i].amount end - npc_message(npc, ch, item_message) + npc_message(item_message) item_message = "Equipment:".. "\nSlot id, item id, item name:".. @@ -64,7 +64,7 @@ function possessions_table(npc, ch) item_message = item_message.."\n"..equipment_table[i].slot..", " ..equipment_table[i].id..", "..equipment_table[i].name end - npc_message(npc, ch, item_message) + npc_message(item_message) end @@ -74,21 +74,21 @@ function Harmony(npc, ch, list) being_apply_status(ch, 1, 99999) -- Say all the messages in the messages list. for i = 1, #list do - npc_message(npc, ch, list[i]) + npc_message(list[i]) end --- Give the player 100 units of money the first time. if harmony_have_talked_to_someone == false then - npc_message(npc, ch, "Here is some money for you to find some toys to play with.\nEh Eh!") + npc_message("Here is some money for you to find some toys to play with.\nEh Eh!") chr_money_change(ch, 100) - npc_message(npc, ch, string.format("You now have %d shiny coins!", chr_money(ch))) + npc_message(string.format("You now have %d shiny coins!", chr_money(ch))) harmony_have_talked_to_someone = true - npc_message(npc, ch, string.format("Try to come back with a better level than %i.", chr_get_level(ch))) + npc_message(string.format("Try to come back with a better level than %i.", chr_get_level(ch))) else - npc_message(npc, ch, "Let me see what you've got so far... Don't be afraid!") + npc_message("Let me see what you've got so far... Don't be afraid!") effect_create(EMOTE_WINK, npc) possessions_table(npc, ch) end - npc_message(npc, ch, "Have fun!") + npc_message("Have fun!") effect_create(EMOTE_HAPPY, npc) -- Make Harmony disappear for a while... with a small earthquake effect! local shakeX = posX(npc) |