gldfunc_ev_agit.txt 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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.5
  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 and monster spawn
  20. //= arg(3): y1 for Emperium and monster spawn
  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. //============================================================
  32. // Function for OnAgitStart =========================================
  33. function script F_AgitStart {
  34. MapRespawnGuildID getarg(0),GetCastleData(getarg(0),1),2;
  35. Monster getarg(0),getarg(2),getarg(3),"EMPERIUM",1288,1,"Agit_"+getarg(1)+"::OnAgitBreak";
  36. GvgOn getarg(0);
  37. if (GetCastleData(getarg(0),1) != 0) return;
  38. if(getarg(0) == "aldeg_cas01" || getarg(0) == "aldeg_cas02" || getarg(0) == "aldeg_cas03" || getarg(0) == "aldeg_cas04" || getarg(0) == "aldeg_cas05" || getarg(0) == "nguild_alde") goto L_AldegCas;
  39. if(getarg(0) == "gefg_cas01" || getarg(0) == "gefg_cas02" || getarg(0) == "gefg_cas03" || getarg(0) == "gefg_cas04" || getarg(0) == "gefg_cas05" || getarg(0) == "nguild_gef") goto L_GefgCas;
  40. if(getarg(0) == "payg_cas01" || getarg(0) == "payg_cas02" || getarg(0) == "payg_cas03" || getarg(0) == "payg_cas04" || getarg(0) == "payg_cas05" || getarg(0) == "nguild_pay") goto L_PaygCas;
  41. if(getarg(0) == "prtg_cas01" || getarg(0) == "prtg_cas02" || getarg(0) == "prtg_cas03" || getarg(0) == "prtg_cas04" || getarg(0) == "prtg_cas05" || getarg(0) == "nguild_prt") goto L_PrtgCas;
  42. L_AldegCas:
  43. areamonster getarg(0),0,0,300,300,"--ja--",1117,10;
  44. areamonster getarg(0),0,0,300,300,"--ja--",1132,4;
  45. areamonster getarg(0),0,0,300,300,"--ja--",1219,2;
  46. areamonster getarg(0),0,0,300,300,"--ja--",1205,1;
  47. areamonster getarg(0),0,0,300,300,"--ja--",1216,10;
  48. areamonster getarg(0),0,0,300,300,"--ja--",1193,17;
  49. areamonster getarg(0),0,0,300,300,"--ja--",1269,9;
  50. areamonster getarg(0),0,0,300,300,"--ja--",1276,7;
  51. areamonster getarg(0),0,0,300,300,"--ja--",1208,3;
  52. areamonster getarg(0),0,0,300,300,"--ja--",1275,1;
  53. areamonster getarg(0),0,0,300,300,"--ja--",1268,1;
  54. areamonster getarg(0),0,0,300,300,"--ja--",1272,1;
  55. monster getarg(0),(getarg(2)+1),getarg(3),"--ja--",1272,1;
  56. monster getarg(0),(getarg(2)-1),getarg(3),"--ja--",1270,4;
  57. monster getarg(0),getarg(2),(getarg(3)+1),"--ja--",1268,1;
  58. monster getarg(0),getarg(2),(getarg(3)-1),"--ja--",1219,1;
  59. monster getarg(0),getarg(2),getarg(3),"--ja--",1276,5;
  60. return;
  61. L_GefgCas:
  62. areamonster getarg(0),0,0,300,300,"--ja--",1117,10;
  63. areamonster getarg(0),0,0,300,300,"--ja--",1263,11;
  64. areamonster getarg(0),0,0,300,300,"--ja--",1102,10;
  65. areamonster getarg(0),0,0,300,300,"--ja--",1130,10;
  66. areamonster getarg(0),0,0,300,300,"--ja--",1140,20;
  67. areamonster getarg(0),0,0,300,300,"--ja--",1163,9;
  68. areamonster getarg(0),0,0,300,300,"--ja--",1275,1;
  69. areamonster getarg(0),0,0,300,300,"--ja--",1219,1;
  70. areamonster getarg(0),0,0,300,300,"--ja--",1150,1;
  71. areamonster getarg(0),0,0,300,300,"--ja--",1159,1;
  72. monster getarg(0),(getarg(2)+1),getarg(3),"--ja--",1203,1;
  73. monster getarg(0),(getarg(2)-1),getarg(3),"--ja--",1087,1;
  74. monster getarg(0),getarg(2),(getarg(3)+1),"--ja--",1213,7;
  75. monster getarg(0),getarg(2),(getarg(3)-1),"--ja--",1189,7;
  76. return;
  77. L_PaygCas:
  78. areamonster getarg(0),0,0,300,300,"--ja--",1277,10;
  79. areamonster getarg(0),0,0,300,300,"--ja--",1208,10;
  80. areamonster getarg(0),0,0,300,300,"--ja--",1262,5;
  81. areamonster getarg(0),0,0,300,300,"--ja--",1102,5;
  82. areamonster getarg(0),0,0,300,300,"--ja--",1150,1;
  83. areamonster getarg(0),0,0,300,300,"--ja--",1115,1;
  84. areamonster getarg(0),0,0,300,300,"--ja--",1129,11;
  85. areamonster getarg(0),0,0,300,300,"--ja--",1276,5;
  86. areamonster getarg(0),0,0,300,300,"--ja--",1282,4;
  87. areamonster getarg(0),0,0,300,300,"--ja--",1253,5;
  88. monster getarg(0),getarg(2),getarg(3),"--ja--",1150,1;
  89. monster getarg(0),getarg(2),getarg(3),"--ja--",1115,1;
  90. monster getarg(0),getarg(2),(getarg(3)+1),"--ja--",1208,6;
  91. monster getarg(0),getarg(2),(getarg(3)-1),"--ja--",1276,5;
  92. return;
  93. L_PrtgCas:
  94. areamonster getarg(0),0,0,300,300,"--ja--",1163,15;
  95. areamonster getarg(0),0,0,300,300,"--ja--",1132,10;
  96. areamonster getarg(0),0,0,300,300,"--ja--",1219,5;
  97. areamonster getarg(0),0,0,300,300,"--ja--",1268,5;
  98. areamonster getarg(0),0,0,300,300,"--ja--",1251,1;
  99. areamonster getarg(0),0,0,300,300,"--ja--",1252,1;
  100. areamonster getarg(0),0,0,300,300,"--ja--",1276,5;
  101. areamonster getarg(0),0,0,300,300,"--ja--",1259,1;
  102. areamonster getarg(0),0,0,300,300,"--ja--",1283,1;
  103. areamonster getarg(0),0,0,300,300,"--ja--",1275,1;
  104. areamonster getarg(0),0,0,300,300,"--ja--",1200,1;
  105. monster getarg(0),(getarg(2)+1),getarg(3),"--ja--",1268,1;
  106. monster getarg(0),(getarg(2)-1),getarg(3),"--ja--",1251,1;
  107. monster getarg(0),getarg(2),(getarg(3)+1),"--ja--",1252,1;
  108. monster getarg(0),getarg(2),(getarg(3)-1),"--ja--",1219,2;
  109. monster getarg(0),getarg(2),getarg(3),"--ja--",1276,5;
  110. return;
  111. }
  112. // Function for OnGuildBreak ======================================
  113. function script F_GuildBreak {
  114. killmonsterall getarg(0);
  115. Announce "Guild Base [" + GetCastleName(getarg(0)) + "] has been abandoned.",0;
  116. disablenpc "Kafra Staff#"+getarg(1);
  117. SetCastleData getarg(0),0,0;
  118. return;
  119. }
  120. // Function for OnAgitBreak ======================================
  121. function script F_AgitBreak {
  122. //killmonsterall getarg(0);
  123. set @GID,getcharid(2);
  124. if (@GID <= 0) return;
  125. set @Economy,GetCastleData(getarg(0),2) - 5;
  126. if (@Economy < 0) set @Economy, 0;
  127. SetCastleData getarg(0),2, @Economy;
  128. set @Defence,GetCastleData(getarg(0),3) - 5;
  129. if (@Defence < 0) set @Defence, 0;
  130. SetCastleData getarg(0),3, @Defence;
  131. SetCastleData getarg(0),1, @GID;
  132. MapAnnounce getarg(0),"The emperium has been destroyed.",bc_map,0x00CCFF;
  133. Announce "The [" + GetCastleName(getarg(0)) + "] castle has been conquered by the [" + GetGuildName(@GID) + "] guild.",bc_map;
  134. GetCastleData getarg(0),0,"::OnRecvCastle"+getarg(1);
  135. disablenpc "Kafra Staff#"+getarg(1);
  136. set @i, 3;
  137. L_Loop:
  138. set @i, @i + 1;
  139. SetCastleData getarg(0),@i,0;
  140. if(@i < 25) goto L_Loop;
  141. return;
  142. }
  143. // Function for OnAgitEnd ======================================
  144. function script F_AgitEnd {
  145. GvgOff getarg(0);
  146. // if (GetCastleData(getarg(0),1) == 0) return; //enable this line to allow take over of non captured castles after woe ends
  147. MapRespawnGuildID getarg(0),GetCastleData(getarg(0),1),4;
  148. KillMonster getarg(0),"Agit_"+getarg(1)+"::OnAgitBreak";
  149. end;
  150. }