Explorar o código

Mapflag:
- added monster_noteleport in TE castle (need official info)
Missions:
- corrected playtime check value
God quest TE:
- Changed $@2012_tegod_kafra -> $2012_tegod_kafra ; $@2012_tegod_gloria -> $2012_tegod_gloria as it should be
- Corrected lowest economy set to 1
- Minor debug and standardise script
WOE main script:
- Added a condition for mobs spawn (case guildbreak)

Atemo %!s(int64=8) %!d(string=hai) anos
pai
achega
2995ba0908

+ 10 - 0
npc/re/mapflag/noteleport.txt

@@ -108,3 +108,13 @@ te_aldecas2	mapflag	noteleport
 te_aldecas3	mapflag	noteleport
 te_aldecas4	mapflag	noteleport
 te_aldecas5	mapflag	noteleport
+te_prtcas01	mapflag	monster_noteleport
+te_prtcas02	mapflag	monster_noteleport
+te_prtcas03	mapflag	monster_noteleport
+te_prtcas04	mapflag	monster_noteleport
+te_prtcas05	mapflag	monster_noteleport
+te_aldecas1	mapflag	monster_noteleport
+te_aldecas2	mapflag	monster_noteleport
+te_aldecas3	mapflag	monster_noteleport
+te_aldecas4	mapflag	monster_noteleport
+te_aldecas5	mapflag	monster_noteleport

+ 138 - 143
npc/re/quests/woe_te/te_goditem_alde1.txt

@@ -13,8 +13,8 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "Please lighten your load and try again.";
 		close;
	}
 
-	.@guild_id = getcastledata( "te_aldecas1",1 );
-	.@economy = getcastledata("te_aldecas1",2);
+	.@guild_id = getcastledata("te_aldecas1",1);
+	.@economy  = getcastledata("te_aldecas1",2);
 	.@npc_name$ = "Cano";
 
 	mes "["+ .@npc_name$ +"]";
@@ -28,7 +28,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "Please, pretend not to see me.";
 		close;
 	}
-	if (WoeTETimeStart(14400) == 1 || agitcheck3() == 1) {
+	if (WoeTETimeStart(14400) == 1 || agitcheck3() == 1) {// cannot start the quest 4 hours before and during WOE TE
 		mes "From now on, I'll stay here quietly and not interrupt anyone until the siege ends.";
 		mes "Don't worry about me.";
 		close;
@@ -43,7 +43,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "I hope I can find that way here.";
 		close;
 	}
-	if ($@2012_tegod_kafra == 0) {// quest status
+	if ($2012_tegod_kafra == 0) {// event status
 		mes "Ah... Master.";
 		mes "I feel so thankful all the time.";
 		mes "Since I owe you big time, I'll help you with anything anytime.";
@@ -136,7 +136,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 			close;
 		}
 	}
-	if ($@2012_tegod_kafra == 1) {
+	if ($2012_tegod_kafra == 1) {// event started
 		mes "Did you hear the news?";
 		mes "The girls are coming.";
 		mes "The merciless girls!!!";
@@ -176,7 +176,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 			close;
 		}
 	}
-	if ($@2012_tegod_kafra == 2) {
+	if ($2012_tegod_kafra == 2) {// after 10 minutes delay
 		mes "Ah stop following me around!";
 		mes "If you could just get rid of them... Jormungand, that's right! I'll make you Jormungand!";
 		next;
@@ -189,7 +189,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "You have to get rid of those girls first.";
 		close;
 	}
-	if ($@2012_tegod_kafra == 3) {
+	if ($2012_tegod_kafra == 3) {// event failed
 		mes "... Although I managed to escape from them again...";
 		mes "it's hard.";
 		mes "life is... just so hard.";
@@ -200,7 +200,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "I'm sorry. I'll take a break.";
 		close;
 	}
-	if ($@2012_tegod_kafra == 4) {
+	if ($2012_tegod_kafra == 4) {
 		mes "I can finally breathe now.";
 		mes "I'll start making Jormungand as promised.";
 		next;
@@ -236,13 +236,13 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 				delitem 6605,1;// Muspellium
 				delitem 6604,1;// Essence_Of_Rune
 				delitem 1473,1;// Wizardy_Staff
-				$@2012_tegod_kafra = 5;
+				$2012_tegod_kafra = 5;
 				getitem 2020,1;// Jormungand
 				announce "Twilight of trail [ Jormungand ] is introduced to this world by ["+ strcharinfo(0) +"] of ["+ getguildname(.@guild_id) +"] Guild.",bc_all,"0x70dbdb",FW_NORMAL,12;
-				if (.@economy <= 20)
-					setcastledata "te_aldecas1",2, 0;
-				else
+				if (.@economy > 20)
 					setcastledata "te_aldecas1",2,(.@economy -20);
+				else
+					setcastledata "te_aldecas1",2,1;// min is 1 for WOE TE
 				next;
 				mes "["+ .@npc_name$ +"]";
 				mes "Whew.. I don't think I can work for a while.";
@@ -265,7 +265,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 			close;
 		}
 	}
-	if ($@2012_tegod_kafra == 5) {
+	if ($2012_tegod_kafra == 5) {
 		mes "I'm tired a little bit.";
 		mes "I think I should rest for a few days.";
 		mes "I may look just fine, but I was mentally very tired.";
@@ -369,7 +369,7 @@ S_Fuse:
 	}
 
 OnInit:
-	if ($@2012_tegod_kafra == 3 || agitcheck3())// 3 -> quest failed
+	if ($2012_tegod_kafra == 3 || agitcheck3())// 3 -> quest failed
 		disablenpc strnpcinfo(0);
 	else
 		enablenpc strnpcinfo(0);
@@ -384,14 +384,14 @@ te_aldecas1,3,2,0	script	#tequest_master_alde01	CLEAR_NPC,{
 		close;
 	}
 	.@map$ = "te_aldecas1";
-	mes "Current Status:" + $@2012_tegod_kafra;
+	mes "Current Status: " + $2012_tegod_kafra;
 	mes "0: Able to proceed with the quest";
 	mes "1: Proceed with the quest. 10-minute wait";
 	mes "2: Quest in progress";
 	mes "3: Quest failed";
 	mes "4: Able to produce items , 5: Items produced successfully.";
 	next;
-	mes "Princess Status:" + $@2012_tegirls_alde01;
+	mes "Princess Status: " + $@2012_tegirls_alde01;
 	mes "Current Commerce Level of the Fortress:" + getcastledata(.@map$,2);
 	next;
 	switch( select( "Do not proceed","Initialization","Raise Commerce Level","Lower Commerce Level" ) ) {
@@ -410,21 +410,32 @@ te_aldecas1,3,2,0	script	#tequest_master_alde01	CLEAR_NPC,{
 		close;
 	case 4:
 		.@economy1 = getcastledata(.@map$,2);
-		.@economy2 = .@economy1 > 29 ? (.@economy1 -30) : 0;
-		if (.@economy1 > 29) {// used .@economy1 for message when economy 30
+		.@economy2 = .@economy1 > 30 ? (.@economy1 -30) : 1;
+		if (.@economy1 > 30) {
 			mes "Lower Commerce Level by 30";
 			setcastledata .@map$,2,.@economy2;
 		}
 		else {
 			mes "Commerce Level gets decreased to 0 since current level is lower than 30.";
-			setcastledata .@map$,2,0;
+			setcastledata .@map$,2,1;// min is 1 for WOE TE
 		}
 		mes "Modified Commerce Level:" + .@economy2;
 		close;
 	}
 
+OnReset:// gm Initialization
+	callsub S_EventReset;// kill all quests mobs and stop timer of others npcs
+	callsub S_EventOff;// clear setnpcdisplay
+	$2012_tegod_kafra = 0;
+	$@2012_tegirls_alde01 = 0;
+	.npc_name$ = "";
+	enablenpc "aldeg-1-11_aldeg-1-15#te";
+	enablenpc "Blacksmith Cano#tegod01";
+	stopnpctimer;
+	end;
+
 OnCommandOn:
-	$@2012_tegod_kafra = 1;
+	$2012_tegod_kafra = 1;
 	.npc_name$ = strnpcinfo(0);// for script readability
 	initnpctimer;
 	end;
@@ -443,7 +454,7 @@ OnTimer598000:
 	end;
 
 OnTimer600000:
-	$@2012_tegod_kafra = 2;
+	$2012_tegod_kafra = 2;
 	mapwarp "te_aldecas1", "te_alde_gld",130,264;
 	donpcevent "Aira#fake01_alde01::OnCommandOn";
 	donpcevent "Kuluna#fake01_alde01::OnCommandOn";
@@ -485,6 +496,13 @@ OnTimer2500000:
 OnTimer3100000:
 	callsub S_MobRedondant;
 	end;
+S_MobRedondant:
+	monster "te_aldecas1",0,0,"Raydric",1163,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_aldecas1",0,0,"Khalitzburg",1132,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_aldecas1",0,0,"Abysmal Knight",1219,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_aldecas1",0,0,"High Orc",1213,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_aldecas1",0,0,"Bloody Knight",1268,5, .npc_name$ +"::OnMyMobDead";
+	end;
 
 OnTimer4200000:
 	mapannounce "te_aldecas1","Girls: ... how long do we have to wait?",bc_map,"0x00ff00",FW_NORMAL,12;
@@ -498,7 +516,7 @@ OnTimer4210000:
 OnTimer4220000:
 	mapannounce "te_aldecas1","Aira: Ah! I can't take it anymore! Girls, come here!",bc_map,"0x00ff00",FW_NORMAL,12;
 
-	$@2012_tegod_kafra = 3;// quest off until someone break the emp
+	$2012_tegod_kafra = 3;// quest off until someone break the emp
 	callsub S_EventReset;
 	enablenpc "aldeg-1-11_aldeg-1-15#te";
 	end;
@@ -537,33 +555,31 @@ OnTimer4240000:
 OnTimer4243000:
 	mapannounce "te_aldecas1","You've failed to recapture the fortress. Cano is now gone.",bc_map,"0x00ff00",FW_NORMAL,12;
 	disablenpc "Blacksmith Cano#tegod01";
-	callsub S_EventOff;
+	callsub S_EventOff;// clear setnpcdisplay
 	.npc_name$ = "";
 	stopnpctimer;
 	end;
 
-OnStop:
-	callsub S_EventReset;
-	donpcevent "#eproom_girls_alde01::OnReset";
-	$@2012_tegirls_alde01 = 0;
-	.npc_name$ = "";
-	stopnpctimer;
-	end;
+S_EventOff:
+	donpcevent "#end_aira_alde01::OnCommandOff";
+	donpcevent "#end_kuluna_alde01::OnCommandOff";
+	donpcevent "#end_mallina_alde01::OnCommandOff";
+	donpcevent "#end_ezella_alde01::OnCommandOff";
+	donpcevent "#end_lune_alde01::OnCommandOff";
+	donpcevent "#end_morin_alde01::OnCommandOff";
+	donpcevent "#end_nasarin_alde01::OnCommandOff";
+	return;
 
-OnReset:// gm Initialization
+OnStop:// all girls have been defeated, kill remaining mobs and stop timer
 	callsub S_EventReset;
-	callsub S_EventOff;
-	donpcevent "#eproom_girls_alde01::OnReset";
-	$@2012_tegod_kafra = 0;
 	$@2012_tegirls_alde01 = 0;
 	.npc_name$ = "";
-	enablenpc "aldeg-1-11_aldeg-1-15#te";
-	enablenpc "Blacksmith Cano#tegod01";
 	stopnpctimer;
 	end;
 
 S_EventReset:
 	killmonster "te_aldecas1", .npc_name$ +"::OnMyMobDead";
+	donpcevent "#eproom_girls_alde01::OnReset";
 	donpcevent "Aira#fake01_alde01::OnReset";
 	donpcevent "Kuluna#fake01_alde01::OnReset";
 	donpcevent "Mallina#fake01_alde01::OnReset";
@@ -571,6 +587,7 @@ S_EventReset:
 	donpcevent "Lune#fake01_alde01::OnReset";
 	donpcevent "Morin#fake01_alde01::OnReset";
 	donpcevent "Nasarin#fake01_alde01::OnReset";
+
 	donpcevent "#aira_real_alde01::OnReset";
 	donpcevent "#kuluna_real_alde01::OnReset";
 	donpcevent "#mallina_real_alde01::OnReset";
@@ -580,99 +597,16 @@ S_EventReset:
 	donpcevent "#nasarin_real_alde01::OnReset";
 	return;
 
-S_EventOff:
-	donpcevent "#end_aira_alde01::OnCommandOff";
-	donpcevent "#end_kuluna_alde01::OnCommandOff";
-	donpcevent "#end_mallina_alde01::OnCommandOff";
-	donpcevent "#end_ezella_alde01::OnCommandOff";
-	donpcevent "#end_lune_alde01::OnCommandOff";
-	donpcevent "#end_morin_alde01::OnCommandOff";
-	donpcevent "#end_nasarin_alde01::OnCommandOff";
-	return;
-
-S_MobRedondant:
-	monster "te_aldecas1",0,0,"Raydric",1163,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_aldecas1",0,0,"Khalitzburg",1132,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_aldecas1",0,0,"Abysmal Knight",1219,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_aldecas1",0,0,"High Orc",1213,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_aldecas1",0,0,"Bloody Knight",1268,5, .npc_name$ +"::OnMyMobDead";
-	end;
-
 OnMyMobDead:
 	end;
 
 OnInit:
-	$@2012_tegirls_alde01 = 0;// mob killed count
-	if ($@2012_tegod_kafra < 3)
-		$@2012_tegod_kafra = 0;
+	$@2012_tegirls_alde01 = 0;// girls mobs killed count
+	if ($2012_tegod_kafra < 3)
+		$2012_tegod_kafra = 0;
 	end;
 }
 
--	script	real_alde01	-1,{
-	end;
-OnCommandOn:
-	.@npc_name$ = strnpcinfo(0);
-	if (.@npc_name$ == "#aira_real_alde01")
-		monster "te_aldecas1",26,224,"Aira in a blaze",2443,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#kuluna_real_alde01")
-		monster "te_aldecas1",24,199,"Passionate Kuluna",2444,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#mallina_real_alde01")
-		monster "te_aldecas1",83,70,"Mallina of the Earth",2445,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#ezella_real_alde01")
-		monster "te_aldecas1",113,93,"Ezella of Verdure",2446,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#lune_real_alde01")
-		monster "te_aldecas1",82,95,"Lune of the Eternal Glacier",2447,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#morin_real_alde01")
-		monster "te_aldecas1",207,148,"Morin of the Abyss",2448,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#nasarin_real_alde01")
-		monster "te_aldecas1",212,170,"Fatal Nasarin",2449,1, .@npc_name$ +"::OnMyMobDead";
-	end;
-
-OnReset:
-	killmonster "te_aldecas1", strnpcinfo(0)+"::OnMyMobDead";
-	end;
-
-OnMyMobDead:
-	if (mobcount( "te_aldecas1",strnpcinfo(0) +"::OnMyMobDead" ) == 0)
-		initnpctimer;
-	end;
-
-OnTimer1000:
-	if (mobcount( "te_aldecas1",strnpcinfo(0) +"::OnMyMobDead" ) == 0) {
-		$@2012_tegirls_alde01++;
-		if ($@2012_tegirls_alde01 == 7) {
-			mapannounce "te_aldecas1","Cano: aaahh!! The girls broke the shields and made their way into where Emperium is!!!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			donpcevent "#eproom_girls_alde01::OnCommandOn";
-		}
-		else {
-			.@npc_name$ = strnpcinfo(0);
-			if (.@npc_name$ == "#aira_real_alde01")
-				mapannounce "te_aldecas1","Aira: You think I lost? You're wrong! We force our way to where Cano is!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#kuluna_real_alde01")
-				mapannounce "te_aldecas1","Kuluna: ... This is called a strategic retreat.",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#mallina_real_alde01")
-				mapannounce "te_aldecas1","Mallina: ... Why are you disturbing us so much? But victory will be ours in the end!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#ezella_real_alde01")
-				mapannounce "te_aldecas1","Ezella: Oh you, a weakling that would just disappear like the wind... !!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#lune_real_alde01")
-				mapannounce "te_aldecas1","Lune: ..Alright. Let the battle begin!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#morin_real_alde01")
-				mapannounce "te_aldecas1","Morin: It's not... interesting anymore.",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#nasarin_real_alde01")
-				mapannounce "te_aldecas1","Nasarin: .. I wasted my time. Cano is in the center of this fortress?",bc_map,"0x00ff00",FW_NORMAL,12;
-		}
-	}
-	stopnpctimer;
-	end;
-}
-te_aldecas1,4,2,0	duplicate(real_alde01)	#aira_real_alde01	CLEAR_NPC
-te_aldecas1,5,2,0	duplicate(real_alde01)	#kuluna_real_alde01	CLEAR_NPC
-te_aldecas1,6,2,0	duplicate(real_alde01)	#mallina_real_alde01	CLEAR_NPC
-te_aldecas1,7,2,0	duplicate(real_alde01)	#ezella_real_alde01	CLEAR_NPC
-te_aldecas1,8,2,0	duplicate(real_alde01)	#lune_real_alde01	CLEAR_NPC
-te_aldecas1,9,2,0	duplicate(real_alde01)	#morin_real_alde01	CLEAR_NPC
-te_aldecas1,10,2,0	duplicate(real_alde01)	#nasarin_real_alde01	CLEAR_NPC
-
 
 te_aldecas1,40,226,3	script	Aira#fake01_alde01	CLEAR_NPC,{
 	end;
@@ -710,7 +644,6 @@ OnTimer3000:
 	end;
 }
 
-
 te_aldecas1,33,197,3	script	Kuluna#fake01_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -747,7 +680,6 @@ OnTimer3000:
 	end;
 }
 
-
 te_aldecas1,90,69,3	script	Mallina#fake01_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -787,7 +719,6 @@ OnTimer5000:
 	end;
 }
 
-
 te_aldecas1,109,91,3	script	Ezella#fake01_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -825,7 +756,6 @@ OnTimer3000:
 	end;
 }
 
-
 te_aldecas1,85,108,3	script	Lune#fake01_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -843,7 +773,7 @@ OnReset:
 	killmonster "te_aldecas1", "Lune#fake01_alde01::OnMyMobDead";
 	setnpcdisplay "Lune#fake01_alde01",CLEAR_NPC;
 OnInit:
-	disablenpc strnpcinfo(0);
+	disablenpc "Lune#fake01_alde01";
 	end;
 
 OnTimer1000:
@@ -859,16 +789,16 @@ OnTimer1000:
 	monster "te_aldecas1",83,83,"Bodyguard",1778,1, "Lune#fake01_alde01::OnMyMobDead";
 	end;
 OnTimer2000:
-    monster "te_aldecas1",84,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";// AQUA_ELEMENTAL
-    monster "te_aldecas1",85,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",86,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",87,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",88,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",89,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",90,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",91,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",92,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
-    monster "te_aldecas1",93,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",84,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";// AQUA_ELEMENTAL
+	monster "te_aldecas1",85,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",86,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",87,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",88,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",89,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",90,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",91,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",92,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
+	monster "te_aldecas1",93,83,"Bodyguard",2016,1, "Lune#fake01_alde01::OnMyMobDead";
 	end;
 OnTimer3000:
 	monster "te_aldecas1",82,95,"Bodyguard",1777,5, "Lune#fake01_alde01::OnMyMobDead";// ICE_TITAN
@@ -879,7 +809,6 @@ OnTimer3000:
 	end;
 }
 
-
 te_aldecas1,207,156,3	script	Morin#fake01_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -897,7 +826,7 @@ OnReset:
 	killmonster "te_aldecas1", "Morin#fake01_alde01::OnMyMobDead";
 	setnpcdisplay "Morin#fake01_alde01",CLEAR_NPC;
 OnInit:
-	disablenpc strnpcinfo(0);
+	disablenpc "Morin#fake01_alde01";
 	end;
 
 OnTimer1000:
@@ -917,7 +846,6 @@ OnTimer3000:
 	end;
 }
 
-
 te_aldecas1,214,176,3	script	Nasarin#fake01_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -935,7 +863,7 @@ OnReset:
 	killmonster "te_aldecas1", "Nasarin#fake01_alde01::OnMyMobDead";
 	setnpcdisplay "Nasarin#fake01_alde01",CLEAR_NPC;
 OnInit:
-	disablenpc strnpcinfo(0);
+	disablenpc "Nasarin#fake01_alde01";
 	end;
 
 OnTimer1000:
@@ -951,6 +879,73 @@ OnTimer3000:
 	end;
 }
 
