Thread: What do I edit in to keep ALL equiped items and items in inventory on death?

Results 1 to 3 of 3
  1. #1 What do I edit in to keep ALL equiped items and items in inventory on death? 
    Registered Member
    Join Date
    Apr 2016
    Posts
    5
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    What do I edit in to keep ALL equiped items and items in inventory on death?

    Code:
    public void giveLife() {
    		// Set the visual masks of a player
    		c.isFullHelm = Item.isFullHat(c.playerEquipment[c.playerHat]);
    		c.isFullMask = Item.isFullMask(c.playerEquipment[c.playerHat]);
    		c.isFullBody = Item.isFullBody(c.playerEquipment[c.playerChest]);
    		c.isDead = false;
    		c.faceUpdate(-1);
    		c.freezeTimer = 1;
    		c.setTektonDamageCounter(0);
    		c.setSkeletalMysticDamageCounter(0);
    		c.setGlodDamageCounter(0);
    		c.setIceQueenDamageCounter(0);
    		c.refreshQuestTab(7);
    
    		// If a player is in any of these areas, their items will not be dropped to
    		// themselves nor others
    		if (!c.inDuelArena() && !Boundary.isIn(c, Boundary.DUEL_ARENA)&& !Vorkath.inVorkath(c)
    
    				&& !Boundary.isIn(c, Boundary.FIGHT_CAVE) && !Boundary.isIn(c, Boundary.LIGHTHOUSE)
    				&& !Boundary.isIn(c, PestControl.GAME_BOUNDARY) && !c.inSafemode()
    				&& !Boundary.isIn(c, Boundary.INFERNO) && !Boundary.isIn(c, Zulrah.BOUNDARY)
    				&& !Boundary.isIn(c, Boundary.CERBERUS_BOSSROOMS) && !Boundary.isIn(c, Boundary.SKOTIZO_BOSSROOM)
    				&& !Boundary.isIn(c, Boundary.RFD) && !Boundary.isIn(c, Boundary.OLM)
    				&& !Boundary.isIn(c, Boundary.RAIDS) && Lowpkarena.getState(c) == null
    				&& Highpkarena.getState(c) == null) {
    
    			// If any items are on this list, delete them
    			for (int itemId : Config.DROP_AND_DELETE_ON_DEATH) {
    				if (c.getItems().isWearingItem(itemId)) {
    					int slot = c.getItems().getItemSlot(itemId);
    					if (slot != -1) {
    						c.getItems().removeItem(itemId, slot);
    					}
    				}
    				if (c.getItems().playerHasItem(itemId)) {
    					c.getItems().deleteItem2(itemId, c.getItems().getItemAmount(itemId));
    				}
    			}
    
    			// Get the killer
    			Entity killer = c.getKiller();
    
    			// Degrade, unequip venomous items
    			c.getCombat().degradeVenemousItems(killer);
    
    			// If a player is not an ultimate ironman, update the items kept on death
    			if (!c.getMode().isUltimateIronman()) {
    				c.getItems().resetKeepItems();
    				c.updateItemsOnDeath();
    			}
    			// Handles the items kept on death
    			for (int item = 0; item < Config.ITEMS_KEPT_ON_DEATH.length; item++) {
    				int itemId = Config.ITEMS_KEPT_ON_DEATH[item];
    				int itemAmount = c.getItems().getItemAmount(itemId) + c.getItems().getWornItemAmount(itemId);
    				if (c.getItems().playerHasItem(itemId) || c.getItems().isWearingItem(itemId)) {
    					if (c.getMode().isUltimateIronman()) {
    						Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.heightLevel, itemAmount,
    								c.getIndex());
    					} else if (c.inClanWars() || c.inClanWarsSafe()) {
    						Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.heightLevel, itemAmount,
    								c.getIndex());
    					} else {
    						c.getItems().sendItemToAnyTab(itemId, 1);
    					}
    				}
    			}
    
    			// If ultimate ironman, delete all items and drop all of them
    			if (c.getMode().isUltimateIronman()) {
    				c.getItems().deleteAllItems();
    				c.getItems().dropAllItems();
    
    				// Otherwise, drop them
    			} else {
    				c.getItems().dropAllItems();
    				c.getItems().deleteAllItems();
    				// If a player is not skulled he will keep 3 items
    				if (!c.isSkulled) {
    					for (int i1 = 0; i1 < 3; i1++) {
    						if (c.itemKeptId[i1] > 0) {
    							c.getItems().addItem(c.itemKeptId[i1], 1);
    						}
    					}
    				}
    				// If protect item is active, one extra item will be kept
    				if (c.prayerActive[10]) {
    					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;
    			 */
    		} else if (Boundary.isIn(c, Boundary.PEST_CONTROL_AREA)) {
    			c.getPA().movePlayer(2657, 2639, 0);
    		} else if (Boundary.isIn(c, Boundary.RAIDS)) {
    			c.getPA().movePlayer(c.getRaids().getStartLocation().getX(),c.getRaids().getStartLocation().getY(),c.getRaids().getHeight(c.getRaids().raidLeader));
    			c.getRaids().currentRoom=0;
    		} else if (Boundary.isIn(c, Boundary.OLM)) {
    			c.getPA().movePlayer(c.getRaids().getStartLocation().getX(),c.getRaids().getStartLocation().getY(),c.getRaids().getHeight(c.getRaids().raidLeader));
    		}
    		if (Boundary.isIn(c, PestControl.GAME_BOUNDARY)) {
    			c.getPA().movePlayer(2656 + Misc.random(2), 2614 - Misc.random(3), 0);
    		} else if (Boundary.isIn(c, Zulrah.BOUNDARY)) {
    			c.getPA().movePlayer(Config.START_LOCATION_X, Config.START_LOCATION_X, 0);
    			InstancedArea instance = c.getZulrahEvent().getInstancedZulrah();
    			if (instance != null) {
    				InstancedAreaManager.getSingleton().disposeOf(instance);
    			}
    			c.getZulrahLostItems().store();
    			c.talkingNpc = 2040;
    			c.getDH().sendNpcChat("It looks like Zulrah beat you.", "I'll give you back your items for 500,000GP.",
    					"Talk to me when you're ready.");
    		} else if (Boundary.isIn(c, Boundary.CERBERUS_BOSSROOMS)) {
    			c.getPA().movePlayer(1309, 1250, 0);
    			c.getCerberusLostItems().store();
    			c.talkingNpc = 5870;
    			c.getDH().sendNpcChat("It looks like Cerberus beat you.", "I'll give you back your items for 500,000GP.",
    					"Talk to me when you're ready.");
    		} else if (Boundary.isIn(c, Boundary.SKOTIZO_BOSSROOM)) {
    			c.getPA().movePlayer(1665, 10045, 0);
    			c.getSkotizoLostItems().store();
    			c.talkingNpc = 7283;
    			c.getDH().sendNpcChat("It looks like Skotizo beat you.", "I'll give you back your items for 500,000GP.",
    					"Talk to me when you're ready.");
    		} else if (Boundary.isIn(c, Boundary.DUEL_ARENA)) {
    			DuelSession duelSession = (DuelSession) Server.getMultiplayerSessionListener().getMultiplayerSession(c,
    					MultiplayerSessionType.DUEL);
    			if (Objects.nonNull(duelSession)
    					&& duelSession.getStage().getStage() == MultiplayerSessionStage.FURTHER_INTERATION) {
    				Player opponent = duelSession.getWinner().get();
    				if (opponent != null) {
    					opponent.getPA().createPlayerHints(10, -1);
    					duelSession.finish(MultiplayerSessionFinalizeType.GIVE_ITEMS);
    				}
    			}
    		} else if (Boundary.isIn(c, Boundary.LIGHTHOUSE) && c.getDagannothMother() != null) {
    			c.getDagannothMother().end(DisposeType.INCOMPLETE);
    		} else if (Boundary.isIn(c, Boundary.RFD) && c.getrecipeForDisaster() != null) {
    			c.getrecipeForDisaster().end(DisposeTypes.INCOMPLETE);
    		} else if (Boundary.isIn(c, Boundary.FIGHT_CAVE)) {
    			c.getFightCave().handleDeath();
    		} else if (Boundary.isIn(c, Boundary.INFERNO)) {
    			c.getInfernoMinigame().handleDeath();
    		} else if (Boundary.isIn(c, Boundary.RAIDS)) {
    			c.getPA().movePlayer(c.getRaids().getStartLocation().getX(),c.getRaids().getStartLocation().getY(),c.getRaids().getHeight(c.getRaids().raidLeader));
    		} else if (Boundary.isIn(c, Boundary.OLM)) {
    			c.getPA().movePlayer(c.getRaids().getStartLocation().getX(),c.getRaids().getStartLocation().getY(),c.getRaids().getHeight(c.getRaids().raidLeader));
    		} else if (Highpkarena.getState(c) != null) {
    			Highpkarena.handleDeath(c);
    		} else if (Lowpkarena.getState(c) != null) {
    			Lowpkarena.handleDeath(c);
    		} else if (c.inClanWars() || c.inClanWarsSafe()) {
    			movePlayer(c.absX, 4759, 0);
    		} else if (Boundary.isIn(c, Boundary.SAFEPKSAFE)) {
    			movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0);
    			c.isSkulled = false;
    			c.skullTimer = 0;
    			c.attackedPlayers.clear();
    			removeAllWindows();
    			closeAllWindows();
    		} else {
    			movePlayer(Config.RESPAWN_X, Config.RESPAWN_Y, 0);
    			c.isSkulled = false;
    			c.skullTimer = 0;
    			c.attackedPlayers.clear();
    			removeAllWindows();
    			closeAllWindows();
    		}
    		c.getCombat().resetPrayers();
    		for (int i = 0; i < 20; i++) {
    			c.playerLevel[i] = getLevelForXP(c.playerXP[i]);
    			c.getPA().refreshSkill(i);
    		}
    		c.startAnimation(65535);
    		updateLife();
    	}
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    If you want it in pvp as pve then just remove anything that has deleteItem in it.


    "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  
    Extreme Donator


    Join Date
    Aug 2016
    Posts
    597
    Thanks given
    109
    Thanks received
    96
    Rep Power
    254
    correct me if i'm wrong, but doesn't this comment tell you exactly what you're looking for?

    // If a player is in any of these areas, their items will not be dropped to
    // themselves nor others

    This entire block of code right here is just exceptions for where your items shouldn't be dropped

    Code:
    if (!c.inDuelArena() && !Boundary.isIn(c, Boundary.DUEL_ARENA)&& !Vorkath.inVorkath(c)
    
    				&& !Boundary.isIn(c, Boundary.FIGHT_CAVE) && !Boundary.isIn(c, Boundary.LIGHTHOUSE)
    				&& !Boundary.isIn(c, PestControl.GAME_BOUNDARY) && !c.inSafemode()
    				&& !Boundary.isIn(c, Boundary.INFERNO) && !Boundary.isIn(c, Zulrah.BOUNDARY)
    				&& !Boundary.isIn(c, Boundary.CERBERUS_BOSSROOMS) && !Boundary.isIn(c, Boundary.SKOTIZO_BOSSROOM)
    				&& !Boundary.isIn(c, Boundary.RFD) && !Boundary.isIn(c, Boundary.OLM)
    				&& !Boundary.isIn(c, Boundary.RAIDS) && Lowpkarena.getState(c) == null
    				&& Highpkarena.getState(c) == null) {
    There are so many possible ways to do what you want. Literally checking anything about any of your players and then adding it right there should accomplish it
    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. What do you guys want to see?
    By Jashy in forum Help
    Replies: 0
    Last Post: 02-28-2016, 03:31 AM
  2. Replies: 1
    Last Post: 04-15-2011, 07:25 PM
  3. Replies: 13
    Last Post: 08-11-2010, 09:44 PM
  4. Replies: 4
    Last Post: 07-03-2010, 08:19 PM
  5. What Do you Edit Pictures with?
    By Xxl33tk1ll3r28x in forum Voting
    Replies: 15
    Last Post: 09-18-2008, 04:26 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
  •