//===================================================================
//Ragnarok Online EP2.5 GVG Script	ev_agit_common      by kalen
//===================================================================
prontera.gat,152,208,0	script	GVG Control	111,{
	if (getgmlevel(0)>0) goto Lgmmode;
	close;
Lgmmode:
	mes "[GVG Control^ff0000(GMp)^000000]";
	mes "U탂[hݒ";
	mes "^3355ffdlClosełȂ̂";
	mes "I";
	mes "OĂ^000000";
	next;
	menu "Jn",LGvGStart,"~",LGvGEnd,"LZ",-;
	close;
//----------GVG̊Jnݒ(Const.txtŐݒ\)-------------
OnMinute00:
	if (GvGWeekDay == 7) goto LTimeCheck;
	if (GetTime(4) != GvGWeekDay) end;
LTimeCheck:
	if (GetTime(3) == GvGTimeST) goto LGvGStart;
	if (GetTime(3) == GvGTimeED) goto LGvGEnd;
	end;
LGvGStart:
	Announce "UJn",8;
	AgitStart;
	End;
LGvGEnd:
	Announce "UI",8;
	AgitEnd;
	End;
//----------ԒċN̍ĊJ(ċN1ɔf)-----------
OnInit:
	initnpctimer;
	end;
OnTimer60000:
	if (((GetTime(3) >= GvGTimeST) && (GetTime(3) < GvGTimeED) && (GetTime(4) == GvGWeekDay)) || ((GetTime(3) >= GvGTimeST) && (GetTime(3) < GvGTimeED) && (GvGWeekDay == 7))) AgitStart;
	if (((GetTime(3) >= GvGTimeST) && (GetTime(3) < GvGTimeED) && (GetTime(4) == GvGWeekDay)) || ((GetTime(3) >= GvGTimeST) && (GetTime(3) < GvGTimeED) && (GvGWeekDay == 7))) Announce "UĊJ",8;
	stopnpctimer;
	End;
}
//--------------------------------------------------------------------
prontera.gat,159,208,0	script	TBOX Control	111,{
	if (getgmlevel(0)>0) goto Lgmmode;
	close;
Lgmmode:
	mes "[TBOX Control^ff0000(GMp)^000000]";
	mes "󔠂𔭐܂H";
	mes "^3355ffdlClosełȂ̂";
	mes "͂I񂾏ꍇ";
	mes "OĂ^000000";
	next;
	menu "͂",Linit,"",-;
	close;
OnClock0000:
Linit:
	callfunc "make_t_box","aldeg_cas01.gat",114,218,123,227,1324,1325;
	callfunc "make_t_box","aldeg_cas02.gat",130,226,139,235,1326,1327;
	callfunc "make_t_box","aldeg_cas03.gat",220,264,229,273,1328,1329;
	callfunc "make_t_box","aldeg_cas04.gat",80,8,89,17,1330,1331;
	callfunc "make_t_box","aldeg_cas05.gat",58,8,67,17,1332,1333;
	callfunc "make_t_box","gefg_cas01.gat",150,108,159,117,1334,1335;
	callfunc "make_t_box","gefg_cas02.gat",136,112,145,121,1336,1337;
	callfunc "make_t_box","gefg_cas03.gat",266,286,275,295,1338,1339;
	callfunc "make_t_box","gefg_cas04.gat",112,114,121,123,1340,1341;
	callfunc "make_t_box","gefg_cas05.gat",140,106,149,115,1342,1343;
	callfunc "make_t_box","payg_cas01.gat",295,8,304,17,1344,1345;
	callfunc "make_t_box","payg_cas02.gat",140,140,149,149,1346,1347;
	callfunc "make_t_box","payg_cas03.gat",154,164,163,173,1348,1349;
	callfunc "make_t_box","payg_cas04.gat",142,44,151,53,1350,1351;
	callfunc "make_t_box","payg_cas05.gat",152,128,161,137,1352,1353;
	callfunc "make_t_box","prtg_cas01.gat",6,204,15,213,1354,1355;
	callfunc "make_t_box","prtg_cas02.gat",198,224,207,233,1356,1357;
	callfunc "make_t_box","prtg_cas03.gat",184,128,193,137,1358,1359;
	callfunc "make_t_box","prtg_cas04.gat",266,158,275,167,1360,1361;
	callfunc "make_t_box","prtg_cas05.gat",272,174,281,183,1362,1363;
	end;
}

