Thread: (PI) Players Don't Lose Items In Wild (PI)

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 (PI) Players Don't Lose Items In Wild (PI) 
    Registered Member
    Join Date
    Apr 2013
    Posts
    37
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    Hey guys, Have a problem with my PI source, I can't seem to find where to change so that players lose items in the wild. If someone could help me would be Kindly appreciated!

    Thanks,
    Elysian
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Mar 2012
    Age
    24
    Posts
    1,522
    Thanks given
    473
    Thanks received
    324
    Rep Power
    0
    giveLife Method:

    applyDead Method:

    post both of them

    and are you testing drops with regular players? or admins accounts?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2013
    Posts
    37
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    Regular Players
    Code:
    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++;
    }
    if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled && c.duelStatus == 0) {
    o.pkPoints = (o.pkPoints + 4);
    o.sendMessage("You recieved 4 pkPoints");
    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;
    }
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2013
    Posts
    37
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    GiveLife Method:
    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 == 0 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 0) {
    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;
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Mar 2012
    Age
    24
    Posts
    1,522
    Thanks given
    473
    Thanks received
    324
    Rep Power
    0
    try adding mine and if it doesnt work ill hard look at it. this is give life

    Code:
    public void giveLife() {
    		c.isDead = false;
    		c.faceUpdate(-1);
    		c.freezeTimer = 0;
    		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.inFightCaves()) {
    					if (c.playerRights > 1){
    					c.sendMessage("Your administration status saves your items on death!");
    					}else{
    					c.getItems().resetKeepItems();
    				if((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 2) {
    					if(!c.isSkulled && !c.isInFala() && !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.isInFala() && !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 < 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);
    			if (c.playerName.equalsIgnoreCase("")){
    				c.forcedChat("I can't die, silly!");
    			}else{
    			if (c.alliance == 0){
    				c.getPA().movePlayer(Config.START_LOCATION_X, Config.START_LOCATION_Y, 0);
    			}else if (c.alliance == 1){
    				c.getPA().movePlayer(2850, 3348, 0);
    			}else if (c.alliance == 2){
    				c.getPA().movePlayer(3659, 3490, 0);
    			}else{
    				c.getPA().movePlayer(800, 800, 0);
    				c.sendMessage("#120548721!");
    			}
    						c.attackedPlayers.clear();
    			}
    			c.isSkulled = false;
    			c.skullTimer = 0;
    		} 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();
    					o.pcPoints += 1;
    					o.sendMessage("You have gained 1 Soul Split Points for winning a duel");
    				}
    			}
    			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);
    		if (c.playerName.equalsIgnoreCase("Brad")){
    			c.isDead = false;
    			c.faceUpdate(-1);
    			c.freezeTimer = 0;
    		}else{
    		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();
    		}
    	}
    Reply With Quote  
     

  6. #6  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    No. It's in the dropAllItems method. Use some damn code tags.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Mar 2012
    Age
    24
    Posts
    1,522
    Thanks given
    473
    Thanks received
    324
    Rep Power
    0
    Quote Originally Posted by Ninth Legion View Post
    No. It's in the dropAllItems method. Use some damn code tags.
    i had a glitch at first my solution was in give life. and yes it could also be there as well.
    Reply With Quote  
     

  8. #8  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Quote Originally Posted by Angel Of Snow View Post
    i had a glitch at first my solution was in give life. and yes it could also be there as well.
    Then it wasn't declared. The problem lies where I indicated.

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Registered Member Lucas Jacob's Avatar
    Join Date
    Jan 2012
    Posts
    183
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    Whats the base of your server?
    Reply With Quote  
     

  11. #10  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,472
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    Quote Originally Posted by Lucas Jacob View Post
    Whats the base of your server?
    Read the title...

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    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. Replies: 1
    Last Post: 03-31-2013, 06:54 AM
  2. Replies: 0
    Last Post: 12-22-2010, 03:29 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
  •