Thread: [PI]Fight Caves

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [PI]Fight Caves 
    Registered Member
    Join Date
    Aug 2008
    Posts
    2,420
    Thanks given
    721
    Thanks received
    595
    Rep Power
    1233
    How do I make the Fight Caves(Jad) work. You go in, and no waves start or anything. Has anyone fixed this?
    [Only registered and activated users can see links. ]
     

  2. #2  
    Registered Member

    Join Date
    Oct 2009
    Age
    25
    Posts
    1,037
    Thanks given
    4
    Thanks received
    8
    Rep Power
    338
    i would like this to .
     

  3. #3  
    Registered Member
    Join Date
    Aug 2008
    Posts
    2,420
    Thanks given
    721
    Thanks received
    595
    Rep Power
    1233
    Bump.

    Anyone?
    [Only registered and activated users can see links. ]
     

  4. #4  
    Registered Member
    Join Date
    May 2010
    Posts
    217
    Thanks given
    0
    Thanks received
    2
    Rep Power
    1
    Idk how fix but you have to stay in the center and relog
     

  5. #5  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    27
    Posts
    4,777
    Thanks given
    199
    Thanks received
    1,255
    Rep Power
    1110
    i think its something like this which goes in playerassistant.java
    Code:
    public void resetTzhaar() {
    		c.waveId = -1;
    		c.tzhaarToKill = -1;
    		c.tzhaarKilled = -1;	
    		c.getPA().movePlayer(2438,5168,0);
    	}
    	
    	public void enterCaves() {
    		c.getPA().movePlayer(2413,5117, c.playerId * 4);
    		c.waveId = 0;
    		c.tzhaarToKill = -1;
    		c.tzhaarKilled = -1;
    		Server.fightCaves.spawnNextWave(c);
    	}
    or possibly this in client.java
    Code:
    public void correctCoordinates() {
    		if (inPcGame()) {
    			getPA().movePlayer(2657, 2639, 0);
    		}
    		if (inFightCaves()) {
    			getPA().movePlayer(absX, absY, playerId * 4);
    			sendMessage("Your wave will start in 10 seconds.");
    			EventManager.getSingleton().addEvent(new Event() {
    				public void execute(EventContainer c) {
    					Server.fightCaves.spawnNextWave((Client)Server.playerHandler.players[playerId]);
    					c.stop();
    				}
    				}, 10000);
    		
    		}
    	
    	}
     

  6. #6  
    Banned

    Join Date
    Mar 2010
    Posts
    1,048
    Thanks given
    239
    Thanks received
    226
    Rep Power
    0
    Look at spawnNextWave and see what's happening there.
     

  7. #7  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    27
    Posts
    4,777
    Thanks given
    199
    Thanks received
    1,255
    Rep Power
    1110
    almost 100% positive this is it.

    open actionhandler.java and find case 1814:

    under the break; add this
    Code:
    case 9356:
    			c.getPA().enterCaves();
    			c.sendMessage("PLEASE LOG OUT AND BACK IN FOR YOUR WAVES TO START!");
    		break;
     

  8. #8  
    Registered Member

    Join Date
    Oct 2009
    Age
    25
    Posts
    1,037
    Thanks given
    4
    Thanks received
    8
    Rep Power
    338
    No , we want it so you dont have to relog and it starts automatically ..
     

  9. #9  
    Registered Member
    Join Date
    Aug 2008
    Posts
    2,420
    Thanks given
    721
    Thanks received
    595
    Rep Power
    1233
    Quote Originally Posted by Acid View Post
    No , we want it so you dont have to relog and it starts automatically ..
    Yup, I thought of making it teleport you to the center, then kicking you..? But that would be a piss off for players.

    Which is why I want it to auto start waves.
    [Only registered and activated users can see links. ]
     

  10. #10  
    Member

    Join Date
    Dec 2008
    Posts
    1,008
    Thanks given
    529
    Thanks received
    225
    Rep Power
    268
    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
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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

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