//====================================================================
//Function
//====================================================================
//---------------------------------------------------------------
//ɂf[^Mob
//callfunc "resetcastledata",MAP,"::OnRecvCastleYYY","kapra_XXXgYY",@GIDXX;
function	script	resetcastledata	{
	killmonsterall getarg(0);
	disablenpc getarg(2);
	SetCastleData getarg(0),1,0;
	SetCastleData getarg(0),2,10;
	SetCastleData getarg(0),3,10;
	SetCastleData getarg(0),4,0;
	SetCastleData getarg(0),5,0;
	SetCastleData getarg(0),6,0;
	SetCastleData getarg(0),7,0;
	SetCastleData getarg(0),8,0;
	SetCastleData getarg(0),9,0;
	SetCastleData getarg(0),10,0;
	SetCastleData getarg(0),11,0;
	SetCastleData getarg(0),12,0;
	SetCastleData getarg(0),13,0;
	SetCastleData getarg(0),14,0;
	SetCastleData getarg(0),15,0;
	SetCastleData getarg(0),16,0;
	SetCastleData getarg(0),17,0;
	GetCastleData getarg(0),0,getarg(1);
	Announce " [" + GetCastleName(getarg(0)) + "] [" + GetGuildName(getarg(3)) + "]Mhj܂B",0;
	MapRespawnGuildID getarg(0),GetCastleData(getarg(0),1),7;
	end;
	return;
}
//---------------------------------------------------------------
//GyEjɂf[^XV
//callfunc "resetcastledata2","MAP","::OnRecvCastleYYY";
function	script	resetcastledata2	{
	killmonsterall getarg(0);
	set @WinGuildID,getcharid(2);
	if (@WinGuildID <= 0) end;
	SetCastleData getarg(0),1,@WinGuildID;
	set @Economy,GetCastleData(getarg(0),2)-5;
	if (@Economy<0) set @Economy,0;
	SetCastleData getarg(0),2,@Economy;
	set @Deffence,GetCastleData(getarg(0),3)-5;
	if (@Deffence<0) set @Deffence,0;
	SetCastleData getarg(0),3,@Deffence;
	SetCastleData getarg(0),4,0;
	SetCastleData getarg(0),5,0;
	SetCastleData getarg(0),6,0;
	SetCastleData getarg(0),7,0;
	SetCastleData getarg(0),8,0;
	SetCastleData getarg(0),9,0;
	SetCastleData getarg(0),10,0;
	SetCastleData getarg(0),11,0;
	SetCastleData getarg(0),12,0;
	SetCastleData getarg(0),13,0;
	SetCastleData getarg(0),14,0;
	SetCastleData getarg(0),15,0;
	SetCastleData getarg(0),16,0;
	SetCastleData getarg(0),17,0;
	Announce " [" + GetCastleName(getarg(0)) + "] [" + GetGuildName(@WinGuildID) + "]Mĥ܂",0;
	MapAnnounce getarg(0),"GyEj󂳂܂",17;
	GetCastleData getarg(0),0,getarg(1);
	return;
}
//---------------------------------------------------------------
//Mĥɂf[^XV
//callfunc "resetcastledata3","MAP","::OnRecvCastleYYY";
function	script	resetcastledata3	{
	killmonsterall getarg(0);
	SetCastleData getarg(0),1,0;
	SetCastleData getarg(0),2,0;
	SetCastleData getarg(0),3,0;
	SetCastleData getarg(0),4,0;
	SetCastleData getarg(0),5,0;
	SetCastleData getarg(0),6,0;
	SetCastleData getarg(0),7,0;
	SetCastleData getarg(0),8,0;
	SetCastleData getarg(0),9,0;
	SetCastleData getarg(0),10,0;
	SetCastleData getarg(0),11,0;
	SetCastleData getarg(0),12,0;
	SetCastleData getarg(0),13,0;
	SetCastleData getarg(0),14,0;
	SetCastleData getarg(0),15,0;
	SetCastleData getarg(0),16,0;
	SetCastleData getarg(0),17,0;
	GetCastleData getarg(0),0,getarg(1);
	MapRespawnGuildID getarg(0),GetCastleData(getarg(0),1),7;
	end;
	return;
}
//---------------------------------------------------------------
//󔠔
//callfunc "make_t_box","MAP",x0,y0,x1,y1,MobID1,MobID2;
function	script	make_t_box	{
	killmonster getarg(0),"TresureBox";
	set $@boxnum1,2+(getcastledata(getarg(0),2)+5)/10;
	set $@boxnum2,2+getcastledata(getarg(0),2)/10;
	if ($@boxnum1 > 12)	set $@boxnum1,12;
	if ($@boxnum2 > 12)	set $@boxnum2,12;
	areamonster getarg(0),getarg(1),getarg(2),getarg(3),getarg(4),"",getarg(5),$@boxnum1,"TresureBox";
	areamonster getarg(0),getarg(1),getarg(2),getarg(3),getarg(4),"",getarg(6),$@boxnum2,"TresureBox";
	SetCastleData getarg(0),2,GetCastleData(getarg(0),2)+GetCastleData(getarg(0),4);
	SetCastleData getarg(0),3,GetCastleData(getarg(0),3)+GetCastleData(getarg(0),5);
	SetCastleData getarg(0),4,0;//Ɠ񐔃Zbg
	SetCastleData getarg(0),5,0;//hq񐔃Zbg
	return;
}
//---------------------------------------------------------------
//UJn
//callfunc "agitstarting","MAP","OnGDEMPSetYYY";
function	script	agitstarting	{
	MapRespawnGuildID getarg(0),GetCastleData(getarg(0),1),2;
	if (getcastledata(getarg(0),1) != 0) donpcevent getarg(1);
	GvgOn getarg(0);
	return;
}
//---------------------------------------------------------------
//
//callfunc "flagsc","MAP",AreaFlag,ReturnFlag,X,Y;
//*AreaFlag 1=Aldebaran,2=Other
//*ReturnFlag 1=Allow,2=Deny
function	script	flagsc	{
	set @GID,getcastledata(getarg(0),1);
	if (@GID != 0) goto LStartg;
		mes "[ [~bhKbc ]";
		mes " ";
		mes "1.";
		if (getarg(1) == 1) mes "̓[~bhKbc";
		if (getarg(1) == 1) mes "Vocoha̋ɂA";
		if (getarg(1) == 2) mes "̓[~bhKbc";
		if (getarg(1) == 2) mes "";
		mes "L҂ȂAWgł邱Ƃ";
		mes "\B";
		next;
		mes " ";
		mes "2.";
		mes "Ă鐦";
		mes "ɏāAGyE";
		mes "j󂷂E҂ɂ͍";
		mes "F肷AWgL^";
		close;
LStartg:
		if ((getcharid(2) == @GID) && (getarg(2) == 1)) goto LStartg2;
		mes "[ [~bhKbc ]";
		mes " ";
		mes "1.";
		if (getarg(1) == 1) mes "̓[~bhKbc";
		if (getarg(1) == 1) mes "Vocoha̋ɂA";
		if (getarg(1) == 2) mes "̓[~bhKbc";
		if (getarg(1) == 2) mes "";
		mes "Mh ^ff0000 " + GetGuildName(@GID) + " ^000000";
		mes "Lł邱ƂF߂ĂB";
		next;
		mes " ";
		mes "2.";
		mes "^ff0000 " + GetGuildName(@GID) + " ^000000 ̃}X^[";
		mes "^ff0000 " + getguildmaster(@GID) + " ^000000łB";
		mes "Ɉًĉ҂́A";
		mes "͂ȂĖ_ȂB";
Lclose:
		close;
LStartg2:
		mes "[  ]";
		mes "E҂c";
		mes "N̒nɋA邩H";
		next;
		menu "ԂɋA",-,"߂",Lclose;
			warp getarg(0),getarg(3),getarg(4);end;
		return;
}
//==============================================================================
//-------------------------------------------------------
//j[
//callfunc "Steward_menu0","MAP","NAME";
function	script	Steward_menu0	{
	set @GID,getcastledata(getarg(0),1);
	if (@GID == 0) goto LStart;
	if (getcharid(2) != @GID) goto LStart2;
	if (getcharid(0) == getguildmasterid(@GID)) goto LStart3;
	goto LStart2;
LStart:
	mes "["+getarg(1)+"]";
	mes "͉^ɓ܂܁A";
	mes "̎lɂȂ҂Ă܂B";
	mes "EĆAx̉^";
	mes "ɂȂĂ͂ł傤B";
	close;
LStart2:
	mes "["+getarg(1)+"]";
	mes "Ȃ狺ƂA";
	mes "͎̃}X^[ł";
	mes "^ff0000" + getguildmaster(@GID) + "^000000lɂ̂";
	mes "dgłB";
	mes "K[fBA͂ǂI";
	mes "̖ȎғǕȂI";
	close;
LStart3:
	mes "["+getarg(1)+"]";
	mes "AȂ܂A ^ff0000"+getguildmaster(@GID)+"^000000 lB";
	mes "ȂƂ\t܂B";
	next;
	return;
}
//-------------------------------------------------------
//j[1uԏv(S) 䎌2004/08/05jRO
//callfunc "Steward_menu1","MAP","NAME";
function	script	Steward_menu1	{
	mes "["+getarg(1)+"]";
	mes "Ԃ̏Ԃ񍐂܂B";
	mes " ";
	mes "^0000ff݂̏ƔWl"+GetCastleData(getarg(0),2)+" łB";
	if (GetCastleData(getarg(0),4) != 0) mes "- 1ȓ "+GetCastleData(getarg(0),4)+"̓܂B";
	mes "݂̖hl"+GetCastleData(getarg(0),3)+" łB^000000";
	if (GetCastleData(getarg(0),5) != 0) mes "^0000ff- 1ȓ "+GetCastleData(getarg(0),5)+"̓܂B^000000";
	mes " ";
	mes "ȏłB";
	close;
	return;
}
//-------------------------------------------------------
//j[QuƓv(S) 䎌2004/08/25jRO
//callfunc "Steward_menu2","MAP","NAME";
function	script	Steward_menu2	{
	mes "["+getarg(1)+"]";
	mes "ƔWl߂΁A";
	mes "MhŐY镨i̐";
	mes "܂̂ŁAX̂߂";
	mes "̂낵ł傤B";
	next;
	mes "["+getarg(1)+"]";
	mes "ʏɈ̂ݓ\łA";
	mes "ǉz𕥂Ƃɂ";
	mes "2ڂ̓\ƂȂ܂B";
	next;
	set @TriggerE,GetCastleData(getarg(0),4);
	set @Economy,GetCastleData(getarg(0),2);
	if(@Economy == 100) goto L2_error2;
	set @tmp,(@Economy-@TriggerE)/5;
	set @InvestE,5000*(1+(1+@tmp)*@tmp/2)*(1+3*@TriggerE);
	if (@TriggerE == 0) goto L2_1;
	if (@TriggerE == 1) goto L2_2;
		mes "[rI]";
		mes "^ff0000A͂ł2";
		mes "̂ŁAȏ̓";
		mes "ł܂B";
		mes "^000000܂܂̂W";
		mes "҂Ă܂B";
		close;
L2_1:
	mes "["+getarg(1)+"]";
	mes "ݕKvȓ";
	mes "^ff0000"+ @InvestE +"^000000 ZenyłB";
	mes "v܂H";
	next;
	menu "ƔWɓ",L2_1_1,"",L2_1_0;
L2_2:
	mes "["+getarg(1)+"]";
	mes "1񓊎ȂĂ܂A";
	mes "ǉȂ܂H";
	mes "̏ꍇ ^ff0000"+ @InvestE +"^000000 Zeny";
	mes "KvƂȂ܂B";
	next;
	menu "ƔWɓ",L2_1_1,"",L2_1_0;
	L2_1_0:
		mes "["+getarg(1)+"]";
		mes "܂܂B";
		mes "łKv͂܂B";
		mes "܂łĂB";
		close;
	L2_1_1:
		if(Zeny < @InvestE) goto L2_error;
		set Zeny,Zeny-@InvestE;
		SetCastleData getarg(0),4,@TriggerE+1;
		mes "["+getarg(1)+"]";
		mes "ɓł܂I";
		mes "オ܂܂y݂łˁB";
		mes "甭Wlオł傤B";
		close;
L2_error:/*K*/
	mes "["+getarg(1)+"]";
	mes "}X^[I";
	mes "ɕKvȂ܂B";
	mes "܂B";
	close;
L2_error2:/*K*/
	mes "["+getarg(1)+"]";
	mes "^ff0000ƔWl";
	mes "ݍőlƂȂĂ܂B";
	mes "͓Kv܂B^000000";
 	close;
	return;
}

