summaryrefslogtreecommitdiff
path: root/npc/guilds/exchange.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/guilds/exchange.txt')
-rw-r--r--npc/guilds/exchange.txt95
1 files changed, 95 insertions, 0 deletions
diff --git a/npc/guilds/exchange.txt b/npc/guilds/exchange.txt
new file mode 100644
index 000000000..360cb2c66
--- /dev/null
+++ b/npc/guilds/exchange.txt
@@ -0,0 +1,95 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Trades Guild Coins for useful items
+// Variable:
+// GUILDSHOP (bitmask)
+
+guilds,29,24,0 script Guild Coin Exchange NPC_NO_SPRITE,{
+ do
+ {
+ mes l("You have %d %s", countitem(GuildCoin), getitemlink(GuildCoin));
+ next;
+ // Calculate fruit cost
+ if (!(GUILDSHOP & GEX_fruit1)) {
+ .@fruitcost=100; .@fruitId=GEX_fruit1;
+ } else if (!(GUILDSHOP & GEX_fruit2)) {
+ .@fruitcost=200; .@fruitId=GEX_fruit2;
+ } else if (!(GUILDSHOP & GEX_fruit3)) {
+ .@fruitcost=350; .@fruitId=GEX_fruit3;
+ } else if (!(GUILDSHOP & GEX_fruit4)) {
+ .@fruitcost=500; .@fruitId=GEX_fruit4;
+ } else if (!(GUILDSHOP & GEX_fruit5)) {
+ .@fruitcost=750; .@fruitId=GEX_fruit5;
+ } else {
+ .@fruitcost=false; .@fruitId=GEX_fruitMAX;
+ }
+
+ // Calculate blueprint cost
+ if (!(GUILDSHOP & GEX_blue1)) {
+ .@bluecost=50; .@blueId=GEX_blue1;
+ } else if (!(GUILDSHOP & GEX_blue2)) {
+ .@bluecost=75; .@blueId=GEX_blue2;
+ } else if (!(GUILDSHOP & GEX_blue3)) {
+ .@bluecost=100; .@blueId=GEX_blue3;
+ } else if (!(GUILDSHOP & GEX_blue4)) {
+ .@bluecost=150; .@blueId=GEX_blue4;
+ } else if (!(GUILDSHOP & GEX_blue5)) {
+ .@bluecost=200; .@blueId=GEX_blue5;
+ } else {
+ .@bluecost=200; .@blueId=GEX_blueMAX;
+ }
+
+ menuint
+ l("Close"), 0,
+ rif(.@fruitcost, .@fruitcost+l(" Coins - Mysterious Fruit")), .@fruitId,
+ rif(.@bluecost, .@bluecost+l(" Coins - Ancient Blueprint")), .@blueId;
+
+ mes "";
+ switch (@menuret) {
+ case GEX_fruit1:
+ case GEX_fruit2:
+ case GEX_fruit3:
+ case GEX_fruit4:
+ case GEX_fruit5:
+ case GEX_fruitMAX:
+ if (countitem(GuildCoin) < .@fruitcost)
+ close;
+ delitem GuildCoin, .@fruitcost;
+ getitem MysteriousFruit, 1;
+ if (@menuret > 0)
+ GUILDSHOP=GUILDSHOP|@menuret;
+ break;
+
+ case GEX_blue1:
+ case GEX_blue2:
+ case GEX_blue3:
+ case GEX_blue4:
+ case GEX_blue5:
+ case GEX_blueMAX:
+ if (countitem(GuildCoin) < .@bluecost)
+ close;
+ delitem GuildCoin, .@bluecost;
+ getitem AncientBlueprint, 1;
+ if (@menuret > 0)
+ GUILDSHOP=GUILDSHOP|@menuret;
+ break;
+ }
+
+ } while (@menuret != 0);
+ close;
+
+OnInit:
+ .@npcId = getnpcid(.name$);
+ setunitdata(.@npcId, UDT_HEADTOP, TopHat);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, GoldenWarlordPlate);
+ setunitdata(.@npcId, UDT_WEAPON, JeansChaps);
+ setunitdata(.@npcId, UDT_HEADBOTTOM, AssassinBoots);
+ setunitdata(.@npcId, UDT_HAIRSTYLE, 25);
+ setunitdata(.@npcId, UDT_HAIRCOLOR, 4);
+
+ .sex = G_MALE;
+ .distance = 5;
+ end;
+}