Thread: Some OsBrutality Fixes

Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27
  1. #21  
    Sponjebobu
    Idiot Bird's Avatar
    Join Date
    Mar 2009
    Posts
    6,500
    Thanks given
    1,539
    Thanks received
    2,197
    Rep Power
    4326
    Quote Originally Posted by omnee View Post
    Why do you say that?
    I'm in no way experienced in private servers, been working with this one for a bit and I'm really enjoying it
    The amount of code used for such simple things, seems unbelievably overkill and annoying to work with

    If the combat was entity based, you could just do something like (Code was written up really quick by hand);

    Code:
    	public static void applyRecoilNPC(final Entity attacker, final Damage damage) {
    		if (!(entity instanceof Player)) {
    			return;
    		}
    		final recoilDamage = damage.getCount() / 10;
    		if (recoilDamage > 0 && entity.getEquipment().contains(RECOIL)) {
    			attacker.getDamageManager().submit(new Damage(DATA));
    			entity.decremetRecoilHits(1);
    			if (entity.getRecoilHits() <= 0) {
    				entity.getEquipment().remove(RECOIL);
    				final Player player = (Player) entity;
    				if (player != null)
    					player.sendOutgoingPacket(new Message("The recoil has shattered"));
    			}
    		}
    	}
    getCloseRandomPlayer() (Also written really quickly from on top of my head):
    Code:
    	public int getRandomClosePlayer() {
    		if (getHitpoints() <= 0 || isDead() || getCombatBuilder().getUnderAttackBy() != null || getCombatBuilder().getTarget() != null)
    			return -1;
    		final List<Player> players = new ArrayList<Player>();
    		RegionManager.getLocalPlayers(getPosition()).forEach(player -> {
    			
    			if (getPosition().isWithinRange(player, distance) && player.getCombatBuilder().getUnderAttackBy() == null) {
    				players.add(player);
    			}
    		});
    		return players.size() > 0 ? players.get(random.nextInt(players.size()) : -1;
    	}
    Compared to:
    Code:
    	public int getCloseRandomPlayer(int i) {
    		ArrayList<Integer> players = new ArrayList<>();
    		for (int j = 0; j < PlayerHandler.players.length; j++) {
    			if (PlayerHandler.players[j] != null) {
    				if (Boundary.isIn(npcs[i], Boundary.GODWARS_BOSSROOMS)) {
    					if (!Boundary.isIn(PlayerHandler.players[j], Boundary.GODWARS_BOSSROOMS)) {
    						npcs[i].killerId = 0;
    						continue;
    					}
    				}
    				if (goodDistance(PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, npcs[i].absX,
    						npcs[i].absY, distanceRequired(i) + followDistance(i)) || isFightCaveNpc(i)) {
    					if ((PlayerHandler.players[j].underAttackBy <= 0 && PlayerHandler.players[j].underAttackBy2 <= 0)
    							|| PlayerHandler.players[j].inMulti())
    						if (PlayerHandler.players[j].heightLevel == npcs[i].heightLevel)
    							players.add(j);
    
    				}
    			}
    		}
    		if (players.size() > 0)
    			return players.get(Misc.random(players.size() - 1));
    		return 0;
    	}
    However, take my code with a grain of salt, I'm by no means the best person on here to give you advice

    Kandarin's Website: [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    The greatest upcoming OSRS PK server
    Reply With Quote  
     

  2. Thankful user:


  3. #22  
    Registered Member
    Join Date
    Apr 2016
    Posts
    123
    Thanks given
    37
    Thanks received
    2
    Rep Power
    0
    Anyway, does anyone know how to fix the emotes tabs? I have to zombie emotes are invisable , How to enable them?
    I hope someone help me in this

    Also does anyone know how to fix this in OS-Burality? Just to rename and in which topic to goes?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #23  
    Registered Member TA TA's Avatar
    Join Date
    Apr 2016
    Posts
    228
    Thanks given
    42
    Thanks received
    7
    Rep Power
    9
    Well done on the thread will help alot of peoples using the source!
    Spoiler for Known Scammers:
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #24  
    Registered Member
    Join Date
    Nov 2015
    Posts
    60
    Thanks given
    14
    Thanks received
    11
    Rep Power
    16
    Quote Originally Posted by Idiot Bird View Post
    The amount of code used for such simple things, seems unbelievably overkill and annoying to work with

    If the combat was entity based, you could just do something like (Code was written up really quick by hand);

    Spoiler for Code:
    Code:
    	public static void applyRecoilNPC(final Entity attacker, final Damage damage) {
    		if (!(entity instanceof Player)) {
    			return;
    		}
    		final recoilDamage = damage.getCount() / 10;
    		if (recoilDamage > 0 && entity.getEquipment().contains(RECOIL)) {
    			attacker.getDamageManager().submit(new Damage(DATA));
    			entity.decremetRecoilHits(1);
    			if (entity.getRecoilHits() <= 0) {
    				entity.getEquipment().remove(RECOIL);
    				final Player player = (Player) entity;
    				if (player != null)
    					player.sendOutgoingPacket(new Message("The recoil has shattered"));
    			}
    		}
    	}
    getCloseRandomPlayer() (Also written really quickly from on top of my head):
    Code:
    	public int getRandomClosePlayer() {
    		if (getHitpoints() <= 0 || isDead() || getCombatBuilder().getUnderAttackBy() != null || getCombatBuilder().getTarget() != null)
    			return -1;
    		final List<Player> players = new ArrayList<Player>();
    		RegionManager.getLocalPlayers(getPosition()).forEach(player -> {
    			
    			if (getPosition().isWithinRange(player, distance) && player.getCombatBuilder().getUnderAttackBy() == null) {
    				players.add(player);
    			}
    		});
    		return players.size() > 0 ? players.get(random.nextInt(players.size()) : -1;
    	}
    Compared to:
    Code:
    	public int getCloseRandomPlayer(int i) {
    		ArrayList<Integer> players = new ArrayList<>();
    		for (int j = 0; j < PlayerHandler.players.length; j++) {
    			if (PlayerHandler.players[j] != null) {
    				if (Boundary.isIn(npcs[i], Boundary.GODWARS_BOSSROOMS)) {
    					if (!Boundary.isIn(PlayerHandler.players[j], Boundary.GODWARS_BOSSROOMS)) {
    						npcs[i].killerId = 0;
    						continue;
    					}
    				}
    				if (goodDistance(PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, npcs[i].absX,
    						npcs[i].absY, distanceRequired(i) + followDistance(i)) || isFightCaveNpc(i)) {
    					if ((PlayerHandler.players[j].underAttackBy <= 0 && PlayerHandler.players[j].underAttackBy2 <= 0)
    							|| PlayerHandler.players[j].inMulti())
    						if (PlayerHandler.players[j].heightLevel == npcs[i].heightLevel)
    							players.add(j);
    
    				}
    			}
    		}
    		if (players.size() > 0)
    			return players.get(Misc.random(players.size() - 1));
    		return 0;
    	}


    However, take my code with a grain of salt, I'm by no means the best person on here to give you advice
    Oh i completely agree with you. That isn't my code that is just what is originally there and what is inside the source Yours seems much cleaner
    Reply With Quote  
     

  6. #25  
    Registered Member
    Join Date
    Jun 2014
    Age
    21
    Posts
    16
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    is this only my got problems with some global objects?
    in camelot i cant see fence's and building in front of bank.
    Any suggestions how to fix it?

    Reply With Quote  
     

  7. #26  
    Registered Member
    Join Date
    Nov 2015
    Posts
    60
    Thanks given
    14
    Thanks received
    11
    Rep Power
    16
    Quote Originally Posted by domseas View Post
    is this only my got problems with some global objects?
    in camelot i cant see fence's and building in front of bank.
    Any suggestions how to fix it?

    Yea the client and maps have a bunch of issues with object rendering etc.. To save yourself time use this. Thank A Mage for this everyone (:
    [Only registered and activated users can see links. ]

    Very easy to setup.
    Reply With Quote  
     

  8. Thankful user:


  9. #27  
    Registered Member
    Join Date
    Jun 2014
    Age
    21
    Posts
    16
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Any fix for wilderness ditch animations? it's strange becouse its teleporting through it.
    Reply With Quote  
     

Page 3 of 3 FirstFirst 123

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [RuneEscape] Some bug fixes
    By dragonkk in forum Tutorials
    Replies: 5
    Last Post: 08-19-2011, 06:38 PM
  2. some rs2hd fixes (i hope)
    By Dylan in forum Snippets
    Replies: 4
    Last Post: 03-15-2010, 07:27 AM
  3. some 1 fix it ?:S
    By b33r in forum Help
    Replies: 0
    Last Post: 07-16-2009, 10:13 AM
  4. need some glitchs fixed...
    By silabgarza in forum Help
    Replies: 4
    Last Post: 03-23-2009, 01:35 AM
  5. Need a mod+ code. or some error fixing.
    By .:Programing God:. in forum Help
    Replies: 5
    Last Post: 01-30-2009, 03:32 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
  •