Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int location [][] = {{3236,3173},{3148,3508},{2999, 3356},{2987,3408}};
- public int locations [][] = {{2956,3504}};
- public int Npcs[] = {1160,3943};
- public int Npcs2[] = {6260};
- public boolean[] rndNpc = new boolean[Npcs.length+1];
- public boolean[] rndNpc2 = new boolean[Npcs2.length+1];
- public int NpcCoord[] = new int[Npcs.length+1];
- public int NpcCoord2[] = new int[Npcs2.length+1];
- public boolean[] rndCoord = new boolean[location.length+1];
- public boolean[] rndCoord2 = new boolean[locations.length+1];
- public boolean RandomNpc() {
- int wichNpc = Misc.random(Npcs.length-1);
- String name[] = {"lumbridge swamp", "edgville bridge", "skilling area","falador"};
- int where = Misc.random(location.length-1);
- if(rndNpc[wichNpc] || rndCoord[where]) return false;
- spawnNpc2(Npcs[wichNpc], location[where][0],location[where][1], 0, 1, 9000, 50, 400, 400);
- rndNpc[wichNpc] = true;
- NpcCoord[wichNpc] = where;
- rndCoord[where] = true;
- if (Npcs[wichNpc] == 1160) {
- c.autoMessage2("[@red@WARNING@bla@]@red@ The Kalphite Queen @bla@ is nearing the "+ name[where] +".");
- }
- if (Npcs[wichNpc] == 3943) {
- c.autoMessage2("[@red@WARNING@bla@]@red@ The Kraken @bla@ is nearing the "+ name[where] +".");
- }
- return true;
- }
- public boolean RandomNpc2() {
- int wichNpc2 = Misc.random(Npcs2.length-1);
- String name2[] = {"Goblin Village Outpost"};
- int where2 = Misc.random(locations.length-1);
- if(rndNpc2[wichNpc2] || rndCoord2[where2]) return false;
- spawnNpc2(Npcs2[wichNpc2], locations[where2][0],locations[where2][1], 0, 1, 9000, 50, 400, 400);
- rndNpc2[wichNpc2] = true;
- NpcCoord2[wichNpc2] = where2;
- rndCoord2[where2] = true;
- if (Npcs2[wichNpc2] == 6260) {
- c.autoMessage2("[@red@WARNING@bla@]@red@ General Graardor @bla@ is assembling the troops at the "+ name2[where2] +".");
- }
- return true;
- }
- public void checkDeath2(int id)
- {
- for(int i = 0; i < Npcs2.length; i++)
- {
- if(Npcs2[i] == id)
- {
- rndNpc2[i] = false;
- rndCoord2[NpcCoord2[i]] = false;
- }
- }
- }
- public void checkDeath(int id)
- {
- for(int i = 0; i < Npcs.length; i++)
- {
- if(Npcs[i] == id)
- {
- rndNpc[i] = false;
- rndCoord[NpcCoord[i]] = false;
- }
- }
- }
- public void spawnNpc2(int npcType, int x, int y, int heightLevel, int WalkingType, int HP, int MAXHit, int attack, int defence) {
- int slot = -1;
- for (int i = 1; i < NPCHandler.maxNPCs; i++) {
- if (NPCHandler.npcs[i] == null) {
- slot = i;
- break;
- }
- }
- if(slot == -1) {
- return;
- }
- NPC newNPC = new NPC(slot, npcType);
- newNPC.absX = x;
- newNPC.absY = y;
- newNPC.makeX = x;
- newNPC.makeY = y;
- newNPC.heightLevel = heightLevel;
- newNPC.walkingType = WalkingType;
- newNPC.HP = HP;
- newNPC.MaxHP = HP;
- newNPC.maxHit = MAXHit * 10;
- newNPC.attack = attack;
- newNPC.defence = defence;
- newNPC.needRespawn = false;
- NPCHandler.npcs[slot] = newNPC;
- }
- // TODO Auto-generated method stub
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement