Thread: Fight caves [pi]

Results 1 to 6 of 6
  1. #1 Fight caves [pi] 
    Banned

    Join Date
    Sep 2009
    Posts
    904
    Thanks given
    139
    Thanks received
    55
    Rep Power
    0
    Could Anyone help me add Fight Caves?


    Well, its added but when I go in the cave, NO NPC'S spawn...
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Sep 2009
    Posts
    904
    Thanks given
    139
    Thanks received
    55
    Rep Power
    0
    b u m p
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jul 2011
    Age
    30
    Posts
    745
    Thanks given
    2,207
    Thanks received
    451
    Rep Power
    0
    Well atleast you can enter your cave... I'm still trying to find out how to get PLayers into it so I can start constructing a full fight cave...

    Try relog?
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Sep 2009
    Posts
    904
    Thanks given
    139
    Thanks received
    55
    Rep Power
    0
    even when i tele, mods/ admins can tele to me.
    Reply With Quote  
     

  5. #5  
    Donator
    Ed17's Avatar
    Join Date
    Jun 2011
    Posts
    296
    Thanks given
    42
    Thanks received
    14
    Rep Power
    10
    Add this to ActionHandler.
    case 9356:
    c.getPA().enterCaves();
    Jad!");
    break;
    Add this in the PlayerAssistant class

    public void enterCaves() {
    c.getPA().movePlayer(2413,5117, c.playerId * 4);
    c.waveId = 0;
    c.tzhaarToKill = -1;
    c.tzhaarKilled = -1;
    Server.fightCaves.spawnNextWave(c);
    c.jadSpawn();
    }
    this to you FightCaves:
    package server.model.minigames;

    import server.model.players.Client;
    import server.Server;

    public class FightCaves {
    private final int[][] WAVES = {{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;
    }


    }
    Hope it helps.
    Reply With Quote  
     

  6. #6  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Code:
    public void startFightCaves(final Client c) {
         EventManager.getSingleton().addEvent(new Event() {
              public void execute(EventContainer e) {
                   Server.fightCaves.spawnNextWave(c);
                   e.stop();
             }
         }
    }
    add this to playerassistant.java and in the entecave method add
    Code:
    startFightCaves(c);
    This way it gives you 10 seconds before spawning a new wave. U need eventmanager to use this.
    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. Fight Caves
    By Demon in forum Requests
    Replies: 7
    Last Post: 09-02-2010, 04:30 AM
  2. Fight Caves Help.
    By immortalz0 in forum Help
    Replies: 0
    Last Post: 08-07-2010, 07:57 AM
  3. [PI] Fight caves
    By pk george in forum Help
    Replies: 1
    Last Post: 06-17-2010, 09:33 PM
  4. Need Help On Fight Caves Please
    By Damien in forum Help
    Replies: 9
    Last Post: 08-29-2009, 02:55 AM
  5. fight caves
    By pure barrage in forum Tutorials
    Replies: 33
    Last Post: 10-15-2008, 05:49 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •