Thread: [525] Need help for drops... rep++

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [525] Need help for drops... rep++ 
    Mops the streets
    Streetwave's Avatar
    Join Date
    Mar 2009
    Age
    29
    Posts
    3,445
    Thanks given
    481
    Thanks received
    1,114
    Rep Power
    5000
    Hello ppl, I need help with drops, because I was testing my server and I went to bounty hunter. If I killed my other guy without that other guy attacked me, I didn't get drops. How can i make it like that, that people can kill someone without getting attacked to get drops?? I give rep++

    Spoiler for Love:







    Reply With Quote  
     

  2. #2  
    Registered Member
    harraj128's Avatar
    Join Date
    Nov 2008
    Posts
    1,153
    Thanks given
    1
    Thanks received
    10
    Rep Power
    382
    Dude Stop Spamming. You wont get a response quick. Just wait!
    Reply With Quote  
     

  3. #3  
    Mops the streets
    Streetwave's Avatar
    Join Date
    Mar 2009
    Age
    29
    Posts
    3,445
    Thanks given
    481
    Thanks received
    1,114
    Rep Power
    5000
    i dunno if i get reacition or not so therefore im bumping cuz i really need that help from some1

    Spoiler for Love:







    Reply With Quote  
     

  4. #4  
    Registered Member
    harraj128's Avatar
    Join Date
    Nov 2008
    Posts
    1,153
    Thanks given
    1
    Thanks received
    10
    Rep Power
    382
    Post Your drop method?
    Reply With Quote  
     

  5. #5  
    Mops the streets
    Streetwave's Avatar
    Join Date
    Mar 2009
    Age
    29
    Posts
    3,445
    Thanks given
    481
    Thanks received
    1,114
    Rep Power
    5000
    Code:
    package com.rs2hd.content;
    
    
    public class PlayerDrops
    {
    
        public PlayerDrops()
        {
        }
    
        public static int PvPDrop()
        {
            return PvPItems[(int)(Math.random() * (double)PvPItems.length)];
        }
    
        public static int PvPItems[] = {
            4716, 4178, 4720, 4722, 4880, 4881, 4882, 4883, 4884, 4886, 
            4887, 4888, 4889, 4892, 4893, 4894, 4895, 4898, 4899, 4900, 
            4901, 4708, 4710, 4712, 4714, 4856, 4857, 4858, 4859, 4860, 
            4862, 4863, 4864, 4865, 4866, 4868, 4869, 4870, 4871, 4872, 
            4874, 4875, 4876, 4877, 4878, 4745, 4747, 4749, 4751, 4952, 
            4253, 4954, 4955, 4958, 4959, 4960, 4961, 4964, 4965, 4966, 
            4967, 4970, 4971, 4972, 4973, 4753, 4755, 4757, 4759, 4976, 
            4977, 4978, 4979, 4982, 4983, 4984, 4985, 4988, 4989, 4990, 
            4991, 4994, 4995, 4996, 4997, 4732, 4734, 4736, 4738, 4928, 
            4929, 4930, 4931, 4934, 4935, 4936, 4937, 4940, 4941, 4942, 
            4943, 4946, 4947, 4948, 4949, 4724, 4726, 4728, 4730, 4904, 
            4905, 4906, 4907, 4910, 4911, 4912, 4913, 4916, 4917, 4918, 
            4919, 4922, 4923, 4924, 4925, 11235, 11732, 11335, 11283, 11284, 
            8850, 10551, 13656, 13657, 13658, 13764, 1079, 1093, 1113, 1127, 
            1147, 1163, 1185, 1201, 1303, 1319, 1333, 1347, 1373, 2615, 
            2617, 2619, 2621, 2623, 2625, 2627, 2629, 3101, 3202, 3476, 
            3477, 7336, 7342, 7348, 7354, 7360, 8464, 8466, 8468, 8470, 
            8472, 8474, 8476, 8478, 8480, 8482, 8484, 8486, 8488, 8490, 
            8492, 8494, 8714, 8716, 8718, 8720, 8722, 8724, 8726, 8728, 
            8730, 8732, 8734, 8736, 8738, 8740, 8742, 8744, 9185, 9185, 
            10286, 10288, 10290, 10292, 10294, 10667, 10670, 10673, 10676, 10679, 
            10679, 10705, 10707, 10704, 10705, 10706, 10708, 10798, 10800, 1149, 
            1187, 1187, 5698, 1377, 5698, 1377, 1434, 1434, 1540, 3140, 
            3204, 3204, 4087, 4585, 4587, 4587, 5699, 7158, 1712, 1712, 
            1712, 1712, 2491, 2491, 2491, 2497, 2497, 2497, 2503, 2503, 
            2503, 861, 861, 861, 4131, 7461, 7461, 7462, 6916, 6918, 
            6920, 6922, 6924, 6914, 13672, 13673, 13674, 13675, 14497, 14499, 
            14501, 11724, 11726, 11728, 4151, 4151, 14490, 14492, 14494, 10828, 
            3751, 3751, 11128, 3749, 3749, 3751, 3751, 3753, 3753, 3755, 
            3755, 1725, 1725, 4675, 4675, 3842, 3842, 3840, 3840, 3843, 
            2412, 2413, 2414, 13897, 13893, 13899, 13905, 4089, 4091, 4093, 
            4095, 4097, 4099, 4101, 4103, 4105, 4107, 4109, 4111, 4113, 
            4115, 4117, 4119, 3385, 3387, 3389, 3391, 3393, 3394, 14484, 
            10828, 11694, 11696, 11698, 11700, 11730, 10887, 5698, 5698, 6524, 
            6570, 4153, 6535, 6536, 6537, 6538, 6568, 3122, 3122, 3122, 
            6809, 6809, 6737, 13672, 13673, 13674, 13675, 14600, 14602, 14603, 
            14605, 13887, 13893, 13899, 13905, 14497, 14499, 14501, 14490, 14492, 
            14494, 14592, 14593, 14594, 14479, 6585, 6585, 6737, 3140, 4087, 
            4585
        };
    
    }
    This is playerdrop.java

    Spoiler for Love:







    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Nov 2008
    Posts
    885
    Thanks given
    13
    Thanks received
    35
    Rep Power
    100
    thats your pvp drops, your death method is gonna be in player.java
    Reply With Quote  
     

  7. #7  
    Mops the streets
    Streetwave's Avatar
    Join Date
    Mar 2009
    Age
    29
    Posts
    3,445
    Thanks given
    481
    Thanks received
    1,114
    Rep Power
    5000
    Code:
    package com.rs2hd.model;
    
    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.Map;
    import java.util.Queue;
    
    import org.apache.mina.common.IoSession;
    
    import com.rs2hd.model.Hits.Hit;
    import com.rs2hd.net.ActionSender;
    import com.rs2hd.net.Packet;
    import com.rs2hd.packethandler.PacketHandlers;
    import com.rs2hd.util.Misc;
    import com.rs2hd.io.PlayerLoader;
    import com.thoughtworks.xstream.XStream;
    import com.rs2hd.io.XStreamPlayerLoader;
    import com.rs2hd.WorkerThread;
    import com.rs2hd.combat.PlayerCombat;
    import com.rs2hd.Constants;
    import com.rs2hd.model.*;
    import com.rs2hd.content.PlayerDrops;
    
    /**
     * Represents a connected player.
     * @author Graham
     *
     */
    public class Player extends Entity {
    
    
    	private PlayerDetails details;
    	private transient ActionSender actionSender;
    	private transient Queue<Packet> queuedPackets;
    	private transient PlayerUpdateFlags updateFlags;
    	private transient Sprite sprite;
    	private transient WalkingQueue walkingQueue;
    	private transient LocalEntityList localEntities;
    	private transient ChatMessage lastChatMessage;
    	private transient Animation lastAnimation;
    	private transient Graphics lastGraphics;
    	private transient EntityFocus entityFocus;
    	private transient ForceText forceText;
    	private transient FaceLocation faceLocation;
    	
    	private transient int world;
    	private transient Map<String, Object> temporaryAttributes;
    	private transient Queue<Hit> queuedHits;
    	private transient Bonuses bonuses;
    	private transient boolean hd;
    	private Bank bank;
    	private Settings settings;
    	private Appearance appearance;
    	private HeadIcons headIcons;
    	private Equipment equipment;
    	private Skills skills;
    	private Inventory inventory;
    	private Friends friends;
    	private int rights = 0;
    	private int runEnergy = 100;
    	public int turkeydelay = -1;
    	public int vengDelay;
    	public boolean usingVeng;
    	public long lastVengeance;
    	public int vengUseDelay;
    	public int animClickDelay;
    	public int magicType;
    	public int specialAmountDelay = 0;
    	public boolean specialAmountUpdateReq = false;
    	private PlayerLoader playerLoader;
    	private XStreamPlayerLoader StreamLoader;
    	private WorkerThread workerThread;
    	private PlayerCombat playerCombat;
    	private Constants constants;
    	public boolean inBounty() {
    	return getLocation().getX() >= 3063 && getLocation().getX() <= 3221 && getLocation().getY() >= 3639 && getLocation().getY() <= 3801;
        	}
    
    	public Player(PlayerDetails details) {
    		this.details = details;
    		this.appearance = new Appearance();
    		this.headIcons = new HeadIcons();
    		this.equipment = new Equipment();
    		this.skills = new Skills();
    		this.inventory = new Inventory();
    		this.friends = new Friends();
    		this.settings = new Settings();
    		this.bank = new Bank();
    		this.settings.setDefaultSettings();
    	}
    	
    	/**
    	 * Called when XStream loads us.
    	 * 
    	 * NOTE: other loaders should call this also.
    	 */
    	public Object readResolve() {
    		super.readResolve();
    		actionSender = new ActionSender(this);
    		queuedPackets = new LinkedList<Packet>();
    		updateFlags = new PlayerUpdateFlags();
    		sprite = new Sprite();
    		walkingQueue = new WalkingQueue(this);
    		skills.setPlayer(this);
    		inventory.setPlayer(this);
    		bank.setPlayer(this);
    		equipment.setPlayer(this);
    		friends.setPlayer(this);
    		localEntities = new LocalEntityList();
    		settings.setPlayer(this);
    		temporaryAttributes = new HashMap<String, Object>();
    		lastChatMessage = null;
    		lastAnimation = null;
    		lastGraphics = null;
    		entityFocus = null;
    		forceText = null;
    		faceLocation = null;
    		world = 66;
    		details.refreshLongName();
    		queuedHits = new LinkedList<Hit>();
    		bonuses = new Bonuses(this);
    		hd = false;
    		return this;
    	      }
    
    	/**
    	 * Called roughly every 500ms.
    	 */
    
    	public void tick() {
    
    		if (turkeydelay == 28) {
    			animate(10994, 0); 
    		}
    		if (turkeydelay == 27) {
    			graphics(1714, 0);
    		}
    		if (turkeydelay == 26) {
    			animate(10996, 0);
    			getAppearance().npcId = 8499;
    			getAppearance().asNpc = true;
    			getUpdateFlags().setAppearanceUpdateRequired(true);
    		}
    		if (turkeydelay == 14) {
    			animate(10995, 0);
    			graphics(1714, 0);
    			getAppearance().npcId = -1;
    			getAppearance().asNpc = false;
    			getUpdateFlags().setAppearanceUpdateRequired(true);
    			turkeydelay = -1;
    		}
    		if(turkeydelay > 0){
    			turkeydelay--;
    		}
    
    		if (animClickDelay > 0) {
    	    		animClickDelay--;
    		}
    
                    if (specialAmountDelay > 0) {
                    specialAmountDelay--;
                    } else {
                    if (specialAmount < 100) {
                    specialAmount++;
                    specialAmountUpdateReq = true;
                    }
                    specialAmountDelay = 1;
                    }
                    if (specialAmountUpdateReq) {
                    checkAmount(this);
                    specialAmountUpdateReq = false;
                    }
    
    		if (animClickDelay > 0) {
    	    		animClickDelay--;
    		}
    
    		if(getSkills().getLevel(5) == 0 && usingPrayer) {
    			sm("Your prayer points have ran out.");
    			sm("Please recharge your prayer at the Lumbridge Church.");
    			usingPrayer = false;	
    		}
    
    		if(getSkills().getLevel(5) < 0) {
    			getSkills().setLvl(5, 0);
    		}
    
    		if(freezeDelay > 0) {
    			freezeDelay--;
    		}
    		if (vengDelay > 0) {
    			vengDelay--;
    		}
    		if (vengUseDelay > 0) {
    			vengUseDelay--;
    		}
    		if (vengUseDelay <= 0 && usingVeng) {
    	    		vengUseDelay = 0;
    	    		usingVeng = false;
    	    		getActionSender().sendMessage("Vengeance has faded away.");
    		}
    		if(specialAmount < 100 && specRefill == -1) {
    			specRefill = 40;
    		}
    		if(specRefill > 0) {
    			specRefill--;
    		}
    		if(specialAmount < 0) {
    			specialAmount = 0;
    		}
    		if(specRefill == 0) {
    			if(specialAmount >= 100) {
    				specialAmount = 100;
    				return;
    			}
    			specRefill = -1;
    			specialAmount += 25;
    			sm("Special Energy Updated - "+specialAmount+"/100.");
    		}
    		if (cmbResetTimer > 0) {
    	 		   cmbResetTimer--;
    		}
    		if (cmbResetTimer == 1) {
    			   combatWith = 0;
    		}
    		if(eatDelay > 0) {
    			eatDelay--;
    		}
    		if(specDelay > 0) {
    			specDelay--;
    		}
    		if(DClawTimer > 0) {
    			DClawTimer--;
    			DClawSpec(Misc.random(SpecHit));
    		}
    		if(combatDelay > 0) {		
    			combatDelay--;
    		}
    		if(attackingPlayer == true) {			
    	    		PlayerCombat pc = new PlayerCombat(this);
    	    		pc.attackPlayer(this);
    		}
    		if(getSkills().getLevel(3) <= 0 && isDead == false) {
    			deathDelay = 6;
    			isDead = true;
    			if(getSkills().getLevel(3) < 0) {
    				getSkills().setLvl(3, 0);
    			}
    		}
    		if(deathDelay > 0 && isDead) {
    			deathDelay--;
    			applyDead();			
    		}
    
    	}
    
        /**
         * Checks special amount and gets config.
         */
    	public void checkAmount(Player p) {
    		int amount = p.specialAmount;
    		if (amount >= 100){
    			getActionSender().sendConfig(300, 1000);
    		} else if (amount >= 75){
    			getActionSender().sendConfig(300, 750);
    		} else if (amount >= 50){
    			getActionSender().sendConfig(300, 500);
    		} else if (amount >= 25){
    			getActionSender().sendConfig(300, 250);
    		} else if (amount >= 0){
    			getActionSender().sendConfig(300, 0);
    		} else {
    			// nothing
    		}
    	}
    	
    	public void setTemporaryAttribute(String attribute, Object value) {
    		temporaryAttributes.put(attribute, value);
    	}
    	
    	public Object getTemporaryAttribute(String attribute) {
    		return temporaryAttributes.get(attribute);
    	}
    	
    	public void removeTemporaryAttribute(String attribute) {
    		temporaryAttributes.remove(attribute);
    	}
    	
    	public Settings getSettings() {
    		return this.settings;
    	}
    	
    	public PlayerDetails getPlayerDetails() {
    		return this.details;
    	}
    	
    	public ActionSender getActionSender() {
    		return this.actionSender;
    	}
    	
    	public IoSession getSession() {
    		return this.details.getSession();
    	}
    	
    	public String getUsername() {
    		return this.details.getUsername();
    	}
    	
    	public int getRights() {
    		return this.rights;
    	}
    	
    	public void processQueuedPackets() {
    		synchronized(queuedPackets) {
    			Packet p = null;
    			while((p = queuedPackets.poll()) != null) {
    				PacketHandlers.handlePacket(getSession(), p);
    			}
    		}
    	}
    	
    	public void addPacketToQueue(Packet p) {
    		synchronized(queuedPackets) {
    			queuedPackets.add(p);
    		}
    	}
    	
    	public PlayerUpdateFlags getUpdateFlags() {
    		return updateFlags;
    	}
    	
    	public Sprite getSprites() {
    		return sprite;
    	}
    	
    	public Appearance getAppearance() {
    		return appearance;
    	}
    	
    	public HeadIcons getHeadIcons() {
    		return headIcons;
    	}
    	
    	public Equipment getEquipment() {
    		return equipment;
    	}
    	
    	public WalkingQueue getWalkingQueue() {
    		return walkingQueue;
    	}
    	
    	public Skills getSkills() {
    		return skills;
    	}
    	
    	public void graphics(int id) {
    		graphics(id, 0);
    	}
    	
    	public void graphics(int id, int delay) {
    
           		if (delay >= 100) {
             	   delay += 6553500;
           		}
    		
    		lastGraphics = new Graphics(id, delay);
    		updateFlags.setGraphicsUpdateRequired(true);
    	}
    
    	public void animate(int id) {
    		animate(id, 0);
    	}
    	
    	public void animate(int id, int delay) {
    		lastAnimation = new Animation(id, delay);
    		updateFlags.setAnimationUpdateRequired(true);
    	}
    
    	public boolean isDisconnected() {
    		return !getSession().isConnected();
    	}
    
    	public void setPlayerListSize(int playerListSize) {
    		localEntities.playerListSize = playerListSize;
    	}
    
    	public int getPlayerListSize() {
    		return localEntities.playerListSize;
    	}
    
    	public void setPlayerList(Player[] playerList) {
    		localEntities.playerList = playerList;
    	}
    
    	public Player[] getPlayerList() {
    		return localEntities.playerList;
    	}
    	
    	public void setPlayersInList(byte[] playersInList) {
    		localEntities.playersInList = playersInList;
    	}
    
    	public byte[] getPlayersInList() {
    		return localEntities.playersInList;
    	}
    	
    	public void setNpcListSize(int npcListSize) {
    		localEntities.npcListSize = npcListSize;
    	}
    
    	public int getNpcListSize() {
    		return localEntities.npcListSize;
    	}
    
    	public void setNpcList(NPC[] npcList) {
    		localEntities.npcList = npcList;
    	}
    
    	public NPC[] getNpcList() {
    		return localEntities.npcList;
    	}
    	
    	public void setNpcsInList(byte[]npcsInList) {
    		localEntities.npcsInList = npcsInList;
    	}
    
    	public byte[] getNpcsInList() {
    		return localEntities.npcsInList;
    	}
    
    	public Inventory getInventory() {
    		return inventory;
    	}
    	
    	public ChatMessage getLastChatMessage() {
    		return lastChatMessage;
    	}
    	
    	public void setLastChatMessage(ChatMessage msg) {
    		lastChatMessage = msg;
    	}
    	
    	public int getWorld() {
    		return world;
    	}
    
    	public Friends getFriends() {
    		return friends;
    	}
    
    	public boolean isRebuildNpcList() {
    		return localEntities.rebuildNpcList;
    	}
    	
    	public Animation getLastAnimation() {
    		return lastAnimation;
    	}
    	
    	public void setLastAnimation(Animation lastAnimation) {
    		this.lastAnimation = lastAnimation;
    	}
    	
    	public void setEntityFocus(EntityFocus entityFocus) {
    		this.entityFocus = entityFocus;
    		updateFlags.setEntityFocusUpdateRequired(true);
    	}
    
    	public EntityFocus getEntityFocus() {
    		return entityFocus;
    	}
    	
    	public void setForceText(ForceText forceText) {
    		this.forceText = forceText;
    		updateFlags.setForceTextUpdateRequired(true);
    	}
    
    	public ForceText getForceText() {
    		return forceText;
    	}
    	
    	public Graphics getLastGraphics() {
    		return lastGraphics;
    	}
    	
    	public void setFaceLocation(FaceLocation faceLocation) {
    		this.faceLocation = faceLocation;
    		updateFlags.setFaceLocationUpdateRequired(true);
    	}
    
    	public FaceLocation getFaceLocation() {
    		return faceLocation;
    	}
    	
    	public void setLastGraphics(Graphics lastGraphics) {
    		this.lastGraphics = lastGraphics;
    	}
    
    	public void setRebuildNpcList(boolean b) {
    		this.localEntities.rebuildNpcList = true;
    	}
    	
    	public void processQueuedHits() {
    		if(!updateFlags.isHitUpdateRequired()) {
    			if(queuedHits.size() > 0) {
    				Hit h = queuedHits.poll();
    				hit(h.getDamage(), h.getType());
    			}
    		}
    		if(!updateFlags.isHit2UpdateRequired()) {
    			if(queuedHits.size() > 0) {
    				Hit h = queuedHits.poll();
    				hit(h.getDamage(), h.getType());
    			}
    		}
    	}
    	
    	public void forceChat(String message) {
    		setForceText(new ForceText(message));
    		updateFlags.setForceTextUpdateRequired(true);
    	}
    	
    	public void hit(int damage) {
    
    		if(damage > getSkills().skillLevel(3)) {
    			damage = getSkills().skillLevel(3);
    		}
    		if(getSkills().skillLevel(3) <= 0) {
    			damage = 0;
    		}
    		if(damage == 0) {
    			hit(damage, Hits.HitType.NO_DAMAGE);		
    		}
    		if(damage != 0) {
    			hit(damage, Hits.HitType.NORMAL_DAMAGE);
    		}
    		getSkills().refreshLvls();
    		getSkills().appendDamage(damage);
    	}
    	
    	public void hit(int damage, Hits.HitType type) {
    		if(!updateFlags.isHitUpdateRequired()) {
    			getHits().setHit1(new Hit(damage, type));
    			updateFlags.setHitUpdateRequired(true);
    		} else {
    			if(!updateFlags.isHit2UpdateRequired()) {
    				getHits().setHit2(new Hit(damage, type));
    				updateFlags.setHit2UpdateRequired(true);
    			} else {
    				queuedHits.add(new Hit(damage, type));
    			}
    		}
    	}
    	
    	public Bank getBank() {
    		return bank;
    	}
    	
    	public void setRunEnergy(int runEnergy) {
    		this.runEnergy = runEnergy;
    		actionSender.sendEnergy();
    	}
    	
    	public int getRunEnergy() {
    		return this.runEnergy;
    	}
    	
    	public Bonuses getBonuses() {
    		return this.bonuses;
    	}
    
    	public void setHd(boolean b) {
    		this.hd = b;
    		if(b) {
    			this.getActionSender().sendHdLogin();
    		}
    	}
    	
    	public boolean isHd() {
    		return hd;
    	}
    
    /****JC-SCAPE Added on Methods****\
    *	PvP, Drops, etc.
    */
        /**
         * 1v1 and PvP variables
         * Do not remove any variables or else it messes up Player loading.
         */
    
    public boolean needSave = false;
    public boolean veng = false;
    public int vengTimer = 0;
    public int smite = 0;
    //public int redemption = 0;
    //public int retribution = 0;
    public int protMelee = 0;
    public int protRange = 0;
    //public int protMagic = 0;
    public boolean usingPrayer = false;
    public int starter = 0;
    public int magicId;
    public int freezeDelay = 0;
    public int skullDelay = 0;
    public boolean isSkulled = false;
    public int cmbResetTimer;
    public int combatWith;
    public boolean resetPvP = false;
    public int specRefill = -1;
    public int eatDelay;
    private int saveTimer;
    public int SpecHit;
    public int deathDelay = 0;
    public boolean isDead = false;
    public int specDelay = 0;
    public int enemyIndex = 0;
    public boolean usingSpecial = false;
    public int specialAmount = 100;
    public int combatDelay = 0;
    public boolean attackingPlayer = false;
    public int DClawTimer = 0;
    
    
    public void faceId(Player p2) {
    	if(enemyIndex == 0 || p2 == null) {
    		return;
    	}
    	setEntityFocus(new EntityFocus(p2.getIndex() + 32768));
    }
    public Item dropId(int id) {
    	return new Item(id);
    }
    public void resetFaceId() {
    	setEntityFocus(new EntityFocus(-1));
    }
    
    	public void tele(int x, int y, int h) {
    		Location tele = null;
    		try {
    			tele = Location.location(x, y, h);
    		} catch (Exception e) {
    			tele = Location.location(x, y, 0);
    		}
    		teleport(tele);
    	}
    
    public void homeTele() {
    	tele(3221, 3218, 0);
    }
    
    
    public void resetMethods() {
    	turkeydelay = -1;
    	resetFaceId();
    	attackingPlayer = false;
    	enemyIndex = 0;
    	deathDelay = 0;
    	isDead = false;
    	specDelay = 0;
    	usingSpecial = false;
    	combatDelay = 0;
    	attackingPlayer = false;
    	eatDelay = 0;
    	combatWith = 0;
    	resetPvP = false;
    	veng = false;
    	vengTimer = 0;
    	specRefill = -1;
    	specialAmount = 100;
    	freezeDelay = 0;
    	smite = 0;
    	//redemption = 0;
    	//retribution = 0;
    	protMelee = 0;
    	protRange = 0;
    	//protMagic = 0;
    
    	usingPrayer = false;
    	eatDelay = 0;
    }
    
    public void resetPrayerConfig() {
    	getActionSender().sendConfig(95, 0);
    	getActionSender().sendConfig(96, 0);
    	getActionSender().sendConfig(97, 0);
    	getActionSender().sendConfig(98, 0);
    	getActionSender().sendConfig(99, 0);
    	getActionSender().sendConfig(100, 0);
    }
    public Player getp2() {
    	for(Player p2 : World.getInstance().getPlayerList()) {
    		if(p2 != null && enemyIndex != 0) {
    			if(p2.getIndex() != getIndex()) {
    				if(p2.getIndex() == enemyIndex) {
    					return p2;
    				}
    			}
    		}
    	}
    	return this;
    }
    
        public void PvPDrop(Player player)
        {
            Item item = dropId(526);
            Item item1 = dropId(PlayerDrops.PvPDrop());
            if(player.getIndex() == getIndex())
            {
                player.sm((new StringBuilder()).append("You killed ").append(getUsername()).append(" but you did not get the drop.").toString());
                return;
            }
            if(item1.getDefinition() == null)
            {
                player.sm("Your drop was nulled, fixing in a second.");
                return;
            }
            if(item != null && item1 != null)
            {
                World.getInstance().getItemManager().createGroundItem(this, item1);
                World.getInstance().getItemManager().createGroundItem(this, item);
            }
        }
    
    public boolean SafeZone(){
    	if((getLocation().getX() >= 2394 && getLocation().getX() <= 2408 && getLocation().getY() >= 5168 && getLocation().getY() <=5175 || getLocation().getX() >= 3200 && getLocation().getX() <= 3229 && getLocation().getY() >= 3200 && getLocation().getY() <=3233|| getLocation().getX() >= 3135 && getLocation().getX() <= 3204 && getLocation().getY() >= 3652 && getLocation().getY() <=3663 || getLocation().getX() >= 3147 && getLocation().getX() <= 3199 && getLocation().getY() >= 3663 && getLocation().getY() <=3681 || getLocation().getX() >= 3158 && getLocation().getX() <= 3199 && getLocation().getY() >= 3681 && getLocation().getY() <=3693 || getLocation().getX() >= 3176 && getLocation().getX() <= 3191 && getLocation().getY() >= 3693 && getLocation().getY() <=3703 || getLocation().getX() >= 2948 && getLocation().getX() <= 2949 && getLocation().getY() >= 3368 && getLocation().getY() <= 3369 || getLocation().getX() >= 3221 && getLocation().getX() <= 3224 && getLocation().getY() >= 3223 && getLocation().getY() <=3225 || getLocation().getX() >= 2526 && getLocation().getX() <= 2554 && getLocation().getY() >= 4707 && getLocation().getY() <=4725 || getLocation().getX() >= 3250 && getLocation().getX() <= 3257 && getLocation().getY() >= 3419 && getLocation().getY() <=3423 || getLocation().getX() >= 3179 && getLocation().getX() <= 3194 && getLocation().getY() >= 3432 && getLocation().getY() <=3446 || getLocation().getX() >= 2943 && getLocation().getX() <= 2947 && getLocation().getY() >= 3368 && getLocation().getY() <=3373 || getLocation().getX() >= 3009 && getLocation().getX() <= 3018 && getLocation().getY() >= 3353 && getLocation().getY() <=3358 || getLocation().getX() >= 3091 && getLocation().getX() <= 3098 && getLocation().getY() >= 3488 && getLocation().getY() <=3499))
    		return true;
    			else
    		return false;
    }
        public boolean inEdgePk() {
    	return getLocation().getX() >= 3040 && getLocation().getX() <= 3118 && getLocation().getY() >= 3522 && getLocation().getY() <= 3553 || getLocation().getX() >= 3316 && getLocation().getX() <= 3369 && getLocation().getY() >= 3636 && getLocation().getY() <= 3738;
        }
        public boolean multiZone() {
            return getLocation().getX() >= 3316 && getLocation().getX() <= 3369 && getLocation().getY() >= 3636 && getLocation().getY() <= 3738 || getLocation().getX() >= 3287 && getLocation().getX() <= 3298 && getLocation().getY() >= 3167 && getLocation().getY() <= 3178 || getLocation().getX() >= 3070 && getLocation().getX() <= 3095 && getLocation().getY() >= 3405 && getLocation().getY() <= 3448 || getLocation().getX() >= 2961 && getLocation().getX() <= 2981 && getLocation().getY() >= 3330 && getLocation().getY() <= 3354 || getLocation().getX() >= 2510 && getLocation().getX() <= 2537 && getLocation().getY() >= 4632 && getLocation().getY() <= 4660 || getLocation().getX() >= 3012 && getLocation().getX() <= 3066 && getLocation().getY() >= 4805 && getLocation().getY() <= 4858 || getLocation().getX() >= 2794 && getLocation().getX() <= 2813 && getLocation().getY() >= 9281 && getLocation().getY() <= 9305 || getLocation().getX() >= 3546 && getLocation().getX() <= 3557 && getLocation().getY() >= 9689 && getLocation().getY() <= 9700 || getLocation().getX() >= 2708 && getLocation().getX() <= 2729 && getLocation().getY() >= 9801 && getLocation().getY() <= 9829 || getLocation().getX() >= 3450 && getLocation().getX() <= 3525 && getLocation().getY() >= 9470 && getLocation().getY() <= 9535 || getLocation().getX() >= 3207 && getLocation().getX() <= 3395 && getLocation().getY() >= 3904 && getLocation().getY() <= 3903 || getLocation().getX() >= 3006 && getLocation().getX() <= 3072 && getLocation().getY() >= 3611 && getLocation().getY() <= 3712 || getLocation().getX() >= 3149 && getLocation().getX() <= 3395 && getLocation().getY() >= 3520 && getLocation().getY() <= 4000 || getLocation().getX() >= 2365 && getLocation().getX() <= 2420 && getLocation().getY() >= 5065 && getLocation().getY() <= 5120 || getLocation().getX() >= 2890 && getLocation().getX() <= 2935 && getLocation().getY() >= 4425 && getLocation().getY() <= 4470 || getLocation().getX() >= 2250 && getLocation().getX() <= 2290 && getLocation().getY() >= 4675 && getLocation().getY() <= 4715 || getLocation().getX() >= 2690 && getLocation().getX() <= 2825 && getLocation().getY() >= 2680 && getLocation().getY() <= 2810;
        }
    
    public int lowestLvl() {
    	return getSkills().getCombatLevel() - 10;
    }
    public int highestLvl() {
    	return getSkills().getCombatLevel() + 10;
    }
        /**
         * Checking if combat level difference is correct for attacking in PvP.
         */
    
    public boolean combatDifference(int cbLvl) {
    	if(cbLvl >= lowestLvl() && cbLvl <= highestLvl()) {
    		return true;
    	}
    	else {
    		return false;
    	}
    }
    
    public int getSpecAmount() {
    	if(getEquipment().get(3) == null) {
    			return 50;
    	}
    	switch(getEquipment().get(3).getDefinition().getId()) {
    		case 14484: return 50;
    		case 11694: return 50;
    		case 11696: return 50;
    		case 11698: return 50;
    		case 11700: return 50;
    		case 10887: return 50;
    		case 11730: return 50;
    		case 5698: return 25;
    		case 1305: return 25;
    		case 4151: return 50;
    		default: return 50;
    	}
    }	
    public void resetAttack() {
    	attackingPlayer = false;
    	resetFaceId();
    }
    
    public void sm(String Msg) {
    	getActionSender().sendMessage(""+Msg);
    }
    public int checkPkIcon() {
    	if(isSkulled) {
    		return 0;
    	}
    	return -1;
    }
    public int checkPrayerIcon() {
    	if(smite == 1) {
    		return 4;
    	}
    	//if(redemption == 1) {
    		//return 5;
    	//}
    	//if(retribution == 1) {
    		//return 3;
    	//}
    	if(protMelee == 1) {
    		return 0;
    	}
    	if(protRange == 1) {
    		return 1;
    	}
    	//if(protMagic == 1) {
    		//return 2;
    	//}
    	return -1;
    }
    
    private void deathMessage(Player p2) {
    	if(p2 == null) {
    		return;
    	}
    	if(p2.getIndex() == getIndex()) {
    		return;
    	}
    	int deathMessage = Misc.random(8);
    	if(deathMessage == 0) {
    		p2.sm("With a crushing blow, you defeat "+getUsername()+".");
    	} else if(deathMessage == 1) {
    		p2.sm("It's a humiliating defeat for "+getUsername()+".");
    	} else if(deathMessage == 2) { 
    		p2.sm(getUsername()+" didn't stand a chance against you.");
    	} else if(deathMessage == 3) {
    		p2.sm("You have defeated "+getUsername()+".");
    	} else if(deathMessage == 4) {
    		p2.sm(getUsername()+" regrets the day they met you in combat.");
    	} else if(deathMessage == 5) {
    		p2.sm("It's all over for "+getUsername()+".");
    	} else if(deathMessage == 6) {
    		p2.sm(getUsername()+" falls before your might.");
    	} else if(deathMessage == 7) {
    		p2.sm("Can anyone defeat you? Certainly not "+getUsername()+".");
    	} else if(deathMessage == 8) {
    		p2.sm("You were clearly a better fighter than "+getUsername()+".");
    	}
    }
    
    private void applyDead() {
    	if(deathDelay == 5) {
    		animate(7197);
    	}
    	if(deathDelay == 1) {
    		PvPDrop(getp2());
    		deathMessage(getp2());
    		getSkills().refresh();					
    		sm("Oh dear, you have died!");
    		homeTele();
    	}
    	if(deathDelay == 0) {
    		resetMethods();
    		resetPrayerConfig();
    		isDead = false;
    		deathDelay = 0;
    		getUpdateFlags().setAppearanceUpdateRequired(true);
    	}
    }
    public int MaxHitMelee() {
    
            double maxHit = 2;
    
    	if(getp2() != this && getp2() != null) {
    		if(getp2().protMelee == 1) {
    			maxHit += 1.06 + (getSkills().getLevel(2) * 0.01228);
    			maxHit += getSkills().getLevel(2) * 0.08;
    		} else {
    			maxHit += 2.06 + (getSkills().getLevel(2) * 0.01228);
    			maxHit += getSkills().getLevel(2) * 0.20;
    		}
    	}
    
    	if(getEquipment().get(3) == null) {
    		return 12;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 11694) { //AGS
    		maxHit *= 2.20;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 11696) { //BGS
    		maxHit *= 2.10;
    	}	
    	if (getEquipment().get(3).getDefinition().getId() == 11698) { //SGS
    		maxHit *= 2.05;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 11700) { //ZGS
    		maxHit *= 2.00;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 11730) { //SS
    		maxHit *= 1.90;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 13899) { //Vesta Long
    		maxHit *= 2.00;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 10887) { //Barrelchest Anchor
    		maxHit *= 1.90;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 4151) { //Whip
    		maxHit *= 1.40;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 14484) { //Dragon Claws
    		maxHit *= 1.75;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 7158) { //Dragon 2h
    		maxHit *= 1.50;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 3204) { //Dragon hally
    		maxHit *= 1.20;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 4587) { //Dragon scimi
    		maxHit *= 1.30;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 1434) { //Dragon Mace
    		maxHit *= 1.20;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 1305) { //Dragon Long
    		maxHit *= 1.25;
    	}
    	if (getEquipment().get(3).getDefinition().getId() == 5698) { //Dragon Dagger(s)
    		maxHit *= 1.25;
    	}
    	else {
    		maxHit *= .88;
    	}
            	return (int)Math.floor(maxHit);
    }
    
    public int MaxHitRange() {
    
            double maxHit = 2;
    
    	if(getp2() != this && getp2() != null) {
    		if(getp2().protRange == 1) {
    			maxHit += 1.06 + (getSkills().getLevel(4) * 0.01228);
    			maxHit += getSkills().getLevel(4) * 0.08;
    		} else {
    			maxHit += 2.06 + (getSkills().getLevel(4) * 0.01228);
    			maxHit += getSkills().getLevel(4) * 0.20;
    		}
    	}
    
    	if(getEquipment().get(3) == null) {
    		return 12;
    	}
    	if(getEquipment().get(3).getDefinition().getId() == 11235) {
    		maxHit *= 1.10;
    	}
    	if(getEquipment().get(3).getDefinition().getId() == 9185) {
    		maxHit *= 1.15;
    	}
    	if(getEquipment().get(3).getDefinition().getId() == 861) {
    		maxHit *= 1.10;
    	}
    	if(getEquipment().get(3).getDefinition().getId() == 4734) {
    		maxHit *= 1.10;
    	}
    	if(getEquipment().get(3).getDefinition().getId() == 4212) {
    		maxHit *= 1.10;
    	}
    	if(getEquipment().get(3).getDefinition().getId() == 4214) {
    		maxHit *= 1.10;
    	}
    	else {
    		maxHit *= .98;
    	}
            	return (int)Math.floor(maxHit);
    }
    public void DragonClawSpecial() {
    	DClawTimer = 5;
    }
    
    public void DClawSpec(int hit) {
    	if(isDead || deathDelay > 0) {
    		return;
    	}
    	if(DClawTimer == 4) {
    		hit(hit);
    	}
    	if(DClawTimer == 3) {
    		hit(hit);
    	}
    	if(DClawTimer == 2) {
    		hit(hit);
    	}
    	if(DClawTimer == 1) {
    		hit(hit);
    	}
    	if(DClawTimer == 0) {
    		combatDelay = 5;
    	}
    }
    public int getSpecialAmount() {
    	if(getEquipment().get(3) == null) {
    		return 25;
    	}
    	switch(getEquipment().get(3).getDefinition().getId()) {
    		case 14484: return 50;
    		case 11694: return 50;
    		case 11696: return 50;
    		case 11698: return 50;
    		case 11700: return 50;
    		case 10887: return 50;
    		case 11730: return 50;
    		case 5698: return 25;
    		case 4151: return 50;
    		case 7158: return 50;
    		case 3204: return 50;
    		case 4587: return 50;
    		case 1434: return 25;
    		case 1305: return 25;
    		default: return 25;
    	}
    }
    
    
    }//End of Player.java. Nothing goes further then this!
    This is my whole player.java, maybe i post wrong method of drops and than i must do it again lol

    Spoiler for Love:







    Reply With Quote  
     

  8. #8  
    Mops the streets
    Streetwave's Avatar
    Join Date
    Mar 2009
    Age
    29
    Posts
    3,445
    Thanks given
    481
    Thanks received
    1,114
    Rep Power
    5000
    my whole player.java where i laid ur gf asked for

    Spoiler for Love:







    Reply With Quote  
     

  9. #9  
    Mops the streets
    Streetwave's Avatar
    Join Date
    Mar 2009
    Age
    29
    Posts
    3,445
    Thanks given
    481
    Thanks received
    1,114
    Rep Power
    5000
    ????

    Spoiler for Love:







    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Nov 2008
    Posts
    150
    Thanks given
    0
    Thanks received
    0
    Rep Power
    38
    the reason is because it only gets p2 by who he attacked
    You've got to make a method like that adds to an int to the damage you hit
    Then who ever hit the most would get it ect..

    Like ex. (none of this will work but the way it is done will)

    Takendamage = whatihit;
    PvPdam += whatihit;

    Then,

    make like a void like: (just telling you what to do with it none of them are methods)

    public void GetKiller() {
    Whoeverhitthemostonme = player;
    return player;
    }

    On death:

    PvPdam = 0;

    If you want it to time out: process:

    if (PvPdamout > 0 && PvPdam > 0) PvPdamout--;

    if(PvPdamout == 0 && PvPdam > 0) {
    PvPdam = 0;
    }



    If you want it to give it to the killer (who ever hit the last shot then.)

    This one might work without any edits by you.


    public Player getwhokilledme() {
    return combatWith;
    }

    Then replace your:

    Code:
        public void PvPDrop(Player player)
        {
            Item item = dropId(526);
            Item item1 = dropId(PlayerDrops.PvPDrop());
            if(player.getIndex() == getIndex())
            {
                player.sm((new StringBuilder()).append("You killed ").append(getUsername()).append(" but you did not get the drop.").toString());
                return;
            }
            if(item1.getDefinition() == null)
            {
                player.sm("Your drop was nulled, fixing in a second.");
                return;
            }
            if(item != null && item1 != null)
            {
                World.getInstance().getItemManager().createGroundItem(this, item1);
                World.getInstance().getItemManager().createGroundItem(this, item);
            }
        }
    With:

    Code:
    public void PvPDrop(Player player)
        {
    Player pk = Engine.players[getwhokilledme()];
            Item item = dropId(526);
            Item item1 = dropId(PlayerDrops.PvPDrop());
        
            if(pk.item1.getDefinition() == null)
            {
                pk.player.sm("Your drop was nulled, fixing in a second.");
                return;
            }
            if(pk.item != null && pk.item1 != null)
            {
                pk.World.getInstance().getItemManager().createGroundItem(this, item1);
                pk.World.getInstance().getItemManager().createGroundItem(this, item);
            }
        }
    Not 100% that that one above is error free but you change fix some things

    I don't code rs2hd so I don't check myself.
    Not allowed
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •