woe_controller.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  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, plus Zeny.
  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. // -- when given directly: <itemID>,<amount>{,<itemID>,<amount>,...}
  63. // -- via mail (option 2): <itemID>,<amount>,<Zeny>
  64. setarray .Reward[0],14001,1;
  65. // -----------------------------------------------------------
  66. // Constants (leave this section alone).
  67. // -----------------------------------------------------------
  68. setarray .Castles$[0],
  69. "prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
  70. "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
  71. "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
  72. "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
  73. "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
  74. "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
  75. setarray .EndLabel$[0],"ar01","ar02","ar03","ar04","ar05","sc01","sc02","sc03","sc04","sc05";
  76. setarray .Days$[0],"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday";
  77. setarray .Regions$[0],"Prontera","Payon","Geffen","Aldebaran","Arunafeltz","Schwaltzvalt";
  78. setarray .Map$[0],"prt_gld","pay_gld","gef_fild13","alde_gld","aru_gld","sch_gld";
  79. 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;
  80. 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;
  81. // -----------------------------------------------------------
  82. set .Size, getarraysize($WOE_CONTROL);
  83. if (.AutoKick || .NoOwner)
  84. for(set .@i,0; .@i<30; set .@i,.@i+1) {
  85. setmapflag .Castles$[.@i], mf_loadevent;
  86. setd "."+.Castles$[.@i], .@i;
  87. }
  88. if (!agitcheck() && !agitcheck2()) sleep 4000;
  89. set .Init,1;
  90. OnMinute00:
  91. freeloop(1);
  92. if (agitcheck() || agitcheck2()) {
  93. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  94. if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) == $WOE_CONTROL[.@i+2]) {
  95. OnWOEEnd:
  96. announce "The War Of Emperium is over!",bc_all|bc_woe;
  97. AgitEnd; AgitEnd2;
  98. sleep 1000;
  99. for(set .@j,0; .@j<30; set .@j,.@j+1) {
  100. if (.Active[0]&(1<<.@j)) Disp_Owner(.Castles$[.@j],1);
  101. if (.ExitWarp) maprespawnguildid .Castles$[.@j],0,3;
  102. }
  103. if ((.Options&1) && .Active[0] && .ForceEnd != 2) callsub OnReward, .Active[0];
  104. deletearray .Active[0],2;
  105. if (.ForceEnd) { set .ForceEnd,0; end; }
  106. break;
  107. }
  108. }
  109. if ((!agitcheck() && !agitcheck2()) || .Init) {
  110. if (!agitcheck() && !agitcheck2()) set .Init,0;
  111. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  112. if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) {
  113. deletearray .Active[0],2;
  114. set .Active[0], $WOE_CONTROL[.@i+3];
  115. if (.Init) { AgitEnd; AgitEnd2; }
  116. else announce "The War Of Emperium has begun!",bc_all|bc_woe;
  117. sleep 1000;
  118. AgitStart; AgitStart2;
  119. for(set .@j,0; .@j<30; set .@j,.@j+1) {
  120. if (.Active[0]&(1<<.@j)) {
  121. if (!.Init) Disp_Owner(.Castles$[.@j],0);
  122. set .Active[1], .Active[1] | (1<<((.@j/5)+1));
  123. } else {
  124. if (.@j<20) {
  125. donpcevent "Agit#"+.Castles$[.@j]+"::OnAgitEnd";
  126. killmonster .Castles$[.@j], "Agit#"+.Castles$[.@j]+"::OnAgitBreak";
  127. } else {
  128. donpcevent "Manager#"+.Castles$[.@j]+"::OnAgitEnd2";
  129. killmonster .Castles$[.@j], "Steward#"+.EndLabel$[.@j-20]+"::OnStartArena";
  130. }
  131. }
  132. }
  133. break;
  134. }
  135. }
  136. set .Init,0;
  137. end;
  138. function Disp_Owner {
  139. set .@o, getcastledata(getarg(0),1);
  140. 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;
  141. else announce "The ["+getcastlename(getarg(0))+"] castle is currently unoccupied.",bc_all|bc_woe;
  142. return;
  143. }
  144. function Add_Zero {
  145. return ((getarg(0)<10)?"0":"")+getarg(0)+(getarg(1,0)?".":":")+"00";
  146. }
  147. OnReward:
  148. set .@sql$, ((.Options&4)?"position = 0":"online = 1");
  149. if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21);
  150. freeloop(1);
  151. for(set .@i,0; .@i<30; set .@i,.@i+1)
  152. if (getarg(0)&(1<<.@i)) {
  153. set .@gid, getcastledata(.Castles$[.@i],1);
  154. if (!.@gid) continue;
  155. set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid);
  156. for(set .@j,0; .@j<.@size; set .@j,.@j+1) {
  157. if ((.Options&8) && !(.Options&4)) {
  158. set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a");
  159. if (getd(".@ip_"+.@i+"_"+.@ip$)) continue;
  160. setd ".@ip_"+.@i+"_"+.@ip$,1;
  161. }
  162. if (.Options&2) {
  163. query_sql("INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) VALUES ("+
  164. "'no-reply',"+.@cid[.@j]+",'** Siege Reward: "+getcastlename(.Castles$[.@i])+" **',"+
  165. "'Brave one,% % Congratulations!% Your guild has successfully occupied% territory in the War of Emperium on% "+.@str$+".% % % % % [ Your reward is attached. ]',"+
  166. .Reward[0]+","+.Reward[1]+",0,"+.Reward[2]+",UNIX_TIMESTAMP(NOW()))");
  167. if (!getd(".@str_"+.@cid[.@j]) && isloggedin(.@aid[.@j],.@cid[.@j])) {
  168. setd ".@str_"+.@cid[.@j],1;
  169. message rid2name(.@aid[.@j]),"You've got mail! Please re-login to update your mailing list.";
  170. }
  171. } else if (isloggedin(.@aid[.@j])) {
  172. for(set .@k,0; .@k<getarraysize(.Reward); set .@k,.@k+2)
  173. getitem .Reward[.@k], .Reward[.@k+1], .@aid[.@j];
  174. message rid2name(.@aid[.@j]),"You have been rewarded for conquering "+getcastlename(.Castles$[.@i])+".";
  175. }
  176. }
  177. }
  178. if (.Options&2) query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'");
  179. return;
  180. OnPCLoadMapEvent:
  181. if (!compare(strcharinfo(3),"g_cas")) end;
  182. if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(3),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(3))))) {
  183. if (getcharid(2) && getcastledata(strcharinfo(3),1) == getcharid(2)) end;
  184. sleep2 1000;
  185. message strcharinfo(0), getcastlename(strcharinfo(3))+" is currently inactive.";
  186. sleep2 5000;
  187. if (compare(strcharinfo(3),"g_cas")) warp "SavePoint",0,0;
  188. }
  189. end;
  190. OnMenu:
  191. while(1) {
  192. mes "[WOE Information]";
  193. if (agitcheck() || agitcheck2()) {
  194. if (.Active[0]) {
  195. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  196. if (gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) >= $WOE_CONTROL[.@i+1] && gettime(DT_HOUR) < $WOE_CONTROL[.@i+2]) {
  197. set .@i, $WOE_CONTROL[.@i+2];
  198. break;
  199. }
  200. mes "The War of Emperium is ^0055FFactive^000000 until ^FF0000"+Add_Zero(.@i)+"^000000 in the following regions:";
  201. mes " ";
  202. for(set .@i,0; .@i<6; set .@i,.@i+1)
  203. if (.Active[1]&(1<<(.@i+1))) mes " > ^777777"+.Regions$[.@i]+"^000000";
  204. } else
  205. mes "The War of Emperium is ^0055FFactive^000000.";
  206. } else {
  207. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  208. if ((gettime(DT_DAYOFWEEK) == $WOE_CONTROL[.@i] && gettime(DT_HOUR) <= $WOE_CONTROL[.@i+1]) || gettime(DT_DAYOFWEEK) < $WOE_CONTROL[.@i]) {
  209. setarray .@time[0],$WOE_CONTROL[.@i],$WOE_CONTROL[.@i+1];
  210. break;
  211. }
  212. if (!getarraysize(.@time))
  213. setarray .@time[0],$WOE_CONTROL[0],$WOE_CONTROL[1];
  214. mes "The War of Emperium is ^777777inactive^000000.";
  215. if (.Size) {
  216. mes " ";
  217. mes "The next session will begin";
  218. mes "on ^0055FF"+.Days$[.@time[0]]+"^000000 at "+Add_Zero(.@time[1])+"^000000.";
  219. }
  220. }
  221. next;
  222. switch(select(""+((.CastleWarp || .Active[1])?" ~ Warp to castles...":"")+": ~ Check schedule...: ~ View castle owners...:"+((getgmlevel()<.GMAccess || !getgmlevel())?"":" ~ Manage sessions...")+": ~ ^777777Cancel^000000")) {
  223. case 1:
  224. if (.CastleWarp) set .@clr$,"^0055FF";
  225. set .@menu$,"";
  226. for(set .@i,0; .@i<6; set .@i,.@i+1) {
  227. if (.CastleWarp || .Active[1]&(1<<(.@i+1)))
  228. set .@menu$, .@menu$+" ~ "+((.Active[1]&(1<<(.@i+1)))?.@clr$:"^777777")+.Regions$[.@i]+" Castles^000000";
  229. set .@menu$, .@menu$+":";
  230. }
  231. set .@i, select(.@menu$)-1;
  232. set .@menu$,"";
  233. for(set .@j,.@i*5; .@j<(.@i*5)+5; set .@j,.@j+1) {
  234. if (.CastleWarp || .Active[0]&(1<<.@j))
  235. set .@menu$, .@menu$+" ~ "+((.Active[0]&(1<<.@j))?.@clr$:"^777777")+getcastlename(.Castles$[.@j])+"^000000";
  236. set .@menu$, .@menu$+":";
  237. }
  238. set .@j, select(.@menu$)-1;
  239. warp .Map$[.@i],.MapX[(.@i*5)+.@j],.MapY[(.@i*5)+.@j];
  240. close;
  241. case 2:
  242. mes "[Schedule]";
  243. if (.Size) {
  244. freeloop(1);
  245. for(set .@i,0; .@i<.Size; set .@i,.@i+4) {
  246. mes "> ^FF0000"+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1])+"-"+Add_Zero($WOE_CONTROL[.@i+2])+")^000000";
  247. for(set .@j,0; .@j<30; set .@j,.@j+1)
  248. if ($WOE_CONTROL[.@i+3]&(1<<.@j)) mes " ~ "+getcastlename(.Castles$[.@j])+" ^777777("+.Castles$[.@j]+")^000000";
  249. if (.@i+4 < .Size) mes " ";
  250. }
  251. freeloop(0);
  252. } else
  253. mes "No times are configured.";
  254. next;
  255. break;
  256. case 3:
  257. mes "[Castle Ownership]";
  258. for(set .@i,0; .@i<6; set .@i,.@i+1) {
  259. set .@k, .@i*5;
  260. mes "> ^FF0000"+.Regions$[.@i]+"^000000";
  261. for(set .@j,.@k; .@j<(.@k+5); set .@j,.@j+1) {
  262. set .@t, getcastledata(.Castles$[.@j],1);
  263. mes " ~ "+getcastlename(.Castles$[.@j])+": "+((.@t)?"^0055FF"+getguildname(.@t):"^777777unoccupied")+"^000000";
  264. }
  265. if (.@i < 5) mes " ";
  266. }
  267. next;
  268. break;
  269. case 4:
  270. while(1) {
  271. mes "[Session Manager]";
  272. mes "There are ^0055FF"+(.Size/4)+" session(s)^000000 configured.";
  273. mes "What would you like to do?";
  274. next;
  275. switch(select(" ~ Add a session...: ~ Delete a session...: ~ Reload settings...:"+((agitcheck() || agitcheck2())?" ~ End WOE session...":"")+": ~ ^777777Go back^000000")) {
  276. case 1:
  277. mes "[New Session]";
  278. if (.Size > 127) {
  279. mes "You have already reached the maximum of 32 sessions.";
  280. next;
  281. break;
  282. }
  283. mes "Select a day.";
  284. next;
  285. set .@Day, select(" ~ "+implode(.Days$,": ~ "))-1;
  286. mes "[New Session]";
  287. mes "Select a start time for ^0055FF"+.Days$[.@Day]+"^000000.";
  288. next;
  289. set .@menu$,"";
  290. for(set .@i,0; .@i<23; set .@i,.@i+1)
  291. set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":";
  292. set .@Start, select(.@menu$)-1;
  293. mes "[New Session]";
  294. mes "Select an end time for ^0055FF"+.Days$[.@Day]+"^000000.";
  295. next;
  296. set .@menu$,"";
  297. for(set .@i,.@Start+1; .@i<24; set.@i,.@i+1)
  298. set .@menu$, .@menu$+" ~ "+Add_Zero(.@i,1)+":";
  299. set .@End, select(.@menu$)+.@Start;
  300. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  301. if (.@Day == $WOE_CONTROL[.@i] &&
  302. ((.@Start >= $WOE_CONTROL[.@i+1] && .@Start < $WOE_CONTROL[.@i+2]) ||
  303. (.@End > $WOE_CONTROL[.@i+1] && .@End <= $WOE_CONTROL[.@i+2]) ||
  304. (.@Start <= $WOE_CONTROL[.@i+1] && .@End >= $WOE_CONTROL[.@i+2]))) {
  305. mes "[New Session]";
  306. mes "The chosen times overlap with an existing session.";
  307. next;
  308. set .@d,1;
  309. break;
  310. }
  311. if (.@d) { set .@d,0; break; }
  312. set .@Castle,0;
  313. while(1) {
  314. mes "[New Session]";
  315. mes "^0055FF"+.Days$[.@Day]+" ("+Add_Zero(.@Start)+"-"+Add_Zero(.@End)+")^000000";
  316. mes " > Castles:";
  317. if (!.@Castle)
  318. mes " ~ ^777777(none selected)^000000";
  319. else for(set .@i,0; .@i<30; set .@i,.@i+1)
  320. if (.@Castle&(1<<.@i)) mes " ~ "+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")";
  321. next;
  322. set .@menu$,((.@Castle)?" ~ ^FF0000Finished...^000000":"")+":";
  323. for(set .@i,0; .@i<30; set .@i,.@i+1)
  324. set .@menu$, .@menu$+" ~ "+((.@Castle&(1<<.@i))?"^0055FF":"")+getcastlename(.Castles$[.@i])+" ("+.Castles$[.@i]+")^000000:";
  325. set .@i, select(.@menu$)-1;
  326. if (.@i)
  327. set .@Castle, .@Castle^(1<<(.@i-1));
  328. else {
  329. mes "[New Session]";
  330. mes "Are you sure?";
  331. next;
  332. switch(select(" ~ ^0055FFAdd session...^000000: ~ Continue selecting castles...: ~ ^777777Cancel^000000")) {
  333. case 1:
  334. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  335. if ((.@Day == $WOE_CONTROL[.@i] && .@End <= $WOE_CONTROL[.@i+1]) || .@Day < $WOE_CONTROL[.@i]) {
  336. set .@d,1;
  337. break;
  338. }
  339. if (!.@d) { set .@d,1; set .@i,.Size; }
  340. copyarray $WOE_CONTROL[.@i+4], $WOE_CONTROL[.@i], .Size-.@i;
  341. setarray $WOE_CONTROL[.@i], .@Day, .@Start, .@End, .@Castle;
  342. set .Size, getarraysize($WOE_CONTROL);
  343. case 3:
  344. mes "[New Session]";
  345. mes ((.@d)?"Session added.":"Cancelled.");
  346. next;
  347. set .@d,1;
  348. case 2:
  349. break;
  350. }
  351. if (.@d) { set .@d,0; break; }
  352. }
  353. }
  354. break;
  355. case 2:
  356. mes "[Remove Session]";
  357. if (!.Size) {
  358. mes "There are no sessions configured.";
  359. next;
  360. break;
  361. }
  362. mes "Select a session to remove.";
  363. next;
  364. set .@menu$,"";
  365. for(set .@i,0; .@i<.Size; set .@i,.@i+4)
  366. set .@menu$, .@menu$+" ~ "+.Days$[$WOE_CONTROL[.@i]]+" ("+Add_Zero($WOE_CONTROL[.@i+1],1)+"-"+Add_Zero($WOE_CONTROL[.@i+2],1)+"):";
  367. set .@menu$, .@menu$+" ~ ^777777Cancel^000000";
  368. set .@i, select(.@menu$)-1;
  369. if (.@i == (.Size/4)) break;
  370. mes "[Remove Session]";
  371. mes "Delete ^0055FF"+.Days$[$WOE_CONTROL[.@i*4]]+"'s^000000 session?";
  372. mes "This action cannot be undone.";
  373. next;
  374. set .@j, select(" ~ ^FF0000Delete session...^000000: ~ ^777777Cancel^000000");
  375. mes "[Remove Session]";
  376. if (.@j == 2)
  377. mes "Cancelled.";
  378. else {
  379. deletearray $WOE_CONTROL[.@i*4],4;
  380. set .Size, getarraysize($WOE_CONTROL);
  381. mes "Session deleted.";
  382. }
  383. next;
  384. break;
  385. case 3:
  386. mes "[Reload Settings]";
  387. mes "This will trigger all events related to new session configurations, if any.";
  388. if (agitcheck() || agitcheck2()) {
  389. mes " ";
  390. mes "Be aware that this will disrupt the current WOE session.";
  391. }
  392. next;
  393. set .@i, select(" ~ ^0055FFReload settings...^000000: ~ ^777777Cancel^000000");
  394. mes "[Reload Settings]";
  395. if (.@i == 2) mes "Cancelled.";
  396. else {
  397. set .Init,1;
  398. donpcevent "WOE_CONTROL::OnMinute00";
  399. mes "Variables have been re-initialized.";
  400. }
  401. next;
  402. break;
  403. case 4:
  404. mes "[Force Agit End]";
  405. if (!agitcheck() && !agitcheck2()) {
  406. mes "WOE has already ended.";
  407. next;
  408. break;
  409. }
  410. mes "This command will safely execute all AgitEnd events.";
  411. mes " ";
  412. mes "Kill the current WOE session?";
  413. next;
  414. set .@i, select(" ~ ^FF0000End session...^000000:"+((.Options&1)?" ~ ^FF0000End session without rewards...^000000":"")+": ~ ^777777Cancel^000000");
  415. mes "[Force Agit End]";
  416. if (.@i == 3)
  417. mes "Cancelled.";
  418. else {
  419. set .ForceEnd, .@i;
  420. donpcevent "WOE_CONTROL::OnWOEEnd";
  421. mes "WOE session terminated.";
  422. }
  423. next;
  424. break;
  425. case 5:
  426. set .@d,1; break;
  427. }
  428. if (.@d) { set .@d,0; break; }
  429. } break;
  430. case 5:
  431. close;
  432. } }
  433. }