From 068f462b94858fe5b3a1b25dd84983fd09e40e5b Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 10 Feb 2020 22:35:00 -0300 Subject: Soren: Allows you to exchange weapons while event is running. --- npc/001-11/Soren.txt | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'npc') diff --git a/npc/001-11/Soren.txt b/npc/001-11/Soren.txt index 73f744b88..43dc68ba2 100644 --- a/npc/001-11/Soren.txt +++ b/npc/001-11/Soren.txt @@ -42,6 +42,7 @@ L_Purpose: select l("You're creepy."), l("Reset status"), + l("Change weapons"), l("Open shop"); mes ""; switch (@menu) { @@ -49,12 +50,74 @@ L_Purpose: ConfirmStatusReset(1); break; case 3: + goto L_Swap; + break; + case 4: closeclientdialog; shop "Shop#Candor"; break; } close; +L_Swap: + // Obtain item ID + if (countitem(Event1HSword)) + .@itemid=Event1HSword; + else if (countitem(Event2HSword)) + .@itemid=Event2HSword; + else if (countitem(EventBow)) + .@itemid=EventBow; + else if (countitem(EventWand)) + .@itemid=EventWand; + else + close; + + // Item list + delinventorylist(); + getinventorylist(); + .@idx=array_find(@inventorylist_id, .@itemid); + if (.@idx < 0) + Exception("Invalid index for ("+.@itemid+") "+getitemlink(.@itemid), RB_DEFAULT|RB_ISFATAL); + + select + rif(.@itemid != Event1HSword, l("One hand sword (average)")), + rif(.@itemid != Event2HSword, l("Two hands sword (strong, misses)")), + rif(.@itemid != EventBow, l("Bow (strong, slow, no evasion)")), + rif(.@itemid != EventWand, l("Wand (skill boost, pathetically weak)")), + l("Cancel"); + mes ""; + switch (@menu) { + case 1: + delitem .@itemid, 1; + getitembound2(Event1HSword, 1, 1, @inventorylist_refine[.@idx], + @inventorylist_attribute[.@idx], @inventorylist_card1[.@idx], + @inventorylist_card2[.@idx], @inventorylist_card3[.@idx], + @inventorylist_card4[.@idx], 1); + break; + case 2: + delitem .@itemid, 1; + getitembound2(Event2HSword, 1, 1, @inventorylist_refine[.@idx], + @inventorylist_attribute[.@idx], @inventorylist_card1[.@idx], + @inventorylist_card2[.@idx], @inventorylist_card3[.@idx], + @inventorylist_card4[.@idx], 1); + break; + case 3: + delitem .@itemid, 1; + getitembound2(EventBow, 1, 1, @inventorylist_refine[.@idx], + @inventorylist_attribute[.@idx], @inventorylist_card1[.@idx], + @inventorylist_card2[.@idx], @inventorylist_card3[.@idx], + @inventorylist_card4[.@idx], 1); + break; + case 4: + delitem .@itemid, 1; + getitembound2(EventWand, 1, 1, @inventorylist_refine[.@idx], + @inventorylist_attribute[.@idx], @inventorylist_card1[.@idx], + @inventorylist_card2[.@idx], @inventorylist_card3[.@idx], + @inventorylist_card4[.@idx], 1); + break; + } + close; + OnInit: .@npcId = getnpcid(.name$); setunitdata(.@npcId, UDT_HEADTOP, CandorShorts); -- cgit v1.2.3-60-g2f50