From e9b61fa762483ad113bfbe821aff171738d02513 Mon Sep 17 00:00:00 2001 From: jesusalva Date: Thu, 22 Feb 2018 11:12:08 -0300 Subject: Rewrite Lua. Swezanne will be holding the MOST HEROIC person for a while. I'll rewrite her and add her quest later. --- npc/003-1/swezanne.txt | 33 ++++++++++++++++++++++++++++++--- npc/003-2/lua.txt | 23 +++++++++++++++-------- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/npc/003-1/swezanne.txt b/npc/003-1/swezanne.txt index 84b745531..ca0798c85 100644 --- a/npc/003-1/swezanne.txt +++ b/npc/003-1/swezanne.txt @@ -1,13 +1,40 @@ // Author: -// Saulc +// Jesusalva 003-1,70,100,0 script Swezanne NPC_FEMALE,{ + mesn; + mesq l("Hi."); + if ($MOST_HEROIC$ != "") goto L_Heroics; + close; -hello; +L_Heroics: + next; + mesn; + .@d=rand(1,6); + // This switch loop is temporaly broken. + switch (.@d) { + case 1: + .@deed$="protected our cities!"; + case 2: + .@deed$="did great acts of bravery!"; + case 3: + .@deed$="is just awesome!"; + case 4: + .@deed$="killed a monster army single-handed!"; + case 5: + .@deed$="proved their worth in battlefield!"; + case 6: + .@deed$="impressed even the High Council!"; + default: + .@deed$="is awesome like me!"; // Should be unreachable + } + + mesq l("I hope to one day be like @@, who @@", $MOST_HEROIC$, .@deed$); + close; OnInit: - .@npcId = getnpcid(0, "Swezanne"); + .@npcId = getnpcid(0, .name$); //setunitdata(.@npcId, UDT_HEADTOP, 2929); setunitdata(.@npcId, UDT_HEADMIDDLE, 1307); setunitdata(.@npcId, UDT_HEADBOTTOM, 2207); diff --git a/npc/003-2/lua.txt b/npc/003-2/lua.txt index 92d927ac1..5230ff908 100644 --- a/npc/003-2/lua.txt +++ b/npc/003-2/lua.txt @@ -5,31 +5,38 @@ 003-2,38,34,0 script Lua#003-2 NPC_FEMALE,{ mesn; mesq l("Hello, I act on the Alliance's behalf."); + +L_Menu: mes ""; - if (getgmlevel()) goto L_AdminMenu; menu l("Ok, see you later."),L_Close, + rif(getgmlevel(), l("I need a GM set, please!")), L_GMItems, + rif(getgmlevel(), l("Tell people the name of a new hero.")), L_NewHero, l("What alliance?"),-; mes ""; mesn; mesq l("The Alliance which was formed after the war!"); close; -L_AdminMenu: - menu - l("I'm done here, thanks."), L_Close, - l("I need a GM set, please!"), L_GMItems; - L_GMItems: getnameditem "GMRobe", strcharinfo(0); getnameditem "GMCap", strcharinfo(0); logmes(strcharinfo(0)+" just took a GM set."); - logmes("@GMSet "+strcharinfo(0), LOGMES_ATCOMMAND); + logmes(strcharinfo(0)+" just took a GM set.", LOGMES_ATCOMMAND); mes ""; mesn; mesq lg("Here they are, miss.", "Here they are, mister."); mes ""; - goto L_AdminMenu; + goto L_Menu; + +L_NewHero: + mes ""; + mes l("Current hero: @@", $MOST_HEROIC$); + input .@MH$; + logmes "Changing hero from "+$MOST_HEROIC$+" to "+.@MH$; + logmes(strcharinfo(0)+" changed the world's hero.", LOGMES_ATCOMMAND); + $MOST_HEROIC$ = .@MH$; + goto L_Menu; L_Close: close; -- cgit v1.2.3-60-g2f50