agit_controller.txt 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //===== rAthena Script =======================================
  2. //= War of Emperium - Auto-Start
  3. //===== By: ==================================================
  4. //= kalen (1.0)
  5. //= 1.1 by Akaru and ho|yAnge|
  6. //===== Current Version: =====================================
  7. //= 2.0
  8. //===== Compatible With: =====================================
  9. //= rAthena Project; RO Episode 4+
  10. //===== Description: =========================================
  11. //= Auto-start for War of Emperium FE.
  12. //= For instructions, see doc/woe_time_explanation.txt.
  13. //===== Additional Comments: =================================
  14. //= 1.1a changed OnInit to OnAgitInit.[kobra_k88]
  15. //= 1.2 added gettime checks. removed $AgitStarted var.[kobra_k88]
  16. //= 1.3 Moved treasure spawn time here.[kobra_k88]
  17. //= 1.3a Implemented Shadowlady's idea to allow for different
  18. //= start/stop times on different days.[kobra_k88]
  19. //= 1.4 Fixed treasure chests spawn! We had to unroll some loops
  20. //= Now they appear in castles from 00:01 to 00:24. [Lupus]
  21. //= 1.5 Fixed WOE end messages on non-WOE days, by Avaj
  22. //= 1.5a missing tabs [KarLaeda]
  23. //= 1.6 Corrected multiple "WoE has begun" announces [ultramage]
  24. //= 1.7 Commented out the WoE start and end announces. [L0ne_W0lf]
  25. //= 1.8 Castle owners displayed when WoE starts and finished. [L0ne_W0lf]
  26. //= 1.8a Will now report unoccupied castles at start/end. [L0ne_W0lf]
  27. //= 1.8b Whoops. Fixed a mistake :D [L0ne_W0lf]
  28. //= 1.9 Rearranged the time-checks so they no longer use goto. [L0ne_W0lf]
  29. //= Removed treasure spawning function calls. (No longer needed)
  30. //= 2.0 Added WoE Battle Log support for broadcasts. [L0ne_W0lf]
  31. //============================================================
  32. - script Agit_Event -1,{
  33. end;
  34. OnClock2100: //start time for Tuesday and Thursday
  35. OnClock2300: //end time for Tuesday and Thursday
  36. OnClock1600: //start time for Saturday
  37. OnClock1800: //end time for Saturday
  38. OnAgitInit:
  39. // starting time checks
  40. if((gettime(DT_DAYOFWEEK)==TUESDAY) && (gettime(DT_HOUR)>=21 && gettime(DT_HOUR)<23) ||
  41. (gettime(DT_DAYOFWEEK)==THURSDAY) && (gettime(DT_HOUR)>=21 && gettime(DT_HOUR)<23) ||
  42. (gettime(DT_DAYOFWEEK)==SATURDAY) && (gettime(DT_HOUR)>=16 && gettime(DT_HOUR)<18)) {
  43. if (!agitcheck()) {
  44. AgitStart;
  45. callsub S_DisplayOwners;
  46. }
  47. end;
  48. }
  49. // end time checks
  50. if ((gettime(DT_DAYOFWEEK)==TUESDAY) && (gettime(DT_HOUR)==23) ||
  51. (gettime(DT_DAYOFWEEK)==THURSDAY) && (gettime(DT_HOUR)==23) ||
  52. (gettime(DT_DAYOFWEEK)==SATURDAY) && (gettime(DT_HOUR)==18)) {
  53. if (agitcheck()) {
  54. AgitEnd;
  55. callsub S_DisplayOwners;
  56. }
  57. end;
  58. }
  59. end;
  60. S_DisplayOwners:
  61. setarray .@maps$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05";
  62. setarray .@maps$[5],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05";
  63. setarray .@maps$[10],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05";
  64. setarray .@maps$[15],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05";
  65. for( set .@i, 0; .@i <= 19; set .@i, .@i+1 ) {
  66. if (GetCastleData(.@maps$[.@i],1)) {
  67. Announce "The [" + GetCastleName(.@maps$[.@i]) + "] castle has been conquered by the [" + GetGuildName(GetCastleData(.@maps$[.@i],1)) + "] guild.",bc_all|bc_woe;
  68. }
  69. else {
  70. Announce "The [" + GetCastleName(.@maps$[.@i]) + "] castle is currently unoccupied.",bc_all|bc_woe;
  71. }
  72. }
  73. end;
  74. }