kvm01.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. //===== rAthena Script =======================================
  2. //= Système de Champs de Bataille - KvM 80-99
  3. //===== Description: =========================================
  4. //= [Conversion Officielle]
  5. //= Champs de Bataille Kreiger Von Midgard pour les niveaux 80 à 99
  6. //= - Équipe victorieuse : 5 points
  7. //= - Équipe perdante : 1 point
  8. //===== Historique des modifications: ========================
  9. //= 1.0 Première version. [L0ne_W0lf]
  10. //= 1.1 Mise à jour depuis les fichiers Aegis officiels. [L0ne_W0lf]
  11. //= 1.2 Mise à jour des annonces et dialogues depuis iRO.
  12. //= Légère modification du fonctionnement du tableau des scores.
  13. //= Suppression des soins de zone, et autres détails mineurs.
  14. //= 1.3 Ajout des vérifications de configuration pour activer l’interface de file d’attente ou l’ancienne méthode. [Aleos]
  15. //===== Traduit par OverSu et Liara ==========================
  16. // PNJ de la Salle d’Attente
  17. //============================================================
  18. bat_room,169,226,5 script Salle d’Attente KvM#a::KvM01R_Guillaume 418,{
  19. end;
  20. OnInit:
  21. waitingroom "Poste de Combat - 5 Joueurs",6,"KvM01_BG_Out::OnGuillaumeJoin",1;
  22. end;
  23. OnEnterBG:
  24. set $@KvM01BG_id1, waitingroom2bg("bat_c01",52,129,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
  25. end;
  26. }
  27. bat_room,169,205,3 script Salle d’Attente KvM#b::KvM01R_Croix 414,{
  28. end;
  29. OnInit:
  30. waitingroom "Poste de Combat - 5 Joueurs",6,"KvM01_BG_Out::OnCroixJoin",1;
  31. end;
  32. OnEnterBG:
  33. set $@KvM01BG_id2, waitingroom2bg("bat_c01",147,55,"KvM01_BG::OnCroixQuit","KvM01_BG::OnCroixDie");
  34. end;
  35. }
  36. bat_room,169,220,0 warp2 #kvm801 2,2,bat_room,154,150
  37. bat_room,169,211,0 warp2 #kvm802 2,2,bat_room,154,150
  38. // Lignes de Départ
  39. //============================================================
  40. - script KVM01::EffetCellule -1,{
  41. end;
  42. OnKvM01One:
  43. specialeffect EF_CHANGECOLD;
  44. end;
  45. OnKvM01Two:
  46. specialeffect EF_CHANGEPOISON;
  47. end;
  48. }
  49. bat_c01,54,124,3 duplicate(EffetCellule) #CelluleRougeA1-1 139
  50. bat_c01,55,124,3 duplicate(EffetCellule) #CelluleRougeA2-1 139
  51. bat_c01,56,124,3 duplicate(EffetCellule) #CelluleRougeA3-1 139
  52. bat_c01,57,124,3 duplicate(EffetCellule) #CelluleRougeA4-1 139
  53. bat_c01,57,125,3 duplicate(EffetCellule) #CelluleRougeA5-1 139
  54. bat_c01,57,126,3 duplicate(EffetCellule) #CelluleRougeA6-1 139
  55. bat_c01,57,127,3 duplicate(EffetCellule) #CelluleRougeA7-1 139
  56. bat_c01,145,59,3 duplicate(EffetCellule) #CelluleRougeB1-1 139
  57. bat_c01,144,59,3 duplicate(EffetCellule) #CelluleRougeB2-1 139
  58. bat_c01,143,59,3 duplicate(EffetCellule) #CelluleRougeB3-1 139
  59. bat_c01,142,59,3 duplicate(EffetCellule) #CelluleRougeB4-1 139
  60. bat_c01,142,56,3 duplicate(EffetCellule) #CelluleRougeB5-1 139
  61. bat_c01,142,57,3 duplicate(EffetCellule) #CelluleRougeB6-1 139
  62. bat_c01,142,58,3 duplicate(EffetCellule) #CelluleRougeB7-1 139
  63. bat_c01,54,128,3 script #Camp_A_depart01 139,4,4,{
  64. end;
  65. OnInit:
  66. disablenpc "#Camp_A_depart01";
  67. end;
  68. OnEnable:
  69. enablenpc "#Camp_A_depart01";
  70. end;
  71. OnDisable:
  72. disablenpc "#Camp_A_depart01";
  73. end;
  74. OnTouch:
  75. set Bat_Team,1;
  76. if (!getbattleflag("feature.bgqueue"))
  77. setquest 6025;
  78. end;
  79. }
  80. bat_c01,146,56,3 script #Camp_B_depart01 139,4,4,{
  81. end;
  82. OnInit:
  83. disablenpc "#Camp_B_depart01";
  84. end;
  85. OnEnable:
  86. enablenpc "#Camp_B_depart01";
  87. end;
  88. OnDisable:
  89. disablenpc "#Camp_B_depart01";
  90. end;
  91. OnTouch:
  92. set Bat_Team,2;
  93. if (!getbattleflag("feature.bgqueue"))
  94. setquest 6025;
  95. end;
  96. }
  97. // Moteur du Champ de Bataille KvM
  98. //============================================================
  99. - script KvM01_BG -1,{
  100. end;
  101. OnInit:
  102. if (getbattleflag("feature.bgqueue"))
  103. bg_unbook "bat_c01";
  104. mapwarp "bat_c01","bat_room",154,150;
  105. setwall "bat_c01",54,122,6,7,0,"mur_c01a";
  106. setwall "bat_c01",55,122,5,7,0,"mur_c01b";
  107. setwall "bat_c01",140,56,6,7,0,"mur_c01c";
  108. setwall "bat_c01",140,57,5,7,0,"mur_c01d";
  109. disablenpc "Officier KvM#KvM01A";
  110. disablenpc "Officier KvM#KvM01B";
  111. end;
  112. OnGuillaumeQuit:
  113. if (getbattleflag("feature.bgqueue"))
  114. bg_desert;
  115. // else
  116. // set BG_Delay_Tick, gettimetick(2) + 1200;
  117. OnGuillaumeDie:
  118. if( $@KvM01BG == 2 ) {
  119. set .Guillaume_Count, .Guillaume_Count - 1;
  120. bg_updatescore "bat_c01",.Guillaume_Count,.Croix_Count;
  121. if( .Guillaume_Count < 1 )
  122. donpcevent "KvM01_BG::OnCroixWin";
  123. else {
  124. mapannounce "bat_c01", "Guillaume : "+.Guillaume_Count+" soldats restants.",bc_map,"0x00ff00";
  125. mapannounce "bat_c01", "Croix : "+.Croix_Count+" combattants encore debout.",bc_map,"0x00ff00";
  126. }
  127. }
  128. end;
  129. OnCroixQuit:
  130. if (getbattleflag("feature.bgqueue"))
  131. bg_desert;
  132. // else
  133. // set BG_Delay_Tick, gettimetick(2) + 1200;
  134. OnCroixDie:
  135. if( $@KvM01BG == 2 ) {
  136. set .Croix_Count, .Croix_Count - 1;
  137. bg_updatescore "bat_c01",.Guillaume_Count,.Croix_Count;
  138. if( .Croix_Count < 1 )
  139. donpcevent "KvM01_BG::OnGuillaumeWin";
  140. else {
  141. mapannounce "bat_c01", "Guillaume : "+.Guillaume_Count+" soldats restants.",bc_map,"0x00ff00";
  142. mapannounce "bat_c01", "Croix : "+.Croix_Count+" combattants encore debout.",bc_map,"0x00ff00";
  143. }
  144. }
  145. end;
  146. OnGuillaumeActive:
  147. warp "bat_c01",61,120;
  148. end;
  149. OnCroixActive:
  150. warp "bat_c01",138,63;
  151. end;
  152. OnStart:
  153. disablenpc "Officier KvM#KvM01A";
  154. disablenpc "Officier KvM#KvM01B";
  155. set $@KvM01BG_Victory, 0;
  156. bg_warp $@KvM01BG_id1,"bat_c01",53,128;
  157. bg_warp $@KvM01BG_id2,"bat_c01",146,55;
  158. initnpctimer;
  159. end;
  160. OnTimer1000:
  161. mapannounce "bat_c01", "Dans 1 minute, la bataille du KvM commence !",bc_map,"0x00ff00";
  162. end;
  163. OnTimer3000:
  164. mapannounce "bat_c01", "Durée maximale de la bataille : 5 minutes.",bc_map,"0x00ff00";
  165. end;
  166. OnTimer6000:
  167. mapannounce "bat_c01", "Préparez-vous, renforcez vos camarades !",bc_map,"0x00ff00";
  168. donpcevent "#Camp_A_depart01::OnEnable";
  169. donpcevent "#Camp_B_depart01::OnEnable";
  170. end;
  171. OnTimer13000:
  172. donpcevent "#Camp_A_depart01::OnDisable";
  173. donpcevent "#Camp_B_depart01::OnDisable";
  174. end;
  175. OnTimer30000:
  176. mapannounce "bat_c01", "Début de la bataille dans 30 secondes !",bc_map,"0x00ff00";
  177. end;
  178. OnTimer45000:
  179. mapannounce "bat_c01", "15 secondes avant le choc des armées !",bc_map,"0x00ff00";
  180. donpcevent "::OnKvM01One";
  181. end;
  182. OnTimer50000:
  183. mapannounce "bat_c01", "10 secondes avant la guerre !",bc_map,"0x00ff00";
  184. donpcevent "::OnKvM01Two";
  185. end;
  186. OnTimer55000:
  187. mapannounce "bat_c01", "5 secondes... Respirez. Armez-vous. Tenez bon !",bc_map,"0x00ff00";
  188. donpcevent "::OnKvM01One";
  189. end;
  190. OnTimer59000:
  191. mapannounce "bat_c01", "C’EST PARTI ! À L’ASSAUT !",bc_map,"0x00ff00";
  192. donpcevent "::OnKvM01Two";
  193. end;
  194. OnTimer61000:
  195. set .Guillaume_Count, bg_get_data($@KvM01BG_id1, 0);
  196. set .Croix_Count, bg_get_data($@KvM01BG_id2, 0);
  197. if (!getbattleflag("feature.bgqueue")) {
  198. if (.Guillaume_Count < 5 || .Croix_Count < 5) {
  199. set $@KvM01BG_Victory, 3;
  200. set $@KvM01BG, 3;
  201. mapannounce "bat_c01","Pas assez de participants pour commencer !",1,0x696969;
  202. stopnpctimer;
  203. donpcevent "KvM01_BG::OnStop";
  204. end;
  205. }
  206. }
  207. bg_updatescore "bat_c01",.Guillaume_Count,.Croix_Count;
  208. set $@KvM01BG, 2; // En cours
  209. bg_warp $@KvM01BG_id1,"bat_c01",61,120;
  210. bg_warp $@KvM01BG_id2,"bat_c01",138,63;
  211. end;
  212. OnTimer360000:
  213. mapannounce "bat_c01", "Fin du KvM ! Cessez le feu !",bc_map,"0x00ff00";
  214. if( .Croix_Count > .Guillaume_Count )
  215. donpcevent "KvM01_BG::OnCroixWin";
  216. else if( .Croix_Count < .Guillaume_Count )
  217. donpcevent "KvM01_BG::OnGuillaumeWin";
  218. else {
  219. set $@KvM01BG, 3;
  220. set $@KvM01BG_Victory, 3;
  221. mapannounce "bat_c01", "Égalité parfaite. Aucun vainqueur aujourd’hui.",bc_map,"0x00ff00";
  222. donpcevent "KvM01_BG::OnStop";
  223. }
  224. end;
  225. OnGuillaumeWin:
  226. set $@KvM01BG, 3;
  227. set $@KvM01BG_Victory, 1;
  228. mapannounce "bat_c01", "Victoire pour l’Armée Guillaume !",bc_map,"0x00ff00";
  229. donpcevent "KvM01_BG::OnStop";
  230. end;
  231. OnCroixWin:
  232. set $@KvM01BG, 3;
  233. set $@KvM01BG_Victory, 2;
  234. mapannounce "bat_c01", "L’Armée Croix remporte la_
  235. // Sortie de champ de bataille - KvM
  236. //============================================================
  237. - script KvM01_BG_Out -1,{
  238. end;
  239. OnBegin:
  240. initnpctimer;
  241. end;
  242. OnTimer1000:
  243. mapannounce "bat_c01", "Parlez à l'officier pour recevoir vos récompenses du KvM.",bc_map,"0x00ff00";
  244. end;
  245. OnTimer3000:
  246. mapannounce "bat_c01", "Vous avez 30 secondes pour réclamer vos points.",bc_map,"0x00ff00";
  247. end;
  248. OnTimer5000:
  249. mapannounce "bat_c01", "N’oubliez pas : sans parler à l’officier, aucun point ne sera attribué !",bc_map,"0x00ff00";
  250. end;
  251. OnTimer55000:
  252. mapannounce "bat_c01", "Retour à la base imminent !",bc_map,"0x00ff00";
  253. end;
  254. OnTimer60000:
  255. stopnpctimer;
  256. if (getbattleflag("feature.bgqueue"))
  257. bg_reserve "bat_c01", true;
  258. mapwarp "bat_c01","bat_room",154,150;
  259. set getvariableofnpc(.Croix_Count,"KvM01_BG"), 0;
  260. set getvariableofnpc(.Guillaume_Count,"KvM01_BG"), 0;
  261. set $@KvM01BG_Victory, 0;
  262. if( $@KvM01BG_id1 ) { bg_destroy $@KvM01BG_id1; set $@KvM01BG_id1, 0; }
  263. if( $@KvM01BG_id2 ) { bg_destroy $@KvM01BG_id2; set $@KvM01BG_id2, 0; }
  264. if (getbattleflag("feature.bgqueue"))
  265. bg_unbook "bat_c01";
  266. disablenpc "Officier KvM#KvM01A";
  267. disablenpc "Officier KvM#KvM01B";
  268. set $@KvM01BG, 0;
  269. end;
  270. OnGuillaumeJoin:
  271. OnCroixJoin:
  272. if( $@KvM01BG )
  273. end;
  274. set .@Guillaume, getwaitingroomstate(0,"KvM01R_Guillaume");
  275. set .@Croix, getwaitingroomstate(0,"KvM01R_Croix");
  276. if( .@Guillaume < 5 || .@Croix < 5 )
  277. end;
  278. set $@KvM01BG, 1; // Démarrage en cours
  279. donpcevent "KvM01R_Croix::OnEnterBG";
  280. donpcevent "KvM01R_Guillaume::OnEnterBG";
  281. donpcevent "KvM01_BG::OnStart";
  282. end;
  283. }
  284. // PNJs de récompense - KvM
  285. //============================================================
  286. bat_c01,51,130,5 script Officier KvM#KvM01A 419,{
  287. if( $@KvM01BG_Victory ) {
  288. mes "[Officier KvM]";
  289. if( $@KvM01BG_Victory == Bat_Team ) {
  290. mes "Bravo, combattant de l'honneur !";
  291. mes "Que la gloire du KvM t’accompagne.";
  292. mes "Tu gagnes : ^0055FF5 points de victoire^000000.";
  293. close2;
  294. set kvm_point,kvm_point + 5;
  295. }
  296. else {
  297. mes "Courage, l’échec n’est qu’un pas vers la victoire.";
  298. mes "Tu gagnes quand même : ^7777771 point de participation^000000.";
  299. close2;
  300. set kvm_point,kvm_point + 1;
  301. }
  302. bg_leave;
  303. set Bat_Team,0;
  304. if (!getbattleflag("feature.bgqueue"))
  305. warp "bat_room",154,150;
  306. }
  307. end;
  308. }
  309. bat_c01,148,53,1 duplicate(Officier KvM#KvM01A) Officier KvM#KvM01B 415
  310. // File d’attente BG - Désactive les scripts inutiles
  311. //============================================================
  312. - script BGQueueInit#kvm01 -1,{
  313. end;
  314. OnInit:
  315. if (getbattleflag("feature.bgqueue")) {
  316. unloadnpc "KvM01R_Guillaume";
  317. unloadnpc "KvM01R_Croix";
  318. unloadnpc "#kvm801";
  319. unloadnpc "#kvm802";
  320. }
  321. end;
  322. }