Jump to content
  • 0

Custome Wapra error when doesnt have zeny


Checkmate

Question


  • Group:  Members
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  554
  • Reputation:   14
  • Joined:  09/24/12
  • Last Seen:  

//===== rAthena Script ============================================
//= Quest Warper Script
//===== By: =======================================================
//= DZeroX, Darkchild, Neouni
//===== Current Version: ==========================================
//= 2.3
//===== Compatible With: ==========================================
//= rAthena Project
//===== Description: ==============================================
//= Warper that works only after locations are unlocked.
//===== Additional Comments: ======================================
//= 1.0 - NPCs created
//= 1.1 - Add Dungeons by sturm
//= 1.2 - Add All char in account unlocked by ace_killer
//= 1.3 - Add new 7 towns and 7 dungeons by escoteiro
// - Correct bug jawaii town by escoteiro
// - Remove some excessive warpras by escoteiro
//= 1.4 - Rewrite of the Warpa system [Neouni]
// - Corrected some bugs caused by autoconverting the old script
//= 1.4a - Rewrite of menu to be custom for each player [Neouni]
// - Dungeon listing rewrite
// - Town listing rewrite
// - GameMaster can Customise Main menu
//= 1.4b - Pricing round [Neouni]
// - GM menu added for pricing
// - Town Warp pricing tags added
// - Dungeon Warp pricing tags added
//= 1.5 - storage functions pricing [Neouni]
// - storage pricing added
// - kafra points setting added
// - kafra storage code security added
// - Healing scripts pricing added
// - Heal Part script added
//= 1.6 - Dungeon warp [Neouni] (beta only)
// - added option to add a extra fee for going down deeper into dungeon
// partly by rebuilding the dungeon warping into variable menu's
//= 1.6a - alot of fixes for beta release [Neouni] (public release)
// - fixed syntax problems
// - fixed missing pyramid gats in @DGat$ array
// - removed the culver level 5 that didn't exist
//= 1.7 - Readability of Dungeon menu building increased [Neouni]
// - Thanatos Tower & Louyang Dungeon added
//= 1.8 - changed around unlock variables [Neouni]
// - Moved warp variables to mark what you have unlocked to an binary array in login based permanent variable
// (warp variables are saved in login database, so all charservers have these unlocked)
// - Town Warp unlock array max 21/(unknown max) items used instead of max account #variables 32 !
// - Dungeon Warp unlock array 28/(unknown max) items used instead of max account #variables 32 !
// - (max login ##variables = 16, i used 3)
// - old variables are cleared on next save
// - Extra Variable clear added for every character, just in case (request by Terces)
//= 1.8a - Show amount of users on map [Neouni]
//= 1.8b - Small typo fixed in stampcard script [Neouni]
//= 1.9 - Making it more edit friendly [Neouni]
// - Made Dungeon warp arrays more readable & editable (QWS_Darray)
// - Made town warp arrays more readable & editable (QWS_Tarray)
//= 2.0 - Special Warp menu added [Neouni]
// - when all towns and dungeons are collected a new option on the main menu will show
// - it will only show when you setup the mapname of the warp !
//= 2.0a - Dungeon Level Limit & Split dungeon fees
// - Limits dungeon based on Depth, access special setup menu thru GM-Menu
// - Dungeon fees split up based on  Basic , Advanced & Overseas
// - Old Dungeon fee system removed, all dungeon fees now set to 0
//= 2.0b - Special warpname menu option name bug fixed
//= 2.1 - Updated names to fall within retrictions. [L0ne_W0lf]
//= 2.2 - #kafra_code is now stored as is. [brianluau]
//= 2.3 - Added new town maps, cleanup, and removed pre-1.8 backwards fix. [Euphy]
//=================================================================

//========================Function=&=Script========================

function	script	Q_Warpra	{
	mes "[Warpra]";
	mes "Hello,";
	mes "I can warp you to any town, field, or dungeon, but you need to unlock them first~!";
	mes "What do you need?";
	
	if(getarg(0) == 0) callfunc "QWS_MMarray",0;
	if(getarg(0) == 1) callfunc "QWS_MMarray",1;
	
	set @MMenu,select(@Mmenulist$[0],@Mmenulist$[1],@Mmenulist$[2],@Mmenulist$[3],@Mmenulist$[4],@Mmenulist$[5],@Mmenulist$[6],@Mmenulist$[7],@Mmenulist$[8]);

	switch(@Mmenuref[@MMenu-1]+1){
	case 1: goto Last_Warp;
	case 2: goto L_town;
	case 3: goto L_field;
	case 4: goto L_citydungeon;
	case 5: goto L_dungeon;
	case 6: goto L_FewWarps;
	case 7: goto GM_Menu;
	case 8:
	default:
		goto L_end;
	}

//=====================GM-Menu=Functions===========================

GM_Menu:
	next;
	mes "Town warping = "+(($QW_TW_OFF)?"^FF0000 Off":"^00FF00 On")+"^000000";
	mes "Field warping = "+(($QW_FW_OFF)?"^FF0000 Off":"^00FF00 On")+"^000000";
	mes "City Dungeon warping = "+(($QW_DW_OFF)?"^FF0000 Off":"^00FF00 On")+"^000000";
	mes "Dungeon warping = "+(($QW_DW_OFF)?"^FF0000 Off":"^00FF00 On")+"^000000";
	mes "Field Depth limit is "+(($QW_FL)?"^00FF00 On":"^FF0000 Off")+"^000000";
	mes "If on Field Depth limit is set to ^0000FF"+$QW_FDL+"^000000";
	mes "City Dungeon Depth limit is "+(($QW_CDL)?"^00FF00 On":"^FF0000 Off")+"^000000";
	mes "If on City Dungeon Depth limit is set to ^0000FF"+$QW_CDDL+"^000000";
	mes "Dungeon Depth limit is "+(($QW_DL)?"^00FF00 On":"^FF0000 Off")+"^000000";
	mes "If on Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000";
	mes "Show Map Users = "+(($QW_MapUserShow)?"^00FF00 On":"^FF0000 Off")+"^000000";

	switch(select("Town Warping","Field Warping","City Dungeon Warping","Dungeon Warping","Field Level Limit","Dungeon Level Limit","Show Map Users","Exit")) {
	case 1: set $QW_TW_OFF,($QW_TW_OFF)?0:1; goto GM_Menu;
	case 2: set $QW_FW_OFF,($QW_FW_OFF)?0:1; goto GM_Menu;
	case 3: set $QW_CDW_OFF,($QW_CDW_OFF)?0:1; goto GM_Menu;
	case 4: set $QW_DW_OFF,($QW_DW_OFF)?0:1; goto GM_Menu;
	case 5: goto FieldLevelLimit;
	case 6: goto CityDungeonLevelLimit;
	case 7: goto DungeonLevelLimit;
	case 8: set $QW_MapUserShow,($QW_MapUserShow)?0:1; goto GM_Menu;
	default:
		close;
		end;
	}
	
//=====================Last_Warp===========================

Last_Warp:
	next;
	set @warpprice, 25 * BaseLevel;
	if(Zeny < @warpprice) callsub L_Short_on_zeny,1;
	warp lastwarp$,lastwarpx,lastwarpy;
	message strcharinfo(0), "Warping costs " + callfunc("F_InsertComma",@warpprice) + " Zeny.";
	set Zeny, Zeny-(@warpprice);
	close2;
	end;


//===========================Towns=================================

L_town:
	callfunc "QWS_Tarray";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<39; set .@i,.@i+1)	// Expected maximum is 35
		set .@menu$,.@menu$+@Tmenulist$[.@i]+":";
	freeloop(0);
	set @TWMenu,select(.@menu$);

	if (@Tmenuref[@TWMenu-1] == 57005) goto L_end; // 57005='dead' in hex

	set @warpprice, 25 * BaseLevel;
	if(Zeny<@warpprice) callsub L_Short_on_zeny,0;
	message strcharinfo(0), "Warping costs " + callfunc("F_InsertComma",@warpprice) + " Zeny.";
	set Zeny, Zeny-(@warpprice);

	set lastwarp$, @pTmap$[@Tmenuref[@TWMenu-1]];
	set lastwarpx, @pTXcoords[@Tmenuref[@TWMenu-1]];
	set lastwarpy, @pTYcoords[@Tmenuref[@TWMenu-1]];
	warp @pTmap$[@Tmenuref[@TWMenu-1]],@pTXcoords[@Tmenuref[@TWMenu-1]],@pTYcoords[@Tmenuref[@TWMenu-1]];

	close2;
	end;

//=========================Fields================================

L_field:
	callfunc "QWS_Farray";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<22; set .@i,.@i+1)	// Expected maximum is 35
		set .@menu$,.@menu$+@Fmenulist$[.@i]+":";
	freeloop(0);
	set @FWMenu,select(.@menu$);

	if (@Fmenuref[@FWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
	set @FwarpMenu, (@Fmenuref[@FWMenu-1]);
	callfunc "QWS_FLarray";

	next;
	mes "[Warpra]";
	mes "Please select where you want to go:";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<20; set .@i,.@i+1)	// Expected maximum is 18
		set .@menu$,.@menu$+@FWLmenulist$[.@i]+":";
	freeloop(0);
	set @FWLMenu,select(.@menu$);

	if (@FWLmenuref[@FWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex

	set @Farrayref, @FWLmenuref[@FWLMenu-1];

	set @warpprice, 25 * BaseLevel;
	if(Zeny<@warpprice) callsub L_Short_on_zeny,1;
	message strcharinfo(0), "Warping costs " + callfunc("F_InsertComma",@warpprice) + " Zeny.";
	set Zeny, Zeny-(@warpprice);
	set lastwarp$, @FGat$[@Farrayref];
	set lastwarpx, @FXcoords[@Farrayref];
	set lastwarpy, @FYcoords[@Farrayref];
	warp @FGat$[@Farrayref],@FXcoords[@Farrayref],@FYcoords[@Farrayref];

	close2;
	end;

//=========================City Dungeons================================

L_citydungeon:
	callfunc "QWS_CDarray";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<30; set .@i,.@i+1)	// Expected maximum is 30
		set .@menu$,.@menu$+@CDmenulist$[.@i]+":";
	freeloop(0);
	set @CDWMenu,select(.@menu$);

	if (@CDmenuref[@CDWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
	set @CDwarpMenu, (@CDmenuref[@CDWMenu-1]);
	callfunc "QWS_CDLarray";

	next;
	mes "[Warpra]";
	mes "Please select where you want to go:";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<20; set .@i,.@i+1)	// Expected maximum is 18
		set .@menu$,.@menu$+@CDWLmenulist$[.@i]+":";
	freeloop(0);
	set @CDWLMenu,select(.@menu$);

	if (@CDWLmenuref[@CDWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex

	set @CDarrayref, @CDWLmenuref[@CDWLMenu-1];
	
	set @warpprice, 25 * BaseLevel;
	if(Zeny<@warpprice) callsub L_Short_on_zeny,2;
	message strcharinfo(0), "Warping costs " + callfunc("F_InsertComma",@warpprice) + " Zeny.";
	set Zeny, Zeny-(@warpprice);

	set lastwarp$, @CDGat$[@CDarrayref];
	set lastwarpx, @CDXcoords[@CDarrayref];
	set lastwarpy, @CDYcoords[@CDarrayref];
	warp @CDGat$[@CDarrayref],@CDXcoords[@CDarrayref],@CDYcoords[@CDarrayref];

	close2;
	end;

//=========================Dungeons================================

L_dungeon:
	callfunc "QWS_Darray";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<30; set .@i,.@i+1)	// Expected maximum is 30
		set .@menu$,.@menu$+@Dmenulist$[.@i]+":";
	freeloop(0);
	set @DWMenu,select(.@menu$);

	if (@Dmenuref[@DWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
	set @DwarpMenu, (@Dmenuref[@DWMenu-1]);
	callfunc "QWS_DLarray";

	next;
	mes "[Warpra]";
	mes "Please select where you want to go:";
	freeloop(1);
	set .@menu$,"";
	for(set .@i,0; .@i<20; set .@i,.@i+1)	// Expected maximum is 18
		set .@menu$,.@menu$+@DWLmenulist$[.@i]+":";
	freeloop(0);
	set @DWLMenu,select(.@menu$);

	if (@DWLmenuref[@DWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex

	set @Darrayref, @DWLmenuref[@DWLMenu-1];
	
	set @warpprice, 25 * BaseLevel;
	if(Zeny<@warpprice) callsub L_Short_on_zeny,3;
	message strcharinfo(0), "Warping costs " + callfunc("F_InsertComma",@warpprice) + " Zeny.";
	set Zeny, Zeny-(@warpprice);

	set lastwarp$, @DGat$[@Darrayref];
	set lastwarpx, @DXcoords[@Darrayref];
	set lastwarpy, @DYcoords[@Darrayref];
	warp @DGat$[@Darrayref],@DXcoords[@Darrayref],@DYcoords[@Darrayref];

	close2;
	end;


//============================L_end=============================
L_end:
	close;
	end;

//============================Few=Warp=============================
L_FewWarps:
	next;
	mes "[Warpra]";
	mes "You need to unlock locations before they come available to you.";
	mes "To unlock a location talk to my colleagues all over the world.";
	mes "Each account has its own stamp card.";
	mes "Want me to check what stamps you have collected so far?";
	if (select("Yes","No")==1) callsub stampcard;
	close;
	end;

	
//=========================Short=On=Zeny===========================
L_Short_on_zeny:
	next;
	switch(getarg(0)) {
	case 0: mes "You don't seem to have the"+25 * BaseLevel +" zeny to pay for the warp to "+@pTmenuitems$[@Tmenuref[@TWMenu-1]]+"."; break;
	case 1: mes "You don't seem to have the "+25 * BaseLevel +" zeny to pay for the warp to "+@FLevelName$[@FWLmenuref[@FWLMenu-1]]+" at "+@pFmenuitems$[@Fmenuref[@FWMenu-1]]+"."; break;
	case 2: mes "You don't seem to have the "+25 * BaseLevel +" zeny to pay for the warp to "+@CDLevelName$[@CDWLmenuref[@CDWLMenu-1]]+" at "+@pCDmenuitems$[@CDmenuref[@CDWMenu-1]]+"."; break;
	case 3: mes "You don't seem to have the "+25 * BaseLevel +" zeny to pay for the warp to "+@DLevelName$[@DWLmenuref[@DWLMenu-1]]+" at "+@pDmenuitems$[@Dmenuref[@DWMenu-1]]+"."; break;
	}
	close;
	end;
	
//===========================Stamp=Card============================
stampcard:
// Counting of the amount of places you have unlocked
	next;
	mes "Let me check what Towns you have.";
	callfunc "QWS_TownStamps";
	mes "You collected^00FF00 "+@Tstamp+" of "+@MaxTstamp+" ^000000Towns.";
	if (@Tstamp == 15) {
		mes "They say there is an island you can only get to when married...";
		emotion ET_SMILE;
	}
	next;
	mes "Let me check what Fields you have.";
	callfunc "QWS_FieldStamps";
	mes "You collected^00FF00 "+@Fstamp+" of "+@MaxFstamp+" ^000000Fields.";
	next;
	mes "Let me check what city dungeons you have.";
	callfunc "QWS_CityDungeonStamps";
	mes "You collected^00FF00 "+@CDstamp+" of "+@MaxCDstamp+" ^000000CityDungeons.";
	mes "To unlock a dungeon, search for my colleagues.";
	mes "You can usually find them near the middle or end of the dungeon.";
	next;
	mes "Let me check what dungeons you have.";
	callfunc "QWS_DungeonStamps";
	mes "You collected^00FF00 "+@Dstamp+" of "+@MaxDstamp+" ^000000Dungeons.";
	mes "To unlock a dungeon, search for my colleagues.";
	mes "You can usually find them near the middle or end of the dungeon.";
	return;
}

function	script	QWS_TownStamps	{
	set @Tstamp,0;
	set @MaxTstamp,28; //maximum number of towns
	set @binvalue,1;
	set @Tstamploop,0;
	do {
		if ((@binvalue & ##QWS_T_Unlock) == @binvalue) set @Tstamp,@Tstamp+1;
		set @binvalue, @binvalue *2;
		set @Tstamploop, @Tstamploop + 1;
	} while (@Tstamploop < @MaxTstamp);
	return;
}

function	script	QWS_FieldStamps	{
	set @Fstamp,0;
	set @MaxFstamp,22; //maximum number of fields
	set @binvalue,1;
	set @Fstamploop,0;
	do {
		if ((@binvalue & ##QWS_F_Unlock) == @binvalue) set @Fstamp,@Fstamp+1;
		set @binvalue, @binvalue *2;
		set @Fstamploop, @Fstamploop + 1;
	} while (@Fstamploop < @MaxFstamp);
	return;
}

function	script	QWS_CityDungeonStamps	{
	set @CDstamp,0;
	set @MaxCDstamp,21; //maximum number of dungeons
	set @binvalue,1;
	set @CDstamploop,0;
	do {
		if ((@binvalue & ##QWS_CD_Unlock) == @binvalue) set @CDstamp,@CDstamp+1;
		set @binvalue, @binvalue *2;
		set @CDstamploop, @CDstamploop + 1;
	} while (@CDstamploop < @MaxCDstamp);
	return;
}

function	script	QWS_DungeonStamps	{
	set @Dstamp,0;
	set @MaxDstamp,20; //maximum number of dungeons
	set @binvalue,1;
	set @Dstamploop,0;
	do {
		if ((@binvalue & ##QWS_D_Unlock) == @binvalue) set @Dstamp,@Dstamp+1;
		set @binvalue, @binvalue *2;
		set @Dstamploop, @Dstamploop + 1;
	} while (@Dstamploop < @MaxDstamp);
	return;
}

//======================Main=Menu=Array============================

function	script	QWS_MMarray	{

	// Currently ... items
	setarray @pMmenuitems$[0], "Last Warp", "Warp to Towns", "Warp to Fields","Warp to City Dungeons", "Warp to Dungeons", "Why so few warps?", "GameMaster Menu", "Cancel";
	set @Mi,0; // loop counter
	set @Mj,0; // menu line counter

//----------------Last-Warp
	set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
	set @Mmenuref[@Mj],@Mi;
	set @Mj,@Mj+1;
	set @Mi,@Mi+1;
//----------------Town-Warp
	if ($QW_TW_OFF == 0) {
		set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
		set @Mmenuref[@Mj],@Mi;
		set @Mj,@Mj+1;
	}
	set @Mi,@Mi+1;
//----------------Field-Warp
	if ($QW_FW_OFF == 0) {
		set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
		set @Mmenuref[@Mj],@Mi;
		set @Mj,@Mj+1;
	}
	set @Mi,@Mi+1;
//----------------City Dungeon-Warp
	if ($QW_CDW_OFF == 0) {
		set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
		set @Mmenuref[@Mj],@Mi;
		set @Mj,@Mj+1;
	}
	set @Mi,@Mi+1;
//----------------Dungeon-Warp
	if ($QW_DW_OFF == 0) {
		set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
		set @Mmenuref[@Mj],@Mi;
		set @Mj,@Mj+1;
	}
	set @Mi,@Mi+1;
//----------------Why-So-Few-Warps
	set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
	set @Mmenuref[@Mj],@Mi;
	set @Mj,@Mj+1;
	set @Mi,@Mi+1;
//----------------No-Unlock
	if (getarg(0) == 1) {
		set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
		set @Mmenuref[@Mj],@Mi;
		set @Mj,@Mj+1;
	}
	set @Mi,@Mi+1;
//----------------GameMaster-Menu
	if (getgmlevel()>= 80) {
		set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
		set @Mmenuref[@Mj],@Mi;
		set @Mj,@Mj+1;
	}
	set @Mi,@Mi+1;
//----------------Cancel
	set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
	set @Mmenuref[@Mj],@Mi;
	return;
}

//======================Town=Menu=Array============================
// Adding a town:
//	setarray @pTmenuitems$[@Ti], "Prontera";// Name of Town shown in Town select Menu
//	// Warp prices: Basic (0), Advanced (0), Overseas (0)
//
//	setarray @pTmap$[@Ti], "prontera";	// Map name
//	setarray @pTXcoords[@Ti], 156;		// X warp coords
//	setarray @pTYcoords[@Ti], 187;		// Y warp coords
//
//	QWS_Make_Town_Menu 0;	// Use a free number (last used is 30, Eclage)
//
// Adding a warpra:
//	map,x,y,facing	script	Warpra#example	113,{
//		callfunc "QWS_Town_Warpra",<town number>,"Your Town";
//		close;
//	}
//	Town number is the same as "QWS_Make_Town_Menu".
//==================================================================

function	script	QWS_Tarray	{
	function QWS_Make_Town_Menu;

	set @Ti,0; // loop counter
	set @Tj,0; // menu lines counter

//----------------Prontera
	setarray @pTmenuitems$[@Ti], "Prontera";


	setarray @pTmap$[@Ti], "prontera";
	setarray @pTXcoords[@Ti], 155;
	setarray @pTYcoords[@Ti], 183;

	QWS_Make_Town_Menu 0;
//----------------Alberta
	setarray @pTmenuitems$[@Ti], "Alberta";


	setarray @pTmap$[@Ti], "alberta";
	setarray @pTXcoords[@Ti], 28;
	setarray @pTYcoords[@Ti], 234;

	QWS_Make_Town_Menu 1;
//----------------Aldebaran
	setarray @pTmenuitems$[@Ti], "Aldebaran";


	setarray @pTmap$[@Ti], "aldebaran";
	setarray @pTXcoords[@Ti], 140;
	setarray @pTYcoords[@Ti], 113;

	QWS_Make_Town_Menu 2;
//----------------Amatsu:
	setarray @pTmenuitems$[@Ti], "Amatsu";


	setarray @pTmap$[@Ti], "amatsu";
	setarray @pTXcoords[@Ti], 198;
	setarray @pTYcoords[@Ti], 84;

	QWS_Make_Town_Menu 3;
//----------------Ayothaya:
	setarray @pTmenuitems$[@Ti], "Ayothaya";


	setarray @pTmap$[@Ti], "ayothaya";
	setarray @pTXcoords[@Ti], 208;
	setarray @pTYcoords[@Ti], 166;

	QWS_Make_Town_Menu 4;
//----------------Comodo:
	setarray @pTmenuitems$[@Ti], "Comodo";


	setarray @pTmap$[@Ti], "comodo";
	setarray @pTXcoords[@Ti], 189;
	setarray @pTYcoords[@Ti], 155;

	QWS_Make_Town_Menu 5;

//----------------Einbech:
	setarray @pTmenuitems$[@Ti], "Einbech";


	setarray @pTmap$[@Ti], "einbech";
	setarray @pTXcoords[@Ti], 63;
	setarray @pTYcoords[@Ti], 35;

	QWS_Make_Town_Menu 6;

//----------------Einbroch:
	setarray @pTmenuitems$[@Ti], "Einbroch";


	setarray @pTmap$[@Ti], "einbroch";
	setarray @pTXcoords[@Ti], 64;
	setarray @pTYcoords[@Ti], 200;

	QWS_Make_Town_Menu 7;

//----------------Geffen:
	setarray @pTmenuitems$[@Ti], "Geffen";


	setarray @pTmap$[@Ti], "geffen";
	setarray @pTXcoords[@Ti], 119;
	setarray @pTYcoords[@Ti], 59;

	QWS_Make_Town_Menu 8;
//----------------Gonryun:
	setarray @pTmenuitems$[@Ti], "Gonryun";


	setarray @pTmap$[@Ti], "gonryun";
	setarray @pTXcoords[@Ti], 160;
	setarray @pTYcoords[@Ti], 120;

	QWS_Make_Town_Menu 9;
//----------------Hugel:
	setarray @pTmenuitems$[@Ti], "Hugel";


	setarray @pTmap$[@Ti], "hugel";
	setarray @pTXcoords[@Ti], 96;
	setarray @pTYcoords[@Ti], 145;

	QWS_Make_Town_Menu 10;
//----------------Izlude:
	setarray @pTmenuitems$[@Ti], "Izlude";


	setarray @pTmap$[@Ti], "izlude";
	setarray @pTXcoords[@Ti], 128;
	setarray @pTYcoords[@Ti], 111;

	QWS_Make_Town_Menu 11;
//----------------Jawaii:
	setarray @pTmenuitems$[@Ti], "Jawaii";


	setarray @pTmap$[@Ti], "jawaii";
	setarray @pTXcoords[@Ti], 251;
	setarray @pTYcoords[@Ti], 132;

	QWS_Make_Town_Menu 12;
//----------------Lighthalzen:
	setarray @pTmenuitems$[@Ti], "Lighthalzen";


	setarray @pTmap$[@Ti], "lighthalzen";
	setarray @pTXcoords[@Ti], 158;
	setarray @pTYcoords[@Ti], 92;

	QWS_Make_Town_Menu 13;
//----------------Louyang:
	setarray @pTmenuitems$[@Ti], "Louyang";


	setarray @pTmap$[@Ti], "louyang";
	setarray @pTXcoords[@Ti], 217;
	setarray @pTYcoords[@Ti], 100;

	QWS_Make_Town_Menu 14;
//----------------Lutie
	setarray @pTmenuitems$[@Ti], "Lutie";


	setarray @pTmap$[@Ti], "xmas";
	setarray @pTXcoords[@Ti], 147;
	setarray @pTYcoords[@Ti], 134;

	QWS_Make_Town_Menu 15;
//----------------Manuk
	setarray @pTmenuitems$[@Ti], "Manuk";


	setarray @pTmap$[@Ti], "manuk";
	setarray @pTXcoords[@Ti], 282;
	setarray @pTYcoords[@Ti], 138;

	QWS_Make_Town_Menu 16;

//----------------Midgard's Expedition Camp:
	setarray @pTmenuitems$[@Ti], "Midgard's Expedition Camp";


	setarray @pTmap$[@Ti], "mid_camp";
	setarray @pTXcoords[@Ti], 210;
	setarray @pTYcoords[@Ti], 288;

	QWS_Make_Town_Menu 17;

//----------------Morroc:
	setarray @pTmenuitems$[@Ti], "Morroc";


	setarray @pTmap$[@Ti], "morocc";
	setarray @pTXcoords[@Ti], 156;
	setarray @pTYcoords[@Ti], 93;

	QWS_Make_Town_Menu 18;
//----------------Moscovia
	setarray @pTmenuitems$[@Ti], "Moscovia";


	setarray @pTmap$[@Ti], "moscovia";
	setarray @pTXcoords[@Ti], 223;
	setarray @pTYcoords[@Ti], 184;

	QWS_Make_Town_Menu 19;
//----------------Niflheim:
	setarray @pTmenuitems$[@Ti], "Niflheim";


	setarray @pTmap$[@Ti], "niflheim";
	setarray @pTXcoords[@Ti], 202;
	setarray @pTYcoords[@Ti], 174;

	QWS_Make_Town_Menu 20;
//----------------Payon:
	setarray @pTmenuitems$[@Ti], "Payon";


	setarray @pTmap$[@Ti], "payon";
	setarray @pTXcoords[@Ti], 179;
	setarray @pTYcoords[@Ti], 100;

	QWS_Make_Town_Menu 21;
//----------------Rachel
	setarray @pTmenuitems$[@Ti], "Rachel";


	setarray @pTmap$[@Ti], "rachel";
	setarray @pTXcoords[@Ti], 130;
	setarray @pTYcoords[@Ti], 110;

	QWS_Make_Town_Menu 22;
//----------------Splendide
	setarray @pTmenuitems$[@Ti], "Splendide";


	setarray @pTmap$[@Ti], "splendide";
	setarray @pTXcoords[@Ti], 201;
	setarray @pTYcoords[@Ti], 147;

	QWS_Make_Town_Menu 23;
//----------------Thor Camp:
	setarray @pTmenuitems$[@Ti], "Thor Camp";


	setarray @pTmap$[@Ti], "thor_camp";
	setarray @pTXcoords[@Ti], 246;
	setarray @pTYcoords[@Ti], 68;

	QWS_Make_Town_Menu 24;
//----------------Umbala:
	setarray @pTmenuitems$[@Ti], "Umbala";


	setarray @pTmap$[@Ti], "umbala";
	setarray @pTXcoords[@Ti], 97;
	setarray @pTYcoords[@Ti], 153;

	QWS_Make_Town_Menu 25;
//----------------Veins
	setarray @pTmenuitems$[@Ti], "Veins";


	setarray @pTmap$[@Ti], "veins";
	setarray @pTXcoords[@Ti], 216;
	setarray @pTYcoords[@Ti], 123;

	QWS_Make_Town_Menu 26;
//----------------Yuno:
	setarray @pTmenuitems$[@Ti], "Yuno";


	setarray @pTmap$[@Ti], "yuno";
	setarray @pTXcoords[@Ti], 157;
	setarray @pTYcoords[@Ti], 51;

	QWS_Make_Town_Menu 27;

//----------------Cancel
	setarray @pTmenuitems$[@Ti], "Cancel";


	set @Tmenulist$[@Tj],@pTmenuitems$[@Ti];
	set @Tmenuref[@Tj],57005; // 57005='dead' in hex
	return;


//----------------Make Town Menu Function

function	QWS_Make_Town_Menu	{
	set @temptownmenubin,1;
	if (getarg(0) == 0) goto menu_item;
	set @templooptownmenu,0;
	do {
		set @temptownmenubin, @temptownmenubin * 2;
		set @templooptownmenu, @templooptownmenu + 1;
		}while (getarg(0) > @templooptownmenu);
// check marker and make menu item
menu_item:
	if ((@temptownmenubin & ##QWS_T_Unlock) != @temptownmenubin) {
		set @Ti,@Ti+1;
		return;
	}
	if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" -> "+@pTprice[@Ti];
	if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti];
	if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"+" -> "+@pTprice[@Ti];
	if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]";
	set @Tmenuref[@Tj],@Ti;
	set @Tj,@Tj+1;
	set @Ti,@Ti+1;
	return;
}
}

//====================Field=Menu=Arrays==========================
// Adding a field:
//	setarray @pFmenuitems$[@Fi], "Abyss Lake";	// Name of Field shown in Field select Menu
//		// Warp prices: Basic (0), Advanced (0), Overseas (0)
//		// Identifier for fee caluclation: Basic (0), Advanced (0), Overseas (0)
//	setarray @FLevels[@Fi], 3;			// Number of levels in Field
//
//	setarray @FGat$[@Fref], "abyss_01", "abyss_02", "abyss_03";	// Map names of Field levels
//	setarray @FLevelName$[@Fref], "Level 1", "Level 2", "Level 3";	// Name of Field levels shown in Menu
//	setarray @FXcoords[@Fref], 265, 275, 116;			// X warp coords
//	setarray @FYcoords[@Fref], 273, 270, 27;			// Y warp coords
//	setarray @FDepth[@Fref], 0, 1, 2;				// Relative depth to entrance, to calculate extra warp fee
//
//	QWS_Make_Field_Menu 0;	// Use a free number (last used is 28, Kiel Dungeon)
//
// Adding a warpra:
//	map,x,y,facing	script	Warpra Helper#example	112,{
//		callfunc "QWS_Field_Warpra",<field number>,"Your Field";
//		close;
//	}
//	Field number is the same as "QWS_Make_Field_Menu".
//==================================================================

function	script	QWS_Farray	{
	function QWS_Make_Field_Menu;

	set @Fi,0;
	set @Fj,0;
	set @Fref,0;

//----------------AMATSU FIELDS
	setarray @pFmenuitems$[@Fi], "Amatsu Fields";


	setarray @FLevels[@Fi], 1;

	setarray @FGat$[@Fref], "ama_fild01";
	setarray @FLevelName$[@Fref], "Amatsu Field 1";
	setarray @FXcoords[@Fref], 190;
	setarray @FYcoords[@Fref], 197;
	setarray @FDepth[@Fref], 0;

	QWS_Make_Field_Menu 0;

//----------------Ayothaya Fields
	setarray @pFmenuitems$[@Fi], "Ayothaya Fields";


	setarray @FLevels[@Fi], 2;
	setarray @FGat$[@Fref], "ayo_fild01", "ayo_fild02";
	setarray @FLevelName$[@Fref], "Ayothaya Field 1", "Ayothaya Field 2";
	setarray @FXcoords[@Fref], 173, 212;
	setarray @FYcoords[@Fref], 134, 150;
	setarray @FDepth[@Fref], 0, 0;

	QWS_Make_Field_Menu 1;

//----------------Comodo Field
	setarray @pFmenuitems$[@Fi], "Comodo Fields";


	setarray @FLevels[@Fi], 9;
	setarray @FGat$[@Fref], "cmd_fild01", "cmd_fild02", "cmd_fild03",  "cmd_fild04", "cmd_fild05", "cmd_fild06", "cmd_fild07", "cmd_fild08", "cmd_fild09";
	setarray @FLevelName$[@Fref], "Comodo Field 1", "Comodo Field 2", "Comodo Field 3", "Comodo Field 4", "Comodo Field 5", "Comodo Field 6", "Comodo Field 7", "Comodo Field 8", "Comodo Field 9";
	setarray @FXcoords[@Fref], 180,231,191,228,224,190,234,194,172;
	setarray @FYcoords[@Fref], 178,160,172,194,203,223,177,175,172;
	setarray @FDepth[@Fref], 0, 0,0, 0,0, 0,0, 0,0;

	QWS_Make_Field_Menu 2;


//----------------Einbroch Field
	setarray @pFmenuitems$[@Fi], "Einbroch Fields";


	setarray @FLevels[@Fi], 10;
	setarray @FGat$[@Fref], "ein_fild01", "ein_fild02", "ein_fild03",  "ein_fild04", "ein_fild05", "ein_fild06", "ein_fild07", "ein_fild08", "ein_fild09", "ein_fild10";
	setarray @FLevelName$[@Fref], "Einbroch Field 1", "Einbroch Field 2", "Einbroch Field 3", "Einbroch Field 4", "Einbroch Field 5", "Einbroch Field 6", "Einbroch Field 7", "Einbroch Field 8", "Einbroch Field 9", "Einbroch Field 10";
	setarray @FXcoords[@Fref], 142, 182, 187, 185, 216, 195, 272, 173, 207, 196;
	setarray @FYcoords[@Fref], 225, 141, 228, 173, 173, 148, 220, 214, 174, 200;
	setarray @FDepth[@Fref], 0, 0,0, 0,0, 0,0, 0,0,0;

	QWS_Make_Field_Menu 3;


//----------------Geffen Field
	setarray @pFmenuitems$[@Fi], "Geffen Fields";


	setarray @FLevels[@Fi], 15;
	setarray @FGat$[@Fref], "gef_fild00", "gef_fild01", "gef_fild02", "gef_fild03",  "gef_fild04", "gef_fild05", "gef_fild06", "gef_fild07", "gef_fild08", "gef_fild09", "gef_fild10","gef_fild11","gef_fild12","gef_fild13","gef_fild14";
	setarray @FLevelName$[@Fref], "Geffen Field 0", "Geffen Field 1", "Geffen Field 2", "Geffen Field 3", "Geffen Field 4", "Geffen Field 5", "Geffen Field 6", "Geffen Field 7", "Geffen Field 8", "Geffen Field 9", "Geffen Field 10","Geffen Field 11","Geffen Field 12","Geffen Field 13","Geffen Field 14";
	setarray @FXcoords[@Fref], 46, 213, 195, 257, 188, 166, 248, 195, 186, 221, 178, 136, 240, 235, 211;
	setarray @FYcoords[@Fref], 199, 204, 212, 192, 171, 263, 158, 191, 183, 117, 218, 328, 181, 235, 185;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 4;

//----------------Gonryun Field
	setarray @pFmenuitems$[@Fi], "Gonryun Fields";


	setarray @FLevels[@Fi], 1;
	setarray @FGat$[@Fref], "gon_fild01";
	setarray @FLevelName$[@Fref], "Gonryun Field 1";
	setarray @FXcoords[@Fref], 220;
	setarray @FYcoords[@Fref], 227;
	setarray @FDepth[@Fref], 0;

	QWS_Make_Field_Menu 5;

//----------------Hugel Field
	setarray @pFmenuitems$[@Fi], "Hugel Fields";


	setarray @FLevels[@Fi], 7;
	setarray @FGat$[@Fref], "hu_fild01", "hu_fild02", "hu_fild03",  "hu_fild04", "hu_fild05", "hu_fild06", "hu_fild07";
	setarray @FLevelName$[@Fref], "Hugel Field 1", "Hugel Field 2", "Hugel Field 3", "Hugel Field 4", "Hugel Field 5", "Hugel Field 6", "Hugel Field 7";
	setarray @FXcoords[@Fref], 268, 222, 232, 252, 196, 216, 227;
	setarray @FYcoords[@Fref], 101, 193, 185, 189, 106, 220, 197;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 6;

//----------------Lighthalzen Field
	setarray @pFmenuitems$[@Fi], "Lighthalzen Fields";


	setarray @FLevels[@Fi], 3;
	setarray @FGat$[@Fref], "hu_fild01", "hu_fild02", "hu_fild03";
	setarray @FLevelName$[@Fref], "Lighthalzen Field 1", "Lighthalzen Field 2", "Lighthalzen Field 3";
	setarray @FXcoords[@Fref], 240, 185, 240;
	setarray @FYcoords[@Fref], 179, 235, 226;
	setarray @FDepth[@Fref], 0, 0, 0;

	QWS_Make_Field_Menu 7;

//----------------Louyang Field
	setarray @pFmenuitems$[@Fi], "Louyang Fields";


	setarray @FLevels[@Fi], 1;
	setarray @FGat$[@Fref], "lou_fild01";
	setarray @FLevelName$[@Fref], "Louyang Field 1";
	setarray @FXcoords[@Fref], 229;
	setarray @FYcoords[@Fref], 187;
	setarray @FDepth[@Fref], 0;

	QWS_Make_Field_Menu 8;

//----------------Lutie Field
	setarray @pFmenuitems$[@Fi], "Lutie Fields";


	setarray @FLevels[@Fi], 1;
	setarray @FGat$[@Fref], "xmas_fild01";
	setarray @FLevelName$[@Fref], "Lutie Field 1";
	setarray @FXcoords[@Fref], 115;
	setarray @FYcoords[@Fref], 145;
	setarray @FDepth[@Fref], 0;

	QWS_Make_Field_Menu 9;

//----------------Manuk Field
	setarray @pFmenuitems$[@Fi], "Manuk Fields";


	setarray @FLevels[@Fi], 3;
	setarray @FGat$[@Fref], "man_fild01", "man_fild02", "man_fild03";
	setarray @FLevelName$[@Fref], "Manuk Field 1", "Manuk Field 2", "Manuk Field 3";
	setarray @FXcoords[@Fref], 35, 35, 84;
	setarray @FYcoords[@Fref], 236, 262, 365;
	setarray @FDepth[@Fref], 0, 0, 0;

	QWS_Make_Field_Menu 10;

//----------------Mjolnir Field
	setarray @pFmenuitems$[@Fi], "Mjolnir Fields";


	setarray @FLevels[@Fi], 12;
	setarray @FGat$[@Fref], "mjolnir_01", "mjolnir_02", "mjolnir_03",  "mjolnir_04", "mjolnir_05", "mjolnir_06", "mjolnir_07", "mjolnir_08", "mjolnir_09", "mjolnir_10","mjolnir_11","mjolnir_12";
	setarray @FLevelName$[@Fref], "Mjolnir Field 1", "Mjolnir Field 2", "Mjolnir Field 3", "Mjolnir Field 4", "Mjolnir Field 5", "Mjolnir Field 6", "Mjolnir Field 7", "Mjolnir Field 8", "Mjolnir Field 9", "Mjolnir Field 10","Mjolnir Field 11","Mjolnir Field 12";
	setarray @FXcoords[@Fref], 204, 175, 208, 179, 181, 195, 235, 188, 205, 245, 180, 196;
	setarray @FYcoords[@Fref], 120, 193, 213, 180, 240, 270, 202, 215, 144, 223, 206, 208;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 11;

//----------------Moscovia Field
	setarray @pFmenuitems$[@Fi], "Moscovia Fields";


	setarray @FLevels[@Fi], 2;
	setarray @FGat$[@Fref], "mosk_fild01", "mosk_fild02";
	setarray @FLevelName$[@Fref], "Moscovia Field 1", "Moscovia Field 2";
	setarray @FXcoords[@Fref], 82, 131;
	setarray @FYcoords[@Fref], 104, 147;
	setarray @FDepth[@Fref], 0, 0;

	QWS_Make_Field_Menu 12;

//----------------Niflheim Field
	setarray @pFmenuitems$[@Fi], "Niflheim Fields";


	setarray @FLevels[@Fi], 2;
	setarray @FGat$[@Fref], "nif_fild01", "nif_fild02";
	setarray @FLevelName$[@Fref], "Niflheim Field 1", "Niflheim Field 2";
	setarray @FXcoords[@Fref], 215, 167;
	setarray @FYcoords[@Fref], 229, 234;
	setarray @FDepth[@Fref], 0, 0;

	QWS_Make_Field_Menu 13;

//----------------Payon Forest
	setarray @pFmenuitems$[@Fi], "Payon Forests";


	setarray @FLevels[@Fi], 11;
	setarray @FGat$[@Fref], "pay_fild01", "pay_fild02", "pay_fild03",  "pay_fild04", "pay_fild05", "pay_fild06", "pay_fild07", "pay_fild08", "pay_fild09", "pay_fild10","pay_fild11";
	setarray @FLevelName$[@Fref], "Payon Forest 1", "Payon Forest 2", "Payon Forest 3", "Payon Forest 4", "Payon Forest 5", "Payon Forest 6", "Payon Forest 7", "Payon Forest 8", "Payon Forest 9", "Payon Forest 10","Payon Forest 11";
	setarray @FXcoords[@Fref], 158, 151, 205, 186, 134, 193, 200, 137, 201, 160, 194;
	setarray @FYcoords[@Fref], 206, 219, 148, 247, 204, 235, 177, 189, 224, 205, 150;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 14;

//----------------Prontera Field
	setarray @pFmenuitems$[@Fi], "Prontera Fields";


	setarray @FLevels[@Fi], 12;
	setarray @FGat$[@Fref], "prt_fild00", "prt_fild01", "prt_fild02", "prt_fild03",  "prt_fild04", "prt_fild05", "prt_fild06", "prt_fild07", "prt_fild08", "prt_fild09", "prt_fild10","prt_fild11";
	setarray @FLevelName$[@Fref], "Prontera Field 0", "Prontera Field 1", "Prontera Field 2", "Prontera Field 3", "Prontera Field 4", "Prontera Field 5", "Prontera Field 6", "Prontera Field 7", "Prontera Field 8", "Prontera Field 9", "Prontera Field 10","Prontera Field 11";
	setarray @FXcoords[@Fref], 208, 190, 240, 190, 307, 239, 185, 193, 187, 210, 195, 198;
	setarray @FYcoords[@Fref], 227, 206, 206, 143, 252, 213, 188, 194, 218, 183, 149, 164;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 15;

//----------------Rachel Field
	setarray @pFmenuitems$[@Fi], "Rachel Fields";


	setarray @FLevels[@Fi], 13;
	setarray @FGat$[@Fref], "ra_fild01", "ra_fild02", "ra_fild03",  "ra_fild04", "ra_fild05", "ra_fild06", "ra_fild07", "ra_fild08", "ra_fild09", "ra_fild10","ra_fild11","ra_fild12","ra_fild13";
	setarray @FLevelName$[@Fref], "Rachel Field 1", "Rachel Field 2", "Rachel Field 3", "Rachel Field 4", "Rachel Field 5", "Rachel Field 6", "Rachel Field 7", "Rachel Field 8", "Rachel Field 9", "Rachel Field 10","Rachel Field 11","Rachel Field 12","Rachel Field 13";
	setarray @FXcoords[@Fref], 192, 235, 202, 202, 225, 202, 263, 217, 87, 277, 221, 175, 174;
	setarray @FYcoords[@Fref], 162, 166, 206, 208, 202, 214, 196, 201, 121, 181, 185, 200, 197;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 16;

//----------------Sograt Desert
	setarray @pFmenuitems$[@Fi], "Sograt Deserts";
	setarray @pFprice[@Fi], 0;
	setarray @pFfee$[@Fi], 0;
	setarray @FLevels[@Fi], 14;
	setarray @FGat$[@Fref], "moc_fild01","moc_fild02","moc_fild03","moc_fild07","moc_fild11","moc_fild12","moc_fild13","moc_fild16","moc_fild17","moc_fild18","moc_fild19","moc_fild20","moc_fild21","moc_fild22";
	setarray @FLevelName$[@Fref], "Sograt Desert 1", "Sograt Desert 2",  "Sograt Desert 3", "Sograt Desert 7", "Sograt Desert 11", "Sograt Desert 12", "Sograt Desert 13", "Sograt Desert 16", "Sograt Desert 17", "Sograt Desert 18", "Sograt Desert 19", "Sograt Desert 20", "Sograt Desert 21","Sograt Desert 22";
	setarray @FXcoords[@Fref], 219, 177, 194, 224, 198, 156, 185, 206, 208, 209, 85, 207, 31, 38;
	setarray @FYcoords[@Fref], 205, 206, 182, 170, 216, 187, 263, 228, 238, 223, 97, 202, 195, 195;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

QWS_Make_Field_Menu 17;

//----------------Splendide Field
	setarray @pFmenuitems$[@Fi], "Splendide Fields";


	setarray @FLevels[@Fi], 3;
	setarray @FGat$[@Fref], "spl_fild01", "spl_fild02", "spl_fild03";
	setarray @FLevelName$[@Fref], "Splendide Field 1", "Splendide Field 2", "Splendide Field 3";
	setarray @FXcoords[@Fref], 175, 236, 188;
	setarray @FYcoords[@Fref], 186, 184, 204;
	setarray @FDepth[@Fref], 0, 0, 0;

	QWS_Make_Field_Menu 18;

//----------------Umbala Field
	setarray @pFmenuitems$[@Fi], "Umbala Fields";


	setarray @FLevels[@Fi], 4;
	setarray @FGat$[@Fref], "um_fild01", "um_fild02", "um_fild03",  "um_fild04";
	setarray @FLevelName$[@Fref], "Umbala Field 1", "Umbala Field 2", "Umbala Field 3", "Umbala Field 4";
	setarray @FXcoords[@Fref], 217, 223, 237, 202;
	setarray @FYcoords[@Fref], 206, 221, 215, 197;
	setarray @FDepth[@Fref], 0, 0, 0, 0;

	QWS_Make_Field_Menu 19;

//----------------Veins Field
	setarray @pFmenuitems$[@Fi], "Veins Fields";


	setarray @FLevels[@Fi], 7;
	setarray @FGat$[@Fref], "ve_fild01", "ve_fild02", "ve_fild03",  "ve_fild04", "ve_fild05", "ve_fild06", "ve_fild07";
	setarray @FLevelName$[@Fref], "Veins Field 1", "Veins Field 2", "Veins Field 3", "Veins Field 4", "Veins Field 5", "Veins Field 6", "Veins Field 7";
	setarray @FXcoords[@Fref], 186, 196, 222, 51, 202, 150, 149;
	setarray @FYcoords[@Fref], 175, 370, 45, 250, 324, 223, 307;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 20;

//----------------Yuno Field
	setarray @pFmenuitems$[@Fi], "Yuno Fields";


	setarray @FLevels[@Fi], 12;
	setarray @FGat$[@Fref], "yuno_fild01", "yuno_fild02", "yuno_fild03",  "yuno_fild04", "yuno_fild05", "yuno_fild06", "yuno_fild07", "yuno_fild08", "yuno_fild09", "yuno_fild10","yuno_fild11","yuno_fild12";
	setarray @FLevelName$[@Fref], "Yuno Field' 1", "Yuno Field' 2", "Yuno Field' 3", "Yuno Field' 4", "Yuno Field' 5", "Yuno Field' 6", "Yuno Field' 7", "Yuno Field' 8", "Yuno Field' 9", "Yuno Field' 10","Yuno Field' 11", "Yuno Field' 12";
	setarray @FXcoords[@Fref], 189, 192, 221, 226, 223, 187, 231, 196, 183, 200, 195, 210;
	setarray @FYcoords[@Fref], 224, 207, 157, 199, 177, 232, 174, 203, 214, 124, 226, 304;
	setarray @FDepth[@Fref], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;

	QWS_Make_Field_Menu 21;

//----------------Cancel
	setarray @pFmenuitems$[@Fi], "Cancel";


	set @Fmenulist$[@Fj],@pFmenuitems$[@Fi];
	set @Fmenuref[@Fj],57005; // 57005='dead' in hex
	return;


//----------------Make Field Menu Function

function	QWS_Make_Field_Menu	{
	set @tempfieldmenubin,1;
	if (getarg(0) == 0) goto menu_item;
	set @temploopfieldmenu,0;
	do {
		set @tempfieldmenubin, @tempfieldmenubin * 2;
		set @temploopfieldmenu, @temploopfieldmenu + 1;
		}while (getarg(0) > @temploopfieldmenu);
// check marker and make menu item
menu_item:
	if ((@tempfieldmenubin & ##QWS_F_Unlock) != @tempfieldmenubin) {
		setarray @FLocRef[@Fi], @Fref;
		set @Fref, @Fref+@FLevels[@Fi];
		set @Fi,@Fi+1;
		return;
	}
	if ($QW_MapUserShow == 1) {
		set @tempmapusers,0;
		set @mapusersloop,0;
		do {
			set @tempmapusers,(getmapusers(@FGat$[@Fref+@mapusersloop]) + @tempmapusers);
			set @mapusersloop, (@mapusersloop + 1);
		} while (@FLevels[@Fi] > @mapusersloop);
		if (@pFprice[@Fi] != 0) set @Fmenulist$[@Fj], @pFmenuitems$[@Fi]+" ["+@tempmapusers+"] -> "+@pFprice[@Fi];
		if (@pFprice[@Fi] == 0) set @Fmenulist$[@Fj], @pFmenuitems$[@Fi]+" ["+@tempmapusers+"]";
		set @Fmenuref[@Fj],@Fi;
		set @Fj,@Fj+1;
		setarray @FLocRef[@Fi], @Fref;
		set @Fref, @Fref+@FLevels[@Fi];
		set @Fi,@Fi+1;
		return;
	}
	if (@pFprice[@Fi] != 0) set @Fmenulist$[@Fj], @pFmenuitems$[@Fi]+" -> "+@pFprice[@Fi];
	if (@pFprice[@Fi] == 0) set @Fmenulist$[@Fj], @pFmenuitems$[@Fi];
	set @Fmenuref[@Fj],@Fi;
	set @Fj,@Fj+1;
	setarray @FLocRef[@Fi], @Fref;
	set @Fref, @Fref+@FLevels[@Fi];
	set @Fi,@Fi+1;
	return;
}
}

function	script	QWS_FLarray	{
//----------------Start building Menu
	set @FWref,@FLocRef[@FwarpMenu]; // reference to the arrays with leveldata
	set @FWi,0;  // loop counter
	set @FWj,0; // menu lines counter
	cleararray @FWLmenulist$[0],"",20; // Clearing the array to get rid off ghost items in menu
	do {
		if ($QW_FL == 0)||($QW_FDL >= @FDepth[@FWref]) {
			set @warpprice, 25 * BaseLevel;
			if (@warpprice != 0)&&($QW_MapUserShow == 0) set @FWLmenulist$[@FWj], @FLevelName$[@FWref]+" -> "+@warpprice;
			if (@warpprice == 0)&&($QW_MapUserShow == 0) set @FWLmenulist$[@FWj], @FLevelName$[@FWref];
			if (@warpprice != 0)&&($QW_MapUserShow == 1) set @FWLmenulist$[@FWj], @FLevelName$[@FWref]+" ["+getmapusers(@FGat$[@FWref])+"] -> "+@warpprice;
			if (@warpprice == 0)&&($QW_MapUserShow == 1) set @FWLmenulist$[@FWj], @FLevelName$[@FWref]+" ["+getmapusers(@FGat$[@FWref])+"]";
			set @FWLmenuref[@FWj],@FWref;
			set @FWj,@FWj+1;
		}
		set @FWref, @FWref+1;
		set @FWi,@FWi+1;
	} while (@FWi < @FLevels[@FwarpMenu]);
	set @FWLmenulist$[@FWj], "Exit";
	set @FWLmenuref[@FWj],57005; // 57005='dead' in hex
	return;
}


//====================City=Dungeon=Menu=Arrays==========================
// Adding a dungeon:
//	setarray @pCDmenuitems$[@CDi], "Abyss Lake";	// Name of Dungeon shown in Dungeon select Menu
//		// Warp prices: Basic (0), Advanced (0), Overseas (0)
//		// Identifier for fee caluclation: Basic (0), Advanced (0), Overseas (0)
//	setarray @CDLevels[@CDi], 3;			// Number of levels in dungeon
//
//	setarray @CDGat$[@CDref], "abyss_01", "abyss_02", "abyss_03";	// Map names of dungeon levels
//	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3";	// Name of dungeon levels shown in Menu
//	setarray @CDXcoords[@CDref], 265, 275, 116;			// X warp coords
//	setarray @CDYcoords[@CDref], 273, 270, 27;			// Y warp coords
//	setarray @CDDepth[@CDref], 0, 1, 2;				// Relative depth to entrance, to calculate extra warp fee
//
//	QWS_Make_CityDungeon_Menu 0;	// Use a free number (last used is 28, Kiel Dungeon)
//
// Adding a warpra:
//	map,x,y,facing	script	Warpra Helper#example	112,{
//		callfunc "QWS_CityDungeon_Warpra",<city dungeon number>,"Your City Dungeon";
//		close;
//	}
//	City Dungeon number is the same as "QWS_Make_CityDungeon_Menu".
//==================================================================

function	script	QWS_CDarray	{
	function QWS_Make_CityDungeon_Menu;

	set @CDi,0;
	set @CDj,0;
	set @CDref,0;


//----------------AMATSU DUNGEON
	setarray @pCDmenuitems$[@CDi], "Amatsu Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "ama_dun01", "ama_dun02", "ama_dun03";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3";
	setarray @CDXcoords[@CDref], 228, 34, 119;
	setarray @CDYcoords[@CDref], 11, 41, 14;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 0;

//----------------AYOTAYA
	setarray @pCDmenuitems$[@CDi], "Ayothaya Dungeon";


	setarray @CDLevels[@CDi], 2;

	setarray @CDGat$[@CDref], "ayo_dun01", "ayo_dun02";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2";
	setarray @CDXcoords[@CDref], 275, 24;
	setarray @CDYcoords[@CDref], 19, 26;
	setarray @CDDepth[@CDref], 0, 1;

	QWS_Make_CityDungeon_Menu 1;
	
//----------------Baldur Guild Dungeon
	setarray @pCDmenuitems$[@CDi], "Baldur Guild Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "gld_dun01", "gld_dun01_2", "gld2_pay";
	setarray @CDLevelName$[@CDref], "Baldur", "Baldur", "Hall of Abyss";
	setarray @CDXcoords[@CDref], 119, 119, 120;
	setarray @CDYcoords[@CDref], 93, 93, 130;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 2;
	
//----------------Beach Dungeon
	setarray @pCDmenuitems$[@CDi], "Beach Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "beach_dun", "beach_dun2", "beach_dun3";
	setarray @CDLevelName$[@CDref], "Beach Dungeon 1", "Beach Dungeon 2", "Beach Dungeon 3";
	setarray @CDXcoords[@CDref], 266, 255, 23;
	setarray @CDYcoords[@CDref], 67, 244, 260;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 3;
	
//----------------Britoniah Guild Dungeon
	setarray @pCDmenuitems$[@CDi], "Britoniah Guild Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "gld_dun04", "gld_dun04_2", "gld2_gef";
	setarray @CDLevelName$[@CDref], "Britoniah", "Britoniah", "Hall of Abyss";
	setarray @CDXcoords[@CDref], 116, 116, 152;
	setarray @CDYcoords[@CDref], 45, 45, 118;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 4;

//----------------BYALAN
	setarray @pCDmenuitems$[@CDi], "Byalan Dungeon";


	setarray @CDLevels[@CDi], 5;

	setarray @CDGat$[@CDref], "iz_dun00", "iz_dun01", "iz_dun02", "iz_dun03", "iz_dun04";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
	setarray @CDXcoords[@CDref], 168, 253, 236, 32, 26;
	setarray @CDYcoords[@CDref], 168, 252, 204, 63, 27;
	setarray @CDDepth[@CDref], 0, 1, 2, 3, 4;

	QWS_Make_CityDungeon_Menu 5;

//----------------CLOCK TOWER
	setarray @pCDmenuitems$[@CDi], "Clock Tower Dungeon";


	setarray @CDLevels[@CDi], 8;

	setarray @CDGat$[@CDref], "c_tower1", "c_tower2", "c_tower3", "c_tower4", "alde_dun01", "alde_dun02", "alde_dun03", "alde_dun04";
	setarray @CDLevelName$[@CDref], "Clock Tower Level 1", "Clock Tower Level 2", "Clock Tower Level 3", "Clock Tower Level 4", "Basement 1F", "Basement 2F", "Basement 3F", "Basement 4F";
	setarray @CDXcoords[@CDref], 199, 148, 65, 56, 297, 127, 277, 268;
	setarray @CDYcoords[@CDref], 159, 283, 147, 155, 25, 169, 178, 74;
	setarray @CDDepth[@CDref], 0, 1, 2, 3, 1, 2, 3, 4;

	QWS_Make_CityDungeon_Menu 6;


//----------------CULVERT
	setarray @pCDmenuitems$[@CDi], "Culvert Dungeon";


	setarray @CDLevels[@CDi], 4;

	setarray @CDGat$[@CDref], "prt_sewb1", "prt_sewb2", "prt_sewb3", "prt_sewb4";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3", "Level 4";
	setarray @CDXcoords[@CDref], 131, 19, 180, 100;
	setarray @CDYcoords[@CDref], 247, 19, 169, 92;
	setarray @CDDepth[@CDref], 0, 1, 2, 3;

	QWS_Make_CityDungeon_Menu 7;
	
//----------------EINBECH DUNGEON
	setarray @pCDmenuitems$[@CDi], "Einbech Dungeon";


	setarray @CDLevels[@CDi], 2;

	setarray @CDGat$[@CDref], "ein_dun01", "ein_dun02";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2";
	setarray @CDXcoords[@CDref], 22, 292;
	setarray @CDYcoords[@CDref], 14, 290;
	setarray @CDDepth[@CDref], 0, 1;

	QWS_Make_CityDungeon_Menu 8;


//----------------GEFFEN DUNGEON
	setarray @pCDmenuitems$[@CDi], "Geffen Dungeon";


	setarray @CDLevels[@CDi], 4;

	setarray @CDGat$[@CDref], "gef_dun00", "gef_dun01", "gef_dun02", "gef_dun03";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3", "Level 4";
	setarray @CDXcoords[@CDref], 104, 115, 106, 203;
	setarray @CDYcoords[@CDref], 99, 236, 132, 200;
	setarray @CDDepth[@CDref], 0, 1, 2, 3;

	QWS_Make_CityDungeon_Menu 9;


//----------------GONRYUN DUNGEON
	setarray @pCDmenuitems$[@CDi], "Gonryun Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "gon_dun01", "gon_dun02", "gon_dun03";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3";
	setarray @CDXcoords[@CDref], 153, 28, 68;
	setarray @CDYcoords[@CDref], 53, 113, 16;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 10;


//----------------LIGHTHALZEN BIO LAB
	setarray @pCDmenuitems$[@CDi], "Lighthalzen Bio Lab";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "lhz_dun01", "lhz_dun02", "lhz_dun03";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3";
	setarray @CDXcoords[@CDref], 150, 150, 140;
	setarray @CDYcoords[@CDref], 288, 18, 134;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 11;

//----------------LOUYANG DUNGEON
	setarray @pCDmenuitems$[@CDi], "Louyang Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "lou_dun01", "lou_dun02", "lou_dun03";
	setarray @CDLevelName$[@CDref], "Royal Tomb Level 1", "Royal Tomb Level 2", "Royal Tomb Level 3";
	setarray @CDXcoords[@CDref], 218, 282, 165;
	setarray @CDYcoords[@CDref], 196, 20, 38;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 12;
	
//----------------Luina Guild Dungeon
	setarray @pCDmenuitems$[@CDi], "Luina Guild Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "gld_dun02", "gld_dun02_2", "gld2_ald";
	setarray @CDLevelName$[@CDref], "Luina", "Luina", "Hall of Abyss";
	setarray @CDXcoords[@CDref], 39, 39, 147;
	setarray @CDYcoords[@CDref], 161, 161, 155;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 13;

//----------------PAYON DUNGEON
	setarray @pCDmenuitems$[@CDi], "Payon Dungeon";


	setarray @CDLevels[@CDi], 5;

	setarray @CDGat$[@CDref], "pay_dun00", "pay_dun01", "pay_dun02", "pay_dun03", "pay_dun04";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
	setarray @CDXcoords[@CDref], 21, 19, 19, 155, 201;
	setarray @CDYcoords[@CDref], 183, 33, 63, 159, 204;
	setarray @CDDepth[@CDref], 0, 1, 2, 3, 4;

	QWS_Make_CityDungeon_Menu 14;

//----------------PYRAMIDS
	setarray @pCDmenuitems$[@CDi], "Pyramids Dungeon";


	setarray @CDLevels[@CDi], 6;

	setarray @CDGat$[@CDref], "moc_pryd01", "moc_pryd02", "moc_pryd03", "moc_pryd04", "moc_pryd05", "moc_pryd06";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3", "Level 4", "Basement 1", "Basement 2";
	setarray @CDXcoords[@CDref], 192, 10, 100, 181, 94, 192;
	setarray @CDYcoords[@CDref], 9, 192, 92, 11, 96, 8;
	setarray @CDDepth[@CDref], 0, 1, 2, 3, 1, 2;

	QWS_Make_CityDungeon_Menu 15;
	
//----------------Rachel Sanctuary
	setarray @pCDmenuitems$[@CDi], "Rachel Sanctuary";


	setarray @CDLevels[@CDi], 5;

	setarray @CDGat$[@CDref], "ra_san01", "ra_san02", "ra_san03", "ra_san04", "ra_san05";
	setarray @CDLevelName$[@CDref], "Rachel Sanctuary 1", "Rachel Sanctuary 2", "Rachel Sanctuary 3", "Rachel Sanctuary 4", "Rachel Sanctuary 5";
	setarray @CDXcoords[@CDref], 140, 32, 8, 204, 150;
	setarray @CDYcoords[@CDref], 11, 21, 149, 218, 9;
	setarray @CDDepth[@CDref], 0, 1, 2, 3, 4;

	QWS_Make_CityDungeon_Menu 16;

//----------------SPHINX
	setarray @pCDmenuitems$[@CDi], "Sphinx Dungeon";


	setarray @CDLevels[@CDi], 5;

	setarray @CDGat$[@CDref], "in_sphinx1", "in_sphinx2", "in_sphinx3", "in_sphinx4", "in_sphinx5";
	setarray @CDLevelName$[@CDref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
	setarray @CDXcoords[@CDref], 288, 149, 210, 10, 100;
	setarray @CDYcoords[@CDref], 9, 81, 54, 222, 99;
	setarray @CDDepth[@CDref], 0, 1, 2, 3, 4;

	QWS_Make_CityDungeon_Menu 17;


//----------------TOY FACTORY
	setarray @pCDmenuitems$[@CDi], "Toy Factory Dungeon";


	setarray @CDLevels[@CDi], 2;

	setarray @CDGat$[@CDref], "xmas_dun01", "xmas_dun02";
	setarray @CDLevelName$[@CDref], "Factory Warehouse", "Classifying Room";
	setarray @CDXcoords[@CDref], 205, 129;
	setarray @CDYcoords[@CDref], 15, 133;
	setarray @CDDepth[@CDref], 0, 1;

	QWS_Make_CityDungeon_Menu 18;

//----------------UMBALA
	setarray @pCDmenuitems$[@CDi], "Umbala Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "um_dun01", "um_dun02", "yggdrasil01";;
	setarray @CDLevelName$[@CDref], "Carpenter's Shop in The Tree", "Passage to a Foreign World", "Hvergelmir's Fountain";
	setarray @CDXcoords[@CDref], 42, 48, 204;
	setarray @CDYcoords[@CDref], 31, 30, 78;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 19;
	
//----------------Valkyrie Guild Dungeon
	setarray @pCDmenuitems$[@CDi], "Valkyrie Guild Dungeon";


	setarray @CDLevels[@CDi], 3;

	setarray @CDGat$[@CDref], "gld_dun03", "gld_dun03_2", "gld2_prt";
	setarray @CDLevelName$[@CDref], "Valkyrie", "Valkyrie", "Hall of Abyss";
	setarray @CDXcoords[@CDref], 50, 50, 140;
	setarray @CDYcoords[@CDref], 44, 44, 132;
	setarray @CDDepth[@CDref], 0, 1, 2;

	QWS_Make_CityDungeon_Menu 20;

//----------------Cancel
	setarray @pCDmenuitems$[@CDi], "Cancel";


	set @CDmenulist$[@CDj],@pCDmenuitems$[@CDi];
	set @CDmenuref[@CDj],57005; // 57005='dead' in hex
	return;


//----------------Make City Dungeon Menu Function

function	QWS_Make_CityDungeon_Menu	{
	set @tempcitydungeonmenubin,1;
	if (getarg(0) == 0) goto menu_item;
	set @temploopcitydungeonmenu,0;
	do {
		set @tempcitydungeonmenubin, @tempcitydungeonmenubin * 2;
		set @temploopcitydungeonmenu, @temploopcitydungeonmenu + 1;
		}while (getarg(0) > @temploopcitydungeonmenu);
// check marker and make menu item
menu_item:
	if ((@tempcitydungeonmenubin & ##QWS_CD_Unlock) != @tempcitydungeonmenubin) {
		setarray @CDLocRef[@CDi], @CDref;
		set @CDref, @CDref+@CDLevels[@CDi];
		set @CDi,@CDi+1;
		return;
	}
	if ($QW_MapUserShow == 1) {
		set @tempmapusers,0;
		set @mapusersloop,0;
		do {
			set @tempmapusers,(getmapusers(@CDGat$[@CDref+@mapusersloop]) + @tempmapusers);
			set @mapusersloop, (@mapusersloop + 1);
		} while (@CDLevels[@CDi] > @mapusersloop);
		if (@pCDprice[@CDi] != 0) set @CDmenulist$[@CDj], @pCDmenuitems$[@CDi]+" ["+@tempmapusers+"] -> "+@pCDprice[@CDi];
		if (@pCDprice[@CDi] == 0) set @CDmenulist$[@CDj], @pCDmenuitems$[@CDi]+" ["+@tempmapusers+"]";
		set @CDmenuref[@CDj],@CDi;
		set @CDj,@CDj+1;
		setarray @CDLocRef[@CDi], @CDref;
		set @CDref, @CDref+@CDLevels[@CDi];
		set @CDi,@CDi+1;
		return;
	}
	if (@pCDprice[@CDi] != 0) set @CDmenulist$[@CDj], @pCDmenuitems$[@CDi]+" -> "+@pCDprice[@CDi];
	if (@pCDprice[@CDi] == 0) set @CDmenulist$[@CDj], @pCDmenuitems$[@CDi];
	set @CDmenuref[@CDj],@CDi;
	set @CDj,@CDj+1;
	setarray @CDLocRef[@CDi], @CDref;
	set @CDref, @CDref+@CDLevels[@CDi];
	set @CDi,@CDi+1;
	return;
}
}

function	script	QWS_CDLarray	{
//----------------Start building Menu
	set @CDWref,@CDLocRef[@CDwarpMenu]; // reference to the arrays with leveldata
	set @CDWi,0;  // loop counter
	set @CDWj,0; // menu lines counter
	cleararray @CDWLmenulist$[0],"",15; // Clearing the array to get rid off ghost items in menu
	do {
		if ($QW_CDL == 0)||($QW_CDDL >= @CDDepth[@CDWref]) {
			set @warpprice, 25 * BaseLevel;
			if (@warpprice != 0)&&($QW_MapUserShow == 0) set @CDWLmenulist$[@CDWj], @CDLevelName$[@CDWref]+" -> "+@warpprice;
			if (@warpprice == 0)&&($QW_MapUserShow == 0) set @CDWLmenulist$[@CDWj], @CDLevelName$[@CDWref];
			if (@warpprice != 0)&&($QW_MapUserShow == 1) set @CDWLmenulist$[@CDWj], @CDLevelName$[@CDWref]+" ["+getmapusers(@CDGat$[@CDWref])+"] -> "+@warpprice;
			if (@warpprice == 0)&&($QW_MapUserShow == 1) set @CDWLmenulist$[@CDWj], @CDLevelName$[@CDWref]+" ["+getmapusers(@CDGat$[@CDWref])+"]";
			set @CDWLmenuref[@CDWj],@CDWref;
			set @CDWj,@CDWj+1;
		}
		set @CDWref, @CDWref+1;
		set @CDWi,@CDWi+1;
	} while (@CDWi < @CDLevels[@CDwarpMenu]);
	set @CDWLmenulist$[@CDWj], "Exit";
	set @CDWLmenuref[@CDWj],57005; // 57005='dead' in hex
	return;
}


//====================Dungeon=Menu=Arrays==========================
// Adding a dungeon:
//	setarray @pDmenuitems$[@Di], "Abyss Lake";	// Name of Dungeon shown in Dungeon select Menu
//		// Warp prices: Basic (0), Advanced (0), Overseas (0)
//		// Identifier for fee caluclation: Basic (0), Advanced (0), Overseas (0)
//	setarray @DLevels[@Di], 3;			// Number of levels in dungeon
//
//	setarray @DGat$[@Dref], "abyss_01", "abyss_02", "abyss_03";	// Map names of dungeon levels
//	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";	// Name of dungeon levels shown in Menu
//	setarray @DXcoords[@Dref], 265, 275, 116;			// X warp coords
//	setarray @DYcoords[@Dref], 273, 270, 27;			// Y warp coords
//	setarray @DDepth[@Dref], 0, 1, 2;				// Relative depth to entrance, to calculate extra warp fee
//
//	QWS_Make_Dungeon_Menu 0;	// Use a free number (last used is 28, Kiel Dungeon)
//
// Adding a warpra:
//	map,x,y,facing	script	Warpra Helper#example	112,{
//		callfunc "QWS_Dungeon_Warpra",<dungeon number>,"Your Dungeon";
//		close;
//	}
//	Dungeon number is the same as "QWS_Make_Dungeon_Menu".
//==================================================================

function	script	QWS_Darray	{
	function QWS_Make_Dungeon_Menu;

	set @Di,0;
	set @Dj,0;
	set @Dref,0;

//----------------ABYSS LAKE
	setarray @pDmenuitems$[@Di], "Abyss Lake";


	setarray @DLevels[@Di], 3;

	setarray @DGat$[@Dref], "abyss_01", "abyss_02", "abyss_03";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
	setarray @DXcoords[@Dref], 261, 275, 116;
	setarray @DYcoords[@Dref], 272, 270, 27;
	setarray @DDepth[@Dref], 0, 1, 2;

	QWS_Make_Dungeon_Menu 0;

//----------------ANT HELL
	setarray @pDmenuitems$[@Di], "Ant Hell Dungeon"; 


	setarray @DLevels[@Di], 2;

	setarray @DGat$[@Dref], "anthell01", "anthell02";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2";
	setarray @DXcoords[@Dref], 35, 168;
	setarray @DYcoords[@Dref], 262, 170;
	setarray @DDepth[@Dref], 0, 1;

	QWS_Make_Dungeon_Menu 1;


//----------------COAL MINE
	setarray @pDmenuitems$[@Di], "Coal Mine Dungeon";


	setarray @DLevels[@Di], 3;

	setarray @DGat$[@Dref], "mjo_dun01", "mjo_dun02", "mjo_dun03";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
	setarray @DXcoords[@Dref], 52, 381, 302;
	setarray @DYcoords[@Dref], 17, 343, 262;
	setarray @DDepth[@Dref], 0, 1, 2;

	QWS_Make_Dungeon_Menu 2;


//----------------Cursed Abbey
	setarray @pDmenuitems$[@Di], "Cursed Abbey";


	setarray @DLevels[@Di], 3;

	setarray @DGat$[@Dref], "abbey01", "abbey02", "abbey03";
	setarray @DLevelName$[@Dref], "Cursed Abbey 1", "Cursed Abbey 2", "Cursed Abbey 3";
	setarray @DXcoords[@Dref], 266, 255, 23;
	setarray @DYcoords[@Dref], 67, 244, 260;
	setarray @DDepth[@Dref], 0, 1, 2;

	QWS_Make_Dungeon_Menu 3;


//----------------GEFENIA DUNGEON
	setarray @pDmenuitems$[@Di], "Gefenia Dungeon";


	setarray @DLevels[@Di], 4;

	setarray @DGat$[@Dref], "gefenia01", "gefenia02", "gefenia03", "gefenia04";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
	setarray @DXcoords[@Dref], 40, 203, 266, 130;
	setarray @DYcoords[@Dref], 103, 34, 168, 272;
	setarray @DDepth[@Dref], 0, 1, 2, 3;

	QWS_Make_Dungeon_Menu 5;


//----------------GLAST HEIM
	setarray @pDmenuitems$[@Di], "Glast Heim Dungeon";


	setarray @DLevels[@Di], 17;

	setarray @DGat$[@Dref], "glast_01",  "gl_cas01", "gl_cas02", "gl_knt01", "gl_knt02", "gl_chyard", "gl_sew01", "gl_sew02", "gl_sew03", "gl_sew04", "gl_church", "gl_step", "gl_dun01", "gl_dun02", "gl_prison", "gl_prison1", "gl_in01";
	setarray @DLevelName$[@Dref], "Glast Heim Entrance", "Castle 1", "Castle 2", "Chivalry 1", "Chivalry 2", "Churchyard", "Sewers 1", "Sewers 2", "Sewers 3", "Sewers 4", "St. Abbey", "Steps", "Lowest Cave 1", "Lowest Cave 2", "Prison 1", "Prison 2", "Inside Glast Heim";
	setarray @DXcoords[@Dref], 370, 199, 104, 150, 157, 147, 258, 108, 171, 68, 156, 12, 133, 224, 14, 150, 121;
	setarray @DYcoords[@Dref], 304, 29, 25, 15, 287, 15, 255, 291, 283, 277, 7, 7, 271, 274, 70, 14, 59;
	setarray @DDepth[@Dref], 0, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 4, 5, 6, 1;

	QWS_Make_Dungeon_Menu 7;


//----------------HIDDEN DUNGEON
	setarray @pDmenuitems$[@Di], "Hidden Dungeon";


	setarray @DLevels[@Di], 3;

	setarray @DGat$[@Dref], "prt_maze01", "prt_maze02", "prt_maze03";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
	setarray @DXcoords[@Dref], 176, 93, 23;
	setarray @DYcoords[@Dref], 7, 20, 8;
	setarray @DDepth[@Dref], 0, 1, 2;

	QWS_Make_Dungeon_Menu 8;
	
//----------------Ice Dungeon
	setarray @pDmenuitems$[@Di], "Ice Dungeon";


	setarray @DLevels[@Di], 4;

	setarray @DGat$[@Dref], "ice_dun01", "ice_dun02", "ice_dun03", "ice_dun04";
	setarray @DLevelName$[@Dref], "Ice Dungeon 1", "Ice Dungeon 2", "Ice Dungeon 3", "Ice Dungeon 4";
	setarray @DXcoords[@Dref], 157, 151, 149, 33;
	setarray @DYcoords[@Dref], 14, 155, 22, 158;
	setarray @DDepth[@Dref], 0, 1, 2, 3;

	QWS_Make_Dungeon_Menu 9;

//----------------JUPEROS CAVE
	setarray @pDmenuitems$[@Di], "Juperos Cave";


	setarray @DLevels[@Di], 4;

	setarray @DGat$[@Dref], "jupe_cave", "juperos_01", "juperos_02", "jupe_core";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
	setarray @DXcoords[@Dref], 140, 53, 37, 150;
	setarray @DYcoords[@Dref], 51, 247, 63, 285;
	setarray @DDepth[@Dref], 0, 1, 2, 3;

	QWS_Make_Dungeon_Menu 10;

//----------------KIEL DUNGEON
	setarray @pDmenuitems$[@Di], "Kiel Dungeon";


	setarray @DLevels[@Di], 2;

	setarray @DGat$[@Dref], "kh_dun01", "kh_dun02";
	setarray @DLevelName$[@Dref], "1st Floor", "2nd Floor";
	setarray @DXcoords[@Dref], 28, 41;
	setarray @DYcoords[@Dref], 226, 198;
	setarray @DDepth[@Dref], 0, 1;

	QWS_Make_Dungeon_Menu 11;

//----------------MAGMA DUNGEON
	setarray @pDmenuitems$[@Di], "Magma Dungeon";


	setarray @DLevels[@Di], 2;

	setarray @DGat$[@Dref], "mag_dun01", "mag_dun02";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2";
	setarray @DXcoords[@Dref], 126, 47;
	setarray @DYcoords[@Dref], 68, 30;
	setarray @DDepth[@Dref], 0, 1;

	QWS_Make_Dungeon_Menu 12;
	
//----------------Nidhogg's Dungeon
	setarray @pDmenuitems$[@Di], "Nidhogg's Dungeon";


	setarray @DLevels[@Di], 2;

	setarray @DGat$[@Dref], "nyd_dun01", "nyd_dun02";
	setarray @DLevelName$[@Dref], "Nidhogg's Dungeon 1", "Nidhogg's Dungeon 2";
	setarray @DXcoords[@Dref], 61, 60;
	setarray @DYcoords[@Dref], 239, 271;
	setarray @DDepth[@Dref], 0, 1;

	QWS_Make_Dungeon_Menu 13;


//----------------ODIN TEMPLE
	setarray @pDmenuitems$[@Di], "Odin Temple";


	setarray @DLevels[@Di], 3;

	setarray @DGat$[@Dref], "odin_tem01", "odin_tem02", "odin_tem03";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
	setarray @DXcoords[@Dref], 298, 224, 266;
	setarray @DYcoords[@Dref], 167, 149, 280;
	setarray @DDepth[@Dref], 0, 1, 2;

	QWS_Make_Dungeon_Menu 14;

//----------------ORC DUNGEON
	setarray @pDmenuitems$[@Di], "Orc Dungeon";


	setarray @DLevels[@Di], 2;

	setarray @DGat$[@Dref], "orcsdun01", "orcsdun02";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2";
	setarray @DXcoords[@Dref], 32, 21;
	setarray @DYcoords[@Dref], 170, 185;
	setarray @DDepth[@Dref], 0, 1;

	QWS_Make_Dungeon_Menu 15;


//----------------SUNKEN SHIP
	setarray @pDmenuitems$[@Di], "Sunken Ship Dungeon";


	setarray @DLevels[@Di], 2;

	setarray @DGat$[@Dref], "treasure01", "treasure02";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2";
	setarray @DXcoords[@Dref], 69, 102;
	setarray @DYcoords[@Dref], 24, 27;
	setarray @DDepth[@Dref], 0, 1;

	QWS_Make_Dungeon_Menu 16;

//----------------THANATOS TOWER
	setarray @pDmenuitems$[@Di], "Thanatos Tower";


	setarray @DLevels[@Di], 13;

	setarray @DGat$[@Dref], "tha_t01", "tha_t02", "tha_t03", "tha_t04", "tha_t05", "tha_t06", "tha_t07", "tha_t08", "tha_t09", "tha_t10", "tha_t11", "tha_t12", "thana_boss";
	setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6", "Level 7", "Level 8", "Level 9", "Level 10", "Level 11", "Level 12", "Thanatos Boss";
	setarray @DXcoords[@Dref], 150, 150, 220, 59, 62, 206, 35, 105, 88, 168, 90, 129, 85;
	setarray @DYcoords[@Dref], 35, 136, 158, 143, 11, 8, 166, 44, 145, 138, 36, 83, 76;
	setarray @DDepth[@Dref], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;

	QWS_Make_Dungeon_Menu 17;
	
//----------------Thor Volcano
	setarray @pDmenuitems$[@Di], "Thor Volcano";


	setarray @DLevels[@Di], 3;

	setarray @DGat$[@Dref], "thor_v01", "thor_v02", "thor_v03";
	setarray @DLevelName$[@Dref], "Thor Volcano 1", "Thor Volcano 2", "Thor Volcano 3";
	setarray @DXcoords[@Dref], 21, 75, 34;
	setarray @DYcoords[@Dref], 228, 205, 272;
	setarray @DDepth[@Dref], 0, 1, 2;

	QWS_Make_Dungeon_Menu 18;


//----------------TURTLE ISTLAND
	setarray @pDmenuitems$[@Di], "Turtle Island Dungeon";


	setarray @DLevels[@Di], 4;

	setarray @DGat$[@Dref], "tur_dun01", "tur_dun02", "tur_dun03", "tur_dun04";
	setarray @DLevelName$[@Dref], "Outside", "Level 1", "Level 2", "Level 3";
	setarray @DXcoords[@Dref], 154, 148, 132, 100;
	setarray @DYcoords[@Dref], 49, 261, 189, 192;
	setarray @DDepth[@Dref], 0, 0, 1, 2;

	QWS_Make_Dungeon_Menu 19;

//----------------Cancel
	setarray @pDmenuitems$[@Di], "Cancel";


	set @Dmenulist$[@Dj],@pDmenuitems$[@Di];
	set @Dmenuref[@Dj],57005; // 57005='dead' in hex
	return;


//----------------Make Dungeon Menu Function

function	QWS_Make_Dungeon_Menu	{
	set @tempdungeonmenubin,1;
	if (getarg(0) == 0) goto menu_item;
	set @temploopdungeonmenu,0;
	do {
		set @tempdungeonmenubin, @tempdungeonmenubin * 2;
		set @temploopdungeonmenu, @temploopdungeonmenu + 1;
		}while (getarg(0) > @temploopdungeonmenu);
// check marker and make menu item
menu_item:
	if ((@tempdungeonmenubin & ##QWS_D_Unlock) != @tempdungeonmenubin) {
		setarray @DLocRef[@Di], @Dref;
		set @Dref, @Dref+@DLevels[@Di];
		set @Di,@Di+1;
		return;
	}
	if ($QW_MapUserShow == 1) {
		set @tempmapusers,0;
		set @mapusersloop,0;
		do {
			set @tempmapusers,(getmapusers(@DGat$[@Dref+@mapusersloop]) + @tempmapusers);
			set @mapusersloop, (@mapusersloop + 1);
		} while (@DLevels[@Di] > @mapusersloop);
		if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"] -> "+@pDprice[@Di];
		if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"]";
		set @Dmenuref[@Dj],@Di;
		set @Dj,@Dj+1;
		setarray @DLocRef[@Di], @Dref;
		set @Dref, @Dref+@DLevels[@Di];
		set @Di,@Di+1;
		return;
	}
	if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" -> "+@pDprice[@Di];
	if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di];
	set @Dmenuref[@Dj],@Di;
	set @Dj,@Dj+1;
	setarray @DLocRef[@Di], @Dref;
	set @Dref, @Dref+@DLevels[@Di];
	set @Di,@Di+1;
	return;
}
}

function	script	QWS_DLarray	{
//----------------Start building Menu
	set @DWref,@DLocRef[@DwarpMenu]; // reference to the arrays with leveldata
	set @DWi,0;  // loop counter
	set @DWj,0; // menu lines counter
	cleararray @DWLmenulist$[0],"",15; // Clearing the array to get rid off ghost items in menu
	do {
		if ($QW_DL == 0)||($QW_DDL >= @DDepth[@DWref]) {
			set @warpprice, 25 * BaseLevel;
			if (@warpprice != 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" -> "+@warpprice;
			if (@warpprice == 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref];
			if (@warpprice != 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"] -> "+@warpprice;
			if (@warpprice == 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"]";
			set @DWLmenuref[@DWj],@DWref;
			set @DWj,@DWj+1;
		}
		set @DWref, @DWref+1;
		set @DWi,@DWi+1;
	} while (@DWi < @DLevels[@DwarpMenu]);
	set @DWLmenulist$[@DWj], "Exit";
	set @DWLmenuref[@DWj],57005; // 57005='dead' in hex
	return;
}


//================City=Dungeon=Warpras=That=Only=Unlock=================

function	script	QWS_CityDungeon_Warpra	{
	function QWS_CD_getbin;
	function QWS_CD_setbin;
	
	if ((QWS_CD_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
		mes "[Warpra]";
		mes getarg(1)+" unlocked!";
		QWS_CD_setbin(getarg(0));
		return;
	} else if (QWS_CD_getbin(getarg(0)) == 1) {
		mes "[Warpra]";
		mes "Sorry, I can only unlock this location.";
	} else
		debugmes "QWS_CityDungeon_Warpra error, improper syntax?";
	return;


function	QWS_CD_setbin	{
	set @tempsetbindata,1;
	if (getarg(0) == 0) goto binset;
	set @temploopsetbin,0;
	do {
		set @tempsetbindata, @tempsetbindata * 2;
		set @temploopsetbin, @temploopsetbin + 1;
	} while (getarg(0) > @temploopsetbin);
binset:
	set ##QWS_CD_Unlock,(##QWS_CD_Unlock | @tempsetbindata);
	return;
}

function	QWS_CD_getbin	{
	set @tempgetbindata,1;
	if (getarg(0) == 0) goto binget;
	set @temploopgetbin,0;
	do {
		set @tempgetbindata, @tempgetbindata * 2;
		set @temploopgetbin, @temploopgetbin + 1;
	} while (getarg(0) > @temploopgetbin);
binget:
	if ((@tempgetbindata & ##QWS_CD_Unlock) == @tempgetbindata) return 1;
	return 0;
}
}


//================Dungeon=Warpras=That=Only=Unlock=================

function	script	QWS_Dungeon_Warpra	{
	function QWS_D_getbin;
	function QWS_D_setbin;
	
	if ((QWS_D_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
		mes "[Warpra]";
		mes getarg(1)+" unlocked!";
		QWS_D_setbin(getarg(0));
		return;
	} else if (QWS_D_getbin(getarg(0)) == 1) {
		mes "[Warpra]";
		mes "Sorry, I can only unlock this location.";
	} else
		debugmes "QWS_Dungeon_Warpra error, improper syntax?";
	return;


function	QWS_D_setbin	{
	set @tempsetbindata,1;
	if (getarg(0) == 0) goto binset;
	set @temploopsetbin,0;
	do {
		set @tempsetbindata, @tempsetbindata * 2;
		set @temploopsetbin, @temploopsetbin + 1;
	} while (getarg(0) > @temploopsetbin);
binset:
	set ##QWS_D_Unlock,(##QWS_D_Unlock | @tempsetbindata);
	return;
}

function	QWS_D_getbin	{
	set @tempgetbindata,1;
	if (getarg(0) == 0) goto binget;
	set @temploopgetbin,0;
	do {
		set @tempgetbindata, @tempgetbindata * 2;
		set @temploopgetbin, @temploopgetbin + 1;
	} while (getarg(0) > @temploopgetbin);
binget:
	if ((@tempgetbindata & ##QWS_D_Unlock) == @tempgetbindata) return 1;
	return 0;
}
}


//================Field=Warpras=That=Only=Unlock=================

function	script	QWS_Field_Warpra	{
	function QWS_F_getbin;
	function QWS_F_setbin;
	
	if ((QWS_F_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
		mes "[Warpra]";
		mes getarg(1)+" unlocked!";
		QWS_F_setbin(getarg(0));
		return;
	} else if (QWS_F_getbin(getarg(0)) == 1) {
		mes "[Warpra]";
		mes "Sorry, I can only unlock this location.";
	} else
		debugmes "QWS_Field_Warpra error, improper syntax?";
	return;


function	QWS_F_setbin	{
	set @tempsetbindata,1;
	if (getarg(0) == 0) goto binset;
	set @temploopsetbin,0;
	do {
		set @tempsetbindata, @tempsetbindata * 2;
		set @temploopsetbin, @temploopsetbin + 1;
	} while (getarg(0) > @temploopsetbin);
binset:
	set ##QWS_F_Unlock,(##QWS_F_Unlock | @tempsetbindata);
	return;
}

function	QWS_F_getbin	{
	set @tempgetbindata,1;
	if (getarg(0) == 0) goto binget;
	set @temploopgetbin,0;
	do {
		set @tempgetbindata, @tempgetbindata * 2;
		set @temploopgetbin, @temploopgetbin + 1;
	} while (getarg(0) > @temploopgetbin);
binget:
	if ((@tempgetbindata & ##QWS_F_Unlock) == @tempgetbindata) return 1;
	return 0;
}
}

//==========================Town=Warpras===========================

function	script	QWS_Town_Warpra	{
	function QWS_T_getbin;
	function QWS_T_setbin;
	
	if ((QWS_T_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
		mes "[Warpra]";
		mes getarg(1)+" unlocked!";
		QWS_T_setbin(getarg(0));
		return;
	} else if (QWS_T_getbin(getarg(0)) == 1) {
		callfunc "Q_Warpra",0;
	} else
		debugmes "QWS_Town_Warpra error, improper syntax ?";
	return;

function	QWS_T_setbin	{
	set @tempsetbindata,1;
	if (getarg(0) == 0) goto binset;
	set @temploopsetbin,0;
	do {
		set @tempsetbindata, @tempsetbindata * 2;
		set @temploopsetbin, @temploopsetbin + 1;
	} while (getarg(0) > @temploopsetbin);
binset:
	set ##QWS_T_Unlock,(##QWS_T_Unlock | @tempsetbindata);
	return;
}

function	QWS_T_getbin	{
	set @tempgetbindata,1;
	if (getarg(0) == 0) goto binget;
	set @temploopgetbin,0;
	do {
		set @tempgetbindata, @tempgetbindata * 2;
		set @temploopgetbin, @temploopgetbin + 1;
	} while (getarg(0) > @temploopgetbin);
binget:
	if ((@tempgetbindata & ##QWS_T_Unlock) == @tempgetbindata) return 1;
	return 0;
}
}
//============================Warpras==============================

-	script	Warpra#0	-1,{ callfunc "Q_Warpra",1; }

alberta,28,240,4	script	Warpra#1	403,{ callfunc "QWS_Town_Warpra",1,"Alberta Town";  close; }
aldebaran,145,118,4	script	Warpra#2	403,{ callfunc "QWS_Town_Warpra",2,"Aldebaran Town"; callfunc "QWS_Field_Warpra",11,"Mjolnir Fields"; callfunc "QWS_CityDungeon_Warpra",6,"Clock Tower Dungeon"; callfunc "QWS_CityDungeon_Warpra",13,"Luina Guild Dungeon"; close; }
ayothaya,209,169,6	script	Warpra#3	403,{ callfunc "QWS_Town_Warpra",4,"Ayotaya Town"; callfunc "QWS_Field_Warpra",1,"Ayothaya Field Field"; callfunc "QWS_CityDungeon_Warpra",1,"Ayotaya Dungeon"; close; }
amatsu,203,87,4	script	Warpra#4	403,{ callfunc "QWS_Town_Warpra",3,"Amatsu Town"; callfunc "QWS_Field_Warpra",0,"Amatsu Fields";  callfunc "QWS_CityDungeon_Warpra",0,"Amatsu Dungeon"; close; }
comodo,194,158,4	script	Warpra#5	403,{ callfunc "QWS_Town_Warpra",5,"Comodo Town"; callfunc "QWS_Field_Warpra",2,"Comodo Fields"; callfunc "QWS_CityDungeon_Warpra",3,"Beach Dungeon"; close; }
einbroch,69,202,4	script	Warpra#6	403,{ callfunc "QWS_Town_Warpra",7,"Einbroch Town";  callfunc "QWS_Field_Warpra",3,"Einbroch Fields"; close; }
einbech,59,38,6	script	Warpra#7	403,{ callfunc "QWS_Town_Warpra",6,"Einbech Town"; callfunc "QWS_CityDungeon_Warpra",8,"Einbech Dungeon"; close; }
geffen,124,72,4	script	Warpra#8	403,{ callfunc "QWS_Town_Warpra",8,"Geffen Town";  callfunc "QWS_Field_Warpra",4,"Geffen Fields"; callfunc "QWS_CityDungeon_Warpra",9,"Gefen Dungeon"; callfunc "QWS_CityDungeon_Warpra",4,"Britoniah Guild Dungeon"; close; }
gonryun,162,122,4	script	Warpra#9	403,{ callfunc "QWS_Town_Warpra",9,"Gonryun Town";  callfunc "QWS_Field_Warpra",5,"Gonryun Fields"; callfunc "QWS_CityDungeon_Warpra",10,"Gonryun Dungeon"; close; }
hugel,101,151,4	script	Warpra#10	403,{ callfunc "QWS_Town_Warpra",10,"Hugel Town";  callfunc "QWS_Field_Warpra",6,"Hugel Fields"; close; }
jawaii,253,138,4	script	Warpra#11	403,{ callfunc "QWS_Town_Warpra",12,"Jawaii Town"; close; }
izlude,132,120,4	script	Warpra#12	403,{ callfunc "QWS_Town_Warpra",11,"Izlude Town"; callfunc "QWS_CityDungeon_Warpra",5,"Byalan Dungeon"; close; }
lighthalzen,162,102,4	script	Warpra#13	403,{ callfunc "QWS_Town_Warpra",13,"Lighthalzen Town";  callfunc "QWS_Field_Warpra",7,"Lighthalzen Fields"; callfunc "QWS_CityDungeon_Warpra",11,"Lighthalzen Bio Lab"; close; }
louyang,208,103,6	script	Warpra#14	403,{ callfunc "QWS_Town_Warpra",14,"Louyang Town";  callfunc "QWS_Field_Warpra",8,"Louyang Fields"; callfunc "QWS_CityDungeon_Warpra",12,"Louyang Dungeon"; close; }
morocc,159,97,4	script	Warpra#15	403,{ callfunc "QWS_Town_Warpra",18,"Morroc Town";  callfunc "QWS_Field_Warpra",17,"Sograt Deserts"; callfunc "QWS_CityDungeon_Warpra",15,"Pyramides Dungeon"; callfunc "QWS_CityDungeon_Warpra",17,"Sphinx Dungeon"; close; }
niflheim,205,179,4	script	Warpra#16	403,{ callfunc "QWS_Town_Warpra",20,"Niflheim Town";  callfunc "QWS_Field_Warpra",13,"Niflheim Fields"; close; }
payon,182,108,4	script	Warpra#17	403,{ callfunc "QWS_Town_Warpra",21,"Payon Town";  callfunc "QWS_Field_Warpra",14,"Payon Forests"; callfunc "QWS_CityDungeon_Warpra",14,"Payon Dungeon"; callfunc "QWS_CityDungeon_Warpra",2,"Baldur Guild Dungeon"; close; }
prontera,159,192,4	script	Warpra#18	403,{ callfunc "QWS_Town_Warpra",0,"Prontera Town";  callfunc "QWS_Field_Warpra",15,"Prontera Fields"; callfunc "QWS_CityDungeon_Warpra",7,"Culvert Dungeon"; callfunc "QWS_CityDungeon_Warpra",20,"Valkyrie Guild Dungeon"; close; }
umbala,106,150,3	script	Warpra#19	403,{ callfunc "QWS_Town_Warpra",25,"Umbala Town";  callfunc "QWS_Field_Warpra",19,"Umbala Fields"; close; }
xmas,150,136,6	script	Warpra#20	403,{ callfunc "QWS_Town_Warpra",15,"Lutie Town";  callfunc "QWS_Field_Warpra",9,"Lutie Fields"; callfunc "QWS_CityDungeon_Warpra",18,"Toy Factory Dungeon"; close; }
yuno,162,47,4	script	Warpra#21	403,{ callfunc "QWS_Town_Warpra",27,"Yuno Town";  callfunc "QWS_Field_Warpra",21,"Yuno Fields"; callfunc "QWS_CityDungeon_Warpra",19,"Umbala Dungeon"; close; }
manuk,262,177,4	script	Warpra#22	403,{ callfunc "QWS_Town_Warpra",16,"Manuk Town";  callfunc "QWS_Field_Warpra",10,"Manuk Fields"; close; }
moscovia,216,196,6	script	Warpra#23	403,{ callfunc "QWS_Town_Warpra",19,"Moscovia Town";  callfunc "QWS_Field_Warpra",12,"Moscovia Fields"; close; }
rachel,135,116,4	script	Warpra#24	403,{ callfunc "QWS_Town_Warpra",22,"Rachel Town";  callfunc "QWS_Field_Warpra",16,"Rachel Fields"; callfunc "QWS_CityDungeon_Warpra",16,"Rachel Sanctuary"; close; }
splendide,205,153,4	script	Warpra#25	403,{ callfunc "QWS_Town_Warpra",23,"Splendide Town";  callfunc "QWS_Field_Warpra",18,"Splendide Fields"; close; }
veins,214,123,4	script	Warpra#26	403,{ callfunc "QWS_Town_Warpra",26,"Veins Town";  callfunc "QWS_Field_Warpra",20,"Veins Fields"; close; }
thor_camp,249,76,4	script	Warpra#27	403,{ callfunc "QWS_Town_Warpra",24,"Thor Camp"; close; }
mid_camp,216,288,4	script	Warpra#28	403,{ callfunc "QWS_Town_Warpra",17,"Midgard's Expedition Camp"; close; }



abyss_01,264,267,2	script	Warpra Helper#0	403,{ callfunc "QWS_Dungeon_Warpra",0,"Abyss Lake"; close; }
anthell01,43,263,3	script	Warpra Helper#1	403,{ callfunc "QWS_Dungeon_Warpra",1,"Ant Hell Dungeon"; close; }
mjo_dun01,49,23,6	script	Warpra Helper#2	403,{ callfunc "QWS_Dungeon_Warpra",2,"Coal Mine Dungeon"; close; }
gefenia01,50,100,0	script	Warpra Helper#3	403,{ callfunc "QWS_Dungeon_Warpra",5,"Gefenia Dungeon"; close; }
glast_01,371,308,3	script	Warpra Helper#4	403,{ callfunc "QWS_Dungeon_Warpra",7,"Glast Heim Dungeon"; close; }
jupe_cave,144,56,3	script	Warpra Helper#5	403,{ callfunc "QWS_Dungeon_Warpra",10,"Juperos Cave"; close; }
kh_dun01,14,224,6	script	Warpra Helper#6	403,{ callfunc "QWS_Dungeon_Warpra",11,"Kiel Dungeon"; close; }
mag_dun01,122,66,0	script	Warpra Helper#7	403,{ callfunc "QWS_Dungeon_Warpra",12,"Magma Dungeon"; close; }
odin_tem01,115,148,3	script	Warpra Helper#8	403,{ callfunc "QWS_Dungeon_Warpra",14,"Odin Temple"; close; }
in_orcs01,37,173,3	script	Warpra Helper#9	403,{ callfunc "QWS_Dungeon_Warpra",15,"Orc Dungeon"; close; }
tha_t01,154,34,1	script	Warpra Helper#10	403,{ callfunc "QWS_Dungeon_Warpra",17,"Thanatos Tower"; close; }
alb2trea,73,101,4	script	Warpra Helper#11	403,{ callfunc "QWS_Dungeon_Warpra",16,"Sunken Ship Dungeon"; close; }
um_dun01,36,29,5	script	Warpra Helper#12	403,{ callfunc "QWS_Dungeon_Warpra",37,"Umbala Dungeon"; close; }
tur_dun01,147,53,5	script	Warpra Helper#13	403,{ callfunc "QWS_Dungeon_Warpra",19,"Turtle Island Dungeon"; close; }
prt_maze01,180,9,3	script	Warpra Helper#14	403,{ callfunc "QWS_Dungeon_Warpra",8,"Hidden Dungeon"; close; }
nameless_n,259,213,4	script	Warpra Helper#15	403,{ callfunc "QWS_Dungeon_Warpra",3,"Cursed Abbey"; close; }
ice_dun01,154,17,6	script	Warpra Helper#16	403,{ callfunc "QWS_Dungeon_Warpra",9,"Ice Dungeon"; close; }
thor_v01,18,229,6	script	Warpra Helper#17	403,{ callfunc "QWS_Dungeon_Warpra",18,"Thor Volcano"; close; }

Greetings everyone. Here i got some working script of advvance Wapra to share with you all but it seem like this script were having a little bug when the zeny is zero, the variable for last warp choice are stuck forever. Im not sure where to edit but already give a try but it seems like im still dont know how to try to fix properly. Maybe some of our expert in scripting can help me out. Btw here are the script 

 

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...