Thread: [PI]Fight Caves

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11  
    Registered Member

    Join Date
    Oct 2009
    Age
    30
    Posts
    1,037
    Thanks given
    4
    Thanks received
    8
    Rep Power
    338
    Anyone try this ?
     

  2. #12  
    Registered Member
    Join Date
    Aug 2008
    Posts
    2,418
    Thanks given
    721
    Thanks received
    595
    Rep Power
    1220
    Quote Originally Posted by javaOwnz™ View Post
    Give me a minute I have a class lying around somewhere for this...

    Code:
    import server.model.players.Client;
    import server.Server;
    
    /**
     * @author Sanity
     */
    
    public class FightCaves {
    	private final int[][] WAVES = {{2743},{2743,2627},{2743,2627,2627},{2743,2630},{2743,2630,2627},{2743,2630,2627,2627},
    								   {2743,2630,2630},{2743,2631},{2743,2631,2627},{2743,2631,2627,2627},{2743,2631,2630},{2743,2631,2630,2627},{2743,2631,2630,2627,2627},
    								   {2743,2631,2630,2630},{2743,2631,2631},{2743,2741},{2743,2741,2627},{2743,2741,2627,2627},
    								   {2743,2741,2630},{2743,2741,2630,2627},{2743,2741,2630,2627,2627},{2743,2741,2630,2630},{2743,2741,2631},{2743,2741,2631,2627},{2743,2741,2631,2627,2627},
    								   {2743,2741,2631,2630},{2743,2741,2631,2630,2627},{2743,2741,2631,2630,2627,2627},{2743,2741,2631,2630,2630},{2743,2741,2631,2631},
    								   {2743,2741,2741},{2743,2743},{2745}};
    	private int[][] coordinates = {{2398,5086},{2387,5095},{2407,5098},{2417,5082},{2390,5076},{2410, 5090}};
    	//2743 = 360, 2627 = 22, 2630 = 45, 2631 = 90, 2741 = 180
    	public void spawnNextWave(Client c) {
    		if (c != null) {
    			if (c.waveId >= WAVES.length) {
    				c.waveId = 0;
    				return;				
    			}
    			if (c.waveId < 0){
    			return;
    			}
    			int npcAmount = WAVES[c.waveId].length;
    			for (int j = 0; j < npcAmount; j++) {
    				int npc = WAVES[c.waveId][j];
    				int X = coordinates[j][0];
    				int Y = coordinates[j][1];
    				int H = c.heightLevel;
    				int hp = getHp(npc);
    				int max = getMax(npc);
    				int atk = getAtk(npc);
    				int def = getDef(npc);
    				Server.npcHandler.spawnNpc(c, npc, X, Y, H, 0, hp, max, atk, def, true, false);				
    			}
    			c.tzhaarToKill = npcAmount;
    			c.tzhaarKilled = 0;
    		}
    	}
    	
    	public int getHp(int npc) {
    		switch (npc) {
    			case 2627:
    			return 10;
    			case 2630:
    			return 20;
    			case 2631:
    			return 40;
    			case 2741:
    			return 80;
    			case 2743: 
    			return 150;
    			case 2745:
    			return 250;		
    		}
    		return 100;
    	}
    	
    	public int getMax(int npc) {
    		switch (npc) {
    			case 2627:
    			return 4;
    			case 2630:
    			return 7;
    			case 2631:
    			return 13;
    			case 2741:
    			return 28;
    			case 2743: 
    			return 54;
    			case 2745:
    			return 97;		
    		}
    		return 5;
    	}
    	
    	public int getAtk(int npc) {
    		switch (npc) {
    			case 2627:
    			return 30;
    			case 2630:
    			return 50;
    			case 2631:
    			return 100;
    			case 2741:
    			return 150;
    			case 2743: 
    			return 450;
    			case 2745:
    			return 650;		
    		}
    		return 100;
    	}
    	
    	public int getDef(int npc) {
    		switch (npc) {
    			case 2627:
    			return 30;
    			case 2630:
    			return 50;
    			case 2631:
    			return 100;
    			case 2741:
    			return 150;
    			case 2743: 
    			return 300;
    			case 2745:
    			return 500;		
    		}
    		return 100;
    	}
    	
    
    }
    Code:
    		case 9356:
    			c.getPA().enterCaves();
    			c.sendMessage("Good luck bitch.");
    		break;
    I think it work's correctly, But I've been wrong before, And I'm not sure I fully understand your problem.
    -Goodluck
    Thanks,
    I'll try it out tomorrow.
     

  3. #13  
    Registered Member
    Join Date
    Jan 2011
    Posts
    70
    Thanks given
    0
    Thanks received
    3
    Rep Power
    1
    I tried this got 2 errors: hmm, ill try fix myself though.
     

Page 2 of 2 FirstFirst 12

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •