Guest User

Fight Caves

a guest
Jul 2nd, 2014
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. package server.model.minigames;
  2.  
  3. import server.model.npcs.NPCHandler;
  4. import server.model.players.Client;
  5.  
  6.  
  7. /**
  8. * @author _Austin_
  9. */
  10.  
  11. public class FightCaves {
  12.  
  13. private final int[][] WAVES = { { 2745 } };
  14.  
  15. private int[][] coordinates = { { 2410, 5090 } };
  16.  
  17. public void spawnNextWave(Client c) {
  18. if (c != null) {
  19. if (c.waveId >= WAVES.length) {
  20. c.waveId = 0;
  21. return;
  22. }
  23. if (c.waveId < 0) {
  24. return;
  25. }
  26. int npcAmount = WAVES[c.waveId].length;
  27. for (int j = 0; j < npcAmount; j++) {
  28. int npc = WAVES[c.waveId][j];
  29. int X = coordinates[j][0];
  30. int Y = coordinates[j][1];
  31. int H = c.heightLevel;
  32. int hp = getHp(npc);
  33. int max = getMax(npc);
  34. int atk = getAtk(npc);
  35. int def = getDef(npc);
  36. NPCHandler.newNPC(2745, X, Y, H, 0, hp, max, atk, def, 0,
  37. c.playerId);
  38. }
  39. c.tzhaarToKill = npcAmount;
  40. c.tzhaarKilled = 0;
  41. }
  42. }
  43.  
  44. public static boolean isCaveNpcs(int i) {
  45. if (NPCHandler.npcs[i].npcType == 2627
  46. || NPCHandler.npcs[i].npcType == 2630
  47. || NPCHandler.npcs[i].npcType == 2631
  48. || NPCHandler.npcs[i].npcType == 2741
  49. || NPCHandler.npcs[i].npcType == 2743
  50. || NPCHandler.npcs[i].npcType == 2745) {
  51. return true;
  52. }
  53. return false;
  54. }
  55.  
  56. public int getHp(int npc) {
  57. switch (npc) {
  58. case 2627:
  59. return 10;
  60. case 2630:
  61. return 20;
  62. case 2631:
  63. return 40;
  64. case 2741:
  65. return 80;
  66. case 2743:
  67. return 150;
  68. case 2745:
  69. return 250;
  70. }
  71. return 100;
  72. }
  73.  
  74. public int getMax(int npc) {
  75. switch (npc) {
  76. case 2627:
  77. return 4;
  78. case 2630:
  79. return 7;
  80. case 2631:
  81. return 17;
  82. case 2741:
  83. return 28;
  84. case 2743:
  85. return 54;
  86. case 2745:
  87. return 97;
  88. }
  89. return 5;
  90. }
  91.  
  92. public int getAtk(int npc) {
  93. switch (npc) {
  94. case 2627:
  95. return 50;
  96. case 2630:
  97. return 70;
  98. case 2631:
  99. return 130;
  100. case 2741:
  101. return 250;
  102. case 2743:
  103. return 450;
  104. case 2745:
  105. return 650;
  106. }
  107. return 100;
  108. }
  109.  
  110. public int getDef(int npc) {
  111. switch (npc) {
  112. case 2627:
  113. return 30;
  114. case 2630:
  115. return 100;
  116. case 2631:
  117. return 150;
  118. case 2741:
  119. return 200;
  120. case 2743:
  121. return 300;
  122. case 2745:
  123. return 500;
  124. }
  125. return 100;
  126. }
  127.  
  128. }
Advertisement
Add Comment
Please, Sign In to add comment