+-	script	real_alde01	-1,{
+	end;
+OnCommandOn:
+	.@npc_name$ = strnpcinfo(0);
+	if (.@npc_name$ == "#aira_real_alde01")
+		monster "te_aldecas1",26,224,"Aira in a blaze",2443,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#kuluna_real_alde01")
+		monster "te_aldecas1",24,199,"Passionate Kuluna",2444,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#mallina_real_alde01")
+		monster "te_aldecas1",83,70,"Mallina of the Earth",2445,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#ezella_real_alde01")
+		monster "te_aldecas1",113,93,"Ezella of Verdure",2446,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#lune_real_alde01")
+		monster "te_aldecas1",82,95,"Lune of the Eternal Glacier",2447,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#morin_real_alde01")
+		monster "te_aldecas1",207,148,"Morin of the Abyss",2448,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#nasarin_real_alde01")
+		monster "te_aldecas1",212,170,"Fatal Nasarin",2449,1, .@npc_name$ +"::OnMyMobDead";
+	end;
+
+OnReset:
+	stopnpctimer;
+	killmonster "te_aldecas1", strnpcinfo(0)+"::OnMyMobDead";
+	end;
+
+OnMyMobDead:
+	if (mobcount( "te_aldecas1",strnpcinfo(0) +"::OnMyMobDead" ) == 0)
+		initnpctimer;
+	end;
+
+OnTimer1000:
+	if (mobcount( "te_aldecas1",strnpcinfo(0) +"::OnMyMobDead" ) == 0) {
+		$@2012_tegirls_alde01++;
+		if ($@2012_tegirls_alde01 == 7) {
+			mapannounce "te_aldecas1","Cano: aaahh!! The girls broke the shields and made their way into where Emperium is!!!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			donpcevent "#eproom_girls_alde01::OnCommandOn";
+		}
+		else {
+			.@npc_name$ = strnpcinfo(0);
+			if (.@npc_name$ == "#aira_real_alde01")
+				mapannounce "te_aldecas1","Aira: You think I lost? You're wrong! We force our way to where Cano is!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#kuluna_real_alde01")
+				mapannounce "te_aldecas1","Kuluna: ... This is called a strategic retreat.",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#mallina_real_alde01")
+				mapannounce "te_aldecas1","Mallina: ... Why are you disturbing us so much? But victory will be ours in the end!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#ezella_real_alde01")
+				mapannounce "te_aldecas1","Ezella: Oh you, a weakling that would just disappear like the wind... !!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#lune_real_alde01")
+				mapannounce "te_aldecas1","Lune: ..Alright. Let the battle begin!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#morin_real_alde01")
+				mapannounce "te_aldecas1","Morin: It's not... interesting anymore.",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#nasarin_real_alde01")
+				mapannounce "te_aldecas1","Nasarin: .. I wasted my time. Cano is in the center of this fortress?",bc_map,"0x00ff00",FW_NORMAL,12;
+		}
+	}
+	stopnpctimer;
+	end;
+}
+te_aldecas1,4,2,0	duplicate(real_alde01)	#aira_real_alde01	CLEAR_NPC
+te_aldecas1,5,2,0	duplicate(real_alde01)	#kuluna_real_alde01	CLEAR_NPC
+te_aldecas1,6,2,0	duplicate(real_alde01)	#mallina_real_alde01	CLEAR_NPC
+te_aldecas1,7,2,0	duplicate(real_alde01)	#ezella_real_alde01	CLEAR_NPC
+te_aldecas1,8,2,0	duplicate(real_alde01)	#lune_real_alde01	CLEAR_NPC
+te_aldecas1,9,2,0	duplicate(real_alde01)	#morin_real_alde01	CLEAR_NPC
+te_aldecas1,10,2,0	duplicate(real_alde01)	#nasarin_real_alde01	CLEAR_NPC
+
+
 te_aldecas1,11,2,0	script	#eproom_girls_alde01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -965,6 +960,7 @@ OnCommandOn:
 	end;
 
 OnReset:
+	stopnpctimer;
 	killmonster "te_aldecas1", "#eproom_girls_alde01::OnMyMobDead";
 	end;
 
@@ -976,7 +972,7 @@ OnMyMobDead:
 OnTimer3000:
 	if (mobcount( "te_aldecas1","#eproom_girls_alde01::OnMyMobDead" ) == 0) {
 		donpcevent "#tequest_master_alde01::OnStop";
-		$@2012_tegod_kafra = 4;
+		$2012_tegod_kafra = 4;
 		mapannounce "te_aldecas1","You have defeated the girls and recaptured the fortress successfully.",bc_map,"0x00ff00",FW_NORMAL,12;
 	}
 	stopnpctimer;
@@ -1009,4 +1005,3 @@ te_aldecas1,225,35,5	duplicate(#end_aira_alde01)	#end_ezella_alde01	CLEAR_NPC
 te_aldecas1,227,34,3	duplicate(#end_aira_alde01)	#end_lune_alde01	CLEAR_NPC
 te_aldecas1,226,35,4	duplicate(#end_aira_alde01)	#end_morin_alde01	CLEAR_NPC
 te_aldecas1,227,33,1	duplicate(#end_aira_alde01)	#end_nasarin_alde01	CLEAR_NPC
-

+ 120 - 128
npc/re/quests/woe_te/te_goditem_prt01.txt

@@ -13,8 +13,8 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "Please lighten your load and try again.";
 		close;
	}
 
-	.@guild_id = getcastledata( "te_prtcas01",1 );
-	.@economy = getcastledata( "te_prtcas01",2 );
+	.@guild_id = getcastledata("te_prtcas01",1);
+	.@economy  = getcastledata("te_prtcas01",2);
 	.@npc_name$ = "Kai";
 
 	mes "["+ .@npc_name$ +"]";
@@ -28,7 +28,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "Please, pretend not to see me.";
 		close;
 	}
-	if (WoeTETimeStart(14400) == 1 || agitcheck3() == 1) {
+	if (WoeTETimeStart(14400) == 1 || agitcheck3() == 1) {// cannot start the quest 4 hours before and during WOE TE
 		mes "From now on, I'll stay here quietly and not interrupt anyone until the siege ends.";
 		mes "Don't worry about me.";
 		close;
@@ -43,7 +43,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "I hope I can find that way here.";
 		close;
 	}
-	if ($@2012_tegod_gloria == 0) {
+	if ($2012_tegod_gloria == 0) {// event status
 		mes "Ah... Master.";
 		mes "I feel so thankful all the time.";
 		mes "Since I owe you big time, I'll help you with anything anytime.";
@@ -136,7 +136,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 			close;
 		}
 	}
-	if ($@2012_tegod_gloria == 1) {
+	if ($2012_tegod_gloria == 1) {// event started
 		mes "Did you hear the news?";
 		mes "The girls are coming.";
 		mes "The merciless girls!!!";
@@ -176,7 +176,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 			close;
 		}
 	}
-	if ($@2012_tegod_gloria == 2) {
+	if ($2012_tegod_gloria == 2) {// after 10 minutes delay
 		mes "Ah stop following me around!";
 		mes "If you could just get rid of them... Hervor, that's right! I'll make you Hervor!";
 		next;
@@ -189,7 +189,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "You have to get rid of those girls first.";
 		close;
 	}
-	if ($@2012_tegod_gloria == 3) {
+	if ($2012_tegod_gloria == 3) {// event failed
 		mes "... Although I managed to escape from them again...";
 		mes "it's hard.";
 		mes "life is... just so hard.";
@@ -200,7 +200,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "I'm sorry. I'll take a break.";
 		close;
 	}
-	if ($@2012_tegod_gloria == 4) {
+	if ($2012_tegod_gloria == 4) {
 		mes "I can finally breathe now.";
 		mes "I'll start making Hervor as promised.";
 		next;
@@ -236,13 +236,13 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 				delitem 6605,1;// Muspellium
 				delitem 6604,1;// Essence_Of_Rune
 				delitem 2115,1;// Valkyrja's_Shield
-				$@2012_tegod_gloria = 5;
+				$2012_tegod_gloria = 5;
 				getitem 2181,1;// Hervor
 				announce "Velund's gift [ Hervor ] is introduced to this world by ["+ strcharinfo(0) +"] of ["+ getguildname(.@guild_id) +"] Guild.",bc_all,"0x70dbdb",FW_NORMAL,12;
 				if (.@economy > 20)
 					setcastledata "te_prtcas01",2,(.@economy-20);
 				else
-					setcastledata "te_prtcas01",2,0;
+					setcastledata "te_prtcas01",2,1;// min is 1 for WOE TE
 				next;
 				mes "["+ .@npc_name$ +"]";
 				mes "Whew.. I don't think I can work for a while.";
@@ -252,7 +252,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 			mes "["+ .@npc_name$ +"]";
 			mes "However, it seems like we need more materials.";
 			mes "Could you check again? I'll give you the list of what we need.";
-			callsub S_Material, .@npc_name$,0;
+			callsub S_Material, .@npc_name$,1;
 		case 2:
 			callsub S_Fuse, .@npc_name$, "Hervor";
 		case 3:
@@ -265,7 +265,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 			close;
 		}
 	}
-	if ($@2012_tegod_gloria == 5) {
+	if ($2012_tegod_gloria == 5) {
 		mes "I'm tired a little bit.";
 		mes "I think I should rest for a few days.";
 		mes "I may look just fine, but I was mentally very tired.";
@@ -369,7 +369,7 @@ S_Fuse:
 	}
 
 OnInit:
-	if ($@2012_tegod_gloria == 3 || agitcheck3())
+	if ($2012_tegod_gloria == 3 || agitcheck3())// 3 -> quest failed
 		disablenpc strnpcinfo(0);
 	else
 		enablenpc strnpcinfo(0);
@@ -384,14 +384,14 @@ te_prtcas01,190,2,0	script	#tequest_master_prt01	CLEAR_NPC,{
 		close;
 	}
 	.@map$ = "te_prtcas01";
-	mes "Current Status:" + $@2012_tegod_gloria;
+	mes "Current Status: " + $2012_tegod_gloria;
 	mes "0: Able to proceed with the quest";
 	mes "1: Proceed with the quest. 10-minute wait";
 	mes "2: Quest in progress";
 	mes "3: Quest failed";
 	mes "4: Able to produce items , 5: Items produced successfully.";
 	next;
-	mes "Princess Status:" + $@2012_tegirls_prt01;
+	mes "Princess Status: " + $@2012_tegirls_prt01;
 	mes "Current Commerce Level of the Fortress:" + getcastledata(.@map$,2);
 	next;
 	switch( select( "Do not proceed","Initialization","Raise Commerce Level","Lower Commerce Level" ) ) {
@@ -410,21 +410,32 @@ te_prtcas01,190,2,0	script	#tequest_master_prt01	CLEAR_NPC,{
 		close;
 	case 4:
 		.@economy1 = getcastledata(.@map$,2);
-		.@economy2 = .@economy1 > 29 ? (.@economy1 -30) : 0;
-		if (.@economy1 > 29) {// used .@economy1 for message when economy 30
+		.@economy2 = .@economy1 > 30 ? (.@economy1 -30) : 1;
+		if (.@economy1 > 30) {
 			mes "Lower Commerce Level by 30";
 			setcastledata .@map$,2,.@economy2;
 		}
 		else {
 			mes "Commerce Level gets decreased to 0 since current level is lower than 30.";
-			setcastledata .@map$,2,0;
+			setcastledata .@map$,2,1;// min is 1 for WOE TE
 		}
 		mes "Modified Commerce Level:" + .@economy2;
 		close;
 	}
 
+OnReset:// gm Initialization
+	callsub S_EventReset;// kill some quests mobs and stop timer of others npcs
+	callsub S_EventOff;// clear setnpcdisplay
+	$2012_tegod_gloria = 0;
+	$@2012_tegirls_prt01 = 0;
+	.npc_name$ = "";
+	enablenpc "prtg-1-22_prtg-1-31#te";
+	enablenpc "Blacksmith Kai#tegod01";
+	stopnpctimer;
+	end;
+
 OnCommandOn:
-	$@2012_tegod_gloria = 1;
+	$2012_tegod_gloria = 1;
 	.npc_name$ = strnpcinfo(0);// for script readability
 	initnpctimer;
 	end;
@@ -443,7 +454,7 @@ OnTimer598000:
 	end;
 
 OnTimer600000:
-	$@2012_tegod_gloria = 2;
+	$2012_tegod_gloria = 2;
 	mapwarp "te_prtcas01", "te_prt_gld",159,211;
 	donpcevent "Aira#fake01_prt01::OnCommandOn";
 	donpcevent "Kuluna#fake01_prt01::OnCommandOn";
@@ -453,7 +464,7 @@ OnTimer600000:
 	donpcevent "Morin#fake01_prt01::OnCommandOn";
 	donpcevent "Nasarin#fake01_prt01::OnCommandOn";
 
-	disablenpc "prtg-1-22_prtg-1-31#te";
+	disablenpc "prtg-1-22_prtg-1-31#te";// warp to emperium room
 	end;
 
 OnTimer602000:
@@ -485,6 +496,13 @@ OnTimer2500000:
 OnTimer3100000:
 	callsub S_MobRedondant;
 	end;
+S_MobRedondant:
+	monster "te_prtcas01",0,0,"Raydric",1163,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_prtcas01",0,0,"Khalitzburg",1132,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_prtcas01",0,0,"Abysmal Knight",1219,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_prtcas01",0,0,"High Orc",1213,10, .npc_name$ +"::OnMyMobDead";
+	monster "te_prtcas01",0,0,"Bloody Knight",1268,5, .npc_name$ +"::OnMyMobDead";
+	end;
 
 OnTimer4200000:
 	mapannounce "te_prtcas01", "Girls: ... how long do we have to wait?",bc_map,"0x00ff00",FW_NORMAL,12;
@@ -495,11 +513,10 @@ OnTimer4205000:
 OnTimer4210000:
 	mapannounce "te_prtcas01", "Girls: Come on, cut if off! You guys are so persistent!!",bc_map,"0x00ff00",FW_NORMAL,12;
 	end;
-
 OnTimer4220000:
 	mapannounce "te_prtcas01", "Aira: Ah! I can't take it anymore! Girls, come here!",bc_map,"0x00ff00",FW_NORMAL,12;
 
-	$@2012_tegod_gloria = 3;
+	$2012_tegod_gloria = 3;// quest off until someone break the emp
 	callsub S_EventReset;
 	enablenpc "prtg-1-22_prtg-1-31#te";
 	end;
@@ -538,31 +555,8 @@ OnTimer4240000:
 OnTimer4243000:
 	mapannounce "te_prtcas01", "You've failed to recapture the fortress. Kai is now gone.",bc_map,"0x00ff00",FW_NORMAL,12;
 	disablenpc "Blacksmith Kai#tegod01";
-	callsub S_EventOff;
-	.npc_name$ = "";
-	stopnpctimer;
-	end;
-
-OnStop:
-	callsub S_EventReset;
-	donpcevent "#eproom_girls_prt01::OnReset";
+	callsub S_EventOff;// clear setnpcdisplay
 	.npc_name$ = "";
-	$@2012_tegirls_prt01 = 0;
-	stopnpctimer;
-	end;
-
-OnReset:
-	callsub S_EventReset;
-	callsub S_EventOff;
-	donpcevent "#eproom_girls_prt01::OnReset";
-
-	$@2012_tegod_gloria = 0;
-	$@2012_tegirls_prt01 = 0;
-	.npc_name$ = "";
-
-	enablenpc "prtg-1-22_prtg-1-31#te";
-	enablenpc "Blacksmith Kai#tegod01";
-
 	stopnpctimer;
 	end;
 
@@ -576,8 +570,16 @@ S_EventOff:
 	donpcevent "#end_nasarin_prt01::OnCommandOff";
 	return;
 
+OnStop:// all girls have been defeated, kill remaining mobs and stop timer
+	callsub S_EventReset;
+	$@2012_tegirls_prt01 = 0;
+	.npc_name$ = "";
+	stopnpctimer;
+	end;
+
 S_EventReset:
 	killmonster "te_prtcas01", .npc_name$ +"::OnMyMobDead";
+	donpcevent "#eproom_girls_prt01::OnReset";
 	donpcevent "Aira#fake01_prt01::OnReset";
 	donpcevent "Kuluna#fake01_prt01::OnReset";
 	donpcevent "Mallina#fake01_prt01::OnReset";
@@ -595,89 +597,16 @@ S_EventReset:
 	donpcevent "#nasarin_real_prt01::OnReset";
 	return;
 
-S_MobRedondant:
-	monster "te_prtcas01",0,0,"Raydric",1163,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_prtcas01",0,0,"Khalitzburg",1132,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_prtcas01",0,0,"Abysmal Knight",1219,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_prtcas01",0,0,"High Orc",1213,10, .npc_name$ +"::OnMyMobDead";
-	monster "te_prtcas01",0,0,"Bloody Knight",1268,5, .npc_name$ +"::OnMyMobDead";
-	return;
-
 OnMyMobDead:
 	end;
 
 OnInit:
-	$@2012_tegirls_prt01 = 0;
-	if ($@2012_tegod_gloria < 3)
-		$@2012_tegod_gloria = 0;
+	$@2012_tegirls_prt01 = 0;// girls mobs killed count
+	if ($2012_tegod_gloria < 3)
+		$2012_tegod_gloria = 0;
 	end;
 }
 
--	script	real_prt01	-1,{
-	end;
-OnCommandOn:
-	.@npc_name$ = strnpcinfo(0);
-	if (.@npc_name$ == "#aira_real_prt01")
-		monster "te_prtcas01",65,28,"Aira in a blaze",2443,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#kuluna_real_prt01")
-		monster "te_prtcas01",54,61,"Passionate Kuluna",2444,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#mallina_real_prt01")
-		monster "te_prtcas01",182,92,"Mallina of the Earth",2445,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#ezella_real_prt01")
-		monster "te_prtcas01",161,111,"Ezella of Verdure",2446,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#lune_real_prt01")
-		monster "te_prtcas01",149,97,"Lune of the Eternal Glacier",2447,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#morin_real_prt01")
-		monster "te_prtcas01",99,176,"Morin of the Abyss",2448,1, .@npc_name$ +"::OnMyMobDead";
-	else if (.@npc_name$ == "#nasarin_real_prt01")
-		monster "te_prtcas01",125,170,"Fatal Nasarin",2449,1, .@npc_name$ +"::OnMyMobDead";
-	end;
-
-OnReset:
-	killmonster "te_prtcas01", strnpcinfo(0) +"::OnMyMobDead";
-	end;
-
-OnMyMobDead:
-	if (mobcount( "te_prtcas01",strnpcinfo(0) +"::OnMyMobDead" ) == 0)
-		initnpctimer;
-	end;
-
-OnTimer1000:
-	if (mobcount( "te_prtcas01",strnpcinfo(0) +"::OnMyMobDead" ) == 0) {
-		$@2012_tegirls_prt01++;
-		if ($@2012_tegirls_prt01 == 7) {
-			mapannounce "te_prtcas01","Kai: aaahh!! The girls broke the shields and made their way into where Emperium is!!!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			donpcevent "#eproom_girls_prt01::OnCommandOn";
-		}
-		else {
-			.@npc_name$ = strnpcinfo(0);
-			if (.@npc_name$ == "#aira_real_prt01")
-				mapannounce "te_prtcas01","Aira: You think I lost? You're wrong! We force our way to where Kai is!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#kuluna_real_prt01")
-				mapannounce "te_prtcas01","Kuluna: ... This is called a strategic retreat.",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#mallina_real_prt01")
-				mapannounce "te_prtcas01","Mallina: ... Why are you disturbing us so much? But victory will be ours in the end!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#ezella_real_prt01")
-				mapannounce "te_prtcas01","Ezella: Oh you, a weakling that would just disappear like the wind... !!!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#lune_real_prt01")
-				mapannounce "te_prtcas01","Lune: ..Alright. Let the battle begin!",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#morin_real_prt01")
-				mapannounce "te_prtcas01","Morin: It's not... interesting anymore.",bc_map,"0x00ff00",FW_NORMAL,12;
-			else if (.@npc_name$ == "#nasarin_real_prt01")
-				mapannounce "te_prtcas01","Nasarin: .. I wasted my time. Kai is in the center of this fortress?",bc_map,"0x00ff00",FW_NORMAL,12;
-		}
-	}
-	stopnpctimer;
-	end;
-}
-te_prtcas01,192,2,0	duplicate(real_prt01)	#aira_real_prt01	CLEAR_NPC
-te_prtcas01,193,2,0	duplicate(real_prt01)	#kuluna_real_prt01	CLEAR_NPC
-te_prtcas01,194,2,0	duplicate(real_prt01)	#mallina_real_prt01	CLEAR_NPC
-te_prtcas01,194,2,0	duplicate(real_prt01)	#ezella_real_prt01	CLEAR_NPC
-te_prtcas01,196,2,0	duplicate(real_prt01)	#lune_real_prt01	CLEAR_NPC
-te_prtcas01,197,2,0	duplicate(real_prt01)	#morin_real_prt01	CLEAR_NPC
-te_prtcas01,198,2,0	duplicate(real_prt01)	#nasarin_real_prt01	CLEAR_NPC
-
 
 te_prtcas01,64,20,3	script	Aira#fake01_prt01	CLEAR_NPC,{
 	end;
@@ -822,7 +751,6 @@ OnTimer3000:
 	end;
 }
 
-
 te_prtcas01,152,102,3	script	Lune#fake01_prt01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -948,12 +876,77 @@ OnTimer3000:
 	end;
 }
 
+-	script	real_prt01	-1,{
+	end;
+OnCommandOn:
+	.@npc_name$ = strnpcinfo(0);
+	if (.@npc_name$ == "#aira_real_prt01")
+		monster "te_prtcas01",65,28,"Aira in a blaze",2443,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#kuluna_real_prt01")
+		monster "te_prtcas01",54,61,"Passionate Kuluna",2444,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#mallina_real_prt01")
+		monster "te_prtcas01",182,92,"Mallina of the Earth",2445,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#ezella_real_prt01")
+		monster "te_prtcas01",161,111,"Ezella of Verdure",2446,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#lune_real_prt01")
+		monster "te_prtcas01",149,97,"Lune of the Eternal Glacier",2447,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#morin_real_prt01")
+		monster "te_prtcas01",99,176,"Morin of the Abyss",2448,1, .@npc_name$ +"::OnMyMobDead";
+	else if (.@npc_name$ == "#nasarin_real_prt01")
+		monster "te_prtcas01",125,170,"Fatal Nasarin",2449,1, .@npc_name$ +"::OnMyMobDead";
+	end;
+
+OnReset:
+	stopnpctimer;
+	killmonster "te_prtcas01", strnpcinfo(0) +"::OnMyMobDead";
+	end;
+
+OnMyMobDead:
+	if (mobcount( "te_prtcas01",strnpcinfo(0) +"::OnMyMobDead" ) == 0)
+		initnpctimer;
+	end;
+
+OnTimer1000:
+	if (mobcount( "te_prtcas01",strnpcinfo(0) +"::OnMyMobDead" ) == 0) {
+		$@2012_tegirls_prt01++;
+		if ($@2012_tegirls_prt01 == 7) {
+			mapannounce "te_prtcas01","Kai: aaahh!! The girls broke the shields and made their way into where Emperium is!!!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			donpcevent "#eproom_girls_prt01::OnCommandOn";
+		}
+		else {
+			.@npc_name$ = strnpcinfo(0);
+			if (.@npc_name$ == "#aira_real_prt01")
+				mapannounce "te_prtcas01","Aira: You think I lost? You're wrong! We force our way to where Kai is!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#kuluna_real_prt01")
+				mapannounce "te_prtcas01","Kuluna: ... This is called a strategic retreat.",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#mallina_real_prt01")
+				mapannounce "te_prtcas01","Mallina: ... Why are you disturbing us so much? But victory will be ours in the end!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#ezella_real_prt01")
+				mapannounce "te_prtcas01","Ezella: Oh you, a weakling that would just disappear like the wind... !!!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#lune_real_prt01")
+				mapannounce "te_prtcas01","Lune: ..Alright. Let the battle begin!",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#morin_real_prt01")
+				mapannounce "te_prtcas01","Morin: It's not... interesting anymore.",bc_map,"0x00ff00",FW_NORMAL,12;
+			else if (.@npc_name$ == "#nasarin_real_prt01")
+				mapannounce "te_prtcas01","Nasarin: .. I wasted my time. Kai is in the center of this fortress?",bc_map,"0x00ff00",FW_NORMAL,12;
+		}
+	}
+	stopnpctimer;
+	end;
+}
+te_prtcas01,192,2,0	duplicate(real_prt01)	#aira_real_prt01	CLEAR_NPC
+te_prtcas01,193,2,0	duplicate(real_prt01)	#kuluna_real_prt01	CLEAR_NPC
+te_prtcas01,194,2,0	duplicate(real_prt01)	#mallina_real_prt01	CLEAR_NPC
+te_prtcas01,194,2,0	duplicate(real_prt01)	#ezella_real_prt01	CLEAR_NPC
+te_prtcas01,196,2,0	duplicate(real_prt01)	#lune_real_prt01	CLEAR_NPC
+te_prtcas01,197,2,0	duplicate(real_prt01)	#morin_real_prt01	CLEAR_NPC
+te_prtcas01,198,2,0	duplicate(real_prt01)	#nasarin_real_prt01	CLEAR_NPC
+
 
 te_prtcas01,199,2,0	script	#eproom_girls_prt01	CLEAR_NPC,{
 	end;
 OnCommandOn:
 	enablenpc "prtg-1-22_prtg-1-31#te";
-
 	monster "te_prtcas01",184,188,"Fatal Nasarin",2449,1, "#eproom_girls_prt01::OnMyMobDead";
 	monster "te_prtcas01",191,182,"Morin of the Abyss",2448,1, "#eproom_girls_prt01::OnMyMobDead";
 	monster "te_prtcas01",183,183,"Lune of the Eternal Glacier",2447,1, "#eproom_girls_prt01::OnMyMobDead";
@@ -964,6 +957,7 @@ OnCommandOn:
 	end;
 
 OnReset:
+	stopnpctimer;
 	killmonster "te_prtcas01", "#eproom_girls_prt01::OnMyMobDead";
 	end;
 
@@ -975,14 +969,13 @@ OnMyMobDead:
 OnTimer3000:
 	if (mobcount( "te_prtcas01","#eproom_girls_prt01::OnMyMobDead" ) == 0) {
 		donpcevent "#tequest_master_prt01::OnStop";
-		$@2012_tegod_gloria = 4;
+		$2012_tegod_gloria = 4;
 		mapannounce "te_prtcas01","You have defeated the girls and recaptured the fortress successfully.",bc_map,"0x00ff00",FW_NORMAL,12;
 	}
 	stopnpctimer;
 	end;
 }
 
-
 te_prtcas01,203,204,5	script	#end_aira_prt01	CLEAR_NPC,{
 	end;
 OnCommandOn:
@@ -1009,4 +1002,3 @@ te_prtcas01,203,205,5	duplicate(#end_aira_prt01)	#end_ezella_prt01	CLEAR_NPC
 te_prtcas01,205,204,3	duplicate(#end_aira_prt01)	#end_lune_prt01	CLEAR_NPC
 te_prtcas01,204,205,4	duplicate(#end_aira_prt01)	#end_morin_prt01	CLEAR_NPC
 te_prtcas01,205,203,1	duplicate(#end_aira_prt01)	#end_nasarin_prt01	CLEAR_NPC
-

+ 5 - 5
npc/re/quests/woe_te/te_mission_main.txt

@@ -188,7 +188,7 @@ S_Coord:
 			mes "Unfortunately, you can't accept missions right now.";
 			next;
 			mes "["+ .@npc_name$ +"]";
-			.@playtime_check2 = checkquest(7516,PLAYTIME);
+			.@playtime_check2 = checkquest(7516,PLAYTIME);// A Break for Commercial Development
 			if (.@playtime_check2 == 2) {
 				erasequest 7516;
 				mes "Mm, you were taking a break?";
@@ -214,7 +214,7 @@ S_Coord:
 		.@mission02 = isbegin_quest(.@quest_id[.@index]);
 		.@mission03 = isbegin_quest(.@quest_id[.@index+1]);
 
-		if (.@s == 0 || .@s == 1 || .@s == 2) {
+		if (.@s == 0 || .@s == 1 || .@s == 2) {// Hunting suspicious quest
 			if (.@map$ == "te_alde_gld")
 				setarray .@mob_name$[0],"Porings","suspicious Porings";
 			else
@@ -291,7 +291,7 @@ S_Coord:
 			mes "I would like you to ^4d4dffeliminate "+ .@num_kill +" or more of "+ .@mob_name$[1] +"^000000.";
 			callsub( S_Acceptquest, .@main_quest, .@npc_name$ );
 		}
-		else if (.@s == 3 || .@s == 4 || .@s == 5) {
+		else if (.@s == 3 || .@s == 4 || .@s == 5) {// Breaking Emperiums
 			if (.@s == 3) {
 				.@num_tool_box = 1;
 				.@num_kill = 1;
@@ -353,7 +353,7 @@ S_Coord:
 				close;
 			}
 			.@playtime_check2 = checkquest(7516,PLAYTIME);
-			if (.@playtime_check2 == 1) {
+			if (.@playtime_check2 == 0) {
 				mes "There is something called 'commercial development level' in each fortress.";
 				mes "It increases as much as each guild invests.";
 				next;
@@ -366,7 +366,7 @@ S_Coord:
 				mes "See you in a bit.";
 				close;
 			}
-			else if (.@playtime_check2 == 2 || .@playtime_check2 == 3) {
+			else if (.@playtime_check2 == 2) {
 				erasequest 7516;
 				mes "The break for commercial development of the fortress is over now.";
 				mes "Good. Think about what kind of missions you want and come back again.";

+ 55 - 49
npc/re/woe_te/main_TE.txt

@@ -18,56 +18,59 @@
 OnAgitInit3:
 	.@map$ = strnpcinfo(4);
 	if (.@map$ == "") end;
+	.@npc_name$ = strnpcinfo(0);
 	.@guild_id = getcastledata(.@map$,1);
 	if (.@guild_id == 0) {
-		killmonsterall .@map$;
+		killmonster .@map$, .@npc_name$ +"::OnMyMobDead";
 		donpcevent strnpcinfo(0)+"::OnEmpSpawn";
-		if (compare(.@map$,"te_aldecas")) {
-			monster .@map$,0,0,"Evil Druid",1117,10;
-			monster .@map$,0,0,"Khalitzburg",1132,4;
-			monster .@map$,0,0,"Abysmal Knight",1219,2;
-			monster .@map$,0,0,"Executioner",1205,1;
-			monster .@map$,0,0,"Penomena",1216,10;
-			monster .@map$,0,0,"Alarm",1193,18;
-			monster .@map$,0,0,"Clock",1269,9;
-			monster .@map$,0,0,"Raydric Archer",1276,7;
-			monster .@map$,0,0,"Wanderer",1208,3;
-			monster .@map$,0,0,"Alice",1275,1;
-			monster .@map$,0,0,"Bloody Knight",1268,1;
-			monster .@map$,0,0,"Dark Lord",1272,1;
-			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; }
-			else if (.@map$ == "te_aldecas4") { setarray .@emproom[0],36,217; }
-			else if (.@map$ == "te_aldecas5") { setarray .@emproom[0],27,101; }
-			monster .@map$,.@emproom[0],.@emproom[1],"Dark Lord",1272,1;
-			monster .@map$,.@emproom[0],.@emproom[1],"Tower Keeper",1270,4;
-			monster .@map$,.@emproom[0],.@emproom[1],"Bloody Knight",1268,1;
-			monster .@map$,.@emproom[0],.@emproom[1],"Abysmal Knight",1219,1;
-			monster .@map$,.@emproom[0],.@emproom[1],"Raydric Archer",1276,5;
-		}
-		else if (compare(.@map$,"te_prtcas")) {
-			monster .@map$,0,0,"Raydric",1163,10;
-			monster .@map$,0,0,"Khalitzburg",1132,10;
-			monster .@map$,0,0,"Abysmal Knight",1219,5;
-			monster .@map$,0,0,"Bloody Knight",1268,5;
-			monster .@map$,0,0,"Stormy Knight",1251,1;
-			monster .@map$,0,0,"Hatii",1252,1;
-			monster .@map$,0,0,"Raydric Archer",1276,5;
-			monster .@map$,0,0,"Gryphon",1259,2;
-			monster .@map$,0,0,"Chimera",1283,2;
-			monster .@map$,0,0,"Alice",1275,1;
-			monster .@map$,0,0,"Zealotus",1200,1;
-			if (.@map$ == "te_prtcas01") { setarray .@emproom[0],197,197; }
-			else if (.@map$ == "te_prtcas02") { setarray .@emproom[0],157,174; }
-			else if (.@map$ == "te_prtcas03") { setarray .@emproom[0],16,220; }
-			else if (.@map$ == "te_prtcas04") { setarray .@emproom[0],291,14; }
-			else if (.@map$ == "te_prtcas05") { setarray .@emproom[0],266,266; }
-			monster .@map$,.@emproom[0],.@emproom[1],"Guardian Knight of Emperium",1268,1;
-			monster .@map$,.@emproom[0],.@emproom[1],"Chief Guardian Knight of Emperium",1251,1;
-			monster .@map$,.@emproom[0],.@emproom[1],"Hatii",1252,1;
-			monster .@map$,.@emproom[0],.@emproom[1],"Guardian Knight of Emperium",1219,2;
-			monster .@map$,.@emproom[0],.@emproom[1],"Raydric Archer",1276,5;
+		if (agitcheck3() == 0) {// we currently remove monsters OnAgitStart3
+			if (compare(.@map$,"te_aldecas")) {
+				monster .@map$,0,0,"Evil Druid",1117,10,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Khalitzburg",1132,4,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Abysmal Knight",1219,2,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Executioner",1205,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Penomena",1216,10,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Alarm",1193,18,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Clock",1269,9,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Raydric Archer",1276,7,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Wanderer",1208,3,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Alice",1275,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Bloody Knight",1268,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Dark Lord",1272,1,.@npc_name$ +"::OnMyMobDead";
+				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; }
+				else if (.@map$ == "te_aldecas4") { setarray .@emproom[0],36,217; }
+				else if (.@map$ == "te_aldecas5") { setarray .@emproom[0],27,101; }
+				monster .@map$,.@emproom[0],.@emproom[1],"Dark Lord",1272,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Tower Keeper",1270,4,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Bloody Knight",1268,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Abysmal Knight",1219,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Raydric Archer",1276,5,.@npc_name$ +"::OnMyMobDead";
+			}
+			else if (compare(.@map$,"te_prtcas")) {
+				monster .@map$,0,0,"Raydric",1163,10,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Khalitzburg",1132,10,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Abysmal Knight",1219,5,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Bloody Knight",1268,5,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Stormy Knight",1251,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Hatii",1252,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Raydric Archer",1276,5,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Gryphon",1259,2,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Chimera",1283,2,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Alice",1275,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,0,0,"Zealotus",1200,1,.@npc_name$ +"::OnMyMobDead";
+				if (.@map$ == "te_prtcas01") { setarray .@emproom[0],197,197; }
+				else if (.@map$ == "te_prtcas02") { setarray .@emproom[0],157,174; }
+				else if (.@map$ == "te_prtcas03") { setarray .@emproom[0],16,220; }
+				else if (.@map$ == "te_prtcas04") { setarray .@emproom[0],291,14; }
+				else if (.@map$ == "te_prtcas05") { setarray .@emproom[0],266,266; }
+				monster .@map$,.@emproom[0],.@emproom[1],"Guardian Knight of Emperium",1268,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Chief Guardian Knight of Emperium",1251,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Hatii",1252,1,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Guardian Knight of Emperium",1219,2,.@npc_name$ +"::OnMyMobDead";
+				monster .@map$,.@emproom[0],.@emproom[1],"Raydric Archer",1276,5,.@npc_name$ +"::OnMyMobDead";
+			}
 		}
 		disablenpc "Kafra Staff#"+ .@map$;
 	}
@@ -192,15 +195,18 @@ S_Message:
 
 	if (.@map$ == "te_aldecas1") {
 		donpcevent "Blacksmith Cano#tegod01::OnInit";// god item TE
-		$@2012_tegod_kafra = 0;
+		$2012_tegod_kafra = 0;
 		$@2012_tegirls_alde01 = 0;
 	}
 	else if (.@map$ == "te_prtcas01") {
-    	$@2012_tegod_gloria = 0;
+    	$2012_tegod_gloria = 0;
     	$@2012_tegirls_prt01 = 0;
     	donpcevent "Blacksmith Kai#tegod01::OnInit";
 	}
 	return;
+
+OnMyMobDead:
+	end;
 }
 
 // Guild Kafras