summaryrefslogtreecommitdiff
path: root/world/map
diff options
context:
space:
mode:
authorHoraK-FDF <HoraK-FDF@web.de>2022-04-04 14:42:20 -0300
committerJesusaves <cpntb1@ymail.com>2022-04-04 14:42:20 -0300
commit0cde61e44137623f883b22f682bff9be0c29bfcf (patch)
treeb1f23e7a75ebe2dda53ced5141e950ce353740ee /world/map
parentbaeddfe63f6720f22883a2978378644f8a70ed47 (diff)
downloadserverdata-0cde61e44137623f883b22f682bff9be0c29bfcf.tar.gz
serverdata-0cde61e44137623f883b22f682bff9be0c29bfcf.tar.bz2
serverdata-0cde61e44137623f883b22f682bff9be0c29bfcf.tar.xz
serverdata-0cde61e44137623f883b22f682bff9be0c29bfcf.zip
Chronos the shopkeeper, with evil edits from The Mana World Team.
Diffstat (limited to 'world/map')
-rw-r--r--world/map/data/099-7.wlkbin19604 -> 30604 bytes
-rw-r--r--world/map/npc/099-7/_import.txt1
-rw-r--r--world/map/npc/099-7/boss.txt34
-rw-r--r--world/map/npc/099-7/chronos.txt249
-rw-r--r--world/map/npc/functions/item_menu.txt296
-rw-r--r--world/map/npc/magic/level0-reapercry.txt2
-rw-r--r--world/map/npc/scripts.conf1
7 files changed, 569 insertions, 14 deletions
diff --git a/world/map/data/099-7.wlk b/world/map/data/099-7.wlk
index 5563107f..0b481559 100644
--- a/world/map/data/099-7.wlk
+++ b/world/map/data/099-7.wlk
Binary files differ
diff --git a/world/map/npc/099-7/_import.txt b/world/map/npc/099-7/_import.txt
index cb8912df..250fcb96 100644
--- a/world/map/npc/099-7/_import.txt
+++ b/world/map/npc/099-7/_import.txt
@@ -5,3 +5,4 @@ npc: npc/099-7/_mobs.txt
npc: npc/099-7/_nodes.txt
npc: npc/099-7/_warps.txt
npc: npc/099-7/boss.txt
+npc: npc/099-7/chronos.txt
diff --git a/world/map/npc/099-7/boss.txt b/world/map/npc/099-7/boss.txt
index 7362690f..c621c68f 100644
--- a/world/map/npc/099-7/boss.txt
+++ b/world/map/npc/099-7/boss.txt
@@ -573,7 +573,7 @@ L_Off:
///////////////////////////////////////////////////////////////////////////////
// Totally optional Easter Egg :>
-099-7,75,49,0|script|Engraving#Keshlam|400
+099-7,95,65,0|script|Engraving#Keshlam|400
{
mes "There's an engraving on this tree.";
next;
@@ -604,9 +604,14 @@ L_Tools:
close;
OnInit:
- areamonster "099-7", 20, 20, 120, 120, "", 1148, 10, "Keshlam::OnDeath8";
- areamonster "099-7", 20, 20, 120, 120, "", 1149, 10, "Keshlam::OnDeath9";
- monster "099-7", 20, 105, "Grim Reaper", 1068, 1, "Keshlam::OnBoss";
+ areamonster "099-7", 37, 36, 142, 140, "", 1148, 10, "Keshlam::OnDeath8";
+ areamonster "099-7", 37, 36, 142, 140, "", 1149, 10, "Keshlam::OnDeath9";
+// areamobuseskill "099-7", 37, 36, 142, 140,
+// areamobuseskill "009-7", 155,188,2,1083,"MG_COLDBOLT",10,3000,1,e_gg,0;
+//*areamobuseskill "<map name>",<x>,<y>,<range>,<mob id>,<skill id>,<skill level>,<cast time>,<cancelable>,<emotion>,<target type>;
+//*areamobuseskill "<map name>",<x>,<y>,<range>,<mob id>,"<skill name>",<skill level>,<cast time>,<cancelable>,<emotion>,<target type>;
+
+ monster "099-7", 40, 121, "Grim Reaper", 1068, 1, "Keshlam::OnBoss";
end;
OnDeath8:
@@ -630,17 +635,17 @@ OnTimer150000:
// 1148
set $@KeshlamMc, mobcount("099-7", "Keshlam::OnDeath8")+1;
if ($@KeshlamMc < 10)
- areamonster "099-7", 20, 20, 120, 120, "", 1148, 10-$@KeshlamMc, "Keshlam::OnDeath8";
+ areamonster "099-7", 37, 36, 142, 140, "", 1148, 10-$@KeshlamMc, "Keshlam::OnDeath8";
// 1149
set $@KeshlamMc, mobcount("099-7", "Keshlam::OnDeath9")+1;
if ($@KeshlamMc < 10)
- areamonster "099-7", 20, 20, 120, 120, "", 1149, 10-$@KeshlamMc, "Keshlam::OnDeath9";
+ areamonster "099-7", 37, 36, 142, 140, "", 1149, 10-$@KeshlamMc, "Keshlam::OnDeath9";
// Boss (TODO maybe give boss their own timer with 5 minutes)
set $@KeshlamMc, mobcount("099-7", "Keshlam::OnBoss")+1;
if ($@KeshlamMc < 1)
- monster "099-7", 20, 105, "Grim Reaper", 1068, 1, "Keshlam::OnBoss";
+ monster "099-7", 40, 121, "Grim Reaper", 1068, 1, "Keshlam::OnBoss";
// Done
set $@KeshlamMc, 0;
@@ -650,7 +655,7 @@ OnTimer150000:
///////////////////////////////////////////////////////////////////////////////
// Who wants a rare drop?
-099-7,18,110,0|script|Chest#keshlam|111
+099-7,38,126,0|script|Chest#keshlam|111
{
if (FLAGS & FLAG_KESHLAM_RAREDROP) goto L_Finished;
mes "[Chest]";
@@ -724,7 +729,7 @@ L_Close:
///////////////////////////////////////////////////////////////////////////////
// Who wants experience?
-099-7,95,117,0|script|Knowledgeable Tree|400
+099-7,115,133,0|script|Knowledgeable Tree|400
{
mes "If you kill every monster, this tree can warp you back.";
mes "You will receive experience points for cleaning the map.";
@@ -746,8 +751,11 @@ L_Done:
"No", L_No;
L_Yes:
+ set #CHRONOS, 0;
getexp 1000000, 0;
warp "027-2", 50, 29;
+ if ($CHRONOS_STOCK < 3)
+ set $CHRONOS_STOCK, 3;
close;
L_No:
@@ -768,14 +776,14 @@ L_No:
mes "(The memorial is at left, behind the column.)";
close;
}
-099-7,73,20,0|script|#NoobKytty01|400,0,0
+099-7,93,36,0|script|#NoobKytty01|400,0,0
{
- warp "099-7", 74, 17;
+ warp "099-7", 94, 33;
end;
}
-099-7,73,17,0|script|#NoobKytty02|400,0,0
+099-7,93,33,0|script|#NoobKytty02|400,0,0
{
- warp "099-7", 72, 20;
+ warp "099-7", 92, 36;
end;
}
diff --git a/world/map/npc/099-7/chronos.txt b/world/map/npc/099-7/chronos.txt
new file mode 100644
index 00000000..45695c74
--- /dev/null
+++ b/world/map/npc/099-7/chronos.txt
@@ -0,0 +1,249 @@
+// Cronos, the lord of time and apparently a shopkeeper
+// There's also Father Time in the GM stuff
+
+099-7,95,27,0|script|Chronos|313
+{
+ cleararray @items$, "", getarraysize(@items$); // must be cleared here if someone used the close button last time then items would remain in list
+ cleararray @item_names$, "", getarraysize(@item_names$);
+ cleararray @shopopt$, "", getarraysize(@shopopt$);
+ mes "[Chronos]";
+ mes "\"I'm Chronos, lord of time, the immortal, the head editor of the Almanach, the... Alright, let's forget that.\"";
+ if (BOSS_POINTS < .price) goto L_Close;
+ // (Does this even work? I'm not sure)
+ set @cur_date, (gettime(7) << 5) | (gettime(6) << 1);
+ if (#CHRONOS == @cur_date) goto L_Maxed;
+ if ($CHRONOS_STOCK < 1) goto L_Maxed;
+ set @cur_date, 0;
+ next;
+ // Boss Points validation
+ set @cur, BOSS_POINTS / .price;
+ set @dif, @cur - #BOSS_MEDALS;
+ if (@dif >= 1) goto L_GiveMedals;
+ mes "[Chronos]";
+ mes "\"You don't made any progress so i can't give you any Boss Medals.\"";
+ mes "";
+
+ if (#BOSS_MEDALS_AVAILABLE >= 1) goto L_Qestion;
+ mes "[Chronos]";
+ mes "\"Sadly there are no Boss Medals for you to do shopping left.\"";
+ goto L_Close;
+
+L_GiveMedals:
+ // BUG, FIXME! 2 + 4 = 4 boss medals
+ set #BOSS_MEDALS, #BOSS_MEDALS + @dif;
+ set #BOSS_MEDALS_AVAILABLE, @dif;
+ mes "[Chronos]";
+ mes "\"For your deeds, I shall bestow upon you " + @dif + " Boss Medals. Use them wisely, they are the results of your hard effort.";
+ mes "Boss Medals are earned each " + .price + " boss points. They are account-bound and cannot be given to other players, not even other versions of you.";
+ mes "I will keep them for you until you evolved a bit.\"";
+ next;
+ goto L_Qestion;
+
+L_Qestion:
+ // Shopkeeping
+ mes "[Chronos]";
+ mes "\"All things shall pass, but with the limited time you have, please enjoy shopkeeping.\"";
+ if (countitem("UnderworldKey")<1) goto L_Shop;
+ menu
+ "Thanks.", L_Shop,
+ "Do you know what the Underworld Key is for?", L_UKey; // not needed here but why not?
+L_UKey:
+ mes "";
+ mes "[Chronos]";
+ mes "\"Yes, I do. But now is not the time. One day, when the event horizon aligns itself and the lazy titans move, then I shall tell you what you need to know.\""; // lazy titans = The developers and shout out to Kronus from mythology
+ goto L_Close;
+
+L_Shop:
+ set @num_medals, 0; // set to 0 to be safe
+
+ set @default_choice$, "I'm not sure right now maybe later.";
+ set @r, 0;
+
+ set @shopoptcounter, 0;
+ setarray @shopopt$, "", "", "", "", "";
+
+ if(#BOSS_MEDALS_AVAILABLE < 1) goto L_Close;
+ set @shopopt$[@shopoptcounter], "1 Boss Medal";
+ set @shopoptcounter, @shopoptcounter + 1;
+
+ if(#BOSS_MEDALS_AVAILABLE < 2) goto L_ShopMenuCreated;
+ set @shopopt$[@shopoptcounter], "2 Boss Medals";
+ set @shopoptcounter, @shopoptcounter + 1;
+
+ if(#BOSS_MEDALS_AVAILABLE < 3) goto L_ShopMenuCreated;
+ set @shopopt$[@shopoptcounter], "3 Boss Medals";
+ set @shopoptcounter, @shopoptcounter + 1;
+
+ if(#BOSS_MEDALS_AVAILABLE < 4) goto L_ShopMenuCreated;
+ set @shopopt$[@shopoptcounter], "4 Boss Medals";
+ set @shopoptcounter, @shopoptcounter + 1;
+ goto L_ShopMenuCreated;
+
+L_ShopMenuCreated:
+ set @shopopt$[@shopoptcounter], "I must think about this again, good bye.";
+ mes "";
+ mes "[Chronos]";
+ mes "\"You have " + #BOSS_MEDALS_AVAILABLE + " Boss Medals left.";
+ mes "For which amount of Boss Medals you want to get a reward?\"";
+ menu
+ @shopopt$[0], L_MenuItems,
+ @shopopt$[1], L_MenuItems,
+ @shopopt$[2], L_MenuItems,
+ @shopopt$[3], L_MenuItems,
+ @shopopt$[4], L_MenuItems;
+
+L_MenuItems:
+ set @menu, @menu - 1;
+ if(@menu >= @shopoptcounter) goto L_Close;
+ if(@menu == 0) goto L_Show1MedalRewards;
+ if(@menu == 1) goto L_Show2MedalRewards;
+ if(@menu == 2) goto L_Show3MedalRewards;
+ if(@menu == 3) goto L_Show4MedalRewards;
+ goto L_Close;
+
+L_Show1MedalRewards:
+ set @num_medals, 1;
+ cleararray @items$, "", getarraysize($@chronos_1_medal$);
+ cleararray @item_names$, "", getarraysize($@chronos_1_medal_n$);
+ set @j, getarraysize($@chronos_1_medal$);
+ goto L_CloneArray;
+
+L_Show2MedalRewards:
+ set @num_medals, 2;
+ cleararray @items$, "", getarraysize($@chronos_2_medal$);
+ cleararray @item_names$, "", getarraysize($@chronos_2_medal_n$);
+ set @j, getarraysize($@chronos_2_medal$);
+ goto L_CloneArray;
+
+L_Show3MedalRewards:
+ set @num_medals, 3;
+ cleararray @items$, "", getarraysize($@chronos_3_medal$);
+ cleararray @item_names$, "", getarraysize($@chronos_3_medal_n$);
+ set @j, getarraysize($@chronos_3_medal$);
+ goto L_CloneArray;
+
+L_Show4MedalRewards:
+ set @num_medals, 4;
+ cleararray @items$, "", getarraysize($@chronos_4_medal$);
+ cleararray @item_names$, "", getarraysize($@chronos_4_medal_n$);
+ set @j, getarraysize($@chronos_4_medal$);
+ goto L_CloneArray;
+
+L_CloneArray:
+ if(@num_medals==1) goto L_CloneArray1;
+ if(@num_medals==2) goto L_CloneArray2;
+ if(@num_medals==3) goto L_CloneArray3;
+ if(@num_medals==4) goto L_CloneArray4;
+ goto L_Close;
+
+L_CloneArray1:
+ set @items$[@r], $@chronos_1_medal$[@r];
+ set @item_names$[@r], $@chronos_1_medal_n$[@r];
+ goto L_CloneArrayNext;
+L_CloneArray2:
+ set @items$[@r], $@chronos_2_medal$[@r];
+ set @item_names$[@r], $@chronos_2_medal_n$[@r];
+ goto L_CloneArrayNext;
+L_CloneArray3:
+ set @items$[@r], $@chronos_3_medal$[@r];
+ set @item_names$[@r], $@chronos_3_medal_n$[@r];
+ goto L_CloneArrayNext;
+L_CloneArray4:
+ set @items$[@r], $@chronos_4_medal$[@r];
+ set @item_names$[@r], $@chronos_4_medal_n$[@r];
+ goto L_CloneArrayNext;
+
+L_CloneArrayNext:
+ set @r, @r + 1;
+ if(@r < @j) goto L_CloneArray;
+ goto L_rewards_choice;
+
+L_rewards_choice:
+ mes "";
+ mes "[Chronos]";
+ mes "\"What Item you want?\"";
+ next;
+ callfunc "ItemMenu$";
+ if(@item$ == "") goto L_Close;
+ mes "";
+
+ getinventorylist;
+ if ((checkweight(@item$, 1) == 0) || (@inventorylist_count == 100)) goto L_InvFull;
+ if ($CHRONOS_STOCK < 1) goto L_Maxed;
+
+ mes "[Chronos]";
+ mes "\"Here's your " + @item_names$[@index] + ", good bye.\"";
+ wgm "=> Player `"+strcharinfo(0) + "` obtained the following item from Chronos: "+ @item_names$[@index];
+ set #BOSS_MEDALS_AVAILABLE, #BOSS_MEDALS_AVAILABLE - @num_medals;
+ set $CHRONOS_STOCK, $CHRONOS_STOCK - 1;
+ set @cur_date, (gettime(7) << 5) | (gettime(6) << 1);
+ set #CHRONOS, @cur_date;
+ set @cur_date, 0;
+ getitem @item$, 1;
+ goto L_Close;
+
+L_Maxed:
+ set @cur_date, 0;
+ mes "[Chronos]";
+ mes "\"I'm afraid I don't have anything now, please wait until my next travel, or complete the Tree of Knowledge quest for my amusement.\"";
+ goto L_Close;
+
+L_InvFull:
+ mes "[Chronos]";
+ mes "\"Your inventory is full come again when you have some free space, good bye.\"";
+ goto L_Close;
+
+L_Close:
+ set @cur, 0;
+ set @dif, 0;
+ set @num_medals, 0;
+ set @item$, 0;
+ set @index, 0;
+ set @default_choice$, "";
+ set @r, 0;
+ set @j, 0;
+ cleararray @items$, "", getarraysize(@items$);
+ cleararray @item_names$, "", getarraysize(@item_names$);
+ set @shopoptcounter, 0;
+ cleararray @shopopt$, "", getarraysize(@shopopt$);
+ close;
+
+OnClock0010:
+ if (gettime(5) == 1)
+ set $CHRONOS_STOCK, 5;
+ end;
+
+OnInit:
+ set .price, 5000;
+ if ($CHRONOS_STOCK < 1)
+ set $CHRONOS_STOCK, 3;
+
+ setarray $@chronos_1_medal$, "MovieCap", "BlueWolfHelmet", "CloverHat", "RabbitEars", "Goggles", "LeatherGoggles", "Crown", "Cap",
+ "GuyFawkesMask", "WitchDoctorsMask", "ElfNightcap", "Sunglasses", "ChristmasTreeHat", "SantaBeardHat", "MoubooHead", "PaperBag", "BunchOfParsley", "SkullMask",
+ "SnowGoggles", "HeartGlasses", "OperaMask", "JesterMask", "WitchHat", "GoblinMask",
+ "ChefHat", "EskimoHat", "AFKCap", "SmileyCap",
+ "RedShades", "GreenShades", "DarkBlueShades", "YellowShades", "LightBlueShades", "PinkShades", "BlackShades", "OrangeShades", "PurpleShades", "DarkGreenShades",
+ "SnowLauncher";
+ setarray $@chronos_1_medal_n$, "Movie Cap", "Blue Wolf Helmet", "Clover Top Hat", "White Rabbit Ears", "Goggles", "Leather Goggles", "Crown", "Cap",
+ "Guy Fawkes Mask", "Witch Doctor's Mask", "Elf Nightcap", "Sunglasses", "Christmas Tree Hat", "Santa Beard Hat", "Mouboo Head", "Paper Bag", "Bunch of Parsley", "Skull Mask",
+ "Snow Goggles", "Heart Glasses", "Opera Mask", "Jester Mask", "Witch Hat", "Goblin Mask",
+ "Chef Hat", "Eskimo Hat", "AFK Cap", "Smiley Cap",
+ "Red Shades", "Green Shades", "Dark Blue Shades", "Yellow Shades", "Light Blue Shades", "Pink Shades", "Black Shades", "Orange Shades", "Purple Shades", "Dark Green Shades",
+ "Candy-Caned Anti-Grinch-Rifle 2020";
+
+ setarray $@chronos_2_medal$, "Eyepatch", "TopHat", "FunkyHat", "MushHat", "ShroomHat", "ChristmasElfHat", "FaceMask", "CaptainsHat", "TamOShanter", "BunnyEars", "PanHat", "PilotHat",
+ "CarbonGasMask", "GroovyHat", "JazzyHat", "AnniversaryHat", "ChicSantaHat", "ReadingGlasses", "EggshellHat", "Pipe", "ScarabArmlet",
+ "BlinkingEvil", "BlinkingEvilRed", "BlinkingEvilBlue", "BlinkingEvilPink", "BlinkingEvilYellow", "BlinkingHocus", "GoldenPlatemail", "Earmuffs";
+ setarray $@chronos_2_medal_n$, "Eyepatch", "Top Hat", "Funky Hat", "Mush Hat", "Shroom Hat", "Christmas Elf Hat", "Face Mask", "Captain's Hat", "Tam O' Shanter", "Bunny Ears", "Pan Hat", "Pilot Hat",
+ "Carbon Gas Mask", "Groovy Hat", "Jazzy Hat", "Anniversary Hat", "Chic Santa Hat", "Reading Glasses", "Eggshell Hat", "Smoking Pipe", "Scarab Armlet",
+ "Mask of Blinking Evil (Green)", "Mask of Blinking Evil (Red)", "Mask of Blinking Evil (Blue)", "Mask of Blinking Evil (Pink)", "Mask of Blinking Evil (Yellow)", "Mask of Blinking Hocus", "Golden Platemail", "Earmuffs";
+
+ setarray $@chronos_3_medal$, "BlinkingEvilHalloween", "MoonshroomHat", "WhiteEvokersRobeBlue", "BlackEvokersRobeBlue", "ApprenticeRobe", "GoldenWarlordPlate", "MageRing";
+ setarray $@chronos_3_medal_n$, "Mask of Blinking Evil (Orange)", "Moonshroom Hat", "White Evoker's Robe (Blue)", "Black Evoker's Robe (Blue)", "Apprentice Robe", "Golden Warlord Plate", "Magic Ring";
+
+ setarray $@chronos_4_medal$, "OverlordsHelmet", "DarkTalisman", "Aureole", "PaladinsHelmet", "EnchantersAmulet",
+ "HeartOfIsis", "BansheeBow", "BullHelmet", "AssassinShirt", "LazuriteRobe", "DarkHelm", "UnderworldMask", "Phylactery";
+ setarray $@chronos_4_medal_n$, "Overlord's Helmet", "Dark Talisman", "Prsm Aura", "Paladin's Helmet", "Enchanter's Amulet",
+ "Heart of Isis", "Banshee Bow", "Bull Helmet", "Assassin Shirt", "Lazurite Robe", "Dark Helm", "Underworld Mask", "Phylactery";
+ end;
+}
diff --git a/world/map/npc/functions/item_menu.txt b/world/map/npc/functions/item_menu.txt
new file mode 100644
index 00000000..a14f1fba
--- /dev/null
+++ b/world/map/npc/functions/item_menu.txt
@@ -0,0 +1,296 @@
+// Input: @items (array of items you want to choose from)
+// @item_names$ (names of the items in @items)
+// @default_choice$ (default option)
+// Return: @item (The selected item, or 0 if the default/something invalid was chosen)
+//
+// NOTE: ItemMenu is ONLY used for scripts that need to do math with @item like tailor, dyer, bleacher
+// All other scripts should use ItemMenu$
+
+function|script|ItemMenu
+{
+set @items_nr, getarraysize(@items);
+if(@items_nr != getarraysize(@item_names$)) goto L_ArrayLengthMismatch;
+if(@default_choice$ == "") set @default_choice$, "Never mind.";
+goto L_pick_one_of_many_items;
+
+L_pick_one_of_many_items:
+ set @c, 0;
+
+ setarray @choice_n$, "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "";
+ goto L_pick_choice_loop;
+
+L_pick_choice_loop:
+ if (@c >= @items_nr)
+ goto L_choice_init_done;
+ set @choice_v[@c], @items[@c];
+ set @choice_n$[@c], @item_names$[@c];
+ set @choice_i[@c], @c;
+ set @c, @c + 1;
+ goto L_pick_choice_loop;
+
+L_choice_init_done:
+ set @choice_v[@c], 0;
+ set @choice_n$[@c], @default_choice$;
+ set @c, @c + 1;
+
+ if (@c < 10)
+ menu
+ @choice_n$[0], L_MenuItems,
+ @choice_n$[1], L_MenuItems,
+ @choice_n$[2], L_MenuItems,
+ @choice_n$[3], L_MenuItems,
+ @choice_n$[4], L_MenuItems,
+ @choice_n$[5], L_MenuItems,
+ @choice_n$[6], L_MenuItems,
+ @choice_n$[7], L_MenuItems,
+ @choice_n$[8], L_MenuItems,
+ @choice_n$[9], L_MenuItems;
+ goto L_MenuItems;
+
+L_MenuItems:
+ if (@c < 10)
+ goto L_choice_join;
+
+ if (@c < 20)
+ menu
+ @choice_n$[0], L_MenuItems1,
+ @choice_n$[1], L_MenuItems1,
+ @choice_n$[2], L_MenuItems1,
+ @choice_n$[3], L_MenuItems1,
+ @choice_n$[4], L_MenuItems1,
+ @choice_n$[5], L_MenuItems1,
+ @choice_n$[6], L_MenuItems1,
+ @choice_n$[7], L_MenuItems1,
+ @choice_n$[8], L_MenuItems1,
+ @choice_n$[9], L_MenuItems1,
+ @choice_n$[10], L_MenuItems1,
+ @choice_n$[11], L_MenuItems1,
+ @choice_n$[12], L_MenuItems1,
+ @choice_n$[13], L_MenuItems1,
+ @choice_n$[14], L_MenuItems1,
+ @choice_n$[15], L_MenuItems1,
+ @choice_n$[16], L_MenuItems1,
+ @choice_n$[17], L_MenuItems1,
+ @choice_n$[18], L_MenuItems1,
+ @choice_n$[19], L_MenuItems1;
+ goto L_MenuItems1;
+
+L_MenuItems1:
+ if (@c < 20)
+ goto L_choice_join;
+
+ menu
+ @choice_n$[0], L_choice_join,
+ @choice_n$[1], L_choice_join,
+ @choice_n$[2], L_choice_join,
+ @choice_n$[3], L_choice_join,
+ @choice_n$[4], L_choice_join,
+ @choice_n$[5], L_choice_join,
+ @choice_n$[6], L_choice_join,
+ @choice_n$[7], L_choice_join,
+ @choice_n$[8], L_choice_join,
+ @choice_n$[9], L_choice_join,
+ @choice_n$[10], L_choice_join,
+ @choice_n$[11], L_choice_join,
+ @choice_n$[12], L_choice_join,
+ @choice_n$[13], L_choice_join,
+ @choice_n$[14], L_choice_join,
+ @choice_n$[15], L_choice_join,
+ @choice_n$[16], L_choice_join,
+ @choice_n$[17], L_choice_join,
+ @choice_n$[18], L_choice_join,
+ @choice_n$[19], L_choice_join,
+ @choice_n$[20], L_choice_join,
+ @choice_n$[21], L_choice_join,
+ @choice_n$[22], L_choice_join,
+ @choice_n$[23], L_choice_join,
+ @choice_n$[24], L_choice_join,
+ @choice_n$[25], L_choice_join,
+ @choice_n$[26], L_choice_join,
+ @choice_n$[27], L_choice_join,
+ @choice_n$[28], L_choice_join,
+ @choice_n$[29], L_choice_join,
+ @choice_n$[30], L_choice_join,
+ @choice_n$[31], L_choice_join,
+ @choice_n$[32], L_choice_join,
+ @choice_n$[33], L_choice_join,
+ @choice_n$[34], L_choice_join,
+ @choice_n$[35], L_choice_join,
+ @choice_n$[36], L_choice_join,
+ @choice_n$[37], L_choice_join,
+ @choice_n$[38], L_choice_join,
+ @choice_n$[39], L_choice_join;
+
+L_choice_join:
+ set @menu, @menu - 1;
+ set @item, @choice_v[@menu];
+ set @index, @choice_i[@menu];
+ if (@menu >= @c)
+ set @item, 0;
+ goto L_Clean;
+
+L_Clean:
+ set @menu, 0;
+ set @items_nr, 0;
+ set @c, 0;
+ cleararray @choice_v, 0, getarraysize(@choice_v);
+ cleararray @choice_n$, "", getarraysize(@choice_n$);
+ cleararray @choice_i, 0, getarraysize(@choice_i);
+ return;
+
+L_ArrayLengthMismatch:
+ debugmes "@items and @item_names$ array length mismatch";
+ mapexit;
+}
+
+
+
+
+// Input: @items$ (array of items you want to choose from)
+// @item_names$ (names of the items in @items)
+// @default_choice$ (default option)
+// Return: @item$ (The selected item, or 0 if the default/something invalid was chosen)
+
+function|script|ItemMenu$
+{
+set @items_nr, getarraysize(@items$);
+if(@items_nr != getarraysize(@item_names$)) goto L_ArrayLengthMismatch;
+if(@default_choice$ == "") set @default_choice$, "Never mind.";
+goto L_pick_one_of_many_items;
+
+L_pick_one_of_many_items:
+ set @c, 0;
+
+ setarray @choice_n$, "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "";
+ goto L_pick_choice_loop;
+
+L_pick_choice_loop:
+ if (@c >= @items_nr)
+ goto L_choice_init_done;
+ set @choice_v$[@c], @items$[@c];
+ set @choice_n$[@c], @item_names$[@c];
+ set @choice_i[@c], @c;
+ set @c, @c + 1;
+ goto L_pick_choice_loop;
+
+L_choice_init_done:
+ set @choice_v$[@c], "";
+ set @choice_n$[@c], @default_choice$;
+ set @c, @c + 1;
+
+ if (@c < 10)
+ menu
+ @choice_n$[0], L_MenuItems,
+ @choice_n$[1], L_MenuItems,
+ @choice_n$[2], L_MenuItems,
+ @choice_n$[3], L_MenuItems,
+ @choice_n$[4], L_MenuItems,
+ @choice_n$[5], L_MenuItems,
+ @choice_n$[6], L_MenuItems,
+ @choice_n$[7], L_MenuItems,
+ @choice_n$[8], L_MenuItems,
+ @choice_n$[9], L_MenuItems;
+ goto L_MenuItems;
+
+L_MenuItems:
+ if (@c < 10)
+ goto L_choice_join;
+
+ if (@c < 20)
+ menu
+ @choice_n$[0], L_MenuItems1,
+ @choice_n$[1], L_MenuItems1,
+ @choice_n$[2], L_MenuItems1,
+ @choice_n$[3], L_MenuItems1,
+ @choice_n$[4], L_MenuItems1,
+ @choice_n$[5], L_MenuItems1,
+ @choice_n$[6], L_MenuItems1,
+ @choice_n$[7], L_MenuItems1,
+ @choice_n$[8], L_MenuItems1,
+ @choice_n$[9], L_MenuItems1,
+ @choice_n$[10], L_MenuItems1,
+ @choice_n$[11], L_MenuItems1,
+ @choice_n$[12], L_MenuItems1,
+ @choice_n$[13], L_MenuItems1,
+ @choice_n$[14], L_MenuItems1,
+ @choice_n$[15], L_MenuItems1,
+ @choice_n$[16], L_MenuItems1,
+ @choice_n$[17], L_MenuItems1,
+ @choice_n$[18], L_MenuItems1,
+ @choice_n$[19], L_MenuItems1;
+ goto L_MenuItems1;
+
+L_MenuItems1:
+ if (@c < 20)
+ goto L_choice_join;
+
+ menu
+ @choice_n$[0], L_choice_join,
+ @choice_n$[1], L_choice_join,
+ @choice_n$[2], L_choice_join,
+ @choice_n$[3], L_choice_join,
+ @choice_n$[4], L_choice_join,
+ @choice_n$[5], L_choice_join,
+ @choice_n$[6], L_choice_join,
+ @choice_n$[7], L_choice_join,
+ @choice_n$[8], L_choice_join,
+ @choice_n$[9], L_choice_join,
+ @choice_n$[10], L_choice_join,
+ @choice_n$[11], L_choice_join,
+ @choice_n$[12], L_choice_join,
+ @choice_n$[13], L_choice_join,
+ @choice_n$[14], L_choice_join,
+ @choice_n$[15], L_choice_join,
+ @choice_n$[16], L_choice_join,
+ @choice_n$[17], L_choice_join,
+ @choice_n$[18], L_choice_join,
+ @choice_n$[19], L_choice_join,
+ @choice_n$[20], L_choice_join,
+ @choice_n$[21], L_choice_join,
+ @choice_n$[22], L_choice_join,
+ @choice_n$[23], L_choice_join,
+ @choice_n$[24], L_choice_join,
+ @choice_n$[25], L_choice_join,
+ @choice_n$[26], L_choice_join,
+ @choice_n$[27], L_choice_join,
+ @choice_n$[28], L_choice_join,
+ @choice_n$[29], L_choice_join,
+ @choice_n$[30], L_choice_join,
+ @choice_n$[31], L_choice_join,
+ @choice_n$[32], L_choice_join,
+ @choice_n$[33], L_choice_join,
+ @choice_n$[34], L_choice_join,
+ @choice_n$[35], L_choice_join,
+ @choice_n$[36], L_choice_join,
+ @choice_n$[37], L_choice_join,
+ @choice_n$[38], L_choice_join,
+ @choice_n$[39], L_choice_join;
+
+L_choice_join:
+ set @menu, @menu - 1;
+ set @item$, @choice_v$[@menu];
+ set @index, @choice_i[@menu];
+ if (@menu >= @c)
+ set @item$, "";
+ goto L_Clean;
+
+L_Clean:
+ set @menu, 0;
+ set @items_nr, 0;
+ set @c, 0;
+ cleararray @choice_v$, "", getarraysize(@choice_v$);
+ cleararray @choice_n$, "", getarraysize(@choice_n$);
+ cleararray @choice_i, 0, getarraysize(@choice_i);
+ return;
+
+L_ArrayLengthMismatch:
+ debugmes "@items$ and @item_names$ array length mismatch";
+ mapexit;
+}
diff --git a/world/map/npc/magic/level0-reapercry.txt b/world/map/npc/magic/level0-reapercry.txt
index f96c3cea..d7f59416 100644
--- a/world/map/npc/magic/level0-reapercry.txt
+++ b/world/map/npc/magic/level0-reapercry.txt
@@ -234,7 +234,7 @@ L_Exec5:
set @reapercry, 0;
getexp 100000, 0;
misceffect FX_MAGIC_TELEPORT, strcharinfo(0);
- warp "099-7", 75, 36;
+ warp "099-7", 95, 52;
end;
//////////////////////////////////////////////////////
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 385d11c5..48992613 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -11,6 +11,7 @@ npc: npc/functions/miriam.txt
npc: npc/functions/travelers.txt
npc: npc/functions/game_rules.txt
npc: npc/functions/inn.txt
+npc: npc/functions/item_menu.txt
npc: npc/functions/magic.txt
npc: npc/functions/mob_points.txt
npc: npc/functions/process_equip.txt