summaryrefslogtreecommitdiff
path: root/world/map/npc/functions
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2014-04-16 13:09:51 -0500
committerwushin <pasekei@gmail.com>2014-04-16 13:09:51 -0500
commite04e9eb0065caa6adf12ef36efbd3c5a3c5c3652 (patch)
treec57506b8665c9acc305bc6c85064bb4a7ab1fbc5 /world/map/npc/functions
parent566297bd2b1467cf23e88bb2c0ad210b7d5a2ffa (diff)
parentc84e27e10b0f6ed56ae0ee1b0ec4fe7e9d0fd507 (diff)
downloadserverdata-e04e9eb0065caa6adf12ef36efbd3c5a3c5c3652.tar.gz
serverdata-e04e9eb0065caa6adf12ef36efbd3c5a3c5c3652.tar.bz2
serverdata-e04e9eb0065caa6adf12ef36efbd3c5a3c5c3652.tar.xz
serverdata-e04e9eb0065caa6adf12ef36efbd3c5a3c5c3652.zip
Merge pull request #79 from wushin/Tile-Fixes-Map-Travelv2014.4.16
Tile map fixes sprite travel
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r--world/map/npc/functions/clear_vars.txt22
-rwxr-xr-xworld/map/npc/functions/debug.txt10
-rw-r--r--world/map/npc/functions/default_npc_checks.txt125
-rw-r--r--world/map/npc/functions/ferry.txt175
-rw-r--r--world/map/npc/functions/soul_menhir.txt8
-rw-r--r--world/map/npc/functions/travelers.txt279
-rw-r--r--world/map/npc/functions/undead_debug.txt106
7 files changed, 646 insertions, 79 deletions
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index ef4f217a..b83ea630 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -2,6 +2,28 @@
function|script|ClearVariables|,
{
+ // Tutorial
+ if (sorfina)
+ goto L_SetAllTut;
+ goto L_Easter;
+
+L_SetAllTut:
+ if (FLAGS & FLAG_TUTORIAL_DONE)
+ goto L_ResetAllTut;
+ set @tutorial_tmp, (sorfina + tanisha + hasan + kaan);
+ set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
+ set @tutorial_tmp, 0;
+ goto L_ResetAllTut;
+
+L_ResetAllTut:
+ set sorfina, 0;
+ set tanisha, 0;
+ set hasan, 0;
+ set kaan, 0;
+ goto L_Easter;
+
+L_Easter:
+ // Easter
set EasterQuest, 0;
// Halloween 2006
diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt
index e1c9e6c8..9918cbaf 100755
--- a/world/map/npc/functions/debug.txt
+++ b/world/map/npc/functions/debug.txt
@@ -965,3 +965,13 @@ OnInit:
disablenpc "Debug4";
end;
}
+
+027-2.gat,125,103,0|script|Debug5|154,
+{
+ callfunc "Debug";
+ end;
+OnInit:
+ if (!debug)
+ disablenpc "Debug5";
+ end;
+}
diff --git a/world/map/npc/functions/default_npc_checks.txt b/world/map/npc/functions/default_npc_checks.txt
new file mode 100644
index 00000000..4ddd00ca
--- /dev/null
+++ b/world/map/npc/functions/default_npc_checks.txt
@@ -0,0 +1,125 @@
+// Default NPC Checks
+// Author: Wushin
+
+// Range
+// Map, X, Y, Distance in Tiles
+// setarray $@npc_loc, 24, 113, 4;
+function|script|PCtoNPCRange|,
+{
+ set @npc_check, 0;
+ set $@Nmap$, getmap() + ".gat";
+ set $@Nx1, ($@npc_loc[0] - $@npc_loc[2]);
+ set $@Ny1, ($@npc_loc[1] - $@npc_loc[2]);
+ set $@Nx2, ($@npc_loc[0] + $@npc_loc[2]);
+ set $@Ny2, ($@npc_loc[1] + $@npc_loc[2]);
+ if (isin($@Nmap$, $@Nx1, $@Ny1, $@Nx2, $@Ny2))
+ goto L_Return;
+ set @npc_check, 1;
+ goto L_Return;
+
+L_Return:
+ return;
+}
+
+// Inventory & Weight
+// setarray @delitem_names$ Items to delete
+// @delitem_counts Counts of Items to delete
+// @getitem_names$ Items to get
+// @getitem_counts Counts of Items to get
+function|script|CheckInventory|,
+{
+ set @del_loop, 0;
+ set @get_loop, 0;
+ set @delitem_loop, 0;
+ set @getitem_loop, 0;
+ set @check_fail, 0;
+
+ if (getarraysize(@delitem_names$))
+ goto L_DelItemsLoop;
+ goto L_CheckGet;
+
+L_DelItemsLoop:
+ if(countitem(@delitem_names$[@delitem_loop]) >= @delitem_counts[@delitem_loop])
+ goto L_DelLoopAgain;
+ goto L_ReturnMissing;
+
+L_DelLoopAgain:
+ if((@delitems_loop + 1) == getarraysize(@delitems_names$))
+ goto L_CheckGet;
+ set @delitems_loop, (@delitems_loop + 1);
+ goto L_DelItemsLoop;
+
+L_CheckGet:
+ if (getarraysize(@getitem_names$))
+ goto L_CheckWeight;
+ goto L_DelCheck;
+
+L_CheckWeight:
+ getinventorylist;
+ if (@inventorylist_count < (101 - getarraysize(@getitem_names$)))
+ goto L_ReturnSpace;
+ goto L_GetItemsLoop;
+
+L_GetItemsLoop:
+ if (checkweight(@getitem_names$, 1) == 0)
+ goto L_GetLoopAgain;
+ goto L_ReturnWeight;
+
+L_GetLoopAgain:
+ if((@getitems_loop + 1) == getarraysize(@getitems_names$))
+ goto L_DelCheck;
+ set @getitems_loop, (@getitems_loop + 1);
+ goto L_GetItemsLoop;
+
+L_DelCheck:
+ if (getarraysize(@delitem_names$))
+ goto L_DelLoop;
+ goto L_CheckGet2;
+
+L_DelLoop:
+ delitem @delitem_names$[@del_loop], @delitem_counts[@del_loop];
+ goto L_DelAgain;
+
+L_DelAgain:
+ if((@del_loop + 1) == getarraysize(@delitems_names$))
+ goto L_GetLoop;
+ set @del_loop, (@del_loop + 1);
+ goto L_DelLoop;
+
+L_CheckGet2:
+ if (getarraysize(@getitem_names$))
+ goto L_GetLoop;
+ goto L_Return;
+
+L_GetLoop:
+ getitem @getitem_names$[@get_loop], @getitem_counts[@get_loop];
+ goto L_GetAgain;
+
+L_GetAgain:
+ if((@get_loop + 1) == getarraysize(@getitems_names$))
+ goto L_Return;
+ set @get_loop, (@get_loop + 1);
+ goto L_GetLoop;
+
+L_ReturnMissing:
+ mes "\"You are missing required items.\"";
+ set @check_fail, 1;
+ goto L_Return;
+
+L_ReturnWeight:
+ mes "\"You need to be carrying less weight.\"";
+ next;
+ set @check_fail, 1;
+ goto L_Return;
+
+L_ReturnSpace:
+ mes "\"You need more room in your inventory.\"";
+ next;
+ set @check_fail, 1;
+ goto L_Return;
+
+L_Return:
+ cleararray @delitem_names$, "", getarraysize(@delitem_names$);
+ cleararray @getitem_names$, "", getarraysize(@getitem_names$);
+ return;
+}
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
index 03f5777f..271a2e39 100644
--- a/world/map/npc/functions/ferry.txt
+++ b/world/map/npc/functions/ferry.txt
@@ -1,97 +1,116 @@
// The ferry system
-function|script|Ferry|,
+botcheck.gat,27,28,0|script|#FerryConfig|-1,
{
- if (BaseLevel < 20)
- goto L_LowerCost;
- set @cost_tulimshar, 500;
- set @cost_hurnscald, 500;
- set @cost_nivalis, 500;
- goto L_Start;
-
-L_Start:
- set @cost_candor, 1500;
- mes "Where would you like to go?";
- next;
- if (BaseLevel < 40)
- goto L_PlainMenu;
- goto L_MenuWithCandor;
+ end;
+
+OnInit:
+ disablenpc "Hurnscald Koga";
+ disablenpc "Candor Koga";
+ disablenpc "Nivalis Koga";
+ disablenpc "Tulimshar North Koga";
+ disablenpc "Tulimshar South Koga";
+ set $@MainCurrentDock, 0;
+ set $@CandorCurrentDock, 0;
+ set $@DockTickCount, 0;
+ set $@DockLeaveCount, 1;
+ setarray $@MainDocks$, "Hurnscald", "Nivalis", "Tulimshar South";
+ setarray $@CandorDocks$, "Candor", "Tulimshar North";
+ cmdothernpc "#"+$@MainDocks$[$@MainCurrentDock]+"Dock", "Arrive";
+ cmdothernpc "#"+$@CandorDocks$[$@CandorCurrentDock]+"Dock", "Arrive";
+ initnpctimer;
+ end;
+
+L_NextDock:
+ set $@MainLastDock, $@MainCurrentDock;
+ set $@CandorLastDock, $@CandorCurrentDock;
+ set $@MainCurrentDock, $@MainCurrentDock + 1;
+ set $@CandorCurrentDock, $@CandorCurrentDock + 1;
+ if($@MainCurrentDock == getarraysize($@MainDocks$))
+ set $@MainCurrentDock, 0;
+ if($@CandorCurrentDock == getarraysize($@CandorDocks$))
+ set $@CandorCurrentDock, 0;
+ set $@DockTickCount, 0;
+ cmdothernpc "#"+$@MainDocks$[$@MainLastDock]+"Dock", "Warp";
+ cmdothernpc "#"+$@MainDocks$[$@MainCurrentDock]+"Dock", "Arrive";
+ cmdothernpc "#"+$@CandorDocks$[$@CandorLastDock]+"Dock", "Warp";
+ cmdothernpc "#"+$@CandorDocks$[$@CandorCurrentDock]+"Dock", "Arrive";
+ mapannounce "035-2.tmx", " Koga - Main : Now arriving in "+$@MainDocks$[$@MainCurrentDock]+".", 0;
+ mapannounce "036-2.tmx", " Koga - Candor : Now arriving in "+$@CandorDocks$[$@CandorCurrentDock]+".", 0;
+ initnpctimer;
+ end;
+
+OnTimer10000:
+ if ($@DockTickCount > $@DockLeaveCount)
+ goto L_NextDock;
+ mapannounce "035-2.tmx", "Koga - Main : Now docked in "+$@MainDocks$[$@MainCurrentDock]+", Departing soon", 0;
+ mapannounce "036-2.tmx", "Koga - Candor : Now docked in "+$@CandorDocks$[$@CandorCurrentDock]+", Departing soon", 0;
+ set $@DockTickCount, $@DockTickCount + 1;
+ initnpctimer;
+ end;
+}
-L_PlainMenu:
+function|script|FerryManifest|,
+{
+ mes "Which Ferry do you want to check the schedule for?";
menu
- "Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar,
- "Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald,
- "Nivalis (" + @cost_nivalis + "GP)", L_Nivalis,
- "Nevermind", L_Close;
+ "World Ferry.", L_WorldFerry,
+ "Candor Ferry.", L_CandorFerry;
-L_MenuWithCandor:
- menu
- "Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar,
- "Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald,
- "Nivalis (" + @cost_nivalis + "GP)", L_Nivalis,
- "Candor (" + @cost_candor + "GP)", L_Candor,
- "Nevermind", L_Close;
-
-L_Tulimshar:
- if (@loc == DOCK_tulimshar)
- goto L_AlreadyThere;
- if (Zeny < @cost_tulimshar)
- goto L_NotEnoughGP;
-
- set Zeny, Zeny - @cost_tulimshar;
- warp "022-1.gat", 76, 72;
+L_CandorFerry:
+ mes "The ferry is currently at "+$@CandorDocks$[$@CandorCurrentDock];
+ next;
+ set @NextDock, ($@CandorCurrentDock + 1);
+ if(@NextDock == getarraysize($@CandorDocks$))
+ set @NextDock, 0;
+ mes "The ferry will be arriving at "+$@CandorDocks$[@NextDock]+" next";
goto L_Close;
-L_Hurnscald:
- if (@loc == DOCK_hurnscald)
- goto L_AlreadyThere;
- if (Zeny < @cost_hurnscald)
- goto L_NotEnoughGP;
-
- set Zeny, Zeny - @cost_hurnscald;
- warp "008-1.gat", 137, 64;
+L_WorldFerry:
+ mes "The ferry is currently at "+$@MainDocks$[$@MainCurrentDock];
+ next;
+ set @NextDock, ($@MainCurrentDock + 1);
+ if(@NextDock == getarraysize($@MainDocks$))
+ set @NextDock, 0;
+ mes "The ferry will be arriving at "+$@MainDocks$[@NextDock]+" next";
goto L_Close;
-L_Nivalis:
- if (@loc == DOCK_nivalis)
- goto L_AlreadyThere;
- if (Zeny < @cost_nivalis)
- goto L_NotEnoughGP;
+L_Close:
+ close;
+}
- set Zeny, Zeny - @cost_nivalis;
- warp "031-1.gat", 95, 109;
- goto L_Close;
+function|script|BoardFerry|,
+{
+ mes "Board the ferry?";
+ menu
+ "yes.", L_Board,
+ "no.", L_Return;
-L_Candor:
- if (@loc == DOCK_candor)
- goto L_AlreadyThere;
- if (Zeny < @cost_candor)
- goto L_NotEnoughGP;
+L_Board:
+ warp "035-2.tmx",39,29;
+ goto L_Return;
- set Zeny, Zeny - @cost_candor;
- warp "029-1.gat", 25, 37;
- goto L_Close;
+L_Return:
+ return;
+}
-L_AlreadyThere:
- mes "You're already here!";
- goto L_Close;
+function|script|BoardCandorFerry|,
+{
+ mes "Board the ferry?";
+ menu
+ "yes.", L_Board,
+ "no.", L_Return;
-L_NotEnoughGP:
- mes "You don't have enough money to go there!";
- goto L_Close;
+L_Board:
+ if (BaseLevel < 40) goto L_TooYoung;
+ warp "036-2.tmx",39,29;
+ goto L_Return;
-L_LowerCost:
- set @cost_tulimshar, 250;
- set @cost_hurnscald, 250;
- set @cost_nivalis, 250;
- goto L_Start;
+L_TooYoung:
+ mes "This area is too dangerous for your low level.";
+ goto L_Return;
-L_Close:
- set @cost_tulimshar, 0;
- set @cost_hurnscald, 0;
- set @cost_candor, 0;
- set @cost_nivalis, 0;
- set @loc, 0;
- close;
+L_Return:
+ return;
}
diff --git a/world/map/npc/functions/soul_menhir.txt b/world/map/npc/functions/soul_menhir.txt
index 14c1cf1c..e5ec9f4a 100644
--- a/world/map/npc/functions/soul_menhir.txt
+++ b/world/map/npc/functions/soul_menhir.txt
@@ -6,7 +6,13 @@ function|script|SoulMenhir|,
menu
"Touch it.", L_Bind,
- "Leave it alone.", L_Return;
+ "Leave it alone.", L_Return,
+ "I lost my towel...", L_Towel;
+
+L_Towel:
+ callfunc "MultiWarpTowel";
+ getitem "HitchhikersTowel", 1;
+ goto L_Return;
L_Bind:
if (Menhir_Activated == 1)
diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt
new file mode 100644
index 00000000..76e96bf7
--- /dev/null
+++ b/world/map/npc/functions/travelers.txt
@@ -0,0 +1,279 @@
+// Travelers
+// Authors: Wombat, Wushin
+
+// Multiple Travelers
+// Cannot access until found (Player Bitmask)
+// Costs Zeny
+
+// Contains all warp points to find
+botcheck.gat,27,28,0|script|#TravelConfig|-1,
+{
+ end;
+
+OnInit:
+ // TravelFound
+ set $@tut_bit, (1 << 2);
+ set $@druid_tree_bit, (1 << 3);
+ set $@graveyard_bit, (1 << 4);
+ set $@magic_house_bit, (1 << 5);
+ set $@terranite_cave_bit, (1 << 6);
+ set $@tulimshar_bit, (1 << 7);
+ set $@blue_sage_bit, (1 << 8);
+ set $@hurnscald_bit, (1 << 9);
+ set $@nivalis_bit, (1 << 10);
+ set $@tul_mine_bit, (1 << 11);
+ set $@pachua_bit, (1 << 12);
+ set $@nivalis_snow_hills_bit, (1 << 13);
+ set $@barbarians_bit, (1 << 14);
+ set $@hurns_farms_bit, (1 << 15);
+ set $@candor_bit, (1 << 16);
+ // Travel Base Cost
+ set $@tulimshar_cost, 100;
+ set $@hurnscald_cost, 100;
+ set $@nivalis_cost, 100;
+ set $@druid_tree_cost, 150;
+ set $@tul_mine_cost, 150;
+ set $@pachua_cost, 200;
+ set $@graveyard_cost, 200;
+ set $@magic_house_cost, 150;
+ set $@terranite_cave_cost, 200;
+ set $@blue_sage_cost, 200;
+ set $@nivalis_snow_hills_cost, 150;
+ set $@barbarians_cost, 150;
+ set $@hurns_farms_cost, 150;
+ set $@candor_cost, 200;
+ end;
+}
+
+function|script|TravelerTut|,
+{
+ //Explain Travelers
+ mes "["+@NpcName$+"]";
+ mes "\"We travelers are found all over the world. Once you have found another traveler, we can create a link and send you between us.\"";
+ next;
+ if (TravelFound & $@tut_bit)
+ goto L_Return;
+ goto L_SetBit;
+
+L_SetBit:
+ set TravelFound, TravelFound | $@tut_bit;
+ goto L_Return;
+
+L_Return:
+ return;
+}
+
+function|script|Traveler|,
+{
+ mes "["+@NpcName$+"]";
+ mes "\"Greetings. I am "+@NpcName$+" the Traveler.\"";
+ next;
+
+ if (TravelFound & $@tut_bit)
+ goto L_Main;
+ goto L_TravelTut;
+
+L_Main:
+ if (TravelFound & @NpcTravelBit)
+ goto L_BitTravelSet;
+ goto L_SetTravelBit;
+
+L_BitTravelSet:
+ set @Cost, 10;
+ if (BaseLevel < 45)
+ set @Cost, 5;
+ goto L_Start;
+
+L_TravelTut:
+ callfunc "TravelerTut";
+ goto L_Main;
+
+L_SetTravelBit:
+ mes "["+@NpcName$+"]";
+ mes "\"Uplink Set. You can now return to this spot for a fee.\"";
+ next;
+ set TravelFound, TravelFound | @NpcTravelBit;
+ goto L_BitTravelSet;
+
+L_Start:
+ mes "\"Where would you like to go?\"";
+ menu
+ "Tulimshar (" + (@Cost * $@tulimshar_cost) + " GP)", L_TravelTulimshar,
+ "Hurnscald (" + (@Cost * $@hurnscald_cost) + " GP)", L_TravelHurnscald,
+ "Nivalis (" + (@Cost * $@nivalis_cost) + " GP)", L_TravelNivalis,
+ "Candor (" + (@Cost * $@candor_cost) + " GP)", L_TravelCandor,
+ "Tonori - Druid Tree (" + (@Cost * $@druid_tree_cost) + " GP)", L_TravelDruidTree,
+ "Tonori - Tulimshar Mines (" + (@Cost * $@tul_mine_cost) + " GP)", L_TravelTulMine,
+ "Tonori - Pachua's Village (" + (@Cost * $@pachua_cost) + " GP)", L_TravelPachua,
+ "Argeas - Magic House (" + (@Cost * $@magic_house_cost) + " GP)", L_TravelMagicHouse,
+ "Argeas - Farmsteads (" + (@Cost * $@hurns_farms_cost) + " GP)", L_TravelHurnsFarms,
+ "Argeas - Graveyard (" + (@Cost * $@graveyard_cost) + " GP)", L_TravelGraveyard,
+ "Argeas - Terranite Cave (" + (@Cost * $@terranite_cave_cost) + " GP)", L_TravelTerranite,
+ "Nivalis - Barbarian Village (" + (@Cost * $@barbarians_cost) + " GP)", L_TravelBarbarians,
+ "Nivalis - Sage Nikolai's Mansion (" + (@Cost * $@blue_sage_cost) + " GP)", L_TravelBlueSage,
+ "Nivalis - Snow Hills (" + (@Cost * $@nivalis_snow_hills_cost) + " GP)", L_TravelSnowHills,
+ "Who are the Travelers?", L_TravelTut,
+ "I'm not interested.", L_TravelNo;
+
+L_TravelChecks:
+ if (@NpcTravelBit == @NextLocationBit)
+ goto L_AlreadyThere;
+ if (!(TravelFound & @NextLocationBit))
+ goto L_NoFound;
+ if (Zeny < @NextLocationCost)
+ goto L_NoMoney;
+ goto L_TravelPlayer;
+
+L_TravelPlayer:
+ mes "["+@NpcName$+"]";
+ mes "\"Be fearless!\"";
+ close2;
+ set Zeny, Zeny - @NextLocationCost;
+ warp @NextLocationMap$,@NextLocationX,@NextLocationY;
+ goto L_Clearvars;
+
+L_TravelDruidTree:
+ set @NextLocationBit, $@druid_tree_bit;
+ set @NextLocationCost, (@Cost * $@druid_tree_cost);
+ set @NextLocationMap$, "005-1.gat";
+ set @NextLocationX, 76;
+ set @NextLocationY, 36;
+ goto L_TravelChecks;
+
+L_TravelGraveyard:
+ set @NextLocationBit, $@graveyard_bit;
+ set @NextLocationCost, (@Cost * $@graveyard_cost);
+ set @NextLocationMap$, "027-1.gat";
+ set @NextLocationX, 84;
+ set @NextLocationY, 86;
+ goto L_TravelChecks;
+
+L_TravelMagicHouse:
+ set @NextLocationBit, $@magic_house_bit;
+ set @NextLocationCost, (@Cost * $@magic_house_cost);
+ set @NextLocationMap$, "013-1.gat";
+ set @NextLocationX, 120;
+ set @NextLocationY, 93;
+ goto L_TravelChecks;
+
+L_TravelTerranite:
+ set @NextLocationBit, $@terranite_cave_bit;
+ set @NextLocationCost, (@Cost * $@terranite_cave_cost);
+ set @NextLocationMap$, "012-3.gat";
+ set @NextLocationX, 445;
+ set @NextLocationY, 65;
+ goto L_TravelChecks;
+
+L_TravelTulimshar:
+ set @NextLocationBit, $@tulimshar_bit;
+ set @NextLocationCost, (@Cost * $@tulimshar_cost);
+ set @NextLocationMap$, "001-1.gat";
+ set @NextLocationX, 44;
+ set @NextLocationY, 70;
+ goto L_TravelChecks;
+
+L_TravelBlueSage:
+ set @NextLocationBit, $@blue_sage_bit;
+ set @NextLocationCost, (@Cost * $@blue_sage_cost);
+ set @NextLocationMap$, "048-2.gat";
+ set @NextLocationX, 26;
+ set @NextLocationY, 47;
+ goto L_TravelChecks;
+
+L_TravelHurnscald:
+ set @NextLocationBit, $@hurnscald_bit;
+ set @NextLocationCost, (@Cost * $@hurnscald_cost);
+ set @NextLocationMap$, "008-1.gat";
+ set @NextLocationX, 79;
+ set @NextLocationY, 84;
+ goto L_TravelChecks;
+
+L_TravelNivalis:
+ set @NextLocationBit, $@nivalis_bit;
+ set @NextLocationCost, (@Cost * $@nivalis_cost);
+ set @NextLocationMap$, "020-1.gat";
+ set @NextLocationX, 53;
+ set @NextLocationY, 122;
+ goto L_TravelChecks;
+
+L_TravelTulMine:
+ set @NextLocationBit, $@tul_mine_bit;
+ set @NextLocationCost, (@Cost * $@tul_mine_cost);
+ set @NextLocationMap$, "002-2.gat";
+ set @NextLocationX, 27;
+ set @NextLocationY, 28;
+ goto L_TravelChecks;
+
+L_TravelPachua:
+ set @NextLocationBit, $@pachua_bit;
+ set @NextLocationCost, (@Cost * $@pachua_cost);
+ set @NextLocationMap$, "006-1.gat";
+ set @NextLocationX, 28;
+ set @NextLocationY, 97;
+ goto L_TravelChecks;
+
+L_TravelSnowHills:
+ set @NextLocationBit, $@nivalis_snow_hills_bit;
+ set @NextLocationCost, (@Cost * $@nivalis_snow_hills_cost);
+ set @NextLocationMap$, "044-1.gat";
+ set @NextLocationX, 152;
+ set @NextLocationY, 19;
+ goto L_TravelChecks;
+
+L_TravelBarbarians:
+ set @NextLocationBit, $@barbarians_bit;
+ set @NextLocationCost, (@Cost * $@barbarians_cost);
+ set @NextLocationMap$, "033-1.gat";
+ set @NextLocationX, 66;
+ set @NextLocationY, 33;
+ goto L_TravelChecks;
+
+L_TravelHurnsFarms:
+ set @NextLocationBit, $@hurns_farms_bit;
+ set @NextLocationCost, (@Cost * $@hurns_farms_cost);
+ set @NextLocationMap$, "055-1.gat";
+ set @NextLocationX, 135;
+ set @NextLocationY, 60;
+ goto L_TravelChecks;
+
+L_TravelCandor:
+ set @NextLocationBit, $@candor_bit;
+ set @NextLocationCost, (@Cost * $@candor_cost);
+ set @NextLocationMap$, "029-1.gat";
+ set @NextLocationX, 69;
+ set @NextLocationY, 69;
+ goto L_TravelChecks;
+
+L_TravelNo:
+ mes "["+@NpcName$+"]";
+ mes "\"Perhaps some day you will have the courage to help us. Enjoy your stay here in Hurnscald.\"";
+ close2;
+ goto L_Clearvars;
+
+L_NoMoney:
+ mes "["+@NpcName$+"]";
+ mes "\"Sorry, you don't have enough money. Maybe next time.\"";
+ close2;
+ goto L_Clearvars;
+
+L_NoFound:
+ mes "["+@NpcName$+"]";
+ mes "\"Sorry, you don't have a memory from that location. Maybe next time.\"";
+ close2;
+ goto L_Clearvars;
+
+L_AlreadyThere:
+ mes "["+@NpcName$+"]";
+ mes "\"Umm, you are already here. Are you sure you know where you are going?\"";
+ close2;
+ goto L_Clearvars;
+
+L_Clearvars:
+ set @Cost, 0;
+ set @NextLocationBit, 0;
+ set @NextLocationCost, 0;
+ set @NextLocationMap$, "";
+ set @NextLocationX, 0;
+ set @NextLocationY, 0;
+ return;
+}
diff --git a/world/map/npc/functions/undead_debug.txt b/world/map/npc/functions/undead_debug.txt
new file mode 100644
index 00000000..4f01a78c
--- /dev/null
+++ b/world/map/npc/functions/undead_debug.txt
@@ -0,0 +1,106 @@
+// Debug Crypts Battle
+
+function|script|UndeadDebug|,
+{
+ goto L_Main;
+
+L_Main:
+ if (@undeaddebug == 3)
+ goto L_UndeadDebugThree;
+ if (@undeaddebug == 4)
+ goto L_UndeadDebugFour;
+ if (@undeaddebug == 5)
+ goto L_UndeadDebugFive;
+ goto L_Close;
+
+L_UndeadDebugThree:
+ mes "Reset your self to the various states.";
+ mes "Options Limited to Time and Place.";
+ menu
+ "Get Ritual Items.", L_KrukanItems,
+ "Nevermind.", L_Close;
+
+L_UndeadDebugFour:
+ mes "Reset your self to the various states.";
+ mes "Options Limited to Time and Place.";
+ menu
+ "Get Ritual Items.", L_RazhaItems,
+ "Nevermind.", L_Close;
+
+L_UndeadDebugFive:
+ mes "Reset your self to the various states.";
+ mes "Options Limited to Time and Place.";
+ menu
+ "Get Ritual Items.", L_TeroganItems,
+ "Nevermind.", L_Close;
+
+L_InventoryNoSpace:
+ mes "\"Drop some weight then come back.\"";
+ goto L_Close;
+
+L_KrukanItems:
+ if ((checkweight("Soul", 1) == 0)
+ || (checkweight("Skull", 5) == 0)
+ || (checkweight("DarkCrystal", 5) == 0)
+ || (checkweight("Bone", 5) == 0)
+ || (@inventorylist_count == 100))
+ goto L_InventoryNoSpace;
+ getitem "Soul", 1;
+ getitem "Skull", 5;
+ getitem "DarkCrystal", 5;
+ getitem "Bone", 5;
+ goto L_Main;
+
+L_RazhaItems:
+ if ((checkweight("Soul", 3) == 0)
+ || (checkweight("RottenRags", 5) == 0)
+ || (checkweight("UndeadEye", 5) == 0)
+ || (checkweight("UndeadEar", 5) == 0)
+ || (@inventorylist_count == 100))
+ goto L_InventoryNoSpace;
+ getitem "Soul", 3;
+ getitem "RottenRags", 5;
+ getitem "UndeadEye", 5;
+ getitem "UndeadEar", 5;
+ goto L_Main;
+
+L_TeroganItems:
+ if ((checkweight("Soul", 5) == 0)
+ || (checkweight("DiseasedHeart", 5) == 0)
+ || (checkweight("UndeadEye", 5) == 0)
+ || (checkweight("UndeadEar", 5) == 0)
+ || (@inventorylist_count == 100))
+ goto L_InventoryNoSpace;
+ getitem "Soul", 5;
+ getitem "DiseasedHeart", 5;
+ getitem "UndeadEye", 5;
+ getitem "UndeadEar", 5;
+ goto L_Main;
+
+L_Close:
+ close;
+}
+
+// Debug for Krukan
+027-3.gat,84,89,0|script|UndeadDebug3|155,
+{
+ set @undeaddebug, 3;
+ callfunc "UndeadDebug";
+ end;
+}
+
+// Debug for Razha
+027-4.gat,76,79,0|script|UndeadDebug4|155,
+{
+ set @undeaddebug, 4;
+ callfunc "UndeadDebug";
+ end;
+}
+
+// Debug for Terogan
+027-5.gat,72,26,0|script|UndeadDebug5|155,
+{
+ set @undeaddebug, 5;
+ callfunc "UndeadDebug";
+ end;
+}