summaryrefslogtreecommitdiff
path: root/npc/001-11/Soren.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/001-11/Soren.txt')
-rw-r--r--npc/001-11/Soren.txt63
1 files changed, 63 insertions, 0 deletions
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);