Thread: [PI] CMD Run Error

Results 1 to 3 of 3
  1. #1 [PI] CMD Run Error 
    Registered Member

    Join Date
    Aug 2010
    Posts
    467
    Thanks given
    49
    Thanks received
    42
    Rep Power
    81
    So, when I run my CMD and try to log onto the Client, I get this

    Code:
    [3/4/12 9:19 AM]: [REGISTERED]: labyrinth
    [3/4/12 9:19 AM]: java.lang.NullPointerException
    [3/4/12 9:19 AM]:       at server.model.npcs.NPCHandler.loadSpell(NPCHandler.jav
    a:2336)
    [3/4/12 9:19 AM]:       at server.model.npcs.NPCHandler.attackPlayer(NPCHandler.
    java:2543)
    [3/4/12 9:19 AM]:       at server.model.npcs.NPCHandler.process(NPCHandler.java:
    1404)
    [3/4/12 9:19 AM]:       at server.Server.main(Server.java:127)
    [3/4/12 9:19 AM]: A fatal exception has been thrown!
    I have looked at all the Lines it shows (2336, 2543, 1404) but I haven't found anything wrong with them? Can anyone tell me why this could be happening & possibly a fix for it?
    I THINK it has something to do with this/these pieces of code
    Code:
    					if (special)
    						loadSpell2(i);
    					else
    						loadSpell(i);
    Code:
                        } else if (special) {
                            loadSpell2(i);
                        } else {
                            loadSpell(i);
                        }
    If you need me to post the WHOLE entire code, please tell me so.

    I fixed it. Thanks.

    Tyler
    Reply With Quote  
     

  2. #2  
    Trap God

    Join Date
    Jun 2010
    Age
    28
    Posts
    570
    Thanks given
    27
    Thanks received
    26
    Rep Power
    4
    Why would you need 2 of the same code. Comment one out then compile and if error free run the server.
    "What was done to me was monstrous."
    "And they created a monster."
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Aug 2010
    Posts
    467
    Thanks given
    49
    Thanks received
    42
    Rep Power
    81
    Quote Originally Posted by Gangster Cudi View Post
    Why would you need 2 of the same code. Comment one out then compile and if error free run the server.
    They are in different parts of the Code.
    Here is the code
    Code:
                          /* if(npcs[i].npcType == 8281) {
                                npcs[i].projectile = c;
                                if(balanceForm == 0 || balanceForm == 1) {
                                  startAnimation(10680, i);
                                    /*   startAnimation(10680, i);
                                    n.projectileId = 1940;
                                    n.endGfx = 1941;*/
    //                                npcs[i].attackType = 2;
    //                            }
    //                            if(balanceForm == 2) {
    //                              //  balanceAttack(c,i,2);
    //                                startAnimation(10669, i);
    //                              /*  n.gfx100(1918);
    //                                n.attackType = 1;
    //                                n.projectileId = 1937;
    //                                n.endGfx = 1941;*/
    //                                npcs[i].attackType = 1;
    //                            }
    //                            if(balanceForm == 3) {
    //                             startAnimation(10681, i);
    //                             npcs[i].attackType = 0;
    //                            }
    //                        }
                        } else if (special) {
                            loadSpell2(i);
                        } else {
                            loadSpell(i);
                        }
                        usingSpecial = false;
                        handleSpecialNPC(npcs[i]);
                        if (npcs[i].attackType == 3) {
                            npcs[i].hitDelayTimer += 2;
                        }
                        if (multiAttacks(i) && npcs[i].npcType != 8281) {
                            multiAttackGfx(i, npcs[i].projectileId);
                            startAnimation(getCombatEmote(i, "Attack"), i);
                            npcs[i].oldIndex = c.playerId;
                            return;
                        }
                        if (npcs[i].projectileId > 0) {
                            int nX = Server.npcHandler.npcs[i].getX() + offset(i);
                            int nY = Server.npcHandler.npcs[i].getY() + offset(i);
                            int pX = c.getX();
                            int pY = c.getY();
                            int offX = (nY - pY) * -1;
                            int offY = (nX - pX) * -1;
                            c.getPA().createPlayersProjectile(nX, nY, offX, offY, 50, getProjectileSpeed(i), npcs[i].projectileId, 43, 31, !npcs[i].splash ? -c.getId() - 1 : 0, 65);
                        }
                        c.underAttackBy2 = i;
                        c.singleCombatDelay2 = System.currentTimeMillis();
                        npcs[i].oldIndex = c.playerId;
                        if (npcs[i].npcType != 8133 && !usingSpecial && npcs[i].npcType != 8281) {
                            startAnimation(getCombatEmote(i, "Attack"), i);
                        } else if(npcs[i].npcType == 8281) {
                            if(balanceForm == 3) { //range 8283
                                startAnimation(10681, i);
                                npcs[i].gfx100(1918);
                                npcs[i].projectileId = 1017;
                                npcs[i].endGfx = 1930;
                                npcs[i].attackType = 1;
                            }
                            if(balanceForm != 3 || balanceForm != 2) {//8281 mage
                                startAnimation(10680, i);
                                npcs[i].gfx100(1939);
                                npcs[i].endGfx = 1941;
                                npcs[i].projectileId = 1940;
                                npcs[i].attackType = 2;
                            }
                            if(balanceForm == 2) {//8282 melee
                                startAnimation(10669, i);
                                npcs[i].endGfx = 0;
                                npcs[i].projectileId = 0;
                                npcs[i].attackType = 0;
                            }
                        }
                        c.getPA().removeAllWindows();
                    }
                }
    Code:
    	public void attackNPC(int c, int i) {
    		if (npcs[i] != null) {
    			if (npcs[i].isDead)
    				return;
    			if (!npcs[i].inMulti() && npcs[i].underAttackBy > 0
    					&& npcs[i].underAttackBy != npcs[c].npcId) {
    				return;
    			}
    			if (!npcs[i].inMulti()
    					&& (npcs[c].underAttackBy > 0 || (npcs[c].underAttackBy2 > 0 && npcs[c].underAttackBy2 != i))) {
    				npcs[i].killerId = 0;
    				return;
    			}
    			if (npcs[i].heightLevel != npcs[c].heightLevel) {
    				npcs[i].killerId = 0;
    				return;
    			}
    			follownpc(i, c);
    			npcs[i].facePlayer(npcs[c].npcId);
    			npcs[i].facenpc(npcs[c].npcId);
    			boolean special = false;// specialCase(c,i);
    			if (goodDistance(npcs[i].getX(), npcs[i].getY(), npcs[c].getX(),
    					npcs[c].getY(), distanceRequired(i)) || special) {
    				if (npcs[c].actionTimer <= 0) {
    					npcs[i].facePlayer(npcs[c].npcId);
    					npcs[i].attackTimer = getNpcDelay(i);
    					npcs[i].hitDelayTimer = getHitDelay(i);
    					npcs[i].attackType = 0;
    
    					if (special)
    						loadSpell2(i);
    					else
    
    						loadSpell(i);
    
    					npcs[c].underAttackBy2 = i;
    					npcs[c].actionTimer = 7;
    					npcs[i].actionTimer = 5;
    					int damg = Misc.random(npcs[i].maxHit);
    					npcs[c].handleHitMask(damg);
    					npcs[c].HP -= damg;
    					npcs[c].hitUpdateRequired2 = true;
    					npcs[c].hitUpdateRequired = true;
    
    					npcs[i].oldIndexNPC = npcs[c].npcId;
    					startAnimation(getAttackEmote(i), i);
    					 //c.getPA().removeAllWindows();
    				}
    			}
    		}
    	}
    
    	public void attacknpc(int i) {
    		if (npcs[i] != null) {
    			if (npcs[i].isDead)
    				return;
    			if (!npcs[i].inMulti() && npcs[i].underAttackBy > 0) {
    				npcs[i].killerId = 0;
    				return;
    			}
    
    			boolean special = false;// specialCase(c,i);
    			if (goodDistance(npcs[i].getX(), npcs[i].getY(),
    					Server.npcHandler.npcs[npcs[i].attacknpc].getX(),
    					Server.npcHandler.npcs[npcs[i].attacknpc].getY(), 1)
    					|| special) {
    				if (npcs[i].actionTimer <= 0
    						&& npcs[i].isDead == false
    						&& Server.npcHandler.npcs[npcs[i].attacknpc].isDead == false) {
    
    					npcs[i].facePlayer(Server.npcHandler.npcs[npcs[i].attacknpc].npcId);
    					Server.npcHandler.npcs[npcs[i].attacknpc]
    							.facePlayer(npcs[i].npcId);
    					npcs[i].attackTimer = getNpcDelay(i);
    					npcs[i].hitDelayTimer = getHitDelay(i);
    					npcs[i].attackType = 0;
    					if (special)
    						loadSpell2(i);
    					else
    						loadSpell(i);
    					if (npcs[i].attackType == 3)
    						npcs[i].hitDelayTimer += 2;
    					if (multiAttacks(i)) {
    						multiAttackGfx(i, npcs[i].projectileId);
    						startAnimation(getAttackEmote(i), i);
    						npcs[i].oldIndex = Server.npcHandler.npcs[npcs[i].attacknpc].npcId;
    						return;
    					}
    					Server.npcHandler.npcs[npcs[i].attacknpc]
    							.handleHitMask(Misc.random(npcs[i].maxHit));
    					if (Server.npcHandler.npcs[npcs[i].attacknpc].actionTimer <= 0
    							&& npcs[i].isDead == false
    							&& Server.npcHandler.npcs[npcs[i].attacknpc].isDead == false) {
    
    						Server.npcHandler.npcs[npcs[i].attacknpc].actionTimer = 7;
    						Server.npcHandler.npcs[npcs[i].attacknpc]
    								.handleHitMask(Misc
    										.random(Server.npcHandler.npcs[npcs[i].attacknpc].maxHit));
    						startAnimation(getAttackEmote(npcs[i].attacknpc),
    								npcs[i].attacknpc);
    					}
    					npcs[i].actionTimer = 7;
    					npcs[i].npcIndex = Server.npcHandler.npcs[npcs[i].attacknpc].npcId;
    					startAnimation(getAttackEmote(i), i);
    					Server.npcHandler.npcs[npcs[i].attacknpc].attacknpc = i;
    
    				}
    			}
    		}
    	}

    Tyler
    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. [PI] run cmd error please Really need this!!
    By imsuperman05 in forum Help
    Replies: 6
    Last Post: 07-04-2011, 09:24 PM
  2. [PI] Error in Run CMD
    By viality in forum Help
    Replies: 1
    Last Post: 02-28-2011, 09:59 AM
  3. [PI] Error in Run CMD
    By viality in forum Help
    Replies: 2
    Last Post: 02-24-2011, 12:15 PM
  4. Replies: 4
    Last Post: 08-17-2010, 01:27 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
  •