From d11e7d49edb8374767d69859fe9ed542722013fe Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 3 Aug 2011 23:20:29 +0200 Subject: Unified the lua.cpp documentation. I also changed the chatmessage function to chat_message to follow the coding standard. --- example/serverdata/scripts/crafting.lua | 10 +++++----- example/serverdata/scripts/global_events.lua | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'example/serverdata/scripts') diff --git a/example/serverdata/scripts/crafting.lua b/example/serverdata/scripts/crafting.lua index ea30628..eae26a4 100644 --- a/example/serverdata/scripts/crafting.lua +++ b/example/serverdata/scripts/crafting.lua @@ -27,7 +27,7 @@ function on_craft(ch, recipe) -- uncomment one (but not both!) of the following three lines to enable the -- example crafting systems - mana.chatmessage(ch, "There is no crafting in this game world.") + mana.chat_message(ch, "There is no crafting in this game world.") --craft_strict(ch, recipe) --craft_lax(ch, recipe) end @@ -42,10 +42,10 @@ function craft_strict(ch, recipe) 8, -2, --take away the iron 9, -1, --take away the wood 5, 1 ) -- give a sword - mana.chatmessage(ch, "You've crafted a sword") + mana.chat_message(ch, "You've crafted a sword") return end - mana.chatmessage(ch, "This wouldn't create anything useful") + mana.chat_message(ch, "This wouldn't create anything useful") end -- a primitive example crafting system which doesn't care about item order @@ -60,10 +60,10 @@ function craft_lax(ch, recipe) 8, -2, --take away the iron 9, -1, --take away the wood 5, 1 ) -- give a sword - mana.chatmessage(ch, "You've crafted a sword") + mana.chat_message(ch, "You've crafted a sword") return end - mana.chatmessage(ch, "This wouldn't create anything useful") + mana.chat_message(ch, "This wouldn't create anything useful") end -- this turns multiple occurences of the same item into one by adding up diff --git a/example/serverdata/scripts/global_events.lua b/example/serverdata/scripts/global_events.lua index 5655dc8..548351a 100644 --- a/example/serverdata/scripts/global_events.lua +++ b/example/serverdata/scripts/global_events.lua @@ -50,14 +50,14 @@ end -- to the character and/or initialize a tutorial quest. function on_chr_birth(ch) -- this message is shown on first login. - mana.chatmessage(0, ch, "And so your adventure begins...") + mana.chat_message(0, ch, "And so your adventure begins...") end -- This function is called when a character logs into the game. This can, -- for example, be utilized for a message-of-the-day or for various -- handlings of offline processing mechanics. function on_chr_login(ch) - mana.chatmessage(0, ch, "Welcome to Manasource") + mana.chat_message(0, ch, "Welcome to Manasource") end @@ -72,7 +72,7 @@ function on_chr_logout(ch) local msg = mana.being_get_name(ch).." left the game." for b in pairs(around) do if mana.being_type(b) == TYPE_CHARACTER then - mana.chatmessage(0, b, msg) + mana.chat_message(0, b, msg) end end end -- cgit