Thread: [PI] Fight Caves

Results 1 to 8 of 8
  1. #1 [PI] Fight Caves 
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    My waves dont seem to spawn so i made it just jad to test it and yes it didnt spawn idk what the problem is but here is my fightcaves.java

    Code:
    package server.model.minigames;
    
    import server.model.players.Client;
    import server.Server;
    
    public class FightCaves {
    
    	/*private final int[][] WAVES = {
    		{2627},
    		{2627,2627},
    		{2630,2627},
    		{2630,2627,2627},
    		{2631,2627},
    		{2631,2627,2627},
    		{2631,2630},
    		{2631,2630,2627},
    		{2631,2630,2627,2627},
    		{2631,2631},
    		{2741,2627,2627},
    		{2741,2630},
    		{2741,2630,2627},
    		{2741,2630,2630},
    		{2741,2631},
    		{2741,2631,2630},
    		{2741,2631,2630,2627},
    		{2741,2741},
    		{2743,2627,2627},
    		{2743,2631},
    		{2743,2631,2627,2627},
    		{2743,2631,2630,2630},
    		{2743,2741},
    		{2743,2741,2627},
    		{2743,2741,2631},
    		{2743,2741,2631,2627},
    		{2743,2741,2631,2630,2627,2627},
    		{2743,2741,2631,2630,2630},
    		{2743,2741,2631,2631},
    		{2743,2741,2741},
    		{2743,2743},
    		{2745}
    	};*/
    
    	private final int[][] WAVES = {
    		{2745}
    	};
    	
    	private int[][] coordinates = {
    		{2398,5086},
    		{2387,5095},
    		{2407,5098},
    		{2417,5082},
    		{2390,5076},
    		{2410, 5090}
    	};
    	
    	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.playerId * 4;
    				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;
    		} else {
    		}
    	}
    	
    	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 static boolean isFightCaveNpc(int npcType) {
    		int[] fightCaveNpc = {2627, 2629, 2630, 2631, 2741, 2743, 2745};
    		for (int element : fightCaveNpc) {
    			if (npcType == element) {
    				return true;
    			}
    		}
    		return false;
    	}
    	
    	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;
    	}
    	
    
    }
    Reply With Quote  
     

  2. #2  
    Rune-Server Affiliate
    Genesis's Avatar
    Join Date
    Sep 2010
    Posts
    4,149
    Thanks given
    1,508
    Thanks received
    1,980
    Rep Power
    4944
    Thanks, will use!



















    Spoiler for :


    No just kidding, but on topic. Why do you have so many coordinates

    Code:
    private int[][] coordinates = {
    		{2398,5086},
    		{2387,5095},
    		{2407,5098},
    		{2417,5082},
    		{2390,5076},
    		{2410, 5090}
    	};
    When there's only 1 wave?
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by xGenesis R View Post
    Thanks, will use!



















    Spoiler for :


    No just kidding, but on topic. Why do you have so many coordinates

    Code:
    private int[][] coordinates = {
    		{2398,5086},
    		{2387,5095},
    		{2407,5098},
    		{2417,5082},
    		{2390,5076},
    		{2410, 5090}
    	};
    When there's only 1 wave?
    I made one wave to test if they realy didnt spawn so and it didnt so for some reason they dont spawn normaly it will have 32 waves
    Reply With Quote  
     

  5. #4  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Bump still needing this
    Reply With Quote  
     

  6. #5  
    Banned

    Join Date
    Jun 2009
    Posts
    2,916
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    got this

    if (isFightCaveNpc(i))
    killedTzhaar(i);
    at npchandler? else where you trying to load it?
    Reply With Quote  
     

  7. #6  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by Allstar+- View Post
    got this



    at npchandler? else where you trying to load it?
    Just in NPCHandler but it doesnt even spawn the first npc
    Reply With Quote  
     

  8. #7  
    Banned

    Join Date
    Jun 2009
    Posts
    2,916
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    Quote Originally Posted by Nighel15 View Post
    Just in NPCHandler but it doesnt even spawn the first npc
    kk sec.
    Reply With Quote  
     

  9. #8  
    Banned

    Join Date
    Jun 2009
    Posts
    2,916
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. 639 Fight Caves!
    By Flashy in forum Requests
    Replies: 2
    Last Post: 11-21-2011, 09:09 AM
  2. [PI] Fight Caves
    By Harman in forum Help
    Replies: 2
    Last Post: 09-21-2011, 01:20 AM
  3. Fight Caves Help.
    By immortalz0 in forum Help
    Replies: 0
    Last Post: 08-07-2010, 07:57 AM
  4. 525 With Fight CAVES? I need Jad.
    By scriptex in forum Requests
    Replies: 14
    Last Post: 05-01-2009, 04:10 PM
  5. 65% Fight Caves
    By James™ in forum Tutorials
    Replies: 9
    Last Post: 05-12-2008, 06:24 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •