Advertisement
Guest User

Untitled

a guest
May 27th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. public int location [][] = {{3236,3173},{3148,3508},{2999, 3356},{2987,3408}};
  2. public int locations [][] = {{2956,3504}};
  3. public int Npcs[] = {1160,3943};
  4. public int Npcs2[] = {6260};
  5. public boolean[] rndNpc = new boolean[Npcs.length+1];
  6. public boolean[] rndNpc2 = new boolean[Npcs2.length+1];
  7. public int NpcCoord[] = new int[Npcs.length+1];
  8. public int NpcCoord2[] = new int[Npcs2.length+1];
  9. public boolean[] rndCoord = new boolean[location.length+1];
  10. public boolean[] rndCoord2 = new boolean[locations.length+1];
  11.  
  12. public boolean RandomNpc() {
  13. int wichNpc = Misc.random(Npcs.length-1);
  14. String name[] = {"lumbridge swamp", "edgville bridge", "skilling area","falador"};
  15. int where = Misc.random(location.length-1);
  16. if(rndNpc[wichNpc] || rndCoord[where]) return false;
  17. spawnNpc2(Npcs[wichNpc], location[where][0],location[where][1], 0, 1, 9000, 50, 400, 400);
  18. rndNpc[wichNpc] = true;
  19. NpcCoord[wichNpc] = where;
  20. rndCoord[where] = true;
  21.  
  22. if (Npcs[wichNpc] == 1160) {
  23. c.autoMessage2("[@red@WARNING@bla@]@red@ The Kalphite Queen @bla@ is nearing the "+ name[where] +".");
  24.  
  25. }
  26. if (Npcs[wichNpc] == 3943) {
  27. c.autoMessage2("[@red@WARNING@bla@]@red@ The Kraken @bla@ is nearing the "+ name[where] +".");
  28. }
  29. return true;
  30. }
  31.  
  32.  
  33.  
  34. public boolean RandomNpc2() {
  35. int wichNpc2 = Misc.random(Npcs2.length-1);
  36. String name2[] = {"Goblin Village Outpost"};
  37. int where2 = Misc.random(locations.length-1);
  38. if(rndNpc2[wichNpc2] || rndCoord2[where2]) return false;
  39. spawnNpc2(Npcs2[wichNpc2], locations[where2][0],locations[where2][1], 0, 1, 9000, 50, 400, 400);
  40. rndNpc2[wichNpc2] = true;
  41. NpcCoord2[wichNpc2] = where2;
  42. rndCoord2[where2] = true;
  43.  
  44.  
  45. if (Npcs2[wichNpc2] == 6260) {
  46. c.autoMessage2("[@red@WARNING@bla@]@red@ General Graardor @bla@ is assembling the troops at the "+ name2[where2] +".");
  47.  
  48. }
  49. return true;
  50. }
  51.  
  52.  
  53. public void checkDeath2(int id)
  54. {
  55. for(int i = 0; i < Npcs2.length; i++)
  56. {
  57. if(Npcs2[i] == id)
  58. {
  59. rndNpc2[i] = false;
  60. rndCoord2[NpcCoord2[i]] = false;
  61. }
  62. }
  63. }
  64. public void checkDeath(int id)
  65. {
  66. for(int i = 0; i < Npcs.length; i++)
  67. {
  68. if(Npcs[i] == id)
  69. {
  70. rndNpc[i] = false;
  71. rndCoord[NpcCoord[i]] = false;
  72. }
  73. }
  74. }
  75. public void spawnNpc2(int npcType, int x, int y, int heightLevel, int WalkingType, int HP, int MAXHit, int attack, int defence) {
  76. int slot = -1;
  77. for (int i = 1; i < NPCHandler.maxNPCs; i++) {
  78. if (NPCHandler.npcs[i] == null) {
  79. slot = i;
  80. break;
  81. }
  82. }
  83. if(slot == -1) {
  84. return;
  85. }
  86. NPC newNPC = new NPC(slot, npcType);
  87. newNPC.absX = x;
  88. newNPC.absY = y;
  89. newNPC.makeX = x;
  90. newNPC.makeY = y;
  91. newNPC.heightLevel = heightLevel;
  92. newNPC.walkingType = WalkingType;
  93. newNPC.HP = HP;
  94. newNPC.MaxHP = HP;
  95. newNPC.maxHit = MAXHit * 10;
  96. newNPC.attack = attack;
  97. newNPC.defence = defence;
  98. newNPC.needRespawn = false;
  99. NPCHandler.npcs[slot] = newNPC;
  100. }
  101.  
  102. // TODO Auto-generated method stub
  103.  
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement