Thread: [PI] ResetTzhaar Problem

Results 1 to 8 of 8
  1. #1 [PI] ResetTzhaar Problem 
    Registered Member
    Join Date
    May 2011
    Posts
    66
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    I have just recently changed my teleport location of the resettzhaar public void. And I noticed that whenever someone dies they now spawn at the tzhaar caves. So what I'm thinking the problem is, is that when you die it resets the resettzhaar int and sends you to the place where I changed te resettzhaar area.

    Here is my error when someone dies:

    [2/26/12 1:50 PM]: Launching Torvapkz in 3... 2... 1... Starting...Now!
    [2/26/12 1:50 PM]: Server listening on port 168.144.32.116:43594
    [2/26/12 1:50 PM]: [REGISTERED]: tony
    [2/26/12 1:50 PM]: java.lang.NullPointerException
    [2/26/12 1:50 PM]: at server.model.players.PlayerAssistant.applyDead(Pla yer
    Assistant.java:1216)
    [2/26/12 1:50 PM]: at server.model.players.Client.process(Client.java:18 81)

    [2/26/12 1:50 PM]: at server.model.players.PlayerHandler.process(PlayerH and
    ler.java:142)
    [2/26/12 1:50 PM]: at server.Server.main(Server.java:176)
    I checked them all. Here is where all the errors are

    In PlayerAssistant (the whole void)
    [SPOIL]
    public void applyDead() {
    c.respawnTimer = 15;
    c.isDead = false;
    Client o = (Client) Server.playerHandler.players[c.killerId];
    if(c.duelStatus != 6) {
    c.killerId = findKiller();
    if(o != null) {
    c.playerKilled = c.playerId;
    if(o.duelStatus == 5) {
    o.duelStatus++;
    }
    int random2 = Misc.random(20);
    int randomz2 = Misc.random(5);
    if(random2 == 10) {
    if (randomz2 == 0)
    {
    Server.itemHandler.createGroundItem(o, 14876, c.getX(), c.getY(), 1, c.killerId);
    o.sendMessage("<col=990>Congratulations! you recieved a PvP artifact drop! Talk to the Mandrith at home!");
    }
    if (randomz2 == 1)//demise
    {
    Server.itemHandler.createGroundItem(o, 14877, c.getX(), c.getY(), 1, c.killerId);
    o.sendMessage("<col=990>Congratulations! you recieved a PvP artifact drop! Talk to the Mandrith at home!");
    }
    if (randomz2 == 2)
    {
    Server.itemHandler.createGroundItem(o, 14878, c.getX(), c.getY(), 1, c.killerId);
    o.sendMessage("<col=990>Congratulations! you recieved a PvP artifact drop! Talk to the Mandrith at home!");
    }
    if (randomz2 == 3)
    {
    Server.itemHandler.createGroundItem(o, 14879, c.getX(), c.getY(), 1, c.killerId);
    o.sendMessage("<col=990>Congratulations! you recieved a PvP artifact drop! Talk to the Mandrith at home!");
    }
    if (randomz2 == 4)
    {
    Server.itemHandler.createGroundItem(o, 14880, c.getX(), c.getY(), 1, c.killerId);
    o.sendMessage("<col=990>Congratulations! you recieved a PvP artifact drop! Talk to the Mandrith at home!");
    }
    if (randomz2 == 5)
    {
    Server.itemHandler.createGroundItem(o, 14881, c.getX(), c.getY(), 1, c.killerId);
    o.sendMessage("<col=990>Congratulations! you recieved a PvP artifact drop! Talk to the Mandrith at home!");
    }
    }
    if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    o.pkPoints = (o.pkPoints + 10);
    o.sendMessage("You recieved 10 DX Points,Double DX Points");
    o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    } else {
    o.sendMessage("You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    }
    }
    }
    c.faceUpdate(0);
    c.npcIndex = 0;
    c.playerIndex = 0;
    c.stopMovement();
    if (c.duelStatus <= 4) {
    c.sendMessage("Oh dear you are dead!");
    } else if(c.duelStatus != 6 || !c.inArena()) {
    c.sendMessage("You have lost the duel!");
    /*o.getPA().movePlayer(
    Config.DUELING_RESPAWN_X
    + (Misc.random(Config.RANDOM_DUELING_RESPAWN)),
    Config.DUELING_RESPAWN_Y
    + (Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);*/
    }
    resetDamageDone();
    c.DC++;
    o.KC++;
    c.specAmount = 10;
    c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
    c.lastVeng = 0;
    c.vengOn = false;
    resetFollowers();
    c.attackTimer = 10;
    if (Server.playerHandler.players[c.killerId].connectedFrom.equals(Server.playerHandler.players[c.playerKilled].connectedFrom)) {
    o.sendMessage("You Don't Recieve PK Points for killing yourself!");
    c.faceUpdate(0);
    c.npcIndex = 0;
    c.playerIndex = 0;
    c.stopMovement();
    if(c.duelStatus <= 4) {
    c.sendMessage("Oh dear you are dead!");
    } else if(c.duelStatus != 6) {
    c.sendMessage("You have lost the duel!");
    }
    resetDamageDone();
    c.lastVeng = 0;
    c.vengOn = false;
    resetFollowers();
    c.attackTimer = 10;
    removeAllWindows();
    c.tradeResetNeeded = true;
    return;
    }
    }
    [/SPOIL]

    In Client.java (just the apply dead
    [SPOIL]
    if(isDead && respawnTimer == -6) {
    getPA().applyDead();
    }
    [/SPOIL]


    And I also have the common errors in Server.java and Client.java when a server has an error. Please help?
    Reply With Quote  
     

  2. #2  
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    Post your giveLife() Method
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2011
    Posts
    66
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    Quote Originally Posted by Defiled-X View Post
    Post your giveLife() Method
    Okay here it is I'll highlight the resettzhaar

    [SPOIL]
    public void giveLife() {
    c.isDead = false;
    c.faceUpdate(-1);
    c.freezeTimer = 0;

    if(c.playerRights == 3) {
    for (int i = 0; i < 20; i++) {
    c.playerLevel[i] = getLevelForXP(c.playerXP[i]);
    c.getPA().refreshSkill(i);
    }
    c.getCombat().resetPrayers();

    c.teleportToX = 3237;
    c.teleportToY = 3523;
    PlayerSave.saveGame(c);
    c.getPA().resetTzhaar();
    requestUpdates();
    return;

    }
    if(c.duelStatus <= 4 && !c.getPA().inPitsWait()) { // if we are not in a duel we must be in wildy so remove items
    if (!c.inPits && !c.inDungeons() && !c.inFightCaves() && !c.inPcGame()) {
    c.getItems().resetKeepItems();
    if((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 2) {
    if(!c.isSkulled && !c.isInArd()) { // what items to keep
    c.getItems().keepItem(0, true);
    c.getItems().keepItem(1, true);
    c.getItems().keepItem(2, true);
    }
    if(c.prayerActive[10] || c.isInArd() && System.currentTimeMillis() - c.lastProtItem > 700) {
    c.getItems().keepItem(3, true);
    }
    c.getItems().dropAllItems(); // drop all items
    c.getItems().deleteAllItems(); // delete all items

    if(!c.isSkulled && !c.isInArd()) { // add the kept items once we finish deleting and dropping them
    for (int i1 = 0; i1 < 3; i1++) {
    if(c.itemKeptId[i1] > 0) {
    c.getItems().addItem(c.itemKeptId[i1], 1);
    }
    }
    }
    if(c.prayerActive[10] || c.isInArd()) { // if we have protect items
    if(c.itemKeptId[3] > 0) {
    c.getItems().addItem(c.itemKeptId[3], 1);
    }
    }
    }
    c.getItems().resetKeepItems();
    } else if (c.inPits) {
    Server.fightPits.removePlayerFromPits(c.playerId);
    c.pitsStatus = 1;
    }
    }
    c.getCombat().resetPrayers();
    for (int i = 0; i < 25; i++) {
    c.playerLevel[i] = getLevelForXP(c.playerXP[i]);
    c.getPA().refreshSkill(i);
    }
    if (c.pitsStatus == 1) {
    movePlayer(2399, 5173, 0);
    } else if(c.duelStatus <= 4) { // if we are not in a duel repawn to wildy
    movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0);
    c.isSkulled = false;
    c.skullTimer = 0;
    c.attackedPlayers.clear();
    } else if (c.inDungeons()) {
    movePlayer(Config.DUNG_RESPAWN_X, Config.DUNG_RESPAWN_Y, 0);
    c.isSkulled = false;
    c.skullTimer = 0;
    c.attackedPlayers.clear();
    } else if (c.inFightCaves()) {
    c.getPA().resetTzhaar();
    } else { // we are in a duel, respawn outside of arena
    Client o = (Client) Server.playerHandler.players[c.duelingWith];
    if(o != null) {
    o.getPA().createPlayerHints(10, -1);
    if(o.duelStatus == 6) {
    o.getTradeAndDuel().duelVictory();
    }
    }
    movePlayer(Config.DUELING_RESPAWN_X+(Misc.random(C onfig.RANDOM_DUELING_RESPAWN)), Config.DUELING_RESPAWN_Y+(Misc.random(Config.RANDO M_DUELING_RESPAWN)), 0);
    if(c.duelStatus != 6) { // if we have won but have died, don't reset the duel status.
    c.getTradeAndDuel().resetDuel();
    }
    }
    //PlayerSaving.getSingleton().requestSave(c.playerId );
    PlayerSave.saveGame(c);
    c.getCombat().resetPlayerAttack();
    resetAnimation();
    c.startAnimation(-1);
    frame1();
    resetTb();
    c.isSkulled = false;
    c.attackedPlayers.clear();
    c.headIconPk = -1;
    c.skullTimer = -1;
    c.damageTaken = new int[Config.MAX_PLAYERS];
    c.getPA().requestUpdates();
    removeAllWindows();
    c.tradeResetNeeded = true;


    }
    [/SPOIL]
    Reply With Quote  
     

  4. #4  
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    Remove the resettzhaar from your givelife. It will teleport your player your x & y coords, which is generally home.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2011
    Posts
    66
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    Quote Originally Posted by Defiled-X View Post
    Remove the resettzhaar from your givelife. It will teleport your player your x & y coords, which is generally home.
    Okay... now when I die in the fight caves I just go to the spawn... What I want is that when you die in the fight caves you get teleported to the outside of the fightcaves
    Reply With Quote  
     

  6. #6  
    Donator
    Defiled-X's Avatar
    Join Date
    Jun 2010
    Posts
    1,434
    Thanks given
    52
    Thanks received
    78
    Rep Power
    27
    So your regular spawning is fixed. Then add that resettzhaar to the fightcaves instead of regular death(giveLife())
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    May 2011
    Posts
    66
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    Quote Originally Posted by Defiled-X View Post
    So your regular spawning is fixed. Then add that resettzhaar to the fightcaves instead of regular death(giveLife())
    I think I understand... But I still get the error when someone dies, which means when I release, I will get spammed with that error everytime someone is killed
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    May 2011
    Posts
    66
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    bump-hump
    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. Replies: 6
    Last Post: 02-26-2012, 01:01 PM
  2. Replies: 0
    Last Post: 12-03-2011, 02:47 AM
  3. AUTODONATION PROBLEM!Webpage command problem!
    By Jay Gatsby in forum Help
    Replies: 5
    Last Post: 10-24-2011, 07:06 PM
  4. Replies: 4
    Last Post: 01-23-2011, 07: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
  •