From 1c1008f0dcc1c1d2c18b37c3df78865bf6986e85 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 9 Jan 2019 10:22:32 -0200 Subject: Allow GMs without access to @item to purchase gift boxes for events I'm looking at you @demure Please do not abuse, the rewards on the boxes raises much more than the GM price. --- npc/003-2/lua.txt | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'npc') diff --git a/npc/003-2/lua.txt b/npc/003-2/lua.txt index 7dca3f969..2959a302a 100644 --- a/npc/003-2/lua.txt +++ b/npc/003-2/lua.txt @@ -21,6 +21,7 @@ L_Menu: rif(.@n >= 4, l("Do you think I'm ready to go to Halinarzo?")), L_Check, rif(is_gm(), l("I need a GM set, please!")), L_GMItems, rif(is_gm() && #GMEVENT_T <= gettimetick(2), l("I plan in doing an event! Give me the coins!")), L_GMEvent, + rif(is_gm() && #GMEVENT_T > gettimetick(2), l("Trade my coins in Gift Boxes, pretty please!")), L_GMEventShop, rif(is_staff(), l("Tell people the name of a new hero.")), L_NewHero, rif((getgmlevel() == 1 || is_admin()) && #T_SPONSOR <= gettimetick(2), l("I want a Sponsor Necklace.")), L_Sponsor, l("Do you have any tips for beginners?"), L_Tips, @@ -53,6 +54,56 @@ L_GMEvent: mes ""; goto L_Menu; +L_GMEvent2: + // Inflaction: Non-admins pay more, and out of main events price is higher + .@inflact=0; + if (!is_admin()) + .@inflact+=1; + if ($EVENT$ == "") + .@inflact+=1; + if (.@inflact == 0) + .@inflact=1; + + // Main Code + .@s=countitem(StrangeCoin); + mes ""; + mesn; + mesq l("You currently have @@ @@.", getitemlink(StrangeCoin)); + mes ""; + mesc l("@@ - @@ coins", getitemlink(BronzeGift), 10*.@inflact); + mesc l("@@ - @@ coins", getitemlink(SilverGift), 20*.@inflact); + mesc l("@@ - @@ coins", getitemlink(GoldenGift), 40*.@inflact); + mesc l("@@ - @@ coins", getitemlink(PrismGift), 60*.@inflact); + mesc l("@@ - @@ coins", getitemlink(SupremeGift), 80*.@inflact); + mes ""; + menuint + "Return to main menu", -1, + rif(.@s > 10*.@inflact, "Bronze Gift"), 10, + rif(.@s > 20*.@inflact, "Silver Gift"), 20, + rif(.@s > 40*.@inflact, "Golden Gift"), 40, + rif(.@s > 60*.@inflact, "Prism Gift"), 60, + rif(.@s > 80*.@inflact, "Supreme Gift"), 80; + + if (@menuret == -1) + goto L_Menu; + + delitem StrangeCoin, @menuret*.@infact; + switch (@menuret) { + case 10: + getitem BronzeGift, 1; break; + case 20: + getitem SilverGift, 1; break; + case 40: + getitem GoldenGift, 1; break; + case 60: + getitem PrismGift, 1; break; + case 80: + getitem SupremeGift, 1; break; + default: + mesc(l("A script error happened, please report: @@", @menuret), 1); break; + } + goto L_GMEvent2; + L_NewHero: mes ""; mes l("Current hero: @@", $MOST_HEROIC$); -- cgit v1.2.3-70-g09d2