Custom woe controller update (#4672)

* Adds the woe TE castle
* Cosmetic changes of the setting format

This update doesn't broke your woe session defined.

Thanks to @mazvi
This commit is contained in:
Atemo 2020-03-10 19:03:08 +01:00 committed by GitHub
parent 67a07fd4d6
commit 36a02685d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@
//= Be sure to disable the default agit controllers!
//= npc\guild\agit_controller.txt
//= npc\guild2\agit_start_se.txt
//= npc\re\guild3\agit_start_te.txt
//============================================================
// Information NPC
@ -29,9 +30,9 @@ prontera,149,193,4 script WOE Information 835,{
doevent "WOE_CONTROL::OnMenu";
end;
OnAgitStart:
while(agitcheck()) {
specialeffect EF_BEGINSPELL6;
while(agitcheck() || agitcheck2() || agitcheck3()) {
sleep 425;
specialeffect EF_BEGINSPELL6;
}
end;
}
@ -40,9 +41,10 @@ OnAgitStart:
//============================================================
- script WOE_CONTROL -1,{
function Disp_Owner; function Add_Zero;
function Region;
function Castle;
OnInit:
// -----------------------------------------------------------
// Configuration settings.
// -----------------------------------------------------------
@ -82,45 +84,93 @@ OnInit:
.reward_zeny = 0;
// -----------------------------------------------------------
// Constants (leave this section alone).
// Castles datas.
// -----------------------------------------------------------
setarray .Castles$[0],
"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
setarray .EndLabel$[0],"ar01","ar02","ar03","ar04","ar05","sc01","sc02","sc03","sc04","sc05";
// Region function defines the region of the castle defined by Castle function.
// Region("<region name>");
// Castle("<castle map name>", "<event name when woe end>", "<event killmonster name>", "<map name special warp>",<x>,<y>)
Region("Prontera");
Castle("prtg_cas01", "Agit#prtg_cas01::OnAgitEnd", "Agit#prtg_cas01::OnAgitBreak", "prt_gld",134,65);
Castle("prtg_cas02", "Agit#prtg_cas02::OnAgitEnd", "Agit#prtg_cas02::OnAgitBreak", "prt_gld",240,128);
Castle("prtg_cas03", "Agit#prtg_cas03::OnAgitEnd", "Agit#prtg_cas03::OnAgitBreak", "prt_gld",153,137);
Castle("prtg_cas04", "Agit#prtg_cas04::OnAgitEnd", "Agit#prtg_cas04::OnAgitBreak", "prt_gld",111,240);
Castle("prtg_cas05", "Agit#prtg_cas05::OnAgitEnd", "Agit#prtg_cas05::OnAgitBreak", "pay_gld",208,240);
Region("Payon");
Castle("payg_cas01", "Agit#payg_cas01::OnAgitEnd", "Agit#payg_cas01::OnAgitBreak", "pay_gld",121,233);
Castle("payg_cas02", "Agit#payg_cas02::OnAgitEnd", "Agit#payg_cas02::OnAgitBreak", "pay_gld",295,116);
Castle("payg_cas03", "Agit#payg_cas03::OnAgitEnd", "Agit#payg_cas03::OnAgitBreak", "pay_gld",317,293);
Castle("payg_cas04", "Agit#payg_cas04::OnAgitEnd", "Agit#payg_cas04::OnAgitBreak", "pay_gld",140,160);
Castle("payg_cas05", "Agit#payg_cas05::OnAgitEnd", "Agit#payg_cas05::OnAgitBreak", "pay_gld",204,266);
Region("Geffen");
Castle("gefg_cas01", "Agit#gefg_cas01::OnAgitEnd", "Agit#gefg_cas01::OnAgitBreak", "gef_fild13",214,75);
Castle("gefg_cas02", "Agit#gefg_cas02::OnAgitEnd", "Agit#gefg_cas02::OnAgitBreak", "gef_fild13",308,240);
Castle("gefg_cas03", "Agit#gefg_cas03::OnAgitEnd", "Agit#gefg_cas03::OnAgitBreak", "gef_fild13",143,240);
Castle("gefg_cas04", "Agit#gefg_cas04::OnAgitEnd", "Agit#gefg_cas04::OnAgitBreak", "gef_fild13",193,278);
Castle("gefg_cas05", "Agit#gefg_cas05::OnAgitEnd", "Agit#gefg_cas05::OnAgitBreak", "gef_fild13",305,87);
Region("Aldebaran");
Castle("aldeg_cas01", "Agit#aldeg_cas01::OnAgitEnd", "Agit#aldeg_cas01::OnAgitBreak", "alde_gld",48,83);
Castle("aldeg_cas02", "Agit#aldeg_cas02::OnAgitEnd", "Agit#aldeg_cas02::OnAgitBreak", "alde_gld",95,249);
Castle("aldeg_cas03", "Agit#aldeg_cas03::OnAgitEnd", "Agit#aldeg_cas03::OnAgitBreak", "alde_gld",142,85);
Castle("aldeg_cas04", "Agit#aldeg_cas04::OnAgitEnd", "Agit#aldeg_cas04::OnAgitBreak", "alde_gld",239,242);
Castle("aldeg_cas05", "Agit#aldeg_cas05::OnAgitEnd", "Agit#aldeg_cas05::OnAgitBreak", "alde_gld",264,90);
Region("Arunafeltz");
Castle("arug_cas01", "Manager#arug_cas01::OnAgitEnd2", "Steward#ar01::OnStartArena", "aru_gld",158,272);
Castle("arug_cas02", "Manager#arug_cas02::OnAgitEnd2", "Steward#ar02::OnStartArena", "aru_gld",83,47);
Castle("arug_cas03", "Manager#arug_cas03::OnAgitEnd2", "Steward#ar03::OnStartArena", "aru_gld",68,155);
Castle("arug_cas04", "Manager#arug_cas04::OnAgitEnd2", "Steward#ar04::OnStartArena", "aru_gld",299,345);
Castle("arug_cas05", "Manager#arug_cas05::OnAgitEnd2", "Steward#ar05::OnStartArena", "aru_gld",292,107);
Region("Schwarzwald");
Castle("schg_cas01", "Manager#schg_cas01::OnAgitEnd2", "Steward#sc01::OnStartArena", "sch_gld",293,100);
Castle("schg_cas02", "Manager#schg_cas02::OnAgitEnd2", "Steward#sc02::OnStartArena", "sch_gld",288,252);
Castle("schg_cas03", "Manager#schg_cas03::OnAgitEnd2", "Steward#sc03::OnStartArena", "sch_gld",97,196);
Castle("schg_cas04", "Manager#schg_cas04::OnAgitEnd2", "Steward#sc04::OnStartArena", "sch_gld",137,90);
Castle("schg_cas05", "Manager#schg_cas05::OnAgitEnd2", "Steward#sc05::OnStartArena", "sch_gld",71,315);
Region("Prontera (TE)");
Castle("te_prtcas01", "Manager_TE#Gaebolg::OnAgitEnd3", "Manager_TE#Gaebolg::OnAgitBreak", "te_prt_gld",134,65);
Castle("te_prtcas02", "Manager_TE#Richard::OnAgitEnd3", "Manager_TE#Richard::OnAgitBreak", "te_prt_gld",240,128);
Castle("te_prtcas03", "Manager_TE#Wigner::OnAgitEnd3", "Manager_TE#Wigner::OnAgitBreak", "te_prt_gld",153,137);
Castle("te_prtcas04", "Manager_TE#Heine::OnAgitEnd3", "Manager_TE#Heine::OnAgitBreak", "te_prt_gld",111,240);
Castle("te_prtcas05", "Manager_TE#Nerious::OnAgitEnd3", "Manager_TE#Nerious::OnAgitBreak", "te_prt_gld",208,240);
Region("Aldebaran (TE)");
Castle("te_aldecas1", "Manager_TE#Glaris::OnAgitEnd3", "Manager_TE#Glaris::OnAgitBreak", "te_alde_gld",48,83);
Castle("te_aldecas2", "Manager_TE#Defolty::OnAgitEnd3", "Manager_TE#Defolty::OnAgitBreak", "te_alde_gld",95,249);
Castle("te_aldecas3", "Manager_TE#Sorin::OnAgitEnd3", "Manager_TE#Sorin::OnAgitBreak", "te_alde_gld",142,85);
Castle("te_aldecas4", "Manager_TE#Bennit::OnAgitEnd3", "Manager_TE#Bennit::OnAgitBreak", "te_alde_gld",239,242);
Castle("te_aldecas5", "Manager_TE#W::OnAgitEnd3", "Manager_TE#W::OnAgitBreak", "te_alde_gld",264,90);
setarray .Days$[0],"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday";
setarray .Regions$[0],"Prontera","Payon","Geffen","Aldebaran","Arunafeltz","Schwarzwald";
setarray .Map$[0],"prt_gld","pay_gld","gef_fild13","alde_gld","aru_gld","sch_gld";
setarray .MapX[0],134,240,153,111,208,121,295,317,140,204,214,308,143,193,305,48, 95,142,239,264,158,83, 68,299,292,293,288, 97,137, 71;
setarray .MapY[0], 65,128,137,240,240,233,116,293,160,266, 75,240,240,278, 87,83,249, 85,242, 90,272,47,155,345,107,100,252,196, 90,315;
// -----------------------------------------------------------
.reward_id_size = getarraysize(.reward_id);
set .Size, getarraysize($WOE_CONTROL);
if (.AutoKick || .NoOwner)
for(set .@i,0; .@i<getarraysize(.Castles$); set .@i,.@i+1) {
if (.AutoKick || .NoOwner) {
for(set .@i,0; .@i<.total_castle; set .@i,.@i+1) {
setmapflag .Castles$[.@i], mf_loadevent;
setd "."+.Castles$[.@i], .@i;
}
if (!agitcheck() && !agitcheck2()) sleep 4000;
}
else {
for(set .@i,0; .@i<.total_castle; set .@i,.@i+1)
setd "."+.Castles$[.@i], 0;
}
if (!agitcheck() && !agitcheck2() && !agitcheck3()) sleep 4000;
set .Init,1;
.current_region = 0;
OnMinute00:
freeloop(1);
if (agitcheck() || agitcheck2()) {
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
if (agitcheck() || agitcheck2() || agitcheck3()) {
for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) == $WOE_CONTROL[.@i+2]) {
OnWOEEnd:
announce "The War Of Emperium is over!",bc_all|bc_woe;
AgitEnd; AgitEnd2;
AgitEnd; AgitEnd2; AgitEnd3;
sleep 1000;
for(set .@j,0; .@j<getarraysize(.Castles$); set .@j,.@j+1) {
for(set .@j,0; .@j<.total_castle; set .@j,.@j+1) {
if (.Active[0]&(1<<.@j)) Disp_Owner(.Castles$[.@j],1);
if (.ExitWarp) maprespawnguildid .Castles$[.@j],0,3;
}
@ -129,33 +179,31 @@ OnMinute00:
if (.ForceEnd) { set .ForceEnd,0; end; }
break;
}
}
}
if ((!agitcheck() && !agitcheck2()) || .Init) {
if (!agitcheck() && !agitcheck2()) set .Init,0;
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
.@agit_check = (!agitcheck() && !agitcheck2() && !agitcheck3());
if (.@agit_check || .Init) {
if (.@agit_check) set .Init,0;
for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) {
deletearray .Active[0],2;
set .Active[0], $WOE_CONTROL[.@i+3];
if (.Init) { AgitEnd; AgitEnd2; }
if (.Init) { AgitEnd; AgitEnd2; AgitEnd3; }
else announce "The War Of Emperium has begun!",bc_all|bc_woe;
sleep 1000;
AgitStart; AgitStart2;
for(set .@j,0; .@j<getarraysize(.Castles$); set .@j,.@j+1) {
AgitStart; AgitStart2; AgitStart3;
for(set .@j,0; .@j<.total_castle; set .@j,.@j+1) {
if (.Active[0]&(1<<.@j)) {
if (!.Init) Disp_Owner(.Castles$[.@j],0);
set .Active[1], .Active[1] | (1<<((.@j/5)+1));
set .Active[1], .Active[1] | (1<<.castle_region[.@j]);
} else {
if (.@j<20) {
donpcevent "Agit#"+.Castles$[.@j]+"::OnAgitEnd";
killmonster .Castles$[.@j], "Agit#"+.Castles$[.@j]+"::OnAgitBreak";
} else {
donpcevent "Manager#"+.Castles$[.@j]+"::OnAgitEnd2";
killmonster .Castles$[.@j], "Steward#"+.EndLabel$[.@j-20]+"::OnStartArena";
}
donpcevent .event_name_agitend$[.@j];
killmonster .Castles$[.@j], .event_name_killmob$[.@j];
}
}
break;
}
}
}
set .Init,0;
end;
@ -169,6 +217,44 @@ function Disp_Owner {
function Add_Zero {
return ((getarg(0)<10)?"0":"")+getarg(0)+(getarg(1,0)?".":":")+"00";
}
function Castle {
.@map$ = getarg(0);
if (getd( "." + .@map$ ) > 0) {
debugmes sprintf("WOE_CONTROL: map %s already defined.", .@map$);
return;
}
if (.total_castle > 61) {
debugmes sprintf("WOE_CONTROL: Maximum of 62 castles defined, %s skipped.", .@map$);
return;
}
.Castles$[.total_castle] = .@map$;
.event_name_agitend$[.total_castle] = getarg(1);
.event_name_killmob$[.total_castle] = getarg(2);
.Map$[.total_castle] = getarg(3);
.MapX[.total_castle] = getarg(4);
.MapY[.total_castle] = getarg(5);
.castle_region[.total_castle] = .current_region;
setd ".castle_index_in_region_" + .current_region + "[" + .size_region[.current_region] + "]", .total_castle;
.total_castle++;
.size_region[.current_region]++;
setd "." + .Castles$[.total_castle-1], .total_castle;
return;
}
function Region {
.@zone$ = getarg(0);
for ( .@i = 0; .@i < .total_region; ++.@i ) {
if (.Regions$[.@i] == .@zone$) {
.current_region = .@index;
return;
}
}
.Regions$[.total_region] = .@zone$;
.current_region = .total_region;
.total_region++;
return;
}
OnReward:
if (!.reward_id_size && !.reward_zeny)
@ -176,10 +262,11 @@ OnReward:
if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21);
freeloop(1);
for(set .@i,0; .@i<getarraysize(.Castles$); set .@i,.@i+1) {
for(set .@i,0; .@i<.total_castle; set .@i,.@i+1) {
if (getarg(0)&(1<<.@i)) {
set .@gid, getcastledata(.Castles$[.@i],1);
if (!.@gid) continue;
if (!.@gid)
continue;
getguildmember( .@gid, 1, .@cid );
.@size_guild = getguildmember( .@gid, 2, .@aid );
@ -199,13 +286,7 @@ OnReward:
for(set .@j,0; .@j<.@size_guild; set .@j,.@j+1) {
if ((.Options&8) && !(.Options&4)) {
if (isloggedin(.@aid[.@j],.@cid[.@j]))
set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a");
else {
if (query_sql("SELECT `last_ip` FROM `login` WHERE `account_id` = '" + .@aid[.@j] + "'", .@last_ip$) < 1)
continue;
.@ip$ = replacestr(.@last_ip$, ".", "a");
}
set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a");
if (getd(".@ip_"+.@i+"_"+.@ip$)) continue;
setd ".@ip_"+.@i+"_"+.@ip$,1;
}
@ -224,7 +305,8 @@ OnReward:
setd ".@str_"+.@cid[.@j],1;
message rid2name(.@aid[.@j]),"You've got mail!";
}
} else if (isloggedin(.@aid[.@j],.@cid[.@j])) {
}
else if (isloggedin(.@aid[.@j],.@cid[.@j])) {
attachrid( .@aid[.@j], true );
.@name$ = strcharinfo( 0 );
.@castle_name$ = getcastlename(.Castles$[.@i]);
@ -244,30 +326,33 @@ OnReward:
return;
OnPCLoadMapEvent:
if (!compare(strcharinfo(3),"g_cas")) end;
.@compare_val = compare(strcharinfo(3),"g_cas");
if (!.@compare_val) end;
if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(3),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(3))))) {
if (getcharid(2) && getcastledata(strcharinfo(3),1) == getcharid(2)) end;
.@castle_name$ = getcastlename(strcharinfo(3));
sleep2 1000;
message strcharinfo(0), getcastlename(strcharinfo(3))+" is currently inactive.";
message strcharinfo(0), .@castle_name$ + " is currently inactive.";
sleep2 5000;
if (compare(strcharinfo(3),"g_cas")) warp "SavePoint",0,0;
if (.@compare_val) warp "SavePoint",0,0;
}
end;
OnMenu:
while(1) {
mes "[WOE Information]";
if (agitcheck() || agitcheck2()) {
if (agitcheck() || agitcheck2() || agitcheck3()) {
if (.Active[0]) {
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) {
set .@i, $WOE_CONTROL[.@i+2];
break;
}
}
mes "The War of Emperium is ^0055FFactive^000000 until ^FF0000"+Add_Zero(.@i)+"^000000 in the following regions:";
mes " ";
for(set .@i,0; .@i<6; set .@i,.@i+1)
if (.Active[1]&(1<<(.@i+1))) mes " > ^777777"+.Regions$[.@i]+"^000000";
for(set .@i,0; .@i < .total_region; set .@i,.@i+1)
if (.Active[1]&(1<<.@i)) mes " > ^777777"+.Regions$[.@i]+"^000000";
} else
mes "The War of Emperium is ^0055FFactive^000000.";
} else {
@ -290,20 +375,22 @@ while(1) {
case 1:
if (.CastleWarp) set .@clr$,"^0055FF";
set .@menu$,"";
for(set .@i,0; .@i<6; set .@i,.@i+1) {
if (.CastleWarp || .Active[1]&(1<<(.@i+1)))
set .@menu$, .@menu$+" ~ "+((.Active[1]&(1<<(.@i+1)))?.@clr$:"^777777")+.Regions$[.@i]+" Castles^000000";
for(set .@i,0; .@i < .total_region; set .@i,.@i+1) {
if (.CastleWarp || .Active[1]&(1<<.@i))
set .@menu$, .@menu$+" ~ "+((.Active[1]&(1<<.@i))?.@clr$:"^777777")+.Regions$[.@i]+" Castles^000000";
set .@menu$, .@menu$+":";
}
set .@i, select(.@menu$)-1;
set .@menu$,"";
for(set .@j,.@i*5; .@j<(.@i*5)+5; set .@j,.@j+1) {
if (.CastleWarp || .Active[0]&(1<<.@j))
set .@menu$, .@menu$+" ~ "+((.Active[0]&(1<<.@j))?.@clr$:"^777777")+getcastlename(.Castles$[.@j])+"^000000";
for(set .@j,0; .@j < .size_region[.@i]; set .@j,.@j+1) {
.@index = getd( ".castle_index_in_region_" + .@i + "[" + .@j + "]" );
if (.CastleWarp || .Active[0]&(1<<.@index))
set .@menu$, .@menu$+" ~ "+((.Active[0]&(1<<.@index))?.@clr$:"^777777")+getcastlename(.Castles$[.@index])+"^000000";
set .@menu$, .@menu$+":";
}
set .@j, select(.@menu$)-1;
warp .Map$[.@i],.MapX[(.@i*5)+.@j],.MapY[(.@i*5)+.@j];
.@index = getd( ".castle_index_in_region_" + .@i + "[" + .@j + "]" );
warp .Map$[.@index],.MapX[.@index],.MapY[.@index];
close;
case 2:
mes "[Schedule]";
@ -311,7 +398,7 @@ while(1) {
freeloop(1);
for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
mes "> ^FF0000"+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1])+"-"+Add_Zero($WOE_CONTROL[.@i+2])+")^000000";
for(set .@j,0; .@j<getarraysize(.Castles$); set .@j,.@j+1)
for(set .@j,0; .@j<.total_castle; set .@j,.@j+1)
if ($WOE_CONTROL[.@i+3]&(1<<.@j)) mes " ~ "+getcastlename(.Castles$[.@j])+" ^777777("+.Castles$[.@j]+")^000000";
if (.@i+4 < .Size) mes " ";
}
@ -322,12 +409,13 @@ while(1) {
break;
case 3:
mes "[Castle Ownership]";
for(set .@i,0; .@i<6; set .@i,.@i+1) {
for(set .@i,0; .@i < .total_region; set .@i,.@i+1) {
set .@k, .@i*5;
mes "> ^FF0000"+.Regions$[.@i]+"^000000";
for(set .@j,.@k; .@j<(.@k+5); set .@j,.@j+1) {
set .@t, getcastledata(.Castles$[.@j],1);
mes " ~ "+getcastlename(.Castles$[.@j])+": "+((.@t)?"^0055FF"+getguildname(.@t):"^777777unoccupied")+"^000000";
for(set .@j,0; .@j<.size_region[.@i]; set .@j,.@j+1) {
.@index = getd( ".castle_index_in_region_" + .@i + "[" + .@j + "]" );
set .@t, getcastledata(.Castles$[.@index],1);
mes " ~ "+getcastlename(.Castles$[.@index])+": "+((.@t)?"^0055FF"+getguildname(.@t):"^777777unoccupied")+"^000000";
}
if (.@i < 5) mes " ";
}
@ -339,14 +427,9 @@ while(1) {
mes "There are ^0055FF"+(.Size/4)+" session(s)^000000 configured.";
mes "What would you like to do?";
next;
switch(select(" ~ Add a session...: ~ Delete a session...: ~ Reload settings...:"+((agitcheck() || agitcheck2())?" ~ End WOE session...":"")+": ~ ^777777Go back^000000")) {
switch(select(" ~ Add a session...: ~ Delete a session...: ~ Reload settings...:"+((agitcheck() || agitcheck2() || agitcheck3())?" ~ End WOE session...":"")+": ~ ^777777Go back^000000")) {
case 1:
mes "[New Session]";
if (.Size > 127) {
mes "You have already reached the maximum of 32 sessions.";
next;
break;
}
mes "Select a day.";
next;
set .@Day, select(" ~ "+implode(.Days$,": ~ "))-1;
@ -383,11 +466,15 @@ while(1) {
mes " > Castles:";
if (!.@Castle)
mes " ~ ^777777(none selected)^000000";
else for(set .@i,0; .@i<getarraysize(.Castles$); set .@i,.@i+1)
if (.@Castle&(1<<.@i)) mes " ~ "+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")";
else {
for(set .@i,0; .@i<.total_castle; set .@i,.@i+1) {
.@string$ = ( .@Castle&(1<<.@i) ) ? " ~ "+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")" : "";
mes .@string$;
}
}
next;
set .@menu$,((.@Castle)?" ~ ^FF0000Finished...^000000":"")+":";
for(set .@i,0; .@i<getarraysize(.Castles$); set .@i,.@i+1)
for(set .@i,0; .@i<.total_castle; set .@i,.@i+1)
set .@menu$, .@menu$+" ~ "+((.@Castle&(1<<.@i))?"^0055FF":"")+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")^000000:";
set .@i, select(.@menu$)-1;
if (.@i)
@ -398,11 +485,12 @@ while(1) {
next;
switch(select(" ~ ^0055FFAdd session...^000000: ~ Continue selecting castles...: ~ ^777777Cancel^000000")) {
case 1:
for(set .@i,0; .@i<.Size; set .@i,.@i+4)
for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
if ((.@Day == $WOE_CONTROL[.@i] && .@End <= $WOE_CONTROL[.@i+1]) || .@Day < $WOE_CONTROL[.@i]) {
set .@d,1;
break;
}
}
if (!.@d) { set .@d,1; set .@i,.Size; }
copyarray $WOE_CONTROL[.@i+4], $WOE_CONTROL[.@i], .Size-.@i;
setarray $WOE_CONTROL[.@i], .@Day, .@Start, .@End, .@Castle;
@ -452,7 +540,7 @@ while(1) {
case 3:
mes "[Reload Settings]";
mes "This will trigger all events related to new session configurations, if any.";
if (agitcheck() || agitcheck2()) {
if (agitcheck() || agitcheck2() || agitcheck3()) {
mes " ";
mes "Be aware that this will disrupt the current WOE session.";
}
@ -469,7 +557,7 @@ while(1) {
break;
case 4:
mes "[Force Agit End]";
if (!agitcheck() && !agitcheck2()) {
if (!agitcheck() && !agitcheck2() && !agitcheck3()) {
mes "WOE has already ended.";
next;
break;