//-------------------------------------------------------
//j[Ruhqv(S) 䎌2004/08/25jRO
//callfunc "Steward_menu3","MAP","NAME";
function	script	Steward_menu3	{
	mes "["+getarg(1)+"]";
	mes "hql߂΁A";
	mes "K[fBAƃGyE";
	mes "ϋvxサ܂B";
	mes "X̐퓬ɔA";
	mes "Ă̂Ǝv܂B";
	next;
	mes "["+getarg(1)+"]";
	mes "ʏɈ̂ݓ\łA";
	mes "ǉz𕥂Ƃɂ";
	mes "2ڂ̓\ƂȂ܂B";
	next;
	set @TriggerD,GetCastleData(getarg(0),5);
	set @Deffence,GetCastleData(getarg(0),3);
	if(@Deffence == 100) goto L3_error2;
	set @tmp,(@Deffence-@TriggerD)/5;
	set @InvestD,10000*(1+(1+@tmp)*@tmp/2)*(1+3*@TriggerD);
	if (@TriggerD == 0) goto L3_1;
	if (@TriggerD == 1) goto L3_2;
		mes "[rI]";
		mes "^ff0000A͂ł2";
		mes "̂ŁAȏ̓";
		mes "ł܂B";
		mes "^000000܂܂̂W";
		mes "҂Ă܂B";
		close;
L3_1:
	mes "["+getarg(1)+"]";
	mes "ݕKvȓ";
	mes "^ff0000"+ @InvestD +"^000000 ZenyłB";
	mes "v܂H";
	next;
	menu "hqɓ",L3_1_1,"",L3_1_0;
L3_2:
	mes "["+getarg(1)+"]";
	mes "1񓊎ȂĂ܂A";
	mes "ǉȂ܂H";
	mes "̏ꍇ ^ff0000"+ @InvestD +"^000000 Zeny";
	mes "KvƂȂ܂B";
	next;
	menu "hqɓ",L3_1_1,"",L3_1_0;
	L3_1_0:
		mes "["+getarg(1)+"]";
		mes "܂܂B";
		mes "łKv͂܂B";
		mes "܂łĂB";
		close;
	L3_1_1:
		if(Zeny < @InvestD) goto L3_error;
		set Zeny,Zeny-@InvestD;
		SetCastleData getarg(0),5,@TriggerD+1;
		mes "["+getarg(1)+"]";
		mes "ɓł܂I";
		mes "オ܂܂y݂łˁB";
		mes "hqlオł傤B";
		close;
L3_error:/*K*/
	mes "["+getarg(1)+"]";
	mes "}X^[I";
	mes "ɕKvȂ܂B";
	mes "܂B";
	close;
L3_error2:/*K*/
	mes "["+getarg(1)+"]";
	mes "^ff0000hql͌100%łB";
	mes "͓Kv܂B^000000";
	close;
	return;
}
//-------------------------------------------------------
//j[SuK[fBAzuv(⏕)
//callfunc "Steward_menu4","MAP","NAME";
function	script	Steward_menu4	{
	mes "["+getarg(1)+"]";
	mes "K[fBAݒu܂H";
	mes "K[fBA͎̍Ԃ";
	mes "҂ƂȂ܂B";
	mes "ݒuK[fBA";
	mes "IĂB";
	next;
	menu "Gurdian 1",L4_1,"Gurdian 2",L4_2,"Gurdian 3",L4_3,"Gurdian 4",L4_4,"Gurdian 5",L4_5,"Gurdian 6",L4_6,"Gurdian 7",L4_7,"Gurdian 8",L4_8;

//ۂMenu(B5Ql)
//menu "A[`[K[fBA - ݒuł܂",L_MENU_1,"A[`[K[fBA - ݒuł܂",L_MENU_2,"\W[K[fBA - ݒuł܂",L_MENU_3,"\W[K[fBA - ݒuł܂",L_MENU_4,"iCgK[fBA - ݒuł܂",L_MENU_5,"\W[K[fBA - ݒuł܂",L_MENU_6,"iCgK[fBA - ݒuł܂",L_MENU_7,"}X^[K[fBA - ݒuł܂ (31214 / 31214)",L_MENU_8;
//
//ݒuł邩oȂ̕\ƁAꍇHP\B
//܂Aꍇłݒu\łȀꍇHP񕜂邱ƂoB
		L4_1:
			if (GetCastleData(getarg(0),10) == 1) goto L4Error2;
			set @GDnum,10;goto L4_9;
		L4_2:
			if (GetCastleData(getarg(0),11) == 1) goto L4Error2;
			set @GDnum,11;goto L4_9;
		L4_3:
			if (GetCastleData(getarg(0),12) == 1) goto L4Error2;
			set @GDnum,12;goto L4_9;
		L4_4:
			if (GetCastleData(getarg(0),13) == 1) goto L4Error2;
			set @GDnum,13;goto L4_9;
		L4_5:
			if (GetCastleData(getarg(0),14) == 1) goto L4Error2;
			set @GDnum,14;goto L4_9;
		L4_6:
			if (GetCastleData(getarg(0),15) == 1) goto L4Error2;
			set @GDnum,15;goto L4_9;
		L4_7:
			if (GetCastleData(getarg(0),16) == 1) goto L4Error2;
			set @GDnum,16;goto L4_9;
		L4_8:
			if (GetCastleData(getarg(0),17) == 1) goto L4Error2;
			set @GDnum,17;goto L4_9;
L4Error:
	mes "["+getarg(1)+"]";
	mes "}X^[cK[fBAݒu";
	mes "KvȌmsĂ܂B";
	mes "K[fBAݒuɊւm";
	mes "邽߂ɂ́AMhXL";
	mes "^ff0000K[fBA쌤^000000";
	mes "KȂ΂Ȃ܂B";
	close;
L4Error2:/*K*/
	mes "["+getarg(1)+"]";
	mes "}X^[I";
	mes "ɃK[fBAݒuĂ܂B";
	mes " ";
	mes "K[fBAݒu܂B";
	close;
L4Error3:/*K*/
	mes "["+getarg(1)+"]";
	mes "}X^[I";
	mes "ɕKvȂ܂B";
	mes "܂B";
	close;
	L4_9:
		mes "["+getarg(1)+"]";
		mes "IK[fBA";
		mes "{ɐݒu܂Hݒuɂ";
		mes "^ff000010000^000000ZenyKvłB";
		next;
		menu "ݒu",L4_9_1,"߂",-;
			mes "["+getarg(1)+"]";
			mes "܂܂B";
			mes "ɗ]Tł́A";
			mes "Аݒu邱Ƃ";
			mes "ߒv܂B";
			close;
		L4_9_1:
		if (getgdskilllv(@GID,GD_GUARDIANRESEARCH) == 0) goto L4Error;
		if (Zeny < 10000) goto L4Error3;
		set Zeny,Zeny-10000;
		setcastledata getarg(0),@GDnum,1;
	return;
}
//-------------------------------------------------------
//j[TuJv_v(S)
//callfunc "Steward_menu5","MAP","NAME","Kapra_xxx";
function	script	Steward_menu5	{
	if (GetCastleData(getarg(0),9) == 1) goto Lkafra_dimi;
//(When Karfa off) Employment
	mes "["+getarg(1)+"]";
	mes "Jv{ЂƂ̌_āA";
	mes "ԓɃJvEق܂H";
	mes "ٗpɂ^ff000010000^000000ZenyKvłc";
	next;
	menu "ق",-,"",L_k_e;
		if (getgdskilllv(@GID,GD_KAFRACONTACT) != 0) goto L_k_0;
		mes "["+getarg(1)+"]";
		mes "}X^[c܂Jv{ЂƂ";
		mes "_񂪌΂Ă܂B";
		mes "_Ȃ΁A";
		mes "JvEقƂł܂B";
		next;
		mes "["+getarg(1)+"]";
		mes "Jv{ЂƂ̌_]݂ȂA";
		mes "MhXL";
		mes " ^ff0000Jv_^000000 XL";
		mes "KȂ΂Ȃ܂B";
		close;
	L_k_0:/*K*/
		if (Zeny > 10000) goto L_k_1;
		mes "["+getarg(1)+"]";
		mes "}X^[I܂I";
		close;
	L_k_1:/*K*/
		set Zeny,Zeny-10000;
		enablenpc getarg(2);
		setcastledata getarg(0),9,1;
		mes "["+getarg(1)+"]";
		mes "JvƂ̌_񂪊܂";
		next;
		cutin "kafra_01",2;
		mes "[JvE]";
		mes "߂܂āA";
		mes "JvfBtHeƐ\܂B";
		mes "őPs܂̂ŋX˂܂I";
		next;
		cutin "kafra_01",255;
		mes "["+getarg(1)+"]";
		mes "Mhx[XŃJvƂ̌_ێ邽߂";
		mes "Zeny𕥂Ȃ΂Ȃ܂B";
		mes "()";
		close;
L_k_e:
		mes "["+getarg(1)+"]";
		mes "܂܂B";
		mes "AMĥ߂ɂ";
		mes "֐̌YĂ";
		mes "Ȃ܂B";
		close;
//(When karfa ON) Dismissal
Lkafra_dimi:
	mes "["+getarg(1)+"]";
	mes "JvEƂ̌_j܂H";
	next;
	menu "ق",-,"LZ",L_D_1;
		cutin "kafra_01",2;
		mes "[JvE]";
		mes "cԈĂ܂H";
		mes "ꂩ͋C܂c";
		mes "Ă͂炦܂񂩁c";
		next;
		menu "ق",-,"LZ",L_D_2;
				mes "[JvE]";
				mes "AقȂłˁc";
				next;
				disablenpc getarg(2);
				setcastledata getarg(0),9,0;
				cutin "kafra_01",255;
				mes "["+getarg(1)+"]";
				mes "c";
				mes "JvƂ̌_񂪔j܂B";
				close;
			L_D_2:
				mes "[JvE]";
				mes "肪Ƃ܂B";
				mes "S͂sĎɂ܂I";
				close2;
				cutin "kafra_01",255;
				end;
		L_D_1:
			mes "["+getarg(1)+"]";
			mes "킩܂B";
			close;
	return;
}
//-------------------------------------------------------
//j[6u}X^[[֍sv(S) 䎌2004/08/25jRO
//callfunc "Steward_menu6","MAP","Name",x,y;
function	script	Steward_menu6	{
	mes "["+getarg(1)+"]";
	mes "̋MdȐYi̐X";
	mes "~Ă镔";
	mes "̂łˁH";
	mes "́A}X^[ɂ̂";
	mes "ꂽł܂B";
	next;
	menu "}X^[̕ɓ",-,"",L6_1;
		mes "["+getarg(1)+"]";
		mes "ł͂ēv܂B";
		mes "ɂĂ炵ĂB";
		mes "Aė鎞͉BXCb`";
		mes "삷΋A܂B";
		close2;
		warp getarg(0),getarg(2),getarg(3);
		end;
	L6_1:
		mes "["+getarg(1)+"]";
		mes "Yi͈Ɉ񐶎Y\łA";
		mes "x܂Œ~Ƃȏ";
		mes "YȂȂ܂BłA";
		mes "B̃Mh̔Ŵ߂ɂ";
		mes "KxɎoȂ΂Ȃ܂B";
		close;
		return;
}
//-------------------------------------------------------
//j[7uԉ́v(⏕)
//callfunc "Steward_menu7","MAP","NAME";
function	script	Steward_menu7	{
	mes "["+getarg(1)+"]";
	mes "}X^[I";
	mes "AWgłIH";
	mes " ";
	mes "ǂlĂA}X^[I";
	next;
	menu "AWg",L7_1,"LZ",L7_2;
	L7_1:
		mes "["+getarg(1)+"]";
		mes "}X^[I";
		mes "ǂxlĂc";
		mes "ǂAA肢!!!!!!!!";
		next;
		menu "߂",-,"AWg",L7_2;
			mes "["+getarg(1)+"]";
			mes "CGbT[I}X^[^^!";
			mes "Aȏk悵Ă^^.";
			close;
		L7_2:
			mes "["+getarg(1)+"]";
			mes "}X^[!!c";
			mes "ccc₾cccc";
			next;
			return;
}
//-------------------------------------------------------
//MhXCb`
//callfunc "gdswitch","MAP",x,y;
function	script	gdswitch	{
	mes "ȃo[܂B";
	mes "܂H";
	next;
	menu "",-,"Ȃ",L2;
	warp getarg(0),getarg(1),getarg(2);
	end;
L2:
	close;
	return;
}
//-------------------------------------------------------
//MhXCb`
//callfunc "gdswitch2","MAP1","MAP2",x,y;
function	script	gdswitch2	{
	mes "[]";
	mes "ɒނȂΐ֐iނ悢";
	next;
	mes " ";
	mes "ȃo[܂B";
	mes "܂H";
	next;
	menu "",-,"Ȃ",L2;
	getcastledata getarg(0),1,@GID;
	if (getcharid(2) != @GID) goto L1n;
	if (0 == @GID) goto L1n;
	warp getarg(1),getarg(2),getarg(3);
	end;
L1n:
	mes " ";
	mes "NȂB";
L2:
	close;
	return;
}
//==============================================================================
//-------------------------------------------------------
/MhJvuj[v
//callfunc "gkfmenu","MAP";
function	script	gkfmenu	{
	cutin "kafra_01",2;
	set @GID,getcastledata(getarg(0),1);
	if (getcharid(2) == @GID) goto LStartg;
	mes "[JvE]";
	mes "́AMh";
	mes "^ff0000" + GetGuildName(@GID) + "^000000";
	mes "̊Flɂd悤";
	mes "_񂳂Ă܂B";
	mes "̃JvT[rX";
	mes "p܂B";
	close2;
	cutin "kafra_01",255;
	end;
LStartg:
	mes "[JvE]";
	mes "Ⴂ܂^ff0000" + GetGuildName(@GID) + "^000000̊F";
	mes "JvT[rX";
	mes "Fl̂΂ɂ܂B";
	next;
	return;
}
//-------------------------------------------------------
/MhJvu[vv
//callfunc "gkfwarp","JMAPNAME","MAP",x,y;
function	script	gkfwarp	{
	mes "[JvE]";
	mes "ړInIщB";
	next;
	menu ""+getarg(0)+" -> 200 z",L3_1,"",L3_2;
		L3_1:
			if (Zeny < 200) goto Lerror3;
			set Zeny,Zeny-200;set KF_PIT,KF_PIT+20;
			warp getarg(1),getarg(2),getarg(3);
			end;
		L3_2:
				mes "[JvE]";
				mes "肪Ƃ܂B";
				mes "܂p܂B";
				close2;
				cutin "kafra_01",255;
				end;
		Lerror3:
				mes "[JvE]";
  				mes "qlA܂B";
   				mes "m߂B";
				cutin "kafra_01",255;
				close2;
				cutin "kafra_01",255;
				end;
	return;
}
