woe_controller.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. //===== rAthena Script =======================================
  2. //= Euphy's WOE Controller
  3. //===== By: ==================================================
  4. //= Euphy
  5. //===== Current Version: =====================================
  6. //= 1.5
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= A controller for War of Emperium designed for
  11. //= simplicity and ease of use.
  12. //= Many concepts taken from ToastOfDoom's script,
  13. //= and "rewards" function originally by Goddameit.
  14. //===== Additional Comments: =================================
  15. //= Be sure to disable the default agit controllers!
  16. //== npc\guild\agit_controller.txt
  17. //== npc\guild2\agit_start_se.txt
  18. //============================================================
  19. // Information NPC
  20. //============================================================
  21. prontera,149,193,4 script WOE Information 835,{
  22. doevent "WOE_CONTROL::OnMenu";
  23. end;
  24. OnAgitStart:
  25. while(agitcheck()) {
  26. specialeffect EF_BEGINSPELL6;
  27. sleep 425;
  28. }
  29. end;
  30. }
  31. // Script Core
  32. //============================================================
  33. - script WOE_CONTROL -1,{
  34. function Disp_Owner; function Add_Zero;
  35. OnInit:
  36. // -----------------------------------------------------------
  37. // Configuration settings.
  38. // -----------------------------------------------------------
  39. set .CastleWarp,0; // 1: Always enable all castle warps. | 0: Warp only to active castles.
  40. set .AutoKick,1; // Automatically kick players from inactive castles during WOE? (1:yes / 0:no)
  41. set .NoOwner,0; // Automatically kick players from unconquered castles outside of WOE? (1:yes / 0:no)
  42. set .ExitWarp,0; // Warp all players from castles when WOE ends? (1:yes / 0:no)
  43. set .GMAccess,99; // GM level required to access Session Manager.
  44. // -----------------------------------------------------------
  45. // Reward options.
  46. // -----------------------------------------------------------
  47. // [1] Enable rewards.
  48. // [2] Mail all rewards.
  49. // - If not set, players receive items in their inventory.
  50. // - Only ONE item can be sent via mail for PACKETVER < 20150513 while later clients are limited to MAIL_MAX_ITEM (5).
  51. // - Note that offline players do NOT receive rewards.
  52. // [4] Only reward Guild Masters.
  53. // - If not set, all guild members are rewarded.
  54. // - If mailing is enabled (option 2), offline Guild Masters WILL receive rewards.
  55. // [8] Duplicate IP check.
  56. // - Members in a guild with the same IP address are not rewarded.
  57. // - If Guild Masters is enabled (option 4), this feature is not used.
  58. // -----------------------------------------------------------
  59. // Combine values as needed (e.g. 1|8 = 1+8 = 9).
  60. set .Options, 1|8;
  61. // Rewards per castle.
  62. // setarray .reward_id[0], <itemID>{,<itemID>,...}
  63. // setarray .reward_amount[0], <amount>{,<amount>,...}
  64. setarray .reward_id[0],14001;
  65. setarray .reward_amount[0],1;
  66. // Zeny reward:
  67. .reward_zeny = 0;
  68. // -----------------------------------------------------------
  69. // Constants (leave this section alone).
  70. // -----------------------------------------------------------
  71. setarray .Castles$[0],
  72. "prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
  73. "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
  74. "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
  75. "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
  76. "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
  77. "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
  78. setarray .EndLabel$[0],"ar01","ar02","ar03","ar04","ar05","sc01","sc02","sc03","sc04","sc05";
  79. setarray .Days$[0],"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday";
  80. setarray .Regions$[0],"Prontera","Payon","Geffen","Aldebaran","Arunafeltz","Schwarzwald";
  81. setarray .Map$[0],"prt_gld","pay_gld","gef_fild13","alde_gld","aru_gld","sch_gld";
  82. 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;
  83. 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;
  84. // -----------------------------------------------------------
  85. .reward_id_size = getarraysize(.reward_id);
  86. set .Size, getarraysize($WOE_CONTROL);
  87. if (.AutoKick || .NoOwner)
  88. for(set .@i,0; .@i<30; set .@i,.@i+1) {
  89. setmapflag .Castles$[.@i], mf_loadevent;
  90. setd "."+.Castles$[.@i], .@i;
  91. }
  92. if (!agitcheck() && !agitcheck2()) sleep 4000;
  93. set .Init,1;
  94. OnMinute00:
  95. freeloop(1);
  96. if (agitcheck() || agitcheck2()) {
  97. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  98. if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) == $WOE_CONTROL[.@i+2]) {
  99. OnWOEEnd:
  100. announce "The War Of Emperium is over!",bc_all|bc_woe;
  101. AgitEnd; AgitEnd2;
  102. sleep 1000;
  103. for(set .@j,0; .@j<30; set .@j,.@j+1) {
  104. if (.Active[0]&(1<<.@j)) Disp_Owner(.Castles$[.@j],1);
  105. if (.ExitWarp) maprespawnguildid .Castles$[.@j],0,3;
  106. }
  107. if ((.Options&1) && .Active[0] && .ForceEnd != 2) callsub OnReward, .Active[0];
  108. deletearray .Active[0],2;
  109. if (.ForceEnd) { set .ForceEnd,0; end; }
  110. break;
  111. }
  112. }
  113. if ((!agitcheck() && !agitcheck2()) || .Init) {
  114. if (!agitcheck() && !agitcheck2()) set .Init,0;
  115. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  116. if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) {
  117. deletearray .Active[0],2;
  118. set .Active[0], $WOE_CONTROL[.@i+3];
  119. if (.Init) { AgitEnd; AgitEnd2; }
  120. else announce "The War Of Emperium has begun!",bc_all|bc_woe;
  121. sleep 1000;
  122. AgitStart; AgitStart2;
  123. for(set .@j,0; .@j<30; set .@j,.@j+1) {
  124. if (.Active[0]&(1<<.@j)) {
  125. if (!.Init) Disp_Owner(.Castles$[.@j],0);
  126. set .Active[1], .Active[1] | (1<<((.@j/5)+1));
  127. } else {
  128. if (.@j<20) {
  129. donpcevent "Agit#"+.Castles$[.@j]+"::OnAgitEnd";
  130. killmonster .Castles$[.@j], "Agit#"+.Castles$[.@j]+"::OnAgitBreak";
  131. } else {
  132. donpcevent "Manager#"+.Castles$[.@j]+"::OnAgitEnd2";
  133. killmonster .Castles$[.@j], "Steward#"+.EndLabel$[.@j-20]+"::OnStartArena";
  134. }
  135. }
  136. }
  137. break;
  138. }
  139. }
  140. set .Init,0;
  141. end;
  142. function Disp_Owner {
  143. set .@o, getcastledata(getarg(0),1);
  144. if (.@o) announce "The ["+getcastlename(getarg(0))+"] castle "+((getarg(1))?"has been conquered":"is currently held")+" by the ["+getguildname(.@o)+"] guild.",bc_all|bc_woe;
  145. else announce "The ["+getcastlename(getarg(0))+"] castle is currently unoccupied.",bc_all|bc_woe;
  146. return;
  147. }
  148. function Add_Zero {
  149. return ((getarg(0)<10)?"0":"")+getarg(0)+(getarg(1,0)?".":":")+"00";
  150. }
  151. OnReward:
  152. if (!.reward_id_size && !.reward_zeny)
  153. return;
  154. set .@sql$, ((.Options&4)?"position = 0":"online = 1");
  155. if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21);
  156. freeloop(1);
  157. for(set .@i,0; .@i<30; set .@i,.@i+1) {
  158. if (getarg(0)&(1<<.@i)) {
  159. set .@gid, getcastledata(.Castles$[.@i],1);
  160. if (!.@gid) continue;
  161. set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid);
  162. for(set .@j,0; .@j<.@size; set .@j,.@j+1) {
  163. if ((.Options&8) && !(.Options&4)) {
  164. set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a");
  165. if (getd(".@ip_"+.@i+"_"+.@ip$)) continue;
  166. setd ".@ip_"+.@i+"_"+.@ip$,1;
  167. }
  168. if (.Options&2) {
  169. .@charid = .@cid[.@j];
  170. .@sender$ = "no-reply";
  171. .@title$ = "** Siege Reward: "+getcastlename(.Castles$[.@i])+" **";
  172. .@body$ = "Brave one,\r\n \r\n Congratulations!\r\n Your guild has successfully occupied\r\n territory in the War of Emperium on\r\n "+.@str$+".\r\n \r\n \r\n \r\n \r\n [ Your reward is attached. ]";
  173. if (.reward_id_size)
  174. mail .@charid, .@sender$, .@title$, .@body$, .reward_zeny, .reward_id, .reward_amount;
  175. else
  176. mail .@charid, .@sender$, .@title$, .@body$, .reward_zeny;
  177. if (PACKETVER < 20150513 && !getd(".@str_"+.@cid[.@j]) && isloggedin(.@aid[.@j],.@cid[.@j])) {
  178. setd ".@str_"+.@cid[.@j],1;
  179. message rid2name(.@aid[.@j]),"You've got mail!";
  180. }
  181. } else if (isloggedin(.@aid[.@j])) {
  182. .@name$ = rid2name(.@aid[.@j]);
  183. .@castle_name$ = getcastlename(.Castles$[.@i]);
  184. for ( .@k = 0; .@k < .reward_id_size; .@k++ ) {
  185. if (checkweight(.reward_id[.@k], .reward_amount[.@k]))
  186. getitem .reward_id[.@k], .reward_amount[.@k], .@aid[.@j];
  187. else
  188. message .@name$, "You can't receive x" + .reward_amount[.@k] + " " + getitemname(.reward_id[.@k]) + " for conquering " + .@castle_name$ + " because you're overweight.";
  189. }
  190. Zeny += .reward_zeny;
  191. message .@name$, "You have been rewarded for conquering " + .@castle_name$ + ".";
  192. }
  193. }
  194. }
  195. }
  196. return;
  197. OnPCLoadMapEvent:
  198. if (!compare(strcharinfo(3),"g_cas")) end;
  199. if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(3),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(3))))) {
  200. if (getcharid(2) && getcastledata(strcharinfo(3),1) == getcharid(2)) end;
  201. sleep2 1000;
  202. message strcharinfo(0), getcastlename(strcharinfo(3))+" is currently inactive.";
  203. sleep2 5000;
  204. if (compare(strcharinfo(3),"g_cas")) warp "SavePoint",0,0;
  205. }
  206. end;
  207. OnMenu:
  208. while(1) {
  209. mes "[WOE Information]";
  210. if (agitcheck() || agitcheck2()) {
  211. if (.Active[0]) {
  212. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  213. if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) {
  214. set .@i, $WOE_CONTROL[.@i+2];
  215. break;
  216. }
  217. mes "The War of Emperium is ^0055FFactive^000000 until ^FF0000"+Add_Zero(.@i)+"^000000 in the following regions:";
  218. mes " ";
  219. for(set .@i,0; .@i<6; set .@i,.@i+1)
  220. if (.Active[1]&(1<<(.@i+1))) mes " > ^777777"+.Regions$[.@i]+"^000000";
  221. } else
  222. mes "The War of Emperium is ^0055FFactive^000000.";
  223. } else {
  224. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  225. if ((gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) <= $WOE_CONTROL[.@i+1]) || gettime(DT_DAYOFWEEK) < $WOE_CONTROL[.@i]) {
  226. setarray .@time[0],$WOE_CONTROL[.@i],$WOE_CONTROL[.@i+1];
  227. break;
  228. }
  229. if (!getarraysize(.@time))
  230. setarray .@time[0],$WOE_CONTROL[0],$WOE_CONTROL[1];
  231. mes "The War of Emperium is ^777777inactive^000000.";
  232. if (.Size) {
  233. mes " ";
  234. mes "The next session will begin";
  235. mes "on ^0055FF"+.Days$[.@time[0]]+"^000000 at "+Add_Zero(.@time[1])+"^000000.";
  236. }
  237. }
  238. next;
  239. switch(select(""+((.CastleWarp || .Active[1])?" ~ Warp to castles...":"")+": ~ Check schedule...: ~ View castle owners...:"+((getgmlevel()<.GMAccess || !getgmlevel())?"":" ~ Manage sessions...")+": ~ ^777777Cancel^000000")) {
  240. case 1:
  241. if (.CastleWarp) set .@clr$,"^0055FF";
  242. set .@menu$,"";
  243. for(set .@i,0; .@i<6; set .@i,.@i+1) {
  244. if (.CastleWarp || .Active[1]&(1<<(.@i+1)))
  245. set .@menu$, .@menu$+" ~ "+((.Active[1]&(1<<(.@i+1)))?.@clr$:"^777777")+.Regions$[.@i]+" Castles^000000";
  246. set .@menu$, .@menu$+":";
  247. }
  248. set .@i, select(.@menu$)-1;
  249. set .@menu$,"";
  250. for(set .@j,.@i*5; .@j<(.@i*5)+5; set .@j,.@j+1) {
  251. if (.CastleWarp || .Active[0]&(1<<.@j))
  252. set .@menu$, .@menu$+" ~ "+((.Active[0]&(1<<.@j))?.@clr$:"^777777")+getcastlename(.Castles$[.@j])+"^000000";
  253. set .@menu$, .@menu$+":";
  254. }
  255. set .@j, select(.@menu$)-1;
  256. warp .Map$[.@i],.MapX[(.@i*5)+.@j],.MapY[(.@i*5)+.@j];
  257. close;
  258. case 2:
  259. mes "[Schedule]";
  260. if (.Size) {
  261. freeloop(1);
  262. for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
  263. mes "> ^FF0000"+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1])+"-"+Add_Zero($WOE_CONTROL[.@i+2])+")^000000";
  264. for(set .@j,0; .@j<30; set .@j,.@j+1)
  265. if ($WOE_CONTROL[.@i+3]&(1<<.@j)) mes " ~ "+getcastlename(.Castles$[.@j])+" ^777777("+.Castles$[.@j]+")^000000";
  266. if (.@i+4 < .Size) mes " ";
  267. }
  268. freeloop(0);
  269. } else
  270. mes "No times are configured.";
  271. next;
  272. break;
  273. case 3:
  274. mes "[Castle Ownership]";
  275. for(set .@i,0; .@i<6; set .@i,.@i+1) {
  276. set .@k, .@i*5;
  277. mes "> ^FF0000"+.Regions$[.@i]+"^000000";
  278. for(set .@j,.@k; .@j<(.@k+5); set .@j,.@j+1) {
  279. set .@t, getcastledata(.Castles$[.@j],1);
  280. mes " ~ "+getcastlename(.Castles$[.@j])+": "+((.@t)?"^0055FF"+getguildname(.@t):"^777777unoccupied")+"^000000";
  281. }
  282. if (.@i < 5) mes " ";
  283. }
  284. next;
  285. break;
  286. case 4:
  287. while(1) {
  288. mes "[Session Manager]";
  289. mes "There are ^0055FF"+(.Size/4)+" session(s)^000000 configured.";
  290. mes "What would you like to do?";
  291. next;
  292. switch(select(" ~ Add a session...: ~ Delete a session...: ~ Reload settings...:"+((agitcheck() || agitcheck2())?" ~ End WOE session...":"")+": ~ ^777777Go back^000000")) {
  293. case 1:
  294. mes "[New Session]";
  295. if (.Size > 127) {
  296. mes "You have already reached the maximum of 32 sessions.";
  297. next;
  298. break;
  299. }
  300. mes "Select a day.";
  301. next;
  302. set .@Day, select(" ~ "+implode(.Days$,": ~ "))-1;
  303. mes "[New Session]";
  304. mes "Select a start time for ^0055FF"+.Days$[.@Day]+"^000000.";
  305. next;
  306. set .@menu$,"";
  307. for(set .@i,0; .@i<23; set .@i,.@i+1)
  308. set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":";
  309. set .@Start, select(.@menu$)-1;
  310. mes "[New Session]";
  311. mes "Select an end time for ^0055FF"+.Days$[.@Day]+"^000000.";
  312. next;
  313. set .@menu$,"";
  314. for(set .@i,.@Start+1; .@i<24; set.@i,.@i+1)
  315. set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":";
  316. set .@End, select(.@menu$)+.@Start;
  317. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  318. if (.@Day == $WOE_CONTROL[.@i] &&
  319. ((.@Start >= $WOE_CONTROL[.@i+1] && .@Start < $WOE_CONTROL[.@i+2]) ||
  320. (.@End > $WOE_CONTROL[.@i+1] && .@End <= $WOE_CONTROL[.@i+2]) ||
  321. (.@Start <= $WOE_CONTROL[.@i+1] && .@End >= $WOE_CONTROL[.@i+2]))) {
  322. mes "[New Session]";
  323. mes "The chosen times overlap with an existing session.";
  324. next;
  325. set .@d,1;
  326. break;
  327. }
  328. if (.@d) { set .@d,0; break; }
  329. set .@Castle,0;
  330. while(1) {
  331. mes "[New Session]";
  332. mes "^0055FF"+.Days$[.@Day]+" ("+Add_Zero(.@Start)+"-"+Add_Zero(.@End)+")^000000";
  333. mes " > Castles:";
  334. if (!.@Castle)
  335. mes " ~ ^777777(none selected)^000000";
  336. else for(set .@i,0; .@i<30; set .@i,.@i+1)
  337. if (.@Castle&(1<<.@i)) mes " ~ "+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")";
  338. next;
  339. set .@menu$,((.@Castle)?" ~ ^FF0000Finished...^000000":"")+":";
  340. for(set .@i,0; .@i<30; set .@i,.@i+1)
  341. set .@menu$, .@menu$+" ~ "+((.@Castle&(1<<.@i))?"^0055FF":"")+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")^000000:";
  342. set .@i, select(.@menu$)-1;
  343. if (.@i)
  344. set .@Castle, .@Castle^(1<<(.@i-1));
  345. else {
  346. mes "[New Session]";
  347. mes "Are you sure?";
  348. next;
  349. switch(select(" ~ ^0055FFAdd session...^000000: ~ Continue selecting castles...: ~ ^777777Cancel^000000")) {
  350. case 1:
  351. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  352. if ((.@Day == $WOE_CONTROL[.@i] && .@End <= $WOE_CONTROL[.@i+1]) || .@Day < $WOE_CONTROL[.@i]) {
  353. set .@d,1;
  354. break;
  355. }
  356. if (!.@d) { set .@d,1; set .@i,.Size; }
  357. copyarray $WOE_CONTROL[.@i+4], $WOE_CONTROL[.@i], .Size-.@i;
  358. setarray $WOE_CONTROL[.@i], .@Day, .@Start, .@End, .@Castle;
  359. set .Size, getarraysize($WOE_CONTROL);
  360. case 3:
  361. mes "[New Session]";
  362. mes ((.@d)?"Session added.":"cancelled.");
  363. next;
  364. set .@d,1;
  365. case 2:
  366. break;
  367. }
  368. if (.@d) { set .@d,0; break; }
  369. }
  370. }
  371. break;
  372. case 2:
  373. mes "[Remove Session]";
  374. if (!.Size) {
  375. mes "There are no sessions configured.";
  376. next;
  377. break;
  378. }
  379. mes "Select a session to remove.";
  380. next;
  381. set .@menu$,"";
  382. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  383. set .@menu$, .@menu$+" ~ "+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1],1)+"-"+Add_Zero($WOE_CONTROL[.@i+2],1)+"):";
  384. set .@menu$, .@menu$+" ~ ^777777Cancel^000000";
  385. set .@i, select(.@menu$)-1;
  386. if (.@i == (.Size/4)) break;
  387. mes "[Remove Session]";
  388. mes "Delete ^0055FF"+.Days$[$WOE_CONTROL[.@i*4]]+"'s^000000 session?";
  389. mes "This action cannot be undone.";
  390. next;
  391. set .@j, select(" ~ ^FF0000Delete session...^000000: ~ ^777777Cancel^000000");
  392. mes "[Remove Session]";
  393. if (.@j == 2)
  394. mes "cancelled.";
  395. else {
  396. deletearray $WOE_CONTROL[.@i*4],4;
  397. set .Size, getarraysize($WOE_CONTROL);
  398. mes "Session deleted.";
  399. }
  400. next;
  401. break;
  402. case 3:
  403. mes "[Reload Settings]";
  404. mes "This will trigger all events related to new session configurations, if any.";
  405. if (agitcheck() || agitcheck2()) {
  406. mes " ";
  407. mes "Be aware that this will disrupt the current WOE session.";
  408. }
  409. next;
  410. set .@i, select(" ~ ^0055FFReload settings...^000000: ~ ^777777Cancel^000000");
  411. mes "[Reload Settings]";
  412. if (.@i == 2) mes "cancelled.";
  413. else {
  414. set .Init,1;
  415. donpcevent "WOE_CONTROL::OnMinute00";
  416. mes "Variables have been re-initialized.";
  417. }
  418. next;
  419. break;
  420. case 4:
  421. mes "[Force Agit End]";
  422. if (!agitcheck() && !agitcheck2()) {
  423. mes "WOE has already ended.";
  424. next;
  425. break;
  426. }
  427. mes "This command will safely execute all AgitEnd events.";
  428. mes " ";
  429. mes "Kill the current WOE session?";
  430. next;
  431. set .@i, select(" ~ ^FF0000End session...^000000:"+((.Options&1)?" ~ ^FF0000End session without rewards...^000000":"")+": ~ ^777777Cancel^000000");
  432. mes "[Force Agit End]";
  433. if (.@i == 3)
  434. mes "cancelled.";
  435. else {
  436. set .ForceEnd, .@i;
  437. donpcevent "WOE_CONTROL::OnWOEEnd";
  438. mes "WOE session terminated.";
  439. }
  440. next;
  441. break;
  442. case 5:
  443. set .@d,1; break;
  444. }
  445. if (.@d) { set .@d,0; break; }
  446. } break;
  447. case 5:
  448. close;
  449. } }
  450. }