Thread: Avalon Release 2

Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 64
  1. #31  
    Registered Member

    Join Date
    Mar 2011
    Age
    27
    Posts
    555
    Thanks given
    168
    Thanks received
    190
    Rep Power
    0
    Quote Originally Posted by Joy. View Post
    I had this EXACT issue, where the NPC you were fighting would literally just stop attacking for some reason when using some of Avalon's code.
    My bad, i got it fixed, i can give the fix in here.

    Quote Originally Posted by Levi X D View Post
    I don't know if this occurs for anyone else, but some NPC's in the Wilderness do NOT like following under combat. As in it just "stops" attacking. Even if the player is standing right next to the monster and the monster is "targeting" the player.
    NPCCombat.java

    Sorry, edited now, forgot one line

    Attached image
    Avalon Developer
    Reply With Quote  
     

  2. Thankful users:


  3. #32  
    Donator

    Yuuji's Avatar
    Join Date
    Feb 2012
    Posts
    678
    Thanks given
    232
    Thanks received
    153
    Rep Power
    197
    Still having an issue with NPC's not considering distance between the target.

    Skeletal Wyvern's for example are scripted to attack from a distance (unless you close the gap), but they're the ones closing the gap and ignoring the other combat styles. (I followed the Mithril Dragon combat script), and still no avail. Yet Mithril Dragons have no issue?

    Am I doing something wrong in the Combat Script?

    Code:
    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.utils.Utils;
    
    public class SkeletalWyvernCombat extends CombatScript {
    
    	@Override
    	public Object[] getKeys() {
    		return new Object[] { 3068, 3069, 3070, 3071, 3072 };
    	}
    
    	private static boolean hasShield(Entity target) {
    		if (!(target instanceof Player))
    			return true;
    		int shieldId = ((Player) target).getEquipment().getShieldId();
    		return shieldId == 2890 || shieldId == 9731 || shieldId == 20436
    				|| shieldId == 20438 || shieldId == 18691 || shieldId == 24558 || shieldId == 24566;
    	}
    
    	@Override
    	public int attack(NPC npc, Entity target) {
    		final NPCCombatDefinitions defs = npc.getCombatDefinitions();
    		boolean withinMeleeDist = npc.withinDistance(target, 1);
    		boolean withinRangedAttackDist = npc.withinDistance(target, 5);
    		final Player player = target instanceof Player ? (Player) target
    				: null;
    		if (withinMeleeDist) {
    			switch (Utils.getRandom(6)) {
    				case 0:
    				case 1:
    				case 2:
    				case 3:
    					npc.animate(new Animation(1593));
    					delayHit(npc, 0, target, getMeleeHit(
    						npc, getRandomMaxHit(npc, defs.getMaxHit(),
    								NPCCombatDefinitions.MELEE, target)));
    					break;
    				case 4:
    				case 5:
    					npc.animate(new Animation(1592));
    					npc.gfx(new Graphics(501));
    					target.gfx(new Graphics(502));
    					if (Utils.random(10) == 0)
    						target.setFreezeDelay(5000);
    					delayHit(npc, 1, target, getRegularHit(npc,
    							Utils.getRandom(hasShield(target) ? 150 : 600)));
    					if (player.getEquipment().getShieldId() == 24558) {
    						player.getAppearence().generateAppearenceData();
    						player.animate(new Animation(6695));
    						player.gfx(new Graphics(1164, 1, 15));
    						player.getPackets().sendGameMessage(
    							"Your ancient wyvern shield absorbs the wyverns icey breath.");
    						}
    					break;
    			}
    			return defs.getAttackDelay();
    			} else if (withinRangedAttackDist) {
    				switch (Utils.getRandom(4)) {
    				case 0:
    				case 1:
    					npc.animate(new Animation(1589));
    					npc.gfx(new Graphics(499));
    					delayHit(npc, 1, target, getRangeHit(
    							npc, getRandomMaxHit(npc, defs.getMaxHit(),
    									NPCCombatDefinitions.RANGE, target)));
    					break;
    				case 2:
    				case 3:
    					npc.animate(new Animation(1592));
    					npc.gfx(new Graphics(501));
    					target.gfx(new Graphics(502));
    					if (Utils.random(10) == 0)
    						target.setFreezeDelay(5000);
    					delayHit(npc, 1, target, getRegularHit(
    							npc, Utils.getRandom(hasShield(target) ? 150 : 600)));
    					if (player.getEquipment().getShieldId() == 24558) {
    						player.getAppearence().generateAppearenceData();
    						player.animate(new Animation(6695));
    						player.gfx(new Graphics(1164, 1, 15));
    						player.getPackets().sendGameMessage(
    							"Your ancient wyvern shield absorbs the wyverns icey breath.");
    					}
    					break;
    				}
    			}
    		return defs.getAttackDelay();
    	}
    }
    They also seem to dislike multi-combat zones. (Seems as though it is delaying there attack because I am "in" combat")
    Attached image

    Attached image
    Attached image
    Reply With Quote  
     

  4. #33  
    Registered Member
    Join Date
    Mar 2020
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Hello :-)

    Can someone please help me? I'm not that good at coding and stuff.

    But when i'm trying to run the server Launcher i receive this message:

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 0
    at com.rs.Launcher.main(Launcher.java:71)

    public static void main(String[] args) throws Exception {
    /*if (args.length < 4) {
    System.err.print(
    "Args, boolean boolean boolean port");
    return;
    }*/
    70 //Settings.OWNER_IP = String.valueOf(args[4]);
    71 Settings.VPS_HOSTED = Boolean.parseBoolean(args[3]);
    72 Settings.PORT_ID = Integer.valueOf(args[2]);
    73 Settings.HOSTED = Boolean.parseBoolean(args[1]);
    74 Settings.DEBUG = Boolean.parseBoolean(args[0]);
    75 long Time = Utils.currentTimeMillis();

    I appreciate if someone wants to help me :-)
    Reply With Quote  
     

  5. #34  
    Registered Member
    Join Date
    Feb 2020
    Posts
    3
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Is this late 2011 or 2012?
    Reply With Quote  
     

  6. #35  
    Registered Member
    Join Date
    Mar 2020
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Tyrasrsps View Post
    Is this late 2011 or 2012?
    What do you mean with that?
    Reply With Quote  
     

  7. #36  
    Registered Member
    Join Date
    Feb 2020
    Posts
    3
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by klosenfekli View Post
    What do you mean with that?
    As in, what year is this revision?
    Reply With Quote  
     

  8. #37  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by klosenfekli View Post
    Hello :-)

    Can someone please help me? I'm not that good at coding and stuff.

    But when i'm trying to run the server Launcher i receive this message:

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 0
    at com.rs.Launcher.main(Launcher.java:71)

    public static void main(String[] args) throws Exception {
    /*if (args.length < 4) {
    System.err.print(
    "Args, boolean boolean boolean port");
    return;
    }*/
    70 //Settings.OWNER_IP = String.valueOf(args[4]);
    71 Settings.VPS_HOSTED = Boolean.parseBoolean(args[3]);
    72 Settings.PORT_ID = Integer.valueOf(args[2]);
    73 Settings.HOSTED = Boolean.parseBoolean(args[1]);
    74 Settings.DEBUG = Boolean.parseBoolean(args[0]);
    75 long Time = Utils.currentTimeMillis();

    I appreciate if someone wants to help me :-)
    You need to pass arguments to the program that it's asked for Intellij Eclipse

    E.g "false false 127.0.0.1 false"

    In the future post to /help/ when you have questions

    Quote Originally Posted by Tyrasrsps View Post
    As in, what year is this revision?
    718 - 6th June 2012
    Attached imageAttached image
    Reply With Quote  
     

  9. #38  
    Registered Member
    Join Date
    Jun 2020
    Posts
    40
    Thanks given
    45
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by -Andreas View Post
    My bad, i got it fixed, i can give the fix in here.



    NPCCombat.java

    Sorry, edited now, forgot one line

    Attached image
    can you send this .java again bro?
    And nice work!!
    Reply With Quote  
     

  10. #39  
    Registered Member
    Join Date
    Jul 2016
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Hello :-)

    Can someone please help me? I'm not that good at coding and stuff.

    But when i'm trying to run the server Launcher i receive this message:

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 0
    at com.rs.Launcher.main(Launcher.java:71)

    public static void main(String[] args) throws Exception {
    /*if (args.length < 4) {
    System.err.print(
    "Args, boolean boolean boolean port");
    return;
    }*/
    70 //Settings.OWNER_IP = String.valueOf(args[4]);
    71 Settings.VPS_HOSTED = Boolean.parseBoolean(args[3]);
    72 Settings.PORT_ID = Integer.valueOf(args[2]);
    73 Settings.HOSTED = Boolean.parseBoolean(args[1]);
    74 Settings.DEBUG = Boolean.parseBoolean(args[0]);
    75 long Time = Utils.currentTimeMillis();

    I appreciate if someone wants to help me :-)

    anyone help me to run server? discord: silva46#2105
    Reply With Quote  
     

  11. #40  
    Registered Member
    Join Date
    Jun 2020
    Posts
    40
    Thanks given
    45
    Thanks received
    5
    Rep Power
    11
    Someone know cuz this are happening ?

    -- > https://imgur.com/a/euDmnUY

    * When im in combat and close client, i got this in the terminal.
    Reply With Quote  
     

Page 4 of 7 FirstFirst ... 23456 ... 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: 70
    Last Post: 05-08-2017, 07:29 PM
  2. [Final Release] Project blue V2...
    By Sam Server in forum Downloads
    Replies: 73
    Last Post: 05-02-2013, 04:14 PM
  3. [Release] Testclient
    By sarah101 in forum Downloads
    Replies: 28
    Last Post: 09-04-2008, 04:34 PM
  4. Nforcescape (released!!)
    By nforce2 in forum Downloads
    Replies: 5
    Last Post: 01-12-2008, 02:12 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •