gldfunc_ev_agit.txt 8.1 KB

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