summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-02-10 22:35:00 -0300
committerJesusaves <cpntb1@ymail.com>2020-02-10 22:35:00 -0300
commit068f462b94858fe5b3a1b25dd84983fd09e40e5b (patch)
tree110d94042b1ba637c6dc12d2120a842a1539eb26
parent0bbea180facd09ec540bcb247afb9c505e6bf9a8 (diff)
downloadserverdata-068f462b94858fe5b3a1b25dd84983fd09e40e5b.tar.gz
serverdata-068f462b94858fe5b3a1b25dd84983fd09e40e5b.tar.bz2
serverdata-068f462b94858fe5b3a1b25dd84983fd09e40e5b.tar.xz
serverdata-068f462b94858fe5b3a1b25dd84983fd09e40e5b.zip
Soren: Allows you to exchange weapons while event is running.
-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);