Thread: NPCs will only use 2 combat styles

Results 1 to 7 of 7
  1. #1 NPCs will only use 2 combat styles 
    Registered Member
    Join Date
    Feb 2012
    Posts
    109
    Thanks given
    9
    Thanks received
    1
    Rep Power
    11
    Title says it all..

    Attacks are loaded properly through NpcCombatDefinition. When you're within melee distance, it alternates through all 3 styles (Melee, Ranged, Magic).

    Whenever you get out of melee distance, it will only use magic. It won't alternate between ranged and magic even though it's set.

    I've made created a class trying to change this but I can't figure out why.

    Can anybody help please?
    Reply With Quote  
     

  2. #2  
    Super Donator

    Chivvon's Avatar
    Join Date
    May 2016
    Posts
    487
    Thanks given
    69
    Thanks received
    142
    Rep Power
    285
    Could upload the method that checks/calculates these combat styles?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2012
    Posts
    109
    Thanks given
    9
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Chivvon View Post
    Could upload the method that checks/calculates these combat styles?
    Correction. Jad uses all 3. Just trying to figure out why the others aren't.

    Quote Originally Posted by Chivvon View Post
    Could upload the method that checks/calculates these combat styles?
    Where could I find that?
    Reply With Quote  
     

  4. #4  
    Super Donator

    Chivvon's Avatar
    Join Date
    May 2016
    Posts
    487
    Thanks given
    69
    Thanks received
    142
    Rep Power
    285
    Quote Originally Posted by Crucify View Post
    Where could I find that?
    Depends on your base...
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2012
    Posts
    109
    Thanks given
    9
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Chivvon View Post
    Depends on your base...
    Oh. Vencillio.
    Reply With Quote  
     

  6. #6  
    Super Donator

    Chivvon's Avatar
    Join Date
    May 2016
    Posts
    487
    Thanks given
    69
    Thanks received
    142
    Rep Power
    285
    Quote Originally Posted by Crucify View Post
    Oh. Vencillio.
    Found this real quick:
    Code:
    	public void attack() {
    		entity.face(attacking);
    		
    		if ((!attacking.isActive()) || (attacking.isDead()) || (entity.isDead()) || (attacking.getLocation().getZ() != entity.getLocation().getZ())) {
    			reset();
    			return;
    		}
    
    		if (!withinDistanceForAttack(combatType, false)) {
    			return;
    		}
    
    		if (!entity.canAttack()) {
    			entity.getFollowing().reset();
    			reset();
    			return;
    		}
    
    		entity.onCombatProcess(attacking);
    		switch (combatType) {
    		case MELEE:
    			melee.execute(attacking);
    			melee.setNextDamage(-1);
    			melee.setDamageBoost(1.0D);
    			break;
    		case MAGIC:
    			magic.execute(attacking);
    			magic.setMulti(false);
    			magic.setpDelay((byte) 0);
    			break;
    		case RANGED:
    			ranged.execute(attacking);
    			break;
    		case NONE:
    			break;
    		}
    
    		entity.afterCombatProcess(attacking);
    	}
    Best of luck.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Feb 2012
    Posts
    109
    Thanks given
    9
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Chivvon View Post
    Found this real quick:
    Code:
    	public void attack() {
    		entity.face(attacking);
    		
    		if ((!attacking.isActive()) || (attacking.isDead()) || (entity.isDead()) || (attacking.getLocation().getZ() != entity.getLocation().getZ())) {
    			reset();
    			return;
    		}
    
    		if (!withinDistanceForAttack(combatType, false)) {
    			return;
    		}
    
    		if (!entity.canAttack()) {
    			entity.getFollowing().reset();
    			reset();
    			return;
    		}
    
    		entity.onCombatProcess(attacking);
    		switch (combatType) {
    		case MELEE:
    			melee.execute(attacking);
    			melee.setNextDamage(-1);
    			melee.setDamageBoost(1.0D);
    			break;
    		case MAGIC:
    			magic.execute(attacking);
    			magic.setMulti(false);
    			magic.setpDelay((byte) 0);
    			break;
    		case RANGED:
    			ranged.execute(attacking);
    			break;
    		case NONE:
    			break;
    		}
    
    		entity.afterCombatProcess(attacking);
    	}
    Best of luck.
    Thank you.
    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. Runesource npc combat styles
    By Pellikan in forum Help
    Replies: 0
    Last Post: 05-03-2016, 01:22 AM
  2. Replies: 11
    Last Post: 06-05-2014, 05:56 AM
  3. Replies: 1
    Last Post: 01-07-2013, 07:42 AM
  4. Replies: 11
    Last Post: 07-05-2011, 01:03 AM
  5. protect from melee (npc's only)
    By WH:II:DOW in forum Tutorials
    Replies: 30
    Last Post: 01-13-2008, 04:38 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
  •