Thread: [PI] Don't lose items outside wildy?

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 [PI] Don't lose items outside wildy? 
    Registered Member undefinedzz's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    57
    Thanks given
    3
    Thanks received
    1
    Rep Power
    13
    Hello! i wanted to make it so, so that when i die outside the wilderniss i wont lose my items but when i die in the wildy i will lose my items.

    anyway i can add that?

    Thanks!

    Also im new and this is my first post so hello everyone! i hope i'll get to know everybody!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Oct 2009
    Posts
    1,312
    Thanks given
    148
    Thanks received
    161
    Rep Power
    33
    Just go to the method which deletes your items and drops it on the ground and add an if check there so it won't remove it when it is outside the wilderness.

    Code:
    if (player.inWilderness()) Item.dropItems(player);
    Reply With Quote  
     

  3. #3  
    Registered Member iCode's Avatar
    Join Date
    Aug 2011
    Posts
    207
    Thanks given
    9
    Thanks received
    8
    Rep Power
    26
    Quote Originally Posted by brkownz View Post
    Just go to the method which deletes your items and drops it on the ground and add an if check there so it won't remove it when it is outside the wilderness.

    Code:
    if (player.inWilderness()) Item.dropItems(player);
    yupp, it should work. Just added this to my server.
    Reply With Quote  
     

  4. #4  
    Registered Member undefinedzz's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    57
    Thanks given
    3
    Thanks received
    1
    Rep Power
    13
    Quote Originally Posted by brkownz View Post
    Just go to the method which deletes your items and drops it on the ground and add an if check there so it won't remove it when it is outside the wilderness.

    Code:
    if (player.inWilderness()) Item.dropItems(player);
    ugh such a noob am i, i cant find where that is >_< Thanks anyway!
    Reply With Quote  
     

  5. #5  
    Registered Member undefinedzz's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    57
    Thanks given
    3
    Thanks received
    1
    Rep Power
    13
    Any help on where i need to add it?
    Reply With Quote  
     

  6. #6  
    Infinite in Mystery.

    Join Date
    Jul 2012
    Posts
    128
    Thanks given
    18
    Thanks received
    17
    Rep Power
    12
    tested and working
    Reply With Quote  
     

  7. #7  
    Registered Member undefinedzz's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    57
    Thanks given
    3
    Thanks received
    1
    Rep Power
    13
    Quote Originally Posted by Licker View Post
    tested and working
    any idea where i can add it, i know im a fucking idiot/noob but ive looked everywhere and cant find it.

    Soz im still learning java.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Oct 2009
    Posts
    1,312
    Thanks given
    148
    Thanks received
    161
    Rep Power
    33
    Quote Originally Posted by undefinedzz View Post
    any idea where i can add it, i know im a fucking idiot/noob but ive looked everywhere and cant find it.

    Soz im still learning java.
    Show me your giveLife() function within PlayerAssistant.java
    Reply With Quote  
     

  9. #9  
    Registered Member undefinedzz's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    57
    Thanks given
    3
    Thanks received
    1
    Rep Power
    13
    Quote Originally Posted by brkownz View Post
    Show me your giveLife() function within PlayerAssistant.java
    Alright here:

    Code:
    public void giveLife() {
                    c.isDead = false;
                    c.faceUpdate(-1);
                    c.freezeTimer = 0;
                    if (c.duelStatus <= 4 && !c.getPA().inPitsWait()) {
                            if (!c.inPits && !c.inFightCaves()) {
                                    c.getItems().resetKeepItems();
                                    if ((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS)
                                                    || c.playerRights != 2) {
                                            if (!c.isSkulled) { // what items to keep
                                                    c.getItems().keepItem(0, true);
                                                    c.getItems().keepItem(1, true);
                                                    c.getItems().keepItem(2, true);
                                            }
                                            if (c.prayerActive[10]
                                                            && 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) { // 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]) { // 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 < 20; 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.inFightCaves()) {
                            c.getPA().resetTzhaar();
                    } else { // we are in a duel, respawn outside of arena
                            Client o = (Client) 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(Config.RANDOM_DUELING_RESPAWN)),
                                            Config.DUELING_RESPAWN_Y
                                                            + (Misc.random(Config.RANDOM_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(65535);
                    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;
            }
    Reply With Quote  
     

  10. #10  
    Registered Member undefinedzz's Avatar
    Join Date
    Aug 2012
    Age
    27
    Posts
    57
    Thanks given
    3
    Thanks received
    1
    Rep Power
    13
    Uh any help?
    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. right 3 don't lose items?
    By MarkQ in forum Help
    Replies: 4
    Last Post: 08-11-2011, 05:24 PM
  2. [delta] don't lose items
    By Nullz in forum Help
    Replies: 1
    Last Post: 03-29-2011, 07:56 AM
  3. [PI] Don't Lose Items in Certain Area
    By Vault in forum Help
    Replies: 15
    Last Post: 12-21-2010, 10:18 PM
  4. [PI] Admins don't lose items
    By Xyger in forum Snippets
    Replies: 13
    Last Post: 11-14-2010, 12:23 PM
  5. [PI] Admins don't lose items
    By Xyger in forum Snippets
    Replies: 1
    Last Post: 08-11-2010, 02:08 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
  •