From 21fa0901dc8723627c6970aa6eff97bc27e36533 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 26 Dec 2013 01:34:12 +0100 Subject: Modernized syntax and fixed errors in the sample scripts Signed-off-by: Haru --- doc/sample/npc_live_dialogues.txt | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'doc/sample/npc_live_dialogues.txt') diff --git a/doc/sample/npc_live_dialogues.txt b/doc/sample/npc_live_dialogues.txt index 8778f6c50..9ce628c30 100644 --- a/doc/sample/npc_live_dialogues.txt +++ b/doc/sample/npc_live_dialogues.txt @@ -3,13 +3,13 @@ //===== By: ================================================== //= Lupus //===== Current Version: ===================================== -//= 20070320 -//===== Description: ========================================= +//= 20131225 +//===== Description: ========================================= //= An example of an NPC with live dialogue. //= Note: This relies on Global_Functions.txt to run. //============================================================ -prontera,167,177,5 script Luppy 1107,{ +prontera,167,177,5 script Luppy DESERT_WOLF_B,{ mes "[Luppy]"; // Say a random greeting from Global_Functions.txt @@ -20,35 +20,34 @@ prontera,167,177,5 script Luppy 1107,{ mes callfunc("F_Sex","What a beautiful lady!","What a handsome man!"); // Add some random greeting and goodbye into the menu - menu callfunc("F_Hi"),-, callfunc("F_Bye"),M_BYE; + if (select(callfunc("F_Hi"), callfunc("F_Bye")) != 1) { + mes "[Luppy]"; + // Add some random goodbye from Global_Functions.txt + mes callfunc("F_Bye"); + close; + } mes "[Luppy]"; // Give a random prize from set list of items - if(@gotstuff){ + if (@gotstuff) { // Again, say stuff according to player's gender mes "I like "+callfunc("F_Sex","smiling ladies!","bloody pirates!"); // Show one of 3 emotion from the list (we added ,1 to show emotion over PLAYER's head) - emotion callfunc("F_RandMes",3,e_scissors,e_kis,e_pat),1; + emotion callfunc("F_RandMes", 3, e_scissors, e_kis, e_pat), 1; close; } // We set a temp var to give present just once. Player can get more by relogging. - set @gotstuff,1; + @gotstuff = 1; // Get item ID from the list of presents: Apple, Mastela Fruit, Yggdrasil Seed or Orange Juice - set @itemIDfromList, callfunc("F_RandMes",4,512,522,608,620); + .@itemIDfromList = callfunc("F_RandMes", 4, Apple, Fruit_Of_Mastela, Seed_Of_Yggdrasil, Orange_Juice); // Again, say stuff according to player's gender - mes "Hey, "+callfunc("F_Sex","sister!","brother!")+" I have "+getitemname(@itemIDfromList)+" for you!"; + mes "Hey, "+callfunc("F_Sex","sister!","brother!")+" I have "+getitemname(.@itemIDfromList)+" for you!"; // Get the item from the list - getitem @itemIDfromList,1; - close; - -M_BYE: - mes "[Luppy]"; - // Add some random goodbye from Global_Functions.txt - mes callfunc("F_Bye"); + getitem .@itemIDfromList, 1; close; } -- cgit v1.2.3-60-g2f50