Thread: fight caves

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1 fight caves 
    Registered Member
    Join Date
    Feb 2008
    Posts
    234
    Thanks given
    0
    Thanks received
    4
    Rep Power
    9
    this isnt one with just a bunch of monsters or height levels this summons the next one after you kill it.

    Purpose: to have a firecape minigame (please make them untradable/ unpkable

    Difficulty: 3

    Assumed Knowledge: basic coding + c&p

    Server Base: project czar

    Classes Modified: client + npchandler

    Procedure
    step 1: declare all this
    Code:
    public boolean inCaves() {
    if((absX >= 2371 && absX <= 2424 && absY >= 5062 && absY <= 5117) || heightLevel == 1)
    return true;
    else
    return false;
    }
    Code:
    public void SummonNewNPC(int npcID) {
    if(inCaves()) {
            server.npcHandler.newSummonedNPC(npcID, absX, absY-1, heightLevel, absX-1, absY-1, absX+1, absY-1, 1, server.npcHandler.GetNpcListHP(npcID), false, playerId);
            summonedNPCS++;
            actionTimer = 8;
            }
    else {
    sendMessage("you failed to spawn next monster because you are not");
    sendMessage("in fight caves");
    }
    }
    
    public void gotoCaves(int npcID) {
            server.npcHandler.newSummonedNPC(npcID, 2402, 5094-1, heightLevel, 2402-1, 5094-1, 2402+1, 5094-1, 1, server.npcHandler.GetNpcListHP(npcID), false, playerId);
            summonedNPCS++;
            actionTimer = 8;
            }
    
    public void summonJad(int npcID) {
    if(inCaves()) {
            server.npcHandler.newSummonedNPC(npcID, 2420, 5083-1, heightLevel, 2420-1, 5083-1, 2420+1, 5083-1, 1, server.npcHandler.GetNpcListHP(npcID), false, playerId);
            summonedNPCS++;
            actionTimer = 8;
            }
    else {
    sendMessage("you failed to spawn next monster because you are not");
    sendMessage("in fight caves");
    }
    }
    step 2: control + f
    Code:
    case 9356:
    if you dont have it thats fine, just go into case 185 and add.

    Code:
    case 9356: // fight caves
     teleportToX = 2402;
     teleportToY = 5094;
    gotoCaves(52);
    break;
    
    case 9357: //fight caves exit
    {
    sendMessage("you wimp you left the minigame.");
    		teleportToX = 3094;//change these coords to your home area.
    		teleportToY = 3243;//change these coords to your home area.
    		heightLevel -= 0;
    }
    break;
    Code:
    if(command.startsWith("firecape")) {//teleport to firecape minigame
    				sendMessage("Welcome to the fight caves, do the waves and work up to jad");
    				teleportToX = 2439;
    				teleportToY = 5171;			
    }
    step 3: the actual minigame
    open up npchandler.java

    find
    Code:
    if(p != null && person != null)
    it should be like the 3rd one down

    if you see
    Code:
    if(p != null && person != null) 
    {
       if(p != null && person != null)
    { 
         if (person.distanceToPoint(npcs[i].absX, npcs[i].absY) >= 5)
         if (npcs[i].npcType != 1158 || npcs[i].npcType == 2745 || npcs[i].npcType == 2025 || npcs[i].npcType == 2026 || npcs[i].npcType == 2027 || npcs[i].npcType == 2028 || npcs[i].npcType == 2029 || npcs[i].npcType == 2030 || npcs[i].npcType == 52 || npcs[i].npcType == 119 || npcs[i].npcType == 145 || npcs[i].npcType == 158 || npcs[i].npcType == 221 || npcs[i].npcType == 58 || npcs[i].npcType == 112 || npcs[i].npcType == 141 || npcs[i].npcType == 193 || npcs[i].npcType == 502 || npcs[i].npcType == 655 || npcs[i].npcType == 677 || npcs[i].npcType == 837 || npcs[i].npcType == 1115 || npcs[i].npcType == 1203 || npcs[i].npcType == 1220 || npcs[i].npcType == 1279 || npcs[i].npcType == 2883 || npcs[i].npcType == 2546 || npcs[i].npcType == 2467 || npcs[i].npcType == 3200 || npcs[i].npcType == 49 || npcs[i].npcType == 83 || npcs[i].npcType == 3494)
    {
        npcs[i].RandomWalk = true;
    your good.

    add
    Code:
    || npcs[i].npcType == 52 || npcs[i].npcType == 119 || npcs[i].npcType == 145 || npcs[i].npcType == 158 || npcs[i].npcType == 221 || npcs[i].npcType == 58 || npcs[i].npcType == 112 || npcs[i].npcType == 141 || npcs[i].npcType == 193 || npcs[i].npcType == 502 || npcs[i].npcType == 655 || npcs[i].npcType == 677 || npcs[i].npcType == 837 || npcs[i].npcType == 1115 || npcs[i].npcType == 1203 || npcs[i].npcType == 1220 || npcs[i].npcType == 1279 || npcs[i].npcType == 2883 || npcs[i].npcType == 2546 || npcs[i].npcType == 2467 || npcs[i].npcType == 3200 || npcs[i].npcType == 49 || npcs[i].npcType == 83 || npcs[i].npcType == 3494)
    and for the next to things similar to that do the same.

    step 4:
    find
    Code:
    System.out.println("Npc id =" +NPCID);
    then below that add
    Code:
    if(npcs[NPCID].npcType == 52) //wave 1
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 2.");
    ppl.SummonNewNPC(119);
    }
    if(npcs[NPCID].npcType == 119) //wave 2
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 3.");
    ppl.SummonNewNPC(145);
    }
    if(npcs[NPCID].npcType == 145) //wave 3
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 4.");
    ppl.SummonNewNPC(158);
    }
    if(npcs[NPCID].npcType == 158) //wave 4
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 5.");
    ppl.SummonNewNPC(221);
    }
    if(npcs[NPCID].npcType == 221) //wave 5
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 6.");
    ppl.SummonNewNPC(58);
    }
    if(npcs[NPCID].npcType == 58) //wave 6
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 7.");
    ppl.SummonNewNPC(112);
    }
    if(npcs[NPCID].npcType == 112) //wave 7
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 8.");
    ppl.SummonNewNPC(141);
    }
    if(npcs[NPCID].npcType == 141) //wave 8
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 9.");
    ppl.SummonNewNPC(193);
    }
    if(npcs[NPCID].npcType == 193) //wave 9
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 10.");
    ppl.SummonNewNPC(502);
    }
    if(npcs[NPCID].npcType == 502) //wave 10
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 11.");
    ppl.SummonNewNPC(655);
    }
    if(npcs[NPCID].npcType == 655) //wave 11
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 12.");
    ppl.SummonNewNPC(677);
    }
    if(npcs[NPCID].npcType == 677) //wave 12
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 13.");
    ppl.SummonNewNPC(837);
    }
    if(npcs[NPCID].npcType == 837) //wave 13
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 14.");
    ppl.SummonNewNPC(1115);
    }
    if(npcs[NPCID].npcType == 1115) //wave 14
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 15.");
    ppl.SummonNewNPC(1203);
    }
    if(npcs[NPCID].npcType == 1203) //wave 15
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 16.");
    ppl.SummonNewNPC(1220);
    }
    if(npcs[NPCID].npcType == 1220) //wave 16
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 17.");
    ppl.SummonNewNPC(1279);
    }
    if(npcs[NPCID].npcType == 1279) //wave 17
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 18.");
    ppl.SummonNewNPC(2883);
    }
    if(npcs[NPCID].npcType == 2883) //wave 18
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("You are now at wave 19.");
    ppl.SummonNewNPC(2546);
    ppl.teleportToX = 2405;
    ppl.teleportToY = 5087;
    }
    if(npcs[NPCID].npcType == 2546) //wave 19
    {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.summonJad(2745);
    ppl.teleportToX = 2419;
    ppl.teleportToY = 5107;
    ppl.sendFrame200(4883, 591);
    ppl.sendFrame126("TzHaar-Mej-Kah", 4884);
    ppl.sendFrame126("Here comes TzTok-Jad", 4885);
    ppl.sendFrame126("Click here to continue", 4886);
    }
    if(npcs[NPCID].npcType == 2745) {
    int Player = npcs[NPCID].StartKilling;
    client ppl = (client) server.playerHandler.players[Player];
    ppl.sendMessage("Good Job!, The Jad Is Dead!");
    ppl.sendFrame200(4883, 591);
    ppl.sendFrame126("TzHaar-Mej-Kah", 4884);
    ppl.sendFrame126("Well Done, You have defeated the TzTok-Jad", 4885);
    ppl.sendFrame126("Click here to continue", 4886);
    ppl.teleportToX = 3094;
    ppl.teleportToY = 3243;
    ppl.sendFrame75(2618, 4883);
    ppl.sendFrame164(4882);
    ppl.NpcDialogueSend = true;
    ppl.addItem(6570, 100);
    ppl.startAnimation(862);
    }
    step 5: find
    Code:
    server.playerHandler.players[Player].IsDead == true
    after the else right below there add
    Code:
    } else if (npcs[NPCID].npcType == 52) {
                                                            npcs[NPCID].animNumber = 1184; //wave 1
                                                            hitDiff = 4 + misc.random(6);
    						} else if (npcs[NPCID].npcType == 119) {
                                                            npcs[NPCID].animNumber = 1184; //wave 2
                                                            hitDiff = 4 + misc.random(7);
    						} else if (npcs[NPCID].npcType == 145) {
                                                            npcs[NPCID].animNumber = 1184; //wave 3
                                                            hitDiff = 4 + misc.random(8);
    						} else if (npcs[NPCID].npcType == 158) {
                                                            npcs[NPCID].animNumber = 1184; //wave 4
                                                            hitDiff = 4 + misc.random(9);
    						} else if (npcs[NPCID].npcType == 221) {
                                                            npcs[NPCID].animNumber = 1184; //wave 5
                                                            hitDiff = 4 + misc.random(10);
    						} else if (npcs[NPCID].npcType == 58) {
                                                            npcs[NPCID].animNumber = 1184; //wave 6
                                                            hitDiff = 4 + misc.random(10);
    						} else if (npcs[NPCID].npcType == 112) {
                                                            npcs[NPCID].animNumber = 1184; //wave 7
                                                            hitDiff = 4 + misc.random(10);
    						} else if (npcs[NPCID].npcType == 141) {
                                                            npcs[NPCID].animNumber = 1184; //wave 8
                                                            hitDiff = 4 + misc.random(10);
    						} else if (npcs[NPCID].npcType == 193) {
                                                            npcs[NPCID].animNumber = 1184; //wave 9
                                                            hitDiff = 4 + misc.random(10);
    						} else if (npcs[NPCID].npcType == 502) {
                                                            npcs[NPCID].animNumber = 1184; //wave 10
                                                            hitDiff = 4 + misc.random(12);
    						} else if (npcs[NPCID].npcType == 655) {
                                                            npcs[NPCID].animNumber = 1184; //wave 11
                                                            hitDiff = 4 + misc.random(12);
    						} else if (npcs[NPCID].npcType == 677) {
                                                            npcs[NPCID].animNumber = 1184; //wave 12
                                                            hitDiff = 4 + misc.random(16);
    						} else if (npcs[NPCID].npcType == 837) {
                                                            npcs[NPCID].animNumber = 1184; //wave 13
                                                            hitDiff = 4 + misc.random(16);
    						} else if (npcs[NPCID].npcType == 1115) {
                                                            npcs[NPCID].animNumber = 1184; //wave 14
                                                            hitDiff = 4 + misc.random(16);
    						} else if (npcs[NPCID].npcType == 1203) {
                                                            npcs[NPCID].animNumber = 1184; //wave 15
                                                            hitDiff = 4 + misc.random(20);
    						} else if (npcs[NPCID].npcType == 1220) {
                                                            npcs[NPCID].animNumber = 1184; //wave 16
                                                            hitDiff = 4 + misc.random(20);
    						} else if (npcs[NPCID].npcType == 1279) {
                                                            npcs[NPCID].animNumber = 1184; //wave 17
                                                            hitDiff = 4 + misc.random(23);
    						} else if (npcs[NPCID].npcType == 2883) {
                                                            npcs[NPCID].animNumber = 1184; //wave 18
                                                            hitDiff = 4 + misc.random(23);
    						} else if (npcs[NPCID].npcType == 2546) {
                                                            npcs[NPCID].animNumber = 1184; //wave 19
                                                            hitDiff = 4 + misc.random(23);
    						 }
    and if you dont have a jad attack add
    Code:
     
     }  else if (npcs[NPCID].npcType == 2745 && misc.random(2) == 1) {
                                                            npcs[NPCID].animNumber = 2655; //poke
                                                            npcs[NPCID].actionTimer = 7;
                                                            hitDiff = 4 + misc.random(32);                                                                                         
                                                    } else if (npcs[NPCID].npcType == 2745 && misc.random(3) == 2) {
                                                            npcs[NPCID].animNumber = 2652; //slash
                                                            gfxAll(451, EnemyY, EnemyX);
                                                            npcs[NPCID].actionTimer = 1;
                                                            hitDiff = 4 + misc.random(34);                                                                   
                                                    }  else if (npcs[NPCID].npcType == 2745 && misc.random(5) == 3) {
                                                            npcs[NPCID].animNumber = 2656; //crush
                                                            gfxAll(451, EnemyY, EnemyX);
                                                            npcs[NPCID].actionTimer = 1;
                                                            hitDiff = 4 + misc.random(28);
    if you dont have summon npc variable, here it is add this in npchandler
    Code:
    	public void newSummonedNPC(int npcType, int x, int y, int heightLevel, int rangex1, int rangey1, int rangex2, int rangey2, int WalkingType, int HP, boolean Respawns, int summonedBy) {
    		// first, search for a free slot
    		int slot = -1;
    		for (int i = 1; i < maxNPCs; i++) {
    			if (npcs[i] == null) {
    				slot = i;
    				break;
    			}
    		}
     

  2. #2  
    Registered Member
    wh1p's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    1,983
    Thanks given
    26
    Thanks received
    285
    Rep Power
    320
    Kinda crapy, Good Job anyways
     

  3. #3  
    Registered Member
    Kelvin's Avatar
    Join Date
    Jun 2007
    Posts
    1,433
    Thanks given
    48
    Thanks received
    33
    Rep Power
    269
    Quote Originally Posted by wh1p View Post
    Kinda crapy, Good Job anyways
    it is crap, cuz if you killed 1 monster, then your going to next wave
    [Only registered and activated users can see links. ]
     

  4. #4  
    Registered Member
    Kelvin's Avatar
    Join Date
    Jun 2007
    Posts
    1,433
    Thanks given
    48
    Thanks received
    33
    Rep Power
    269
    Quote Originally Posted by The Linux View Post
    Just add more summonnpcs then more will come
    Naw, He added if you kill 1 monster, next wave
    [Only registered and activated users can see links. ]
     

  5. #5  
    my rep is h4x0r3d


    Join Date
    Dec 2006
    Posts
    1,760
    Thanks given
    10
    Thanks received
    8
    Rep Power
    207
    Then add more dipshit. L2R?
    Quote Originally Posted by super_ View Post
    this is shit. you are shit. gtfo retard.
     

  6. #6  
    Banned

    Join Date
    Oct 2007
    Age
    28
    Posts
    2,733
    Thanks given
    32
    Thanks received
    53
    Rep Power
    0
    how many "waves" is this?
     

  7. #7  
    kilermage
    Guest
    Your missing the summonedNPCS++; variable. So Ppl will get errors.
     

  8. #8  
    Respected Member


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    32
    Posts
    12,549
    Thanks given
    177
    Thanks received
    5,784
    Discord
    View profile
    Rep Power
    5000
    you didnt make it single-player, and some people might not have SummonedNPC, so provde that void with the tutorial..this isnt the way i wouldve done it, but good job anyway.

     

  9. #9  
    kilermage
    Guest
    I think it's not his cause he is missing some variables, also case 185 is a button case not an object case.

    EDIT: Also he didn't finish the code for the npc dead. The { has no }

    Code:
    else if (npcs[NPCID].npcType == 2467) {
    EDIT 2: He didn't supply the newSummonedNPC method that is suppose to go in npchandler.java
     

  10. #10  
    Registered Member
    Join Date
    Feb 2008
    Posts
    234
    Thanks given
    0
    Thanks received
    4
    Rep Power
    9
    okay guys i fixed up everything i gave u the void u needed and if u wanted to do something with waves, use the same monsters and make it so u need like a kc of 3 to go to the next waves, and that code i didnt finish was part of my gwd but i took out.
     

Page 1 of 4 123 ... LastLast

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
  •