diff options
-rw-r--r-- | db/constants.conf | 45 | ||||
-rw-r--r-- | npc/012-1/bot.txt | 2 | ||||
-rw-r--r-- | npc/guilds/_import.txt | 1 | ||||
-rw-r--r-- | npc/guilds/exchange.txt | 95 |
4 files changed, 142 insertions, 1 deletions
diff --git a/db/constants.conf b/db/constants.conf index fac3bb89a..048ab926b 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3785,6 +3785,51 @@ constants_db: { GPOS_5: 4 // pos5 GPOS_NEWBIE: 19 + comment__: "guild exchange" + GEX_fruit1: 1 + GEX_fruit2: 2 + GEX_fruit3: 4 + GEX_fruit4: 8 + GEX_fruit5: 16 + + GEX_merc1: 32 + GEX_merc2: 64 + GEX_merc3: 128 + GEX_merc4: 256 + GEX_merc5: 512 + + GEX_blue1: 1024 + GEX_blue2: 2048 + GEX_blue3: 4096 + GEX_blue4: 8192 + GEX_blue5: 16384 + + GEX_arcmage1: 32768 + GEX_arcmage2: 65536 + GEX_arcmage3: 131072 + GEX_arcmage4: 262144 + GEX_arcmage5: 524288 + + GEX_elixir1: 1048576 + GEX_elixir2: 2097152 + GEX_elixir3: 4194304 + GEX_elixir4: 8388608 + GEX_elixir5: 16777216 + + GEX_scholar1: 33554432 + GEX_scholar2: 67108864 + GEX_scholar3: 134217728 + GEX_scholar4: 268435456 + GEX_scholar5: 536870912 + + // TOTAL 1073741824 : The last valid slot + GEX_fruitMAX: -1 + GEX_mercMAX: -2 + GEX_blueMAX: -3 + GEX_arcmageMAX: -4 + GEX_elixirMAX: -5 + GEX_scholarMAX: -6 + comment__: "genders" G_FEMALE: 0 G_MALE: 1 diff --git a/npc/012-1/bot.txt b/npc/012-1/bot.txt index dde000620..3a6422b76 100644 --- a/npc/012-1/bot.txt +++ b/npc/012-1/bot.txt @@ -35,7 +35,7 @@ L_Menu: L_Where: mes ""; mesn; - mesq l("If you head west, you'll eventually reach Jesus Saves' Castle."); + mesq l("If you head west, you'll eventually reach the magical Kamelot Castle."); next; mesn; mesq l("Inside it, there'll be a Transcendence Gate."); diff --git a/npc/guilds/_import.txt b/npc/guilds/_import.txt index 7bb36e1e4..43098eeb3 100644 --- a/npc/guilds/_import.txt +++ b/npc/guilds/_import.txt @@ -3,6 +3,7 @@ "npc/guilds/_warps.txt", "npc/guilds/alchemy.txt", "npc/guilds/bank.txt", +"npc/guilds/exchange.txt", "npc/guilds/forge.txt", "npc/guilds/logs.txt", "npc/guilds/management.txt", 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; +} |