Thread: [592] Combat Hitpoints

Results 1 to 5 of 5
  1. #1 [592] Combat Hitpoints 
    Registered Member
    Join Date
    Feb 2019
    Posts
    21
    Thanks given
    6
    Thanks received
    1
    Rep Power
    0
    Good morning!
    I've been trying to add combat against farmer npc's. He hits 11's constantly and 11 is my max amount of hitpoints. (One hit should kill me but it doesn't). And when the farmer hits me it shows my health go down and I do eventually die, but it doesn't update the hits on my health stats as shown in the photo below. Stays on 11/11
    Loving what I currently have with the server and looking forward to learning more about combat.



    Here is the Farmer.java which I placed in com>rs>game>npc>combat>impl (Matrix 592)

    Code:
    package com.rs.game.npc.combat.impl;
    
    import com.rs.game.Animation;
    import com.rs.game.Entity;
    import com.rs.game.Graphics;
    import com.rs.game.npc.NPC;
    import com.rs.game.npc.combat.CombatScript;
    import com.rs.game.npc.combat.NPCCombatDefinitions;
    import com.rs.game.player.Player;
    import com.rs.game.player.content.Slayer;
    import com.rs.game.tasks.WorldTask;
    import com.rs.game.tasks.WorldTasksManager;
    import com.rs.utils.Utils;
    
    public class Farmer extends CombatScript {
    
    	@Override
    	public Object[] getKeys() {
    		return new Object[] { "Farmer" };
    	}
    
    	@Override
    	public int attack(NPC npc, final Entity target) {
    		NPCCombatDefinitions def = npc.getCombatDefinitions();
    		if (!Slayer.hasReflectiveEquipment(target)) {
    			Player targetPlayer = (Player) target;
    			delayHit(npc, 0, target, getMeleeHit(npc, targetPlayer.getMaxHitpoints() / 10));
    			WorldTasksManager.schedule(new WorldTask() {
    
    				@Override
    				public void run() {
    					target.setNextGraphics(new Graphics(747));
    				}
    			});
    			// TODO player emote hands on ears
    		} else
    			delayHit(npc, 0, target, getMeleeHit(npc, getRandomMaxHit(npc, npc.getMaxHit(), def.getAttackStyle(), target)));
    		npc.setNextAnimation(new Animation(def.getAttackEmote()));
    		return def.getAttackDelay();
    	}
    }
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    May 2017
    Age
    27
    Posts
    1,552
    Thanks given
    946
    Thanks received
    1,395
    Rep Power
    0
    Maybe its something with interfaces updating thru your client side and between outgoing packets from server side or you missing playerUpdate
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2019
    Posts
    21
    Thanks given
    6
    Thanks received
    1
    Rep Power
    0
    Hmm. When I log out and back in it saves all character information and hitpoints still show 11/11 and health bar shows half way gone haha xD
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Jun 2018
    Posts
    14
    Thanks given
    0
    Thanks received
    4
    Rep Power
    82
    its a bug in the 592 release. nothing client sided.
    Thanks,
    Zero.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2019
    Posts
    21
    Thanks given
    6
    Thanks received
    1
    Rep Power
    0
    Any idea which file to look in and fix it? Guess an update function is the only way to fix.

    Bump. I can do all else if I find the answer to why players health bar (above head) goes down but the hitpoints skill stays 11/11.
    Many thanks.
    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. (592) OSRS Wiki NPC Combat Information
    By Dumb Dork in forum Configuration
    Replies: 7
    Last Post: 06-06-2018, 07:57 AM
  2. What 99 NON-combat skill would you like?
    By P Hatz Own in forum Voting
    Replies: 83
    Last Post: 05-04-2008, 07:01 PM
  3. Change max combat level
    By Afro in forum Tutorials
    Replies: 13
    Last Post: 07-25-2007, 01:44 AM
  4. Halo: Combat Evolved
    By Guthan in forum Showcase
    Replies: 14
    Last Post: 05-25-2007, 02:40 AM
  5. [tut]Combat hit totals (Kinda fun to have)..
    By Santa Clause in forum Tutorials
    Replies: 5
    Last Post: 05-10-2007, 08:30 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
  •