//===== eAthena Script =======================================
//= War of Emperium Treasure Rooms for Al De Baran Guild Castles
//===== By: ==================================================
//= jAthena - kalen (1.0)
//= 1.1 by Akaru, ho|yAnge|X, and Valaris
//===== Current Version: =====================================
//= 1.2
//===== Compatible With: =====================================
//= eAthena 0.1+; RO Episode 4+
//===== Description: =========================================
//=
//===== Additional Comments: =================================
//= v1.2 Optimized with functions.[kobra_k88]
//============================================================


//<=============================== Castle 1 =================================>\\

// Treasure Spawn -----------------------
aldeg_cas01.gat,1,1,1	script	Treasure_A01	-1,{

OnRecvCastleA01:
	if($boxNumA01 == 0) end;
	set $@bxA01, $boxNumA01;
//	callfunc "F_GldTreas","aldeg_cas01","A01",$boxNumA01,$@bxA01,$@boxIdA01,1324,114,218,123,227,1;
	end;

OnDied:
	mapannounce "aldeg_cas01.gat","Treasure Chest Broken Open",17;
	set $boxNumA01, $boxNumA01 -1;
	if($boxNumA01 == 0) mapannounce "aldeg_cas01.gat", "All of the treasure boxes have been opened.  You must wait untill the next day for them to appear again.",0;
	end;
}

// Treasure Room Switch --------------------
aldeg_cas01.gat,123,223,0	script	Switch#TresA01	111,{
	callfunc "F_GldTreasSw", "aldeg_cas01",218,176;
	end;
}

//<================================ Castle 2 ================================>\\

// Treasure Spawn ----------------------------
aldeg_cas02.gat,1,1,1	script	Treasure_A02	-1,{

OnRecvCastleA02:
	if($boxNumA02 == 0) end;
	set $@bxA02, $boxNumA02;
//	callfunc "F_GldTreas","aldeg_cas02","A02",$boxNumA02,$@bxA02,$@boxIdA02,1326,130,226,138,235,1;
	end;

OnDied:
	mapannounce "aldeg_cas02.gat","Treasure Chest Broken Open",17;
	set $boxNumA02, $boxNumA02 -1;
	if($boxNumA02 == 0) mapannounce "aldeg_cas02.gat", "All of the treasure boxes have been opened.  You must wait untill the next day for them to appear again.",0;
	end;
}

// Treasure Room Switch ----------------------
aldeg_cas02.gat,139,235,0	script	Switch#TresA02	111,{
	callfunc "F_GldTreasSw", "aldeg_cas02",78,75;
}

//<================================ Castle 3 ================================>\\

// Treasure Spawn ---------------------------
aldeg_cas03.gat,1,1,1	script	Treasure_A03	-1,{

OnRecvCastleA03:
	if($boxNumA03 == 0) end;
	set $@bxA03, $boxNumA03;
//	callfunc "F_GldTreas","aldeg_cas03","A03",$boxNumA03,$@bxA03,$@boxIdA03,1328,220,264,229,273,1;
	end;

OnDied:
	mapannounce "aldeg_cas03.gat","Treasure Chest Broken Open",17;
	set $boxNumA03, $boxNumA03 -1;
	if($boxNumA03 == 0) mapannounce "aldeg_cas03.gat", "All of the treasure boxes have been opened.  You must wait untill the next day for them to appear again.",0;
	end;
}

// Treasure Room Switch -----------------------
aldeg_cas03.gat,229,267,0	script	Switch#TresA03	111,{
	callfunc "F_GldTreasSw", "aldeg_cas03",110,119;
}

//<================================ Castle 4 ================================>\\

// Treasure Spawn -------------------------------
aldeg_cas04.gat,1,1,1	script	Treasure_A04	-1,{

OnRecvCastleA04:
	if($boxNumA04 == 0) end;
	set $@bxA04, $boxNumA04;
//	callfunc "F_GldTreas","aldeg_cas04","A04",$boxNumA04,$@bxA04,$@boxIdA04,1330,80,8,89,17,1;
	end;

OnDied:
	mapannounce "aldeg_cas04.gat","Treasure Chest Broken Open",17;
	set $boxNumA04, $boxNumA04 -1;
	if($boxNumA04 == 0) mapannounce "aldeg_cas04.gat", "All of the treasure boxes have been opened.  You must wait untill the next day for them to appear again.",0;
	end;

}
// Treasure Room Switch -------------------------
aldeg_cas04.gat,83,17,0	script	Switch#TresA04	111,{
	callfunc "F_GldTreasSw", "aldeg_cas04",67,117;
}

//<================================ Castle 5 ================================>\\

// Treasure Spawn ------------------------------------
aldeg_cas05.gat,1,1,1	script	Treasure_A05	-1,{

OnRecvCastleA05:
	if($boxNumA05 == 0) end;
	set $@bxA05, $boxNumA05;
//	callfunc "F_GldTreas","aldeg_cas05","A05",$boxNumA05,$@bxA05,$@boxIdA05,1332,58,8,65,15,1;
	end;

OnDied:
	mapannounce "aldeg_cas05.gat","Treasure Chest Broken Open",17;
	set $boxNumA05, $boxNumA05 -1;
	if($boxNumA05 == 0) mapannounce "aldeg_cas05.gat", "All of the treasure boxes have been opened.  You must wait untill the next day for them to appear again.",0;
	end;
}

// Treasure Room Switch ---------------------------------
aldeg_cas05.gat,64,8,0	script	Switch#TresA05	111,{
	callfunc "F_GldTreasSw", "aldeg_cas05",51,179;
}
