Browse Source

Merge branch 'woe_te' into woe_te-restrictions

Signed-off-by: Atemo <capucrath@gmail.com>
Atemo 9 years ago
parent
commit
c094314b66

+ 0 - 0
npc/re/woe_te/te_guides.txt → npc/re/guides/guides_woe_te.txt


+ 40 - 40
npc/re/woe_te/te_merchant.txt → npc/re/merchants/te_merchant.txt

@@ -14,7 +14,7 @@ te_alde_gld,215,184,4	duplicate(TE Potion Merchant#prt)	TE Potion Merchant#alde
 //=======================================
 -	script	rental_woe_TE	-1,{
 	mes "[Rental Items Manager]";
-	if (CanParticipatewoeTE() == 1) {
+	if (canParticipateSiegeTE() == 1) {
 		.@list01$ = "[Shield] [Armor] [Garment]";
 		.@list02$ = "[Helmet] [Accessory] [Shoes]";
 		.@list03$ = "[Sword] [Spear] [Axe] [Katar]";
@@ -41,58 +41,58 @@ te_alde_gld,215,184,4	duplicate(TE Potion Merchant#prt)	TE Potion Merchant#alde
 				end;
 			case 2:
 				callsub( S_Rent, "shields, armors, and garments",
-					 2178,"TE Siege Buckler",// TE_Woe_Buckler
-					 2179,"TE Siege Shield",// TE_Woe_Shield
-					 2180,"TE Siege Magic Guard",// TE_Woe_Magic_Guard
-					15062,"TE Siege Long Coat",// TE_Woe_Coat
-					15063,"TE Siege Mail",// TE_Woe_Chain_Mail
-					15064,"TE Siege Magic Coat",// TE_Woe_Mage_Coat
-					20702,"TE Siege Muffler",// TE_Woe_Muffler
-					20703,"TE Siege Cape",// TE_Woe_Manteau
-					20704,"TE Siege Magic Cape" );// TE_Woe_Magic_Manteau
+					 2178,"TE Siege Buckler",		// TE_Woe_Buckler
+					 2179,"TE Siege Shield",		// TE_Woe_Shield
+					 2180,"TE Siege Magic Guard",	// TE_Woe_Magic_Guard
+					15062,"TE Siege Long Coat",		// TE_Woe_Coat
+					15063,"TE Siege Mail",			// TE_Woe_Chain_Mail
+					15064,"TE Siege Magic Coat",	// TE_Woe_Mage_Coat
+					20702,"TE Siege Muffler",		// TE_Woe_Muffler
+					20703,"TE Siege Cape",			// TE_Woe_Manteau
+					20704,"TE Siege Magic Cape" );	// TE_Woe_Magic_Manteau
 				break;
 			case 3:
 				callsub( S_Rent, "helmets, accessories, and shoes",
-					2496,"TE Siege Shoes",// TE_Woe_Shoes
-					2497,"TE Siege Boots",// TE_Woe_Boots
-					2498,"TE Siege Magic Sandals",// TE_Woe_Magic_Sandal
-					2944,"TE Guardian Ring",// TE_Ring_Of_Protection
-					2945,"TE Ring of Wrath",// TE_Ring_Of_Rage
-					2946,"TE Ring of Rebellion",// TE_Ring_Of_Defiance
-					18732,"TE Siege Cap",// TE_Woe_Cap
-					18733,"TE Siege Bone Helm",// TE_Woe_Bone_Helm
-					18734,"TE Siege Magic Eyes" );// TE_Woe_Magic_Eyes
+					2496,"TE Siege Shoes",			// TE_Woe_Shoes
+					2497,"TE Siege Boots",			// TE_Woe_Boots
+					2498,"TE Siege Magic Sandals",	// TE_Woe_Magic_Sandal
+					2944,"TE Guardian Ring",		// TE_Ring_Of_Protection
+					2945,"TE Ring of Wrath",		// TE_Ring_Of_Rage
+					2946,"TE Ring of Rebellion",	// TE_Ring_Of_Defiance
+					18732,"TE Siege Cap",			// TE_Woe_Cap
+					18733,"TE Siege Bone Helm",		// TE_Woe_Bone_Helm
+					18734,"TE Siege Magic Eyes" );	// TE_Woe_Magic_Eyes
 				break;
 			case 4:
 				callsub( S_Rent, "swords, spears, axes, and katars",
-					1299,"TE Siege Katar",// TE_Woe_Katar
-					1399,"TE Siege Two-Handed Axe",// TE_Woe_Two_Handed_Axe
-					1495,"TE Siege Lance",// TE_Woe_Lance
-					13317,"TE Siege Magic Shuriken",// TE_Woe_Huuma
-					21006,"TE Siege Two-Handed Sword",// TE_Woe_Two_Hand_Sword
-					1319,"TE Siege Axe",// TE_Woe_Axe
-					1437,"TE Siege Pike",// TE_Woe_Pike
-					13083,"TE Siege Knife",// TE_Woe_Knife
-					13439,"TE Siege Sword" );// TE_Woe_Sword
+					1299,"TE Siege Katar",				// TE_Woe_Katar
+					1399,"TE Siege Two-Handed Axe",		// TE_Woe_Two_Handed_Axe
+					1495,"TE Siege Lance",				// TE_Woe_Lance
+					13317,"TE Siege Magic Shuriken",	// TE_Woe_Huuma
+					21006,"TE Siege Two-Handed Sword",	// TE_Woe_Two_Hand_Sword
+					1319,"TE Siege Axe",				// TE_Woe_Axe
+					1437,"TE Siege Pike",				// TE_Woe_Pike
+					13083,"TE Siege Knife",				// TE_Woe_Knife
+					13439,"TE Siege Sword" );			// TE_Woe_Sword
 				break;
 			case 5:
 				callsub( S_Rent, "staves, maces, books, and fists",
 					2019,"TE Siege Two-Handed Staff",// TE_Woe_Two_Hand_Staff
-					1591,"TE Siege Book",// TE_Woe_Book
-					1667,"TE Siege Staff",// TE_Woe_Staff
-					1834,"TE Siege Fist",// TE_Woe_Fist
-					16025,"TE Siege Mace" );// TE_Woe_Mace
+					1591,"TE Siege Book",			// TE_Woe_Book
+					1667,"TE Siege Staff",			// TE_Woe_Staff
+					1834,"TE Siege Fist",			// TE_Woe_Fist
+					16025,"TE Siege Mace" );		// TE_Woe_Mace
 				break;
 			case 6:
 				callsub( S_Rent, "bows, guns, musical instruments, and whips",
-					18118,"TE Siege Bow",// TE_Woe_Bow
-					13117,"TE Siege Pistol",// TE_Woe_Pistol
-					13184,"TE Siege Rifle",// TE_Woe_Rifle
-					13185,"TE Siege Gatling Gun",// TE_Woe_Gatling
-					13186,"TE Siege Shotgun",// TE_Woe_Shotgun
-					13187,"TE Siege Grenade Gun",// TE_Woe_Grenade
-					1932,"TE Siege Guitar",// TE_Woe_Guitar
-					1987,"TE Siege Rope" );// TE_Woe_Rope
+					18118,"TE Siege Bow",			// TE_Woe_Bow
+					13117,"TE Siege Pistol",		// TE_Woe_Pistol
+					13184,"TE Siege Rifle",			// TE_Woe_Rifle
+					13185,"TE Siege Gatling Gun",	// TE_Woe_Gatling
+					13186,"TE Siege Shotgun",		// TE_Woe_Shotgun
+					13187,"TE Siege Grenade Gun",	// TE_Woe_Grenade
+					1932,"TE Siege Guitar",			// TE_Woe_Guitar
+					1987,"TE Siege Rope" );			// TE_Woe_Rope
 				break;
 			case 7:
 				mes "[Rental Items Manager]";

+ 27 - 0
npc/re/other/Global_Functions.txt

@@ -0,0 +1,27 @@
+//============================================================ 
+//===== rAthena Script =======================================
+//= Global Functions
+//===== Description: =========================================
+//= General script functions.
+//===== Changelogs: ==========================================
+//= 1.0 Added WoeTECheckHour(X) function to check if the woe
+//	will start in X hour. [Capuche]
+//============================================================
+
+// WoeTETimeStart(<seconds>) : return 1 if the woe te will start in less than X seconds, 0 otherwise
+function	script	WoeTETimeStart	{
+	.@woe_status = agitcheck3();
+	.@min_today  = gettime(2);
+	.@hour_today = gettime(3);
+	.@day_today  = gettime(4);
+
+	if (getvariableofnpc( getd( ".day_"+ .@day_today ),"woe_TE_contoller" )) {
+		.@h = getvariableofnpc( getd( ".hour_start_"+ .@hour_today ),"woe_TE_contoller" );
+		if (.@h > .@hour_today) {
+			.@time = (60 - .@min_today) *60 + ( .@h - .@hour_today -1 ) *3600;
+			if (.@time <= getarg(0))
+				return 1;
+		}
+	}
+	return 0;
+}

+ 1 - 2
npc/re/woe_te/te_goditem_alde1.txt → npc/re/quests/woe_te/te_goditem_alde1.txt

@@ -12,7 +12,6 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "You have too many items to proceed with the quest.";
 		mes "Please lighten your load and try again.";
 		close;
	}
-	// .@time_check = OpenHour_SiegeMode 3 14400
 
 	.@guild_id = getcastledata( "te_aldecas1",1 );
 	.@economy = getcastledata("te_aldecas1",2);
@@ -29,7 +28,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "Please, pretend not to see me.";
 		close;
 	}
-	if (.@time_check == 1 || agitcheck3() == 1) {
+	if (WoeTETimeStart(14400) == 1 || agitcheck3() == 1) {
 		mes "From now on, I'll stay here quietly and not interrupt anyone until the siege ends.";
 		mes "Don't worry about me.";
 		close;

+ 8 - 9
npc/re/woe_te/te_goditem_prt01.txt → npc/re/quests/woe_te/te_goditem_prt01.txt

@@ -12,7 +12,6 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "You have too many items to proceed with the quest.";
 		mes "Please lighten your load and try again.";
 		close;
	}
-	// .@time_check = OpenHour_SiegeMode 3 14400
 
 	.@guild_id = getcastledata( "te_prtcas01",1 );
 	.@economy = getcastledata( "te_prtcas01",2 );
@@ -29,7 +28,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "Please, pretend not to see me.";
 		close;
 	}
