Thread: CrossBow Error

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 CrossBow Error 
    Registered Member
    Join Date
    Nov 2014
    Posts
    273
    Thanks given
    26
    Thanks received
    8
    Discord
    View profile
    Rep Power
    72
    Shooting cross bow with dragon bolts (e) when it does the special it gives this error...

    Reply With Quote  
     

  2. #2  
    Community Veteran


    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,833
    Thanks given
    187
    Thanks received
    306
    Discord
    View profile
    Rep Power
    770
    You are giving it a value that is above the length of your array.
    TRy insert a value that is within the array. Just check RangeExtras.java at line 48


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2014
    Posts
    273
    Thanks given
    26
    Thanks received
    8
    Discord
    View profile
    Rep Power
    72
    Quote Originally Posted by arch337 View Post
    You are giving it a value that is above the length of your array.
    TRy insert a value that is within the array. Just check RangeExtras.java at line 48
    That is the Max Players that it leads me too which I have changed to 500 in attempt to fix it but I’ll give another look when I get home.
    Reply With Quote  
     

  4. #4  
    Community Veteran


    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,833
    Thanks given
    187
    Thanks received
    306
    Discord
    View profile
    Rep Power
    770
    Quote Originally Posted by scoping king View Post
    That is the Max Players that it leads me too which I have changed to 500 in attempt to fix it but I’ll give another look when I get home.
    Do you have 593 players online?! It seems more like a npc id if anything aka the 593.
    Just show all the code for the method that include that line.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2014
    Posts
    273
    Thanks given
    26
    Thanks received
    8
    Discord
    View profile
    Rep Power
    72
    Quote Originally Posted by arch337 View Post
    Do you have 593 players online?! It seems more like a npc id if anything aka the 593.
    Just show all the code for the method that include that line.
    Edit: Nevermind fixed just had to up my players count for some odd reason.
    Reply With Quote  
     

  6. #6  
    Community Veteran


    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,833
    Thanks given
    187
    Thanks received
    306
    Discord
    View profile
    Rep Power
    770
    Quote Originally Posted by scoping king View Post
    Edit: Nevermind fixed just had to up my players count for some odd reason.
    Not sure why you would need to use players count for firing a bolt from a crossbow.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. #7  
    WhiteDownMb | HYBRID JEFE
    Brett the Don's Avatar
    Join Date
    Dec 2009
    Posts
    2,064
    Thanks given
    303
    Thanks received
    507
    Rep Power
    2191
    Im curious so see the code and why player count is causing a problem firing a bolt lol.

    All of humanity's problems stem from man's
    inability to sit quietly in a room by himself

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Registered Member
    King Zeus's Avatar
    Join Date
    Jan 2018
    Posts
    182
    Thanks given
    26
    Thanks received
    72
    Rep Power
    120
    Strange that playercount affects bolts... glad you fixed it though
    Reply With Quote  
     

  9. #9  
    Registered Member viacom's Avatar
    Join Date
    Jul 2012
    Posts
    68
    Thanks given
    0
    Thanks received
    10
    Rep Power
    51
    Quote Originally Posted by scoping king View Post
    Edit: Nevermind fixed just had to up my players count for some odd reason.

    That's not a proper fix.. lol....
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Nov 2014
    Posts
    273
    Thanks given
    26
    Thanks received
    8
    Discord
    View profile
    Rep Power
    72
    Quote Originally Posted by Brett the Don View Post
    Im curious so see the code and why player count is causing a problem firing a bolt lol.
    I’ll post when I get back home but I was thinking the same exact thing, I don’t understand why player count fixes the issue

    Quote Originally Posted by viacom View Post
    That's not a proper fix.. lol....
    Tell me about it lol, just as odd to me.

    Quote Originally Posted by King Zeus View Post
    Strange that playercount affects bolts... glad you fixed it though
    Thanks lol, but still weird.

    Code:
    public static void crossbowSpecial(Client c, int i) {
    		Client p = (Client)PlayerHandler.players[i]; //  error part
    		NPC n = (NPC)NPCHandler.npcs[i];
    
    		c.crossbowDamage = 1.4;
    
    		switch (c.lastArrowUsed) {
    			case 9236: // Lucky Lightning
    				createCombatGFX(c, i, 749, false);
    				c.crossbowDamage = 1.25;
    				break;
    			case 9237: // Earth's Fury
    				createCombatGFX(c, i, 755, false);
    				break;
    			case 9238: // Sea Curse
    				createCombatGFX(c, i, 750, false);
    				c.crossbowDamage = 1.10;
    				break;
    			case 9239: // Down to Earth
    				createCombatGFX(c, i, 757, false);
     				if(c.playerIndex > 0) {
    					p.playerLevel[6] -= 2;
    					p.getPA().refreshSkill(6);
    					p.sendMessage("Your magic has been lowered!");
    				}
    				break;
    			case 9240: // Clear Mind
    				createCombatGFX(c, i, 751, false);
    				if(c.playerIndex > 0) {
    					p.playerLevel[5] -= 2;
    					p.getPA().refreshSkill(5);
    					p.sendMessage("Your prayer has been lowered!");
    					c.playerLevel[5] += 2;
    					if(c.playerLevel[5] >= c.getPA().getLevelForXP(c.playerXP[5])) {
    						c.playerLevel[5] = c.getPA().getLevelForXP(c.playerXP[5]);
    					}
    					c.getPA().refreshSkill(5);
    				}
    				break;
    			case 9241: // Magical Posion
    				createCombatGFX(c, i, 752, false);
    				if(c.playerIndex > 0) {
    					p.getPA().appendPoison(6);
    				}
    				break;
    			case 9242: // Blood Forfiet
    				createCombatGFX(c, i, 754, false);
    
    				if(c.playerLevel[3] - c.playerLevel[3]/20 < 1) {
    					break;
    				}
    				c.handleHitMask(c.playerLevel[3]/20);
    				c.dealDamage(c.playerLevel[3]/20);
    				if(c.npcIndex > 0) {
    					n.handleHitMask(n.HP/10);
    					n.dealDamage(n.HP/10);
    				} else if(c.playerIndex > 0) {
    					p.handleHitMask(c.playerLevel[3]/10);
    					p.dealDamage(c.playerLevel[3]/10);
    				}
    				break;
    			case 9243: // Armour Piercing
    				createCombatGFX(c, i, 758, true);
    				c.crossbowDamage = 1.15;
    				c.ignoreDefence = true;
    				break;
    				
    				
    			case 9244: // Dragon's Breath
    				createCombatGFX(c, i, 756, false);
    				if(c.playerEquipment[c.playerShield] != 1540 || c.playerEquipment[c.playerShield] != 11283
    					|| c.playerEquipment[c.playerShield] != 11284) {
    						c.crossbowDamage = 1.48;
    				}
    				break;
    				
    				
    			case 9245:
                    createCombatGFX(c, i, 753, true);
                    c.crossbowDamage = 1.15;
                    int heal = (int) (c.boltDamage / 3);
                    if (c.playerLevel[3] + heal > c.getPA().getLevelForXP
                                    (c.playerXP[3])) {
                                            c.playerLevel[3] = c.getPA().getLevelForXP(c.playerXP[3]);
                                    } else {
                                            c.playerLevel[3] += heal;
                                            c.sendMessage("You heal 25% of your current hit.");
                                    }
                    break;
    		}
    	}
    Reply With Quote  
     

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)


User Tag List

Similar Threads

  1. pi crossbow error
    By is whoopie in forum Help
    Replies: 2
    Last Post: 08-11-2012, 11:04 AM
  2. Chaotic crossbow 4 Errors
    By Prince_ownt in forum Help
    Replies: 9
    Last Post: 12-18-2011, 11:22 PM
  3. Same error over and over?!!
    By phantomphreak in forum Tutorials
    Replies: 4
    Last Post: 09-28-2007, 01:20 AM
  4. [HELP]Render Error
    By Big J in forum General
    Replies: 3
    Last Post: 07-30-2007, 01:01 AM
  5. Error. Please reboot me :)
    By Inside Sin in forum Showcase
    Replies: 4
    Last Post: 05-13-2007, 03:39 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
  •