// CVC ]w
//###########################################################################################
// GVG - 00:00 2004/06/27 
// BY Michael p  http//www.99nest.com
//###########################################################################################
//npc "prt_gld" "Xm" GUILD_FLAG 199 243 2 5 5
prt_gld.gat,199,243,2	script	w#p5-1	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	if (GetCharID(2) == @GIDp5) goto L_Member;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;
L_Member:
	mes "[ TGڭ ]";
	mes "iH...";
	mes "n^zWAa?";
	next;
	menu "^쯵Ka ",L_Warp," ",-;
	close;
	end;
L_Warp:
	warp "prtg_cas05.gat",52,41;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prt_gld" "Xm" GUILD_FLAG 199 236 2 5 5
prt_gld.gat,199,236,2	script	w#p5-2	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	if (GetCharID(2) == @GIDp5) goto L_Member;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;
L_Member:
	mes "[ TGڭ ]";
	mes "iH...";
	mes "n^zWAa?";
	next;
	menu "^쯵Ka ",L_Warp," ",-;
	close;
	end;
L_Warp:
	warp "prtg_cas05.gat",52,41;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prt_gld" "Xm" GUILD_FLAG 197 243 2 5 5
prt_gld.gat,197,243,2	script	w#p5-3	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	if (GetCharID(2) == @GIDp5) goto L_Member;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;
L_Member:
	mes "[ TGڭ ]";
	mes "iH...";
	mes "n^zWAa?";
	next;
	menu "^쯵Ka ",L_Warp," ",-;
	close;
	end;
L_Warp:
	warp "prtg_cas05.gat",52,41;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prt_gld" "Xm" GUILD_FLAG 197 236 2 5 5
prt_gld.gat,197,236,2	script	w#p5-4	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	if (GetCharID(2) == @GIDp5) goto L_Member;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;
L_Member:
	mes "[ TGڭ ]";
	mes "iH...";
	mes "n^zWAa?";
	next;
	menu "^쯵Ka ",L_Warp," ",-;
	close;
	end;
L_Warp:
	warp "prtg_cas05.gat",52,41;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 19 247 4 5 5
prtg_cas05.gat,19,247,4	script	w#p5-5	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 19 243 4 5 5
prtg_cas05.gat,19,243,4	script	w#p5-6	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 26 247 4 5 5
prtg_cas05.gat,26,247,4	script	w#p5-7	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 26 243 4 5 5
prtg_cas05.gat,26,243,4	script	w#p5-8	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 249 289 4 5 5
prtg_cas05.gat,249,289,4	script	w#p5-9	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 256 289 4 5 5
prtg_cas05.gat,256,289,4	script	w#p5-10	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 253 271 4 5 5
prtg_cas05.gat,253,271,4	script	w#p5-11	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}

//npc "prtg_cas05" "Xm" GUILD_FLAG 273 257 4 5 5
prtg_cas05.gat,273,257,4	script	w#p5-12	722,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "   o̤GASҦv";
	mes "   Xm";
	mes " ";
	mes "2. ԳӦubo̪AiȪ礧";
	mes "   }aRݪH";
	mes "   |礩";
	mes "   g{Ҫ";
	mes "   KaҦv";
	close;
	end;
L_Guild:
	mes "       [ wԤ  iO ]";
	mes " ";
	mes "1. ھڳo̪AwԤO";
	mes "    o̳Q{w ^ff0000" + GetGuildName(@GIDp5) + "^000000u|";
	mes "    p";
	mes " ";
	mes "2. ^ff0000" + GetGuildName(@GIDp5) + "^000000 u|DHO";
	mes "    ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 A L׬O";
	mes "    oƱN";
	mes "    ЧA|_zCAۤvWAa";
	close;
	end;

OnRecvCastleP05:
	FlagEmblem GetCastleData("prtg_cas05.gat",1);
	end;
}











//npc "prtg_cas05" " " HIDDEN_NPC 280 177 0 5 5
//prtg_cas05.gat,280,177,0	script	@	111,{
prtg_cas05.gat,281,176,0	script	@	111,{
	mes " ";
	mes "pԱ AAnUԶ? ";
	next;
	menu "ڭn ",L_Yes,"ڤn ",L_No;
L_Yes:
	warp "prtg_cas05.gat",36,38;
	end;
L_No:
	close;
	end;
}

//npc "prtg_cas05" " " HIDDEN_NPC 212 95 0 5 5
prtg_cas05.gat,212,95,0	script	@	111,{
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 > 0) goto L_Guild;
	mes " [ TGn ] ";
	mes " ' qL禨i𪺥DH ... AhM䥦窺' ";
	close;
	end;
L_Guild:
	mes "[ TGn ]";
	mes " ' ui𪺥DHA~౵'";
	next;
	mes " ";
	mes "pԱ AAnUԶ? ";
	next;
	menu "ڭn ",L_Yes,"ڤn ",L_No;
L_Yes:
	if (GetCharID(2) != @GIDp5) goto L_NotMember;
	warp "gld_dun03.gat",199,28;
	end;
L_NotMember:
	mes " ";
	mes " SoͥƱ ";
	close;
	end;
L_No:
	close;
	end;
}



//npc "prtg_cas05" "d ¾" 4_F_KAFRA1 52 41 4 5 5
prtg_cas05.gat,52,41,4	script	d ¾#prt5	117,{
//OnClick:
	cutin "kafra_01.bmp",2;
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 == GetCharID(2)) goto L_Member;
	mes "[d ¾]";
	mes "ڤwñqM^ff0000" + GetGuildName(@GIDp5) + "^000000 |A AШϥΧڭ̨䥦a誺d¾ ApKBqШ";
	cutin "kafra_01.bmp",255;
	close;
	end;
L_Member:
	mes " [d ¾]";
	mes "w{ ^ff0000" + GetGuildName(@GIDp5) + "^000000 | ";
	mes "dԪA(q) AûbU쨭䬰zA";
	next;
	menu "ϥέܮwA",L_M1,"ϥΪŶʪA",L_M2,"ϥΤA ",L_M3,"",L_M4;
	L_M1:
		if (getskilllv(1) < 6) goto L_M1_A;
		mes "[d ¾]";
		mes "n}ܮwF";
		mes "±zϥΡC";
		cutin "kafra_01.bmp",255;
		openstorage;
		close;
		end;
		L_M1_A://Basic Skill < 6
			mes "[d ¾]";
			mes "Qnϥέܮw AǪ̧ޯ൥ŭn6HW~";
			cutin "kafra_01.bmp",255;
			close;
			end;
	L_M2:
		mes "[d ¾]";
		mes "лXتaa";
		next;
		menu "w  -> 200 z",L_M2_M1,"  ",L_M2_M2;
		L_M2_M1:
			if (Zeny < 200) goto L_M2_M1_A;
			set Zeny,Zeny-200;
//			set kf_10_pit,kf_10_pit+2;
			warp "prontera.gat",278,211;
			end;
			L_M2_M1_A:
				mes "[d ¾]";
				mes "|/pj AAҤIB AЭsT{";
				cutin "kafra_01.bmp",255;
				close;
				end;
		L_M2_M2:
			cutin "kafra_01.bmp",255;
			close;
			end;
	L_M3:
		if ((Class != 5) && (Class != 10)) goto L_M3_A;
		if (checkcart != 0) goto L_M3_B;
		mes "[d ¾]";
		mes "ϥζOO 800  AаݧAnϥζ?";
		next;
		menu "ϥ ",L_M3_M1," ",L_M3_M2;
		L_M3_M1:
			if (Zeny < 800) goto L_M3_M1_A;
//			set kf_10_pit,kf_10_pit+8;
			set Zeny,Zeny-800;
			setcart;
			cutin "kafra_01.bmp",255;
			close;
			end;
			L_M3_M1_A:
				mes "[d ¾]";
				mes "U AAҤIB AϥζOO800 ";
				cutin "kafra_01.bmp",255;
				close;
				end;
		L_M3_M2:
			cutin "kafra_01.bmp",255;
			close;
			end;
		L_M3_A:
			mes "[d ¾]";
			mes "藍_ AOӤHMKKAMΪA";
			cutin "kafra_01.bmp",255;
			close;
			end;
		L_M3_B:
			mes "[d ¾]";
			mes "UȧA{bwgA˳ƤF";
			cutin "kafra_01.bmp",255;
			close;
			end;
	L_M4:
		mes "[d ¾]";
		mes "ڭ̥dԪA(q)|ѧ󧹬A AMY檺~Ⱥ޲z AUUȦw߫KQϥΡA̤jؼ";
		mes "P§Aϥ AdԪA(q) ";
		cutin "kafra_01.bmp",255;
		close;	
		end;
OnInit:
	disablenpc "d ¾#prt5";
	End;
}


//npc "prtg_cas05" "O" 1_M_JOBTESTER 36 37 4 5 5
prtg_cas05.gat,36,37,4	script	O#prt5	55,{
//OnClick:
	set @GIDp5,GetCastleData("prtg_cas05.gat",1);
	if (@GIDp5 == 0) goto L_Waiting;
	if (strcharinfo(0) != GetGuildMaster(@GIDp5)) goto L_Member;
	goto L_Castle;
	end;
// -------u|DH bɭ------------------------------------------
L_Waiting:
	mes "[޲zHO]";
	mes "  ڱN̾ڧڪRB AbݧڪDH";
	mes "ih...@UARBa ...";
	close;
	end;
// -----------------------------------------------------------------------------
// --------Oڪ u|DH? -----------------------------------------------
L_Member:
	mes "[޲zHO]";
	mes "ާA̫¯٧ Aڥu@NlHڪDH ^ff0000" + GetGuildMaster(@GIDp5) + "^000000 ! @HA̦b̧r! ֧oǵLzå̻a!";
	close;
	end;
//-----------------------------------------------------------------------------
L_Castle:
	mes "[޲zHO]";
	mes "w{ A ڪDH^ff0000" + GetGuildMaster(@GIDp5) + "^000000/pj...";
	mes "оާhJ AڱNۦaA";
	next;
//	choose menu "dݯKap" "ӷ~oi" "꨾m" "]m@H " " / Ѷ ܮw¾" "iJDHж" "XKa"
	menu "dݯKap",L_M1,"ӷ~oi",L_M2,"꨾m",L_M3,"]m@H ",L_M4," / Ѷ ܮw¾",L_M5,"iJDHж",L_M6;
// ---------dݯKap---------------------------------------------------
	L_M1:
		mes "[޲zHO]";
		mes "{bVAiKap";
		mes "^0000ff ";
		mes "   {bӷ~oi׬O" + GetCastleData("prtg_cas05.gat",2) +  " ";
		if (GetCastleData("prtg_cas05.gat",4) > 0 ) mes "   - bLh@ѤAF " + GetCastleData("prtg_cas05.gat",4) + "  ";
		mes "   {bm׬O" + GetCastleData("prtg_cas05.gat",3) +  " ";
		if (GetCastleData("prtg_cas05.gat",5) > 0 ) mes "   - bLh@ѤAF " + GetCastleData("prtg_cas05.gat",5) + "  ";
		mes "^000000 ";
		mes "i";
		close;
		end;
// ---------ӷ~oi
	L_M2:
		mes "[޲zHO]";
		mes "ӷ~oiת Abu|̥Ͳ~ƶq|W[AFH۷QܡAण";
		mes " ";
		mes "ӭ覡A@ѥu@ AphI@I A@ѥiH⦸";
		set @TriggerE,GetCastleData("prtg_cas05.gat",4);
		set @Economy,GetCastleData("prtg_cas05.gat",2);
		if (@Economy >= 100) goto L_M2_A;
		if (@TriggerE > 1) goto L_M2_B;
		if (@TriggerE == 0) goto L_M2_C;
		goto L_M2_D;
		L_M2_A://economyOK == 0
			mes " ";
			mes "^ff0000]ѩ AKaӷ~oiסAwgO̰100% FAҥHݭn ADHGuAO֦W㪺z^000000";
			close;
			end;
		L_M2_B://economyOK == 1
			mes " ";
			mes "^ff0000iOAwgAbѤF⦸AAF.^000000oi׻֤WɡAݵ۴IQlo";
			close;
			end;
//		gold = AgitGet AGIT_E_FUND 
		L_M2_C://economyOK == 2
//Ĥ@һݪB
			if ((@Economy >= 0) && (@Economy <= 4)) set @gold,5000;
			if ((@Economy >= 5) && (@Economy <= 9)) set @gold,10000;
			if ((@Economy >= 10) && (@Economy <= 14)) set @gold,20000;
			if ((@Economy >= 15) && (@Economy <= 19)) set @gold,35000;
			if ((@Economy >= 20) && (@Economy <= 24)) set @gold,55000;
			if ((@Economy >= 25) && (@Economy <= 29)) set @gold,80000;
			if ((@Economy >= 30) && (@Economy <= 34)) set @gold,110000;
			if ((@Economy >= 35) && (@Economy <= 39)) set @gold,145000;
			if ((@Economy >= 40) && (@Economy <= 44)) set @gold,185000;
			if ((@Economy >= 45) && (@Economy <= 49)) set @gold,230000;
			if ((@Economy >= 50) && (@Economy <= 54)) set @gold,280000;
			if ((@Economy >= 55) && (@Economy <= 59)) set @gold,335000;
			if ((@Economy >= 60) && (@Economy <= 64)) set @gold,395000;
			if ((@Economy >= 65) && (@Economy <= 69)) set @gold,460000;
			if ((@Economy >= 70) && (@Economy <= 74)) set @gold,530000;
			if ((@Economy >= 75) && (@Economy <= 79)) set @gold,605000;
			if ((@Economy >= 80) && (@Economy <= 84)) set @gold,685000;
			if ((@Economy >= 85) && (@Economy <= 89)) set @gold,770000;
			if ((@Economy >= 90) && (@Economy <= 94)) set @gold,860000;
			if ((@Economy >= 95) && (@Economy <= 99)) set @gold,995000;
			mes " ";
			mes "{bݭnBO ^ff0000" + @gold + "^000000  AаݧAn?";
			goto L_M2_Go;
		L_M2_D://economyOK == else
//ĤGһݪB
			if ((@Economy >= 0) && (@Economy <= 4)) set @gold,20000;
			if ((@Economy >= 5) && (@Economy <= 9)) set @gold,40000;
			if ((@Economy >= 10) && (@Economy <= 14)) set @gold,80000;
			if ((@Economy >= 15) && (@Economy <= 19)) set @gold,140000;
			if ((@Economy >= 20) && (@Economy <= 24)) set @gold,220000;
			if ((@Economy >= 25) && (@Economy <= 29)) set @gold,320000;
			if ((@Economy >= 30) && (@Economy <= 34)) set @gold,440000;
			if ((@Economy >= 35) && (@Economy <= 39)) set @gold,580000;
			if ((@Economy >= 40) && (@Economy <= 44)) set @gold,740000;
			if ((@Economy >= 45) && (@Economy <= 49)) set @gold,920000;
			if ((@Economy >= 50) && (@Economy <= 54)) set @gold,1120000;
			if ((@Economy >= 55) && (@Economy <= 59)) set @gold,1340000;
			if ((@Economy >= 60) && (@Economy <= 64)) set @gold,1580000;
			if ((@Economy >= 65) && (@Economy <= 69)) set @gold,1840000;
			if ((@Economy >= 70) && (@Economy <= 74)) set @gold,2120000;
			if ((@Economy >= 75) && (@Economy <= 79)) set @gold,2420000;
			if ((@Economy >= 80) && (@Economy <= 84)) set @gold,2740000;
			if ((@Economy >= 85) && (@Economy <= 89)) set @gold,3080000;
			if ((@Economy >= 90) && (@Economy <= 94)) set @gold,3440000;
			if ((@Economy >= 95) && (@Economy <= 99)) set @gold,3820000;
			mes " ";
			mes "{bAwgF@... ٭nA? ٻݭnl[^ff0000" + @gold + "^000000  ";
			goto L_M2_Go;
		L_M2_Go:
		next;
		menu "ӷ~oiק",L_M2_Go_M1," ",L_M2_Go_M2;
		L_M2_Go_M1:
			if (Zeny < @gold) goto L_M2_Go_M1_A;
			set Zeny,Zeny-@gold;
//			AgitFunc AF_INVEST_E 0 0
			SetCastleData "prtg_cas05.gat",4,@TriggerE+1;
			SetCastleData "prtg_cas05.gat",2,@Economy+1;
			mes "[޲zHO]";
			mes "QaF! ݵۧڭ̩n{ AѪܵoi׷|W ";
			close;
			end;
			L_M2_Go_M1_A:
				mes "[޲zHO]";
				mes "DHui Au|xWAF쨬HꪺB AҥHꥢѤF";
				close;
				end;
		L_M2_Go_M2:
			mes "[޲zHO]";
			mes "ڱN̷ӧAhJh AOڪDH ... nӵ۫ Aڭ̷|oܦn ";
			close;
			end;
// --------- m  ---------------------------------------------------
	L_M3:
		mes "[޲zHO]";
		mes "mO A@HMRݪ@[׷|W[ AҼ{쩹᪺Ԫ Ao";
		mes " ";
		mes "ӭ覡A@ѥu@ AphI@I A@ѥiH⦸";
		set @TriggerD,GetCastleData("prtg_cas05.gat",5);
		set @Deffence,GetCastleData("prtg_cas05.gat",3);
		if (@Deffence >= 100) goto L_M3_A;
		if (@TriggerD > 1) goto L_M3_B;
		if (@TriggerD == 0) goto L_M3_C;
		goto L_M3_D;
		L_M3_A://if defenseOK == 0
			mes " ";
			mes "^ff0000]ѩ AKaӷ~oiסAwgO̰100% FAҥHݭn ADHGuAO֦W㪺z^000000";
			close;
			end;
		L_M3_B://if defenseOK == 1
			mes " ";
			mes "^ff0000iOAwgAbѤF⦸AAF.^000000oi׻֤WɡAݵ۴IQlo";
			close;
			end;
//		gold = AgitGet AGIT_D_FUND 
		L_M3_C://if defenseOK == 2
//Ĥ@һݪB
			if ((@Deffence >= 0) && (@Deffence <= 4)) set @gold,10000;
			if ((@Deffence >= 5) && (@Deffence <= 9)) set @gold,20000;
			if ((@Deffence >= 10) && (@Deffence <= 14)) set @gold,40000;
			if ((@Deffence >= 15) && (@Deffence <= 19)) set @gold,70000;
			if ((@Deffence >= 20) && (@Deffence <= 24)) set @gold,110000;
			if ((@Deffence >= 25) && (@Deffence <= 29)) set @gold,160000;
			if ((@Deffence >= 30) && (@Deffence <= 34)) set @gold,220000;
			if ((@Deffence >= 35) && (@Deffence <= 39)) set @gold,290000;
			if ((@Deffence >= 40) && (@Deffence <= 44)) set @gold,370000;
			if ((@Deffence >= 45) && (@Deffence <= 49)) set @gold,460000;
			if ((@Deffence >= 50) && (@Deffence <= 54)) set @gold,560000;
			if ((@Deffence >= 55) && (@Deffence <= 59)) set @gold,670000;
			if ((@Deffence >= 60) && (@Deffence <= 64)) set @gold,790000;
			if ((@Deffence >= 65) && (@Deffence <= 69)) set @gold,920000;
			if ((@Deffence >= 70) && (@Deffence <= 74)) set @gold,1060000;
			if ((@Deffence >= 75) && (@Deffence <= 79)) set @gold,1210000;
			if ((@Deffence >= 80) && (@Deffence <= 84)) set @gold,1370000;
			if ((@Deffence >= 85) && (@Deffence <= 89)) set @gold,1540000;
			if ((@Deffence >= 90) && (@Deffence <= 94)) set @gold,1720000;
			if ((@Deffence >= 95) && (@Deffence <= 99)) set @gold,1910000;
			mes " ";
			mes "{bݭnBO ^ff0000" + @gold + "^000000  AаݧAn?";
			goto L_M3_Go;
		L_M3_D://else
//ĤGһݪB
			if ((@Deffence >= 0) && (@Deffence <= 4)) set @gold,40000;
			if ((@Deffence >= 5) && (@Deffence <= 9)) set @gold,80000;
			if ((@Deffence >= 10) && (@Deffence <= 14)) set @gold,160000;
			if ((@Deffence >= 15) && (@Deffence <= 19)) set @gold,280000;
			if ((@Deffence >= 20) && (@Deffence <= 24)) set @gold,440000;
			if ((@Deffence >= 25) && (@Deffence <= 29)) set @gold,640000;
			if ((@Deffence >= 30) && (@Deffence <= 34)) set @gold,880000;
			if ((@Deffence >= 35) && (@Deffence <= 39)) set @gold,1160000;
			if ((@Deffence >= 40) && (@Deffence <= 44)) set @gold,1480000;
			if ((@Deffence >= 45) && (@Deffence <= 49)) set @gold,1840000;
			if ((@Deffence >= 50) && (@Deffence <= 54)) set @gold,2240000;
			if ((@Deffence >= 55) && (@Deffence <= 59)) set @gold,2680000;
			if ((@Deffence >= 60) && (@Deffence <= 64)) set @gold,3160000;
			if ((@Deffence >= 65) && (@Deffence <= 69)) set @gold,3680000;
			if ((@Deffence >= 70) && (@Deffence <= 74)) set @gold,4240000;
			if ((@Deffence >= 75) && (@Deffence <= 79)) set @gold,4840000;
			if ((@Deffence >= 80) && (@Deffence <= 84)) set @gold,5480000;
			if ((@Deffence >= 85) && (@Deffence <= 89)) set @gold,6160000;
			if ((@Deffence >= 90) && (@Deffence <= 94)) set @gold,6880000;
			if ((@Deffence >= 95) && (@Deffence <= 99)) set @gold,7640000;
			mes " ";
			mes "{bAwgF@... ٭nA? ٻݭnl[^ff0000" + @gold + "^000000  ";
			goto L_M3_Go;
		L_M3_Go:
		next;
		menu "慨m ",L_M3_Go_M1,"",L_M3_Go_M2;
		L_M3_Go_M1:
			if (Zeny < @gold) goto L_M3_Go_M1_A;
			set Zeny,Zeny-@gold;
//			AgitFunc AF_INVEST_D 0 0                  
			SetCastleData "prtg_cas05.gat",5,@TriggerD+1;
			SetCastleData "prtg_cas05.gat",3,@Deffence+1;
			mes "[޲zHO]";
			mes "QaF! ݵۧڭ̩n{ AѪܨm׷|W ";
			close;
			end;
			L_M3_Go_M1_A:
				mes "[޲zHO]";
				mes "DHui Au|xWAF쨬HꪺB AҥHꥢѤF";
				close;
				end;
		L_M3_Go_M2:
			mes "[޲zHO]";
			mes "ڱN̷ӧAhJh AOڪDH ... nӵ۫ Aڭ̷|oܦn ";
			close;
			end;
// ---------]m @H---------------------------------------------------
	L_M4:
		mes "[޲zHO]";
		mes "аݧAn]m@H? @HYNAڭ̯Kaۦu@ ";
		mes " пܭn]m@H";
		next;
//		if (GetCastleData("prtg_cas05.gat",3) >= 1200) menu "çL 1",L_M4_M1,"çL 2",L_M4_M2,"}b 1",L_M4_M3,"}b 2",L_M4_M4,"}b 3",L_M4_M5,"Mh 1",L_M4_M6,"Mh 2",L_M4_M7,"Mh 3",L_M4_M8;
//		if (GetCastleData("prtg_cas05.gat",3) >= 600) menu "çL 1",L_M4_M1,"çL 2",L_M4_M2,"}b 1",L_M4_M3,"}b 2",L_M4_M4,"}b 3",L_M4_M5;
//		menu "çL 1",L_M4_M1,"çL 2",L_M4_M2;
		set @GD1$," Mh @H";
		set @GD2$," Mh @H";
		set @GD3$," Mh @H";
		set @GD4$," hL @H";
		set @GD5$," hL @H";
		set @GD6$," hL @H";
		set @GD7$,"~ }b @H";
		set @GD8$,"~ }b @H";
		if (GetCastleData("prtg_cas05.gat",10) > 0) set @GD1$,@GD1$+" - w]m (266 , 262)";
		if (GetCastleData("prtg_cas05.gat",10) == 0) set @GD1$,@GD1$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",11) > 0) set @GD2$,@GD2$+" - w]m (287 , 280)";
		if (GetCastleData("prtg_cas05.gat",11) == 0) set @GD2$,@GD2$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",12) > 0) set @GD3$,@GD3$+" - w]m (245 , 250)";
		if (GetCastleData("prtg_cas05.gat",12) == 0) set @GD3$,@GD3$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",13) > 0) set @GD4$,@GD4$+" - w]m (236 , 63)";
		if (GetCastleData("prtg_cas05.gat",13) == 0) set @GD4$,@GD4$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",14) > 0) set @GD5$,@GD5$+" - w]m (251 , 63)";
		if (GetCastleData("prtg_cas05.gat",14) == 0) set @GD5$,@GD5$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",15) > 0) set @GD6$,@GD6$+" - w]m (278 , 71)";
		if (GetCastleData("prtg_cas05.gat",15) == 0) set @GD6$,@GD6$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",16) > 0) set @GD7$,@GD7$+" - w]m (32 , 235)";
		if (GetCastleData("prtg_cas05.gat",16) == 0) set @GD7$,@GD7$+" - S]m";
		if (GetCastleData("prtg_cas05.gat",17) > 0) set @GD8$,@GD8$+" - w]m (44 , 248)";
		if (GetCastleData("prtg_cas05.gat",17) == 0) set @GD8$,@GD8$+" - S]m";
		menu @GD1$,L_M4_M1,@GD2$,L_M4_M2,@GD3$,L_M4_M3,@GD4$,L_M4_M4,@GD5$,L_M4_M5,@GD6$,L_M4_M6,@GD7$,L_M4_M7,@GD8$,L_M4_M8;
		L_M4_M1:
			set @GDnum,10;
			goto L_M4_MC;
		L_M4_M2:
			set @GDnum,11;
			goto L_M4_MC;
		L_M4_M3:
			set @GDnum,12;
			goto L_M4_MC;
		L_M4_M4:
			set @GDnum,13;
			goto L_M4_MC;
		L_M4_M5:
			set @GDnum,14;
			goto L_M4_MC;
		L_M4_M6:
			set @GDnum,15;
			goto L_M4_MC;
		L_M4_M7:
			set @GDnum,16;
			goto L_M4_MC;
		L_M4_M8:
			set @GDnum,17;
			goto L_M4_MC;
		L_M4_MC:
		mes "[޲zHO]";
		mes "Twn]mwܪ@H? ]mɻݭn 10000 .";
		next;
		menu "n]m ",L_M4_MC_M1," ",L_M4_MC_M2;
		L_M4_MC_M1:
//			npcStatus = AgitNpcGet no AN_VISIBLE
//			skLevel = AgitGet AGIT_GUARDIAN_SKILL
//------u|ޯ ASs@ A@HsO?-----------------
			set @Guardian_Skill,getgdskilllv(@GIDp5,GD_GUARDIANRESEARCH);
			if (@Guardian_Skill == 0) goto L_M4_MC_M1_A;
			if (GetCastleData("prtg_cas05.gat",@GDnum) != 0) goto L_M4_MC_M1_B;
			if (Zeny < 10000) goto L_M4_MC_M1_C;
			set Zeny,Zeny-10000;
//			AgitNpcSet no AN_VISIBLE 1
			setcastledata "prtg_cas05.gat",@GDnum,1;
			mes "[޲zHO]";
			mes "]m@HF A{b}lwgFAO@ڭ̯KajڭxF";
			close;
			end;
			L_M4_MC_M1_A:
				mes "[޲zHO]";
				mes "DH A]m@Hs Aڭ̥M AQnֿn]m@HѪ Anǲߤu|ޯत^ff0000@Hs@s^000000. nMNO A@H]m";
				close;
				end;
			L_M4_MC_M1_B:
				mes "[޲zHO]";
				mes "DH... @HwgODH]m@HFAA]mF";
				close;
				end;
			L_M4_MC_M1_C:
				mes "[޲zHO]";
				mes "]m@H Aܩp... ]m@HѤF";
				close;
				end;
		L_M4_MC_M2:
			mes "[޲zHO]";
			mes "ڤwgӧAhJF ApIWeΪܡA@wn]m@HAOn";
			close;
			end;
//ܮw¾   / Ѷ
	L_M5:
//		npcStatus = AgitNpcGet AGIT_NPC_CONTAINER AN_VISIBLE 
		if (GetCastleData("prtg_cas05.gat",9) == 1) goto L_M5_A;
		goto L_M5_B;
		L_M5_A://if npcStatus == 1
			mes "[޲zHO]";
			mes "{bwgO AΥd¾Ao... AnѶd¾ ?";
			next;
			menu "nѶ ",L_M5_A_M1," ",L_M5_A_M2;
			L_M5_A_M1:
				cutin "kafra_01.bmp",2;
				mes "[ Ϊ d¾ ]";
				mes "LhڨΤߪu@F... AunڸѶ?... ХDHo̤jqA@|...ЧAAҼ{@n ...";
				next;
				menu "nѶ ",L_M5_A_M1_M1," ",L_M5_A_M1_M2;
				L_M5_A_M1_M1:
					mes "[ Ϊ  d¾ ]";
					mes "z! ӹLF! iHo˰ ~";
					next;
					cutin "kafra_01.bmp",255;
//					AgitNpcSet AGIT_NPC_CONTAINER AN_VISIBLE 0
					disablenpc "d ¾#prt5";
					setcastledata "prtg_cas05.gat",9,0;
					mes "[޲zHO]";
					mes "....";
					mes "wgd¾ѶF... L A٦a褣N?";
					close;
					end;
				L_M5_A_M1_M2:
					mes "[ Ϊ  d¾ ]";
					mes "ڷ|VO...  ";
					close;
					end;
			L_M5_A_M2:
				mes "[޲zHO]";
				mes "̧ڬݡAd¾D`VOu@ AF䥦|̵۷QAN~dۦoa";
				close;
				end;
		L_M5_B://else()
			mes "[޲zHO]";
			mes "Md`qq AQnbKa̭ AΥd¾ ?";
			mes "^ff0000 QnΪܡAݭn 10000... ";
			next;
			menu "n ",L_M5_B_M1," ",L_M5_B_M2;
			L_M5_B_M1:
//				skLevel = AgitGet AGIT_KAFRA_SKILL
// -----u|ޯ AMdԭqޯ? --------------------
				set @Kafra_Skill,getgdskilllv(@GIDp5,GD_KAFRACONTACT);
				if (@Kafra_Skill == 0) goto L_M5_B_M1_A;
				if (Zeny < 10000) goto L_M5_B_M1_B;
				set Zeny,Zeny-10000;
//				AgitNpcSet AGIT_NPC_CONTAINER AN_VISIBLE 1
//				AgitFunc AF_SET_PAY_TIME 0 0
				enablenpc "d ¾#prt5";
				setcastledata "prtg_cas05.gat",9,1;
				mes "[޲zHO]";
				mes "\Md`qqFAAwgΥd¾F";
				next;
				cutin "kafra_01.bmp",2;
				mes "[ Ϊ d¾ ]";
				mes "zn AڬO`qӪd¾";
				mes "ڤ|u|WAgWI AҥHڷ|VOu@";
				next;
				cutin "kafra_01.bmp",255;
				mes "[޲zHO]";
				mes "Ϊd¾ A@Ӥ몺 ALF@ӤAbúB";
				mes "{b}lA|̪ҷ|CCF ";
				close;
				end;
				L_M5_B_M1_A:
					mes "[޲zHO]";
					mes "DH Ap٨Sd`qqpAҥH٤๵Υd¾ ApQnd`qñq AǷ|u|ޯत ^ff0000Mdԭq^000000 ޯa";
					close;
					end;
				L_M5_B_M1_B://if v[VAR_MONEY] <  10000
					mes "[޲zHO]";
					mes "ܩp... {bu|̪xW AһݪBAҥHΥd¾ .";
					close;
					end;
			L_M5_B_M2:
				mes "[޲zHO]";
				mes "ڤwgӧAhJF AL]nFW|۷QA鹵Υd¾W";
				close;
				end;
	L_M6:
		mes "[޲zHO]";
		mes "nڭ̥Ͳ~ynAuQ~ж?";
		mes "ӦaOFڭ̪DHAMݩAa... FA~A䥦HӤJ";
		next;
		menu "niJDHж",L_M6_M1,"",L_M6_M2;
		L_M6_M1:
			mes "[޲zHO]";
			mes "ڱNAAȨ쯵KqD̡Aиڨ ";
			mes "^ӪɭԡAUKsYi ";
			next;
			warp "prtg_cas05.gat",281,176;
			end;
		L_M6_M2:
			mes "[޲zHO]";
			mes "Ͳ~@ѥuͲ@ . . .   pSYɦܡAU@NiӤF";
			mes "ҥHFڭ̤u|oiAɶqIɶh";
			close;
			end;
// XKa
//~	L_M7:
//~	mes "[޲zHO]";
//~	mes "DH!!";
//~	mes "AunAڭ̥A崫ӪKa?!";
//~	mes "punܡAboǤlHӡAڭ̩ҬyA쩳NqO!";
//~	mes "ЦAҼ{Ҽ{a! DH!!";
//~	next;
//~	menu "XKa",L_M7_M1,"",L_M7_M2;
//~	L_M7_M1:
//~		mes "[޲zHO]";
//~		mes "DH!!ФTӫ ADH!!";
//~		mes "oҬy!! Q쨺묹Ao˰!!";
//~		next;
//~		menu "",L_M7_M1_M1,"XKa",L_M7_M2_M2;
//~		L_M7_M1_M1:
//~			mes "[޲zHO]";
//~			mes "ڴNDA|o˰ ADH!!";
//~			mes "UAF  AYɬO}AЧAU@noظ";
//~			close;
//~			end;
//~		L_M7_M1_M2:
//~			mes "[޲zHO]";
//~			mes "DH!!.....";
//~			mes "......D .....DH ......";
//~//			AgitSet AGIT_GUILD 0 
//~			close;
//~			setcastledata "prtg_cas05.gat",1,0;
//~			setcastledata "prtg_cas05.gat",2,0;
//~			setcastledata "prtg_cas05.gat",3,0;
//~			setcastledata "prtg_cas05.gat",4,0;
//~			setcastledata "prtg_cas05.gat",5,0;
//~			setcastledata "prtg_cas05.gat",6,0;
//~			setcastledata "prtg_cas05.gat",7,0;
//~			setcastledata "prtg_cas05.gat",8,0;
//~			setcastledata "prtg_cas05.gat",9,0;
//~			setcastledata "prtg_cas05.gat",10,0;
//~			setcastledata "prtg_cas05.gat",11,0;
//~			setcastledata "prtg_cas05.gat",12,0;
//~			setcastledata "prtg_cas05.gat",13,0;
//~			setcastledata "prtg_cas05.gat",14,0;
//~			setcastledata "prtg_cas05.gat",15,0;
//~			setcastledata "prtg_cas05.gat",16,0;
//~			setcastledata "prtg_cas05.gat",17,0;
//~			Announce "Ka[" + GetCastleName("prtg_cas05.gat") + "]Q[" + GetGuildName(@GIDp5) + "]u|XF",0;
//~			MapRespawnGuildID "prtg_cas05.gat",GetCastleData("prtg_cas05.gat",1),7;
//~			end;
//~	L_M7_M2:
//~		mes "[޲zHO]";
//~		mes "ڴNDA|o˰ ADH!!";
//~		mes "UAF  AYɬO}AЧAU@noظ";
//~		close;
//~		end;

OnClock0000://sPCѯ2Iƭ
	SetCastleData "prtg_cas05.gat",4,0;
	SetCastleData "prtg_cas05.gat",5,0;
	end;

OnAgitStart:
	disablenpc "d ¾#prt5";
	End;
OnRecvCastleP05:
	if ($@vMap_AgitFlag_P05 >= 1) end;
OnAgitEnd:
	if (getcastledata("prtg_cas05.gat",9) != 0) enablenpc "d ¾#prt5";
	End;
}

prtg_cas05.gat,1,1,1	script	GDprt05	-1,{
OnAgitStart:
//OnRecvCastleP05:
// u|̪ŵLHɡAiHl]HIW.
	if (GetCastleData("prtg_cas05.gat",1) == 0) goto L_Mob;
	if (GetCastleData("prtg_cas05.gat",1) != 0) goto L_Guardian;
	end;

L_Mob:
	areamonster "prtg_cas05.gat",0,0,300,300,"FCh",1163,15;
	areamonster "prtg_cas05.gat",0,0,300,300,"dQ",1132,10;
	areamonster "prtg_cas05.gat",0,0,300,300,"`WMh",1219,5;
	areamonster "prtg_cas05.gat",0,0,300,300,"{Mh",1268,5;
	areamonster "prtg_cas05.gat",0,0,300,300,"BMh",1251,1;
	areamonster "prtg_cas05.gat",0,0,300,300,"d",1252,1;
	areamonster "prtg_cas05.gat",0,0,300,300,"F}b",1276,5;
	areamonster "prtg_cas05.gat",0,0,300,300,"l~",1259,2;
	areamonster "prtg_cas05.gat",0,0,300,300,"ͬ",1283,2;
	areamonster "prtg_cas05.gat",0,0,300,300,"RRk",1275,1;
	areamonster "prtg_cas05.gat",0,0,300,300,"㴵]k",1200,1;
	monster "prtg_cas05.gat",266,266,"{Mh",1268,1;
	monster "prtg_cas05.gat",266,266,"BMh",1251,1;
	monster "prtg_cas05.gat",266,266,"d",1252,1;
	monster "prtg_cas05.gat",266,266,"`WMh",1219,2;
	monster "prtg_cas05.gat",266,266,"F}b",1276,5;
	end;

L_Guardian:
	if (GetCastleData("prtg_cas05.gat",10) != 0) monster "prtg_cas05.gat",266,262," Mh @H",1286,1,"GDprt05::OnGD1Dead";
	if (GetCastleData("prtg_cas05.gat",11) != 0) monster "prtg_cas05.gat",287,280," Mh @H",1286,1,"GDprt05::OnGD2Dead";
	if (GetCastleData("prtg_cas05.gat",12) != 0) monster "prtg_cas05.gat",245,250," Mh @H",1286,1,"GDprt05::OnGD3Dead";
	if (GetCastleData("prtg_cas05.gat",13) != 0) monster "prtg_cas05.gat",236,63," hL @H",1287,1,"GDprt05::OnGD4Dead";
	if (GetCastleData("prtg_cas05.gat",14) != 0) monster "prtg_cas05.gat",251,63," hL @H",1287,1,"GDprt05::OnGD5Dead";
	if (GetCastleData("prtg_cas05.gat",15) != 0) monster "prtg_cas05.gat",278,71," hL @H",1287,1,"GDprt05::OnGD6Dead";
	if (GetCastleData("prtg_cas05.gat",16) != 0) monster "prtg_cas05.gat",32,253,"~ }b @H",1285,1,"GDprt05::OnGD7Dead";
	if (GetCastleData("prtg_cas05.gat",17) != 0) monster "prtg_cas05.gat",44,248,"~ }b @H",1285,1,"GDprt05::OnGD8Dead";
	end;

OnGD1Dead:
	setcastledata "prtg_cas05.gat",10,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡yԤhz01 Q}aF",17;
//	set @Deffence,GetCastleData("prtg_cas05.gat",3);
//	if (@Deffence < 100) End;
//	set @Deffence,@Deffence-100;
//	SetCastleData "prtg_cas05.gat",3,@Deffence;
	end;

OnGD2Dead:
	SetCastleData "prtg_cas05.gat",11,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡yԤhz02 Q}aF, mפU",17;
	end;

OnGD3Dead:
	SetCastleData "prtg_cas05.gat",12,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡y}bz01 Q}aF, mפU",17;
	end;

OnGD4Dead:
	SetCastleData "prtg_cas05.gat",13,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡y}bz02 Q}aF, mפU",17;
	end;

OnGD5Dead:
	SetCastleData "prtg_cas05.gat",14,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡y}bz03 Q}aF, mפU",17;
	end;

OnGD6Dead:
	SetCastleData "prtg_cas05.gat",15,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡yMhz01 Q}aF, mפU",17;
	end;

OnGD7Dead:
	SetCastleData "prtg_cas05.gat",16,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡yMhz02 Q}aF, mפU",17;
	end;

OnGD8Dead:
	SetCastleData "prtg_cas05.gat",17,0;
//	MapAnnounce "prtg_cas05.gat","u|u@̡yMhz03 Q}aF, mפU",17;
	end;

OnAgitEnd:
	KillMonster "prtg_cas05.gat","GDprt05::OnGD1Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD2Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD3Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD4Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD5Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD6Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD7Dead";
	KillMonster "prtg_cas05.gat","GDprt05::OnGD8Dead";
	end;
}

prtg_cas05.gat,281,176,0	script	DHЪ_c#prt5	-1,{
OnClock0010:
	killmonster "prtg_cas05.gat","T_Box_P05";
	end;
OnClock0030:
	if (GetCastleData("prtg_cas05.gat",1) == 0) end;
	set $@vMap_Economy_P05,GetCastleData("prtg_cas05.gat",2);
	//Basic T_Box
	monster "prtg_cas05.gat",275,178,"_c",rand(1362,1363),1,"T_Box_P05";
	monster "prtg_cas05.gat",276,178,"_c",rand(1362,1363),1,"T_Box_P05";
	monster "prtg_cas05.gat",276,177,"_c",rand(1362,1363),1,"T_Box_P05";
	monster "prtg_cas05.gat",275,177,"_c",rand(1362,1363),1,"T_Box_P05";
	//Economy T_Box
	if ($@vMap_Economy_P05 >=  5) monster "prtg_cas05.gat",273,180,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 10) monster "prtg_cas05.gat",274,180,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 15) monster "prtg_cas05.gat",275,180,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 20) monster "prtg_cas05.gat",276,180,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 25) monster "prtg_cas05.gat",277,180,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 30) monster "prtg_cas05.gat",278,180,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 35) monster "prtg_cas05.gat",278,179,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 40) monster "prtg_cas05.gat",278,178,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 45) monster "prtg_cas05.gat",278,177,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 50) monster "prtg_cas05.gat",278,176,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 55) monster "prtg_cas05.gat",278,175,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 60) monster "prtg_cas05.gat",277,175,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 65) monster "prtg_cas05.gat",276,175,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 70) monster "prtg_cas05.gat",275,175,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 75) monster "prtg_cas05.gat",274,175,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 80) monster "prtg_cas05.gat",273,175,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 85) monster "prtg_cas05.gat",273,176,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 90) monster "prtg_cas05.gat",273,177,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >= 95) monster "prtg_cas05.gat",273,178,"_c",rand(1362,1363),1,"T_Box_P05";
	if ($@vMap_Economy_P05 >  99) monster "prtg_cas05.gat",273,179,"_c",rand(1362,1363),1,"T_Box_P05";
	end;

}