gldfunc_ev_agit.txt 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. //===== eAthena Script =======================================
  2. //= War of Emperium Guild Event AgitStart/AgitBreak Functions
  3. //===== By: ==================================================
  4. //= jAthena - kalen (1.0)
  5. //= 1.1 by Akaru, ho|yAnge|X, and Valaris
  6. //===== Current Version: =====================================
  7. //= 1.6
  8. //===== Compatible With: =====================================
  9. //= eAthena 0.1+; RO Episode 4+
  10. //===== Description: =========================================
  11. //= F_AgitStart is in charge of spawning Emperium and mobs in castles
  12. //= when WoE is started.
  13. //= F_AgitBreak resets guild castle data when a castle has been taken over.
  14. //= It then sets the data for the new guild master if there is one.
  15. //=======================================
  16. //= Break down of arguments used in F_AgitStart:
  17. //= arg(0): name of specific guild castle.
  18. //= arg(1): name of specific agit castle script.
  19. //= arg(2): x1 for Emperium coordinates.
  20. //= arg(3): y1 for Emperium coordinates.
  21. //= Break down of arguments used in F_AgitBreak:
  22. //= arg(0): name of specific guild castle.
  23. //= arg(1): name of specific OnRevCastle label.
  24. //===== Additional Comments: =================================
  25. //= v1.2: All OnAgitStart and OnAgitBreak calls will use these functions.[kobra_k88]
  26. //= v1.2a: Added OnAgitEnd function.[kobra_k88]
  27. //= 1.3 Added code for abandoning captured castles on /breakguild [Lupus]
  28. //= 1.3a fixed Defence / Economy underflow [Lupus] thanks2 kyoki
  29. //= 1.4 updated a couple mapannounces in OnAgitBreak. [L0ne_W0lf]
  30. //= 1.5 Changed the names of the Kafra from "Service" to "Staff" [L0ne_W0lf]
  31. //= 1.6 Fixed the OnAgitBreak message being map-only and not global. (Lil DomX) [L0ne_W0lf]
  32. //============================================================
  33. // Function for OnAgitStart =========================================
  34. function script F_AgitStart {
  35. set .@map$, getarg(0);
  36. set .@castle$, getarg(1);
  37. set .@empx, getarg(2);
  38. set .@empy, getarg(3);
  39. MapRespawnGuildID .@map$,GetCastleData(.@map$,1),2;
  40. monster .@map$,.@empx,.@empy,"EMPERIUM",1288,1,"Agit_"+.@castle$+"::OnAgitBreak";
  41. GvgOn .@map$;
  42. if (GetCastleData(.@map$,1) != 0) return;
  43. if(.@map$ == "aldeg_cas01" || .@map$ == "aldeg_cas02" || .@map$ == "aldeg_cas03" || .@map$ == "aldeg_cas04" || .@map$ == "aldeg_cas05" || .@map$ == "nguild_alde") goto L_AldegCas;
  44. if(.@map$ == "gefg_cas01" || .@map$ == "gefg_cas02" || .@map$ == "gefg_cas03" || .@map$ == "gefg_cas04" || .@map$ == "gefg_cas05" || .@map$ == "nguild_gef" ) goto L_GefgCas;
  45. if(.@map$ == "payg_cas01" || .@map$ == "payg_cas02" || .@map$ == "payg_cas03" || .@map$ == "payg_cas04" || .@map$ == "payg_cas05" || .@map$ == "nguild_pay" ) goto L_PaygCas;
  46. if(.@map$ == "prtg_cas01" || .@map$ == "prtg_cas02" || .@map$ == "prtg_cas03" || .@map$ == "prtg_cas04" || .@map$ == "prtg_cas05" || .@map$ == "nguild_prt" ) goto L_PrtgCas;
  47. L_AldegCas:
  48. areamonster .@map$,0,0,300,300,"--ja--",1117,10;
  49. areamonster .@map$,0,0,300,300,"--ja--",1132,4;
  50. areamonster .@map$,0,0,300,300,"--ja--",1219,2;
  51. areamonster .@map$,0,0,300,300,"--ja--",1205,1;
  52. areamonster .@map$,0,0,300,300,"--ja--",1216,10;
  53. areamonster .@map$,0,0,300,300,"--ja--",1193,17;
  54. areamonster .@map$,0,0,300,300,"--ja--",1269,9;
  55. areamonster .@map$,0,0,300,300,"--ja--",1276,7;
  56. areamonster .@map$,0,0,300,300,"--ja--",1208,3;
  57. areamonster .@map$,0,0,300,300,"--ja--",1275,1;
  58. areamonster .@map$,0,0,300,300,"--ja--",1268,1;
  59. areamonster .@map$,0,0,300,300,"--ja--",1272,1;
  60. monster .@map$,.@empx+1,.@empy,"--ja--",1272,1;
  61. monster .@map$,.@empx-1,.@empy,"--ja--",1270,4;
  62. monster .@map$,.@empx,.@empy+1,"--ja--",1268,1;
  63. monster .@map$,.@empx,.@empy-1,"--ja--",1219,1;
  64. monster .@map$,.@empx,.@empy,"--ja--",1276,5;
  65. return;
  66. L_GefgCas:
  67. areamonster .@map$,0,0,300,300,"--ja--",1117,10;
  68. areamonster .@map$,0,0,300,300,"--ja--",1263,11;
  69. areamonster .@map$,0,0,300,300,"--ja--",1102,10;
  70. areamonster .@map$,0,0,300,300,"--ja--",1130,10;
  71. areamonster .@map$,0,0,300,300,"--ja--",1140,20;
  72. areamonster .@map$,0,0,300,300,"--ja--",1163,9;
  73. areamonster .@map$,0,0,300,300,"--ja--",1275,1;
  74. areamonster .@map$,0,0,300,300,"--ja--",1219,1;
  75. areamonster .@map$,0,0,300,300,"--ja--",1150,1;
  76. areamonster .@map$,0,0,300,300,"--ja--",1159,1;
  77. monster .@map$,.@empx+1,.@empy,"--ja--",1203,1;
  78. monster .@map$,.@empx-1,.@empy,"--ja--",1087,1;
  79. monster .@map$,.@empx,.@empy+1,"--ja--",1213,7;
  80. monster .@map$,.@empx,.@empy-1,"--ja--",1189,7;
  81. return;
  82. L_PaygCas:
  83. areamonster .@map$,0,0,300,300,"--ja--",1277,10;
  84. areamonster .@map$,0,0,300,300,"--ja--",1208,10;
  85. areamonster .@map$,0,0,300,300,"--ja--",1262,5;
  86. areamonster .@map$,0,0,300,300,"--ja--",1102,5;
  87. areamonster .@map$,0,0,300,300,"--ja--",1150,1;
  88. areamonster .@map$,0,0,300,300,"--ja--",1115,1;
  89. areamonster .@map$,0,0,300,300,"--ja--",1129,11;
  90. areamonster .@map$,0,0,300,300,"--ja--",1276,5;
  91. areamonster .@map$,0,0,300,300,"--ja--",1282,4;
  92. areamonster .@map$,0,0,300,300,"--ja--",1253,5;
  93. monster .@map$,.@empx,.@empy,"--ja--",1150,1;
  94. monster .@map$,.@empx,.@empy,"--ja--",1115,1;
  95. monster .@map$,.@empx,.@empy+1,"--ja--",1208,6;
  96. monster .@map$,.@empx,.@empy-1,"--ja--",1276,5;
  97. return;
  98. L_PrtgCas:
  99. areamonster .@map$,0,0,300,300,"--ja--",1163,15;
  100. areamonster .@map$,0,0,300,300,"--ja--",1132,10;
  101. areamonster .@map$,0,0,300,300,"--ja--",1219,5;
  102. areamonster .@map$,0,0,300,300,"--ja--",1268,5;
  103. areamonster .@map$,0,0,300,300,"--ja--",1251,1;
  104. areamonster .@map$,0,0,300,300,"--ja--",1252,1;
  105. areamonster .@map$,0,0,300,300,"--ja--",1276,5;
  106. areamonster .@map$,0,0,300,300,"--ja--",1259,1;
  107. areamonster .@map$,0,0,300,300,"--ja--",1283,1;
  108. areamonster .@map$,0,0,300,300,"--ja--",1275,1;
  109. areamonster .@map$,0,0,300,300,"--ja--",1200,1;
  110. monster .@map$,.@empx+1,.@empy,"--ja--",1268,1;
  111. monster .@map$,.@empx-1,.@empy,"--ja--",1251,1;
  112. monster .@map$,.@empx,.@empy+1,"--ja--",1252,1;
  113. monster .@map$,.@empx,.@empy-1,"--ja--",1219,2;
  114. monster .@map$,.@empx,.@empy,"--ja--",1276,5;
  115. return;
  116. }
  117. // Function for OnGuildBreak ======================================
  118. function script F_GuildBreak {
  119. set .@map$, getarg(0);
  120. set .@castle$, getarg(1);
  121. killmonsterall .@map$;
  122. Announce "Guild Base [" + GetCastleName(.@map$) + "] has been abandoned.",0;
  123. disablenpc "Kafra Staff#"+.@castle$;
  124. SetCastleData .@map$,0,0;
  125. return;
  126. }
  127. // Function for OnAgitBreak ======================================
  128. function script F_AgitBreak {
  129. set .@map$, getarg(0);
  130. set .@castle$, getarg(1);
  131. //killmonsterall .@map$;
  132. set .@GID,getcharid(2);
  133. if (.@GID <= 0) return;
  134. set .@Economy,GetCastleData(.@map$,2) - 5;
  135. if (.@Economy < 0) set .@Economy, 0;
  136. SetCastleData .@map$, 2, .@Economy;
  137. set .@Defence,GetCastleData(.@map$,3) - 5;
  138. if (.@Defence < 0) set .@Defence, 0;
  139. SetCastleData .@map$, 3, .@Defence;
  140. SetCastleData .@map$,1, .@GID;
  141. MapAnnounce .@map$,"The emperium has been destroyed.",bc_map,0x00CCFF;
  142. Announce "The [" + GetCastleName(.@map$) + "] castle has been conquered by the [" + GetGuildName(.@GID) + "] guild.",bc_all;
  143. GetCastleData .@map$,0,"::OnRecvCastle"+.@castle$;
  144. disablenpc "Kafra Staff#"+.@castle$;
  145. for( set .@i, 4; .@i < 25; set .@i, .@i+1 )
  146. SetCastleData .@map$, .@i, 0;
  147. return;
  148. }
  149. // Function for OnAgitEnd ======================================
  150. function script F_AgitEnd {
  151. set .@map$, getarg(0);
  152. set .@castle$, getarg(1);
  153. GvgOff .@map$;
  154. // if (GetCastleData(.@map$,1) == 0) return; //enable this line to allow take over of non captured castles after woe ends
  155. MapRespawnGuildID .@map$,GetCastleData(.@map$,1),4;
  156. KillMonster .@map$,"Agit_"+.@castle$+"::OnAgitBreak";
  157. end;
  158. }