-	if (.@time_check == 1 || agitcheck3() == 1) {
+	if (WoeTETimeStart(14400) == 1 || agitcheck3() == 1) {
 		mes "From now on, I'll stay here quietly and not interrupt anyone until the siege ends.";
 		mes "Don't worry about me.";
 		close;
@@ -688,7 +687,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Aira#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#aira_real_prt01::OnCommandOn";
-	npctalk "My summon water balls! I'll get you! With my own hands!!";
+	npctalk "Aira: My summon water balls! I'll get you! With my own hands!!";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Aira#fake01_prt01::OnMyMobDead";
@@ -724,7 +723,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Kuluna#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#kuluna_real_prt01::OnCommandOn";
-	npctalk "Hmm? So you're going to be that way? You'd better be ready!";
+	npctalk "Kuluna: Hmm? So you're going to be that way? You'd better be ready!";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Kuluna#fake01_prt01::OnMyMobDead";
@@ -760,7 +759,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Mallina#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#mallina_real_prt01::OnCommandOn";
-	npctalk "Stop it!! Stop bothering me!!";
+	npctalk "Mallina: Stop it!! Stop bothering me!!";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Mallina#fake01_prt01::OnMyMobDead";
@@ -794,7 +793,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Ezella#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#ezella_real_prt01::OnCommandOn";
-	npctalk "Ahh... This only makes both of us more tired...";
+	npctalk "Ezella: Ahh... This only makes both of us more tired...";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Ezella#fake01_prt01::OnMyMobDead";
@@ -832,7 +831,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Lune#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#lune_real_prt01::OnCommandOn";
-	npctalk "..you want to be drowned in the deep sea? Huh?";
+	npctalk "Lune: ..you want to be drowned in the deep sea? Huh?";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Lune#fake01_prt01::OnMyMobDead";
@@ -887,7 +886,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Morin#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#morin_real_prt01::OnCommandOn";
-	npctalk "... . ...";
+	npctalk "Morin: ... . ...";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Morin#fake01_prt01::OnMyMobDead";
@@ -924,7 +923,7 @@ OnCommandOn:
 OnMyMobDead:
 	if (mobcount( "te_prtcas01","Nasarin#fake01_prt01::OnMyMobDead" )) end;
 	donpcevent "#nasarin_real_prt01::OnCommandOn";
-	npctalk "..Ahh.. It's so hard to become a Valkyrie!";
+	npctalk "Nasarin: ..Ahh.. It's so hard to become a Valkyrie!";
 OnReset:
 	stopnpctimer;
 	killmonster "te_prtcas01", "Nasarin#fake01_prt01::OnMyMobDead";

+ 0 - 0
npc/re/woe_te/te_mission_alde.txt → npc/re/quests/woe_te/te_mission_alde.txt


+ 8 - 13
npc/re/woe_te/te_mission_main.txt → npc/re/quests/woe_te/te_mission_main.txt

@@ -46,7 +46,7 @@ S_Event:
 OnMyMobDead:
 	.@map$ = strnpcinfo(4);
 	if (mobcount( .@map$,strnpcinfo(0) +"::OnMyMobDead" ) < 1 && playerattached()) {// playerattached stop the script if killmonster / maprespawnguildid
-		callsub S_Coord, .@item_id, .@mob_id, .@mob_name$, .@coord;
+		callsub S_Coord, .@item_id, .@mob_id, .@coord;
 		for ( .@mtem = 0; .@mtem < 20; .@mtem++ )
 			makeitem .@item_id,1, .@map$, rand( .@coord[0],.@coord[1] ), rand( .@coord[2],.@coord[3] );
 		initnpctimer;
@@ -56,8 +56,8 @@ OnMyMobDead:
 OnTimer12000:
 	stopnpctimer;
 OnCommandOn:
-	callsub S_Coord, .@item_id, .@mob_id, .@mob_name$, .@coord;
-	monster strnpcinfo(4), rand( .@coord[0],.@coord[1] ), rand( .@coord[2],.@coord[3] ),.@mob_name$,.@mob_id,1,strnpcinfo(0) + "::OnMyMobDead";// THIEF_PORING, BABY_STRANGE -> !TODO: not implemented
+	callsub S_Coord, .@item_id, .@mob_id, .@coord;
+	monster strnpcinfo(4), rand( .@coord[0],.@coord[1] ), rand( .@coord[2],.@coord[3] ),"--ja--",.@mob_id,1,strnpcinfo(0) + "::OnMyMobDead";
 	end;
 
 OnReset:
@@ -69,10 +69,9 @@ S_Coord:
 	if (compare( strnpcinfo(4),"te_alde" )) {
 		set getarg(0), 7056;// Payroll_Of_Kafra
 		set getarg(1), 2450;// THIEF_PORING
-		set getarg(2), "Poring the Thief";
 		.@hidden_name$ = strnpcinfo(2);
 
-		if (.@hidden_name$ == "popa_alde01") setarray .@coord[0],178,234, 128,175;// x1,x2, y1,y2
+		if (.@hidden_name$ == "popa_alde01") setarray .@coord[0],178,234, 128,175;// area x1,x2, y1,y2
 		else if (.@hidden_name$ == "popb_alde01") setarray .@coord[0],14,65, 186,222;
 		else if (.@hidden_name$ == "popc_alde01") setarray .@coord[0],46,114, 37,105;
 		else if (.@hidden_name$ == "popd_alde01") setarray .@coord[0],198,233, 5,41;
@@ -96,7 +95,6 @@ S_Coord:
 	else {
 		set getarg(0), 6592;// Small_Wooden_Chest
 		set getarg(1), 2451;// BABY_STRANGE
-		set getarg(2), "Suspicious Babee";
 		.@hidden_name$ = strnpcinfo(2);
 
 		if (.@hidden_name$ == "popa_prt01") setarray .@coord[0],10,90, 10,80;
@@ -121,7 +119,7 @@ S_Coord:
 		else if (.@hidden_name$ == "popd_prt05") setarray .@coord[0],205,282, 12,93;
 	}
 	for ( .@i = 0; .@i < 4; .@i++ )
-		set getelementofarray( getarg(3),.@i ), .@coord[.@i];
+		set getelementofarray( getarg(2),.@i ), .@coord[.@i];
 	return;
 }
 
@@ -162,7 +160,7 @@ S_Coord:
 			7509,"30 Small Wooden Boxes" );
 	}
 	mes "["+ .@npc_name$ +"]";
-	if (CanParticipatewoeTE() == 0) {
+	if (canParticipateSiegeTE() == 0) {
 		mes "Ah... you...";
 		mes "based on TE rules, I won't be ordering you or asking you favors unfortunately.";
 		next;
@@ -181,7 +179,7 @@ S_Coord:
 			mes "Honestly, it's hard to complete a mission if your level is too low.";
 			close;
 		}
-		// .@time_check = OpenHour_SiegeMode 3 3600
+		.@time_check = WoeTETimeStart(3600);
 		.@siege_check = agitcheck3();
 		mes "You already know that you have to accept a mission in a certain period of time, right?";
 		if (.@time_check == 1 || .@siege_check == 1)
@@ -491,9 +489,7 @@ S_Coord:
 
 S_Cancelquest:
 	.@npc_name$ = getarg(1);
-	// .@time_check = = OpenHour_SiegeMode 3 3600
-	.@siege_check = agitcheck3();
-	if ((.@time_check == 1) || (.@siege_check == 1)) {
+	if (WoeTETimeStart(3600) == 1 || agitcheck3()) {
 		mes "It seems like you haven't accomplished the mission yet?";
 		mes getarg(2);
 		next;
@@ -569,4 +565,3 @@ S_Menu:
 	}
 	return .@menu$;
 }
-

+ 0 - 0
npc/re/woe_te/te_mission_prt.txt → npc/re/quests/woe_te/te_mission_prt.txt


+ 9 - 1
npc/re/scripts_athena.conf

@@ -48,6 +48,7 @@ npc: npc/re/guides/guides_prontera.txt
 npc: npc/re/guides/guides_rachel.txt
 npc: npc/re/guides/guides_umbala.txt
 npc: npc/re/guides/guides_veins.txt
+npc: npc/re/guides/guides_woe_te.txt
 
 // ------------------------ Instances ---------------------------
 npc: npc/re/instances/BakonawaLake.txt
@@ -89,10 +90,12 @@ npc: npc/re/merchants/shops.txt
 //npc: npc/re/merchants/ticket_refiner.txt
 //npc: npc/re/merchants/enchan_upg.txt
 //npc: npc/re/merchants/cash_trader-idRO.txt
+npc: npc/re/merchants/te_merchant.txt
 
 // --------------------------- Others ---------------------------
-npc: npc/re/other/bulletin_boards.txt
 npc: npc/re/other/adven_boards.txt
+npc: npc/re/other/bulletin_boards.txt
+npc: npc/re/other/Global_Functions.txt
 npc: npc/re/other/item_merge.txt
 npc: npc/re/other/mail.txt
 npc: npc/re/other/mercenary_rent.txt
@@ -147,3 +150,8 @@ npc: npc/re/quests/quests_mora.txt
 npc: npc/re/quests/quests_morocc.txt
 npc: npc/re/quests/quests_nameless.txt
 npc: npc/re/quests/quests_veins.txt
+npc: npc/re/quests/woe_te/te_mission_main.txt
+npc: npc/re/quests/woe_te/te_mission_alde.txt
+npc: npc/re/quests/woe_te/te_mission_prt.txt
+npc: npc/re/quests/woe_te/te_goditem_prt01.txt
+npc: npc/re/quests/woe_te/te_goditem_alde1.txt

+ 0 - 10
npc/re/scripts_guild.conf

@@ -9,10 +9,6 @@ npc: npc/re/guild/invest_npc.txt
 
 npc: npc/re/woe_te/main_TE.txt
 npc: npc/re/woe_te/te_controller.txt
-
-npc: npc/re/woe_te/te_mission_main.txt
-npc: npc/re/woe_te/te_merchant.txt
-
 npc: npc/re/woe_te/te_aldecas1.txt
 npc: npc/re/woe_te/te_aldecas2.txt
 npc: npc/re/woe_te/te_aldecas3.txt
@@ -23,9 +19,3 @@ npc: npc/re/woe_te/te_prt_cas02.txt
 npc: npc/re/woe_te/te_prt_cas03.txt
 npc: npc/re/woe_te/te_prt_cas04.txt
 npc: npc/re/woe_te/te_prt_cas05.txt
-npc: npc/re/woe_te/te_guides.txt
-npc: npc/re/woe_te/te_gmnpc.txt
-npc: npc/re/woe_te/te_mission_alde.txt
-npc: npc/re/woe_te/te_mission_prt.txt
-npc: npc/re/woe_te/te_goditem_prt01.txt
-npc: npc/re/woe_te/te_goditem_alde1.txt

+ 2 - 5
npc/re/warps/guildcastles.txt

@@ -78,7 +78,7 @@ OnTouch:
 	end;
 
 S_Warp:
-	if (CanParticipatewoeTE() == 0) {
+	if (canParticipateSiegeTE() == 0) {
 		mes "3rd and expansion job level can't enter in WoE TE.";
 		close;
 	}
@@ -87,13 +87,11 @@ S_Warp:
 	.@my_guild_id = getcharid(2);
 
 	if (.@guild_id && .@guild_id == .@my_guild_id) {
-		// ResetBuffLowLevelSiege;
 		warp getarg(0),getarg(1),getarg(2);
 		end;
 	}
 
-	// .@hour = OpenHour_SiegeMode 3 3600 //!TODO
-	if (.@hour == 1) {
+	if (WoeTETimeStart(3600) == 1) {
 		if (!.@guild_id || !.@my_guild_id) {
 			mes "It's time for preparing to WoE. Only Alliance guild is able to enter.";
 			close;
@@ -105,7 +103,6 @@ S_Warp:
 		mes "Welcome alliance guild.";
 		close2;
 	}
-	// ResetBuffLowLevelSiege;
 	warp getarg(0),getarg(1),getarg(2);
 	end;
 }

+ 92 - 12
npc/re/woe_te/main_TE.txt

@@ -9,14 +9,11 @@
 //= - Enables Kafra Services inside Guild.
 //= - Treasure Chest spawning.
 //= - Flag Template.
+//= - GM NPC.
 //===== Changelogs: ==========================================
 //= 1.0 First Version. [Capuche]
 //============================================================
 
-function	script	CanParticipatewoeTE	{
-	return canParticipateSiegeTE();
-}
-
 -	script	Manager_TE	-1,{
 OnAgitInit3:
 	.@map$ = strnpcinfo(4);
@@ -96,7 +93,7 @@ OnAgitInit3:
 
 OnEmpSpawn:
 	.@map$ = strnpcinfo(4);
-	if (!mobcount( .@map$, strnpcinfo(0) +"::OnAgitBreak" )) {// voir si utile
+	if (!mobcount( .@map$, strnpcinfo(0) +"::OnAgitBreak" )) {
 		if (.@map$ == "te_aldecas1") { setarray .@emproom[0],216,23; }
 		else if (.@map$ == "te_aldecas2") { setarray .@emproom[0],213,23; }
 		else if (.@map$ == "te_aldecas3") { setarray .@emproom[0],205,31; }
@@ -158,11 +155,9 @@ OnAgitBreak:
 			setcastledata .@map$,.@i,0;
 	}
 
-	// announce that the Emperium is destroyed, and respawn all but new castle-occupants.
 	mapannounce .@map$,"Emperium has been destroyed.",bc_map,"0x00FF00",FW_BOLD,20,0,40;
-	maprespawnguildid .@map$,.@guild_id,6;
+	maprespawnguildid .@map$,.@guild_id,6;// Respawn all but new castle-occupants.
 
-	// Respawn the Emperium, and display new owners.
 	sleep 500;
 	if (agitcheck3())
 		donpcevent strnpcinfo(0) +"::OnEmpSpawn";
@@ -1068,14 +1063,12 @@ function	script	F_flag_woe_TE	{
 		mes "Do you wish to return with honor?";
 		next;
 		if (select( "Return to the fortress.","Forget it." ) == 1) {
-			if (CanParticipatewoeTE() == 0) {
+			if (canParticipateSiegeTE() == 0) {
 				mes "Tertiary job class and users with expanded levels are not allowed to participate in Siege Battles TE.";
 				close;
 			}
-			if (getcastledata( getarg(1),1 ) == getcharid(2)) {
-				// ResetBuffLowLevelSiege;
+			if (getcastledata( getarg(1),1 ) == getcharid(2))
 				warp getarg(1),getarg(2),getarg(3);
-			}
 			end;
 		}
 	}
@@ -1110,3 +1103,90 @@ OnInit:
 		flagemblem getcastledata( strnpcinfo(2),1 );
 	end;
 }
+
+
+// GM NPC
+//============================================================
+prt_gld,1,4,0	script	#Enterance Button prt	CLEAR_NPC,{
+	mes "password";
+	next;
+	if ( callfunc( "F_GM_NPC", 1854,0, 0,9000 ) < 1 ) {
+		mes "That's not right";
+		close;
+	}
+	mes "What do you want to do with the Gloria-bound warp?";
+	next;
+	switch( select( "Open it","Close it","Cancel","Rental item provided" ) ) {
+	case 1:
+		mes "Opening the warp.";
+		enablenpc "to_gloria";
+		close;
+	case 2:
+		mes "Closing the warp.";
+		disablenpc "to_gloria";
+		close;
+	case 3:
+		end;
+	case 4:
+		mes "You have 300 seconds.";
+		rentitem 13083,300;// TE_Woe_Knife
+		close;
+	}
+}
+
+alde_gld,1,4,0	script	#Enterance Button ald	CLEAR_NPC,{
+	mes "password";
+	next;
+	if ( callfunc( "F_GM_NPC", 1854,0, 0,9000 ) < 1 ) {
+		mes "That's not right";
+		close;
+	}
+	mes "What do you want to do with the Kafragarten-bound warp?";
+	next;
+	switch( select( "Open it","Close it","Cancel" ) ) {
+	case 1:
+		mes "Opening the warp.";
+		enablenpc "to_kafragarten";
+		close;
+	case 2:
+		mes "Closing the warp.";
+		disablenpc "to_kafragarten";
+		close;
+	case 3:
+		end;
+	}
+}
+
+// God Item Hervor & Jormungand
+sec_in02,20,20,0	script	Test Guide	CLEAR_NPC,{
+	mes "Password?";
+	next;
+	if (callfunc( "F_GM_NPC", 18543792,0, 0,99999999 ) < 1) {
+		mes "Aww...";
+		close;
+	}
+	mes "We provide material items needed for testing TE.";
+	next;
+	switch( select( "Materials for Hervor","Materials for Jormungand" ) ) {
+	case 1:
+		getitem 6595,2;// Hammer_Of_Velund
+		getitem 6596,1;// Anvil_Of_Velund
+		getitem 6594,4;// Magic_Bronze_Bullion
+		getitem 6597,3;// Bracelet_Of_Velund
+		getitem 6602,1;// Secret_Of_Rune
+		getitem 6605,1;// Muspellium
+		getitem 6604,1;// Essence_Of_Rune
+		getitem 2115,1;// Valkyrja's_Shield
+		end;
+	case 2:
+		getitem 6603,4;// Skin_Of_Hraesvelg
+		getitem 6599,1;// Spirit_Of_Hugin
+		getitem 6598,1;// Rib_Of_Jormungand
+		getitem 6601,4;// Chisel_Of_Giant
+		getitem 6600,1;// Spirit_Of_Munin
+		getitem 6605,1;// Muspellium
+		getitem 6604,1;// Essence_Of_Rune
+		getitem 1473,1;// Wizardy_Staff
+		end;
+	}
+}

+ 38 - 24
npc/re/woe_te/te_controller.txt

@@ -1,37 +1,51 @@
 //===== rAthena Script =======================================
 //= War of Emperium - Auto-Start
 //===== Description: =========================================
-//= Auto-start for War of Emperium TE.
-//= For instructions, see doc/woe_time_explanation.txt.
+//= Basic auto-start for War of Emperium TE.
 //===== Changelogs: ==========================================
 //= 1.0 First version. [Capuche]
 //============================================================
 
--	script	timer_woe_TE	-1,{
+-	script	woe_TE_contoller	-1,{
+function WoeTimer;
+
+OnSun2000:// date woe start
+	if (agitcheck3() == 0)
+		agitstart3;
+	end;
+OnSun2100:// date woe end
+	if (agitcheck3() == 1)
+		agitend3;
 	end;
 
-OnClock2100://start time for Tues(2), Thurs(4)
-OnClock2300://end time for Tues(2), Thurs(4)
-OnClock1600://start time for Sat(4)
-OnClock1800://end time for Sat(6)
+OnAgitInit3:
+	WoeTimer( "Sunday",20,21 );// <day>, <hour start>, <hour end>
+	end;
 
-OnAgitInit:
-	// starting time checks
-	if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23) ||
-	   (gettime(4)==4) && (gettime(3)>=21 && gettime(3)<23) ||
-	   (gettime(4)==6) && (gettime(3)>=16 && gettime(3)<18)) {
-		if (!agitcheck())
-			agitstart;
-		end;
-	}
+function WoeTimer {
+	.@Sunday    = 0;
+	.@Monday    = 1;
+	.@Tuesday   = 2;
+	.@Wednesday = 3;
+	.@Thursday  = 4;
+	.@Friday    = 5;
+	.@Saturday  = 6;
 
-	// end time checks
-	if ((gettime(4)==2) && (gettime(3)==23) ||
-	    (gettime(4)==4) && (gettime(3)==23) ||
-	    (gettime(4)==6) && (gettime(3)==18)) {
-		if (agitcheck())
-			agitend;
-		end;
+	.@day = getd( ".@"+ getarg(0) );
+	.@hour_start = getarg(1);
+	.@hour_end   = getarg(2);
+	.@woe_status = agitcheck3();
+	.@hour_today = gettime(3);
+	.@day_today  = gettime(4);
+	setd ".day_"+ .@day, 1;
+	setd ".hour_start_"+ .@hour_start, 1;
+
+	if (.@day_today == .@day) {
+		if (.@hour_today >= .@hour_start && .@hour_today < .@hour_end && .@woe_status == 0)
+			agitstart3;
+		else if (.@hour_today == .@hour_end && .@woe_status)
+			agitend3;
 	}
-	end;
+	return;
+}
 }

+ 0 - 94
npc/re/woe_te/te_gmnpc.txt

@@ -1,94 +0,0 @@
-// GM NPC
-sec_in02,27,25,3	script	Woe Status	4_M_KNIGHT_BLACK,{
-	// .@hour1 = OpenHour_SiegeMode 1 3600
-	// .@hour2 = OpenHour_SiegeMode 2 3600
-	// .@hour3 = OpenHour_SiegeMode 3 3600
-	mes "WOE FE: " + .@hour1;
-	mes "WOE SE: " + .@hour2;
-	mes "WOE TE: " + .@hour3;
-	close;
-}
-
-prt_gld,1,4,0	script	#Enterance Button prt	CLEAR_NPC,{
-	mes "password";
-	next;
-	if ( callfunc( "F_GM_NPC", 1854,0, 0,9000 ) < 1 ) {
-		mes "That's not right";
-		close;
-	}
-	mes "What do you want to do with the Gloria-bound warp?";
-	next;
-	switch( select( "Open it","Close it","Cancel","Rental item provided" ) ) {
-	case 1:
-		mes "Opening the warp.";
-		enablenpc "to_gloria";
-		close;
-	case 2:
-		mes "Closing the warp.";
-		disablenpc "to_gloria";
-		close;
-	case 3:
-		end;
-	case 4:
-		mes "You have 300 seconds.";
-		rentitem 13083,300;// TE_Woe_Knife
-		close;
-	}
-}
-
-alde_gld,1,4,0	script	#Enterance Button ald	CLEAR_NPC,{
-	mes "password";
-	next;
-	if ( callfunc( "F_GM_NPC", 1854,0, 0,9000 ) < 1 ) {
-		mes "That's not right";
-		close;
-	}
-	mes "What do you want to do with the Kafragarten-bound warp?";
-	next;
-	switch( select( "Open it","Close it","Cancel" ) ) {
-	case 1:
-		mes "Opening the warp.";
-		enablenpc "to_kafragarten";
-		close;
-	case 2:
-		mes "Closing the warp.";
-		disablenpc "to_kafragarten";
-		close;
-	case 3:
-		end;
-	}
-}
-
-// God Item Hervor & Jormungand
-sec_in02,20,20,0	script	Test Guide	CLEAR_NPC,{
-	mes "Password?";
-	next;
-	if (callfunc( "F_GM_NPC", 18543792,0, 0,99999999 ) < 1) {
-		mes "Aww...";
-		close;
-	}
-	mes "We provide material items needed for testing TE.";
-	next;
-	switch( select( "Materials for Hervor","Materials for Jormungand" ) ) {
-	case 1:
-		getitem 6595,2;// Hammer_Of_Velund
-		getitem 6596,1;// Anvil_Of_Velund
-		getitem 6594,4;// Magic_Bronze_Bullion
-		getitem 6597,3;// Bracelet_Of_Velund
-		getitem 6602,1;// Secret_Of_Rune
-		getitem 6605,1;// Muspellium
-		getitem 6604,1;// Essence_Of_Rune
-		getitem 2115,1;// Valkyrja's_Shield
-		end;
-	case 2:
-		getitem 6603,4;// Skin_Of_Hraesvelg
-		getitem 6599,1;// Spirit_Of_Hugin
-		getitem 6598,1;// Rib_Of_Jormungand
-		getitem 6601,4;// Chisel_Of_Giant
-		getitem 6600,1;// Spirit_Of_Munin
-		getitem 6605,1;// Muspellium
-		getitem 6604,1;// Essence_Of_Rune
-		getitem 1473,1;// Wizardy_Staff
-		end;
-	}
-}