Thread: boss help updated the script take alook

Results 1 to 4 of 4
  1. #1 boss help updated the script take alook 
    Registered Member
    Join Date
    Apr 2012
    Posts
    23
    Thanks given
    1
    Thanks received
    2
    Rep Power
    44
    Code:
    public class vindybossCombat extends CombatScript {
    
    
    	private int location = Utils.random(3);
    
    	@Override
    	public Object[] getKeys() {
    		return new Object[] { 22459, 22460 };
    	}
    
    	private void slice(NPC npc, Entity target) {
    		if (npc.getId() == 22459) {
    			npc.setNextAnimation(new Animation(28253));
    			Hit hit = getMeleeHit(
    					npc,
    					getMaxHit(npc, Utils.random(1500, 3000),
    							NPCCombatDefinitions.MELEE, target));
    			delayHit(npc, 0, target, hit);
    		}
    	}
    
    	private void hurricane(NPC npc, Entity target) {
    		npc.setNextAnimation(new Animation(28256));
    		npc.setNextGraphics(new Graphics(6111));
    		for (Entity t : npc.getPossibleTargets()) {
    			Hit hit = getMeleeHit(
    					npc,
    					getMaxHit(npc, Utils.random(2000, 3000),
    							NPCCombatDefinitions.MELEE, t));
    			delayHit(npc, 0, t, hit);
    		}
    	}
    
    	private void fly(NPC npc) {
    		if (npc.getId() == 22460) {
    			npc.setNextAnimation(new Animation(28275));
    			npc.setNextGraphics(new Graphics(6118));
    			npc.setCantInteract(true);
    			WorldTasksManager.schedule(new WorldTask() {
    				@Override
    				public void run() {
    					land(npc);
    					npc.setCantInteract(false);
    					stop();
    				}
    			}, 2, 1);
    		}
    	}
    
    	private void land(NPC npc) {
    		if (npc.getId() == 22460) {
    			npc.setNextAnimation(new Animation(28276));
    			npc.setNextGraphics(new Graphics(6118));
    		}
    	}
    
    	private void stab(NPC npc, Entity target) {
    		npc.setNextAnimation(new Animation(28273));
    		Hit hit = getMeleeHit(
    				npc,
    				getMaxHit(npc, Utils.random(2000, 3500),
    						NPCCombatDefinitions.MELEE, target));
    		delayHit(npc, 0, target, hit);
    	}
    
    	private void dragonBreath(NPC npc, Entity target) {
    			npc.setNextAnimation(new Animation(28277));
    			WorldTasksManager.schedule(new WorldTask() {
    				@Override
    				public void run() {
    					for (int i = 0; i < 20; i++) {
    						if (location == 0 || location == 1) {
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() + i, target
    											.getY() + i, 1));
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() - i, target
    											.getY() - i, 1));
    							
    						} else if (location == 2 || location == 3) {
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() + i, target
    											.getY() - i, 1));
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() - i, target
    											.getY() + i, 1));
    						}
    						stop();
    					}
    				}
    			}, 1, 1);
    	}
    	
    
    	private void rangedAttack(NPC npc, Entity target) {
    		npc.setNextAnimation(new Animation(28271));
    	}
    
    	private void startDragonFire(NPC npc, Entity target) {
    			npc.setNextAnimation(new Animation(28259));
    			World.sendGraphics(target, new Graphics(6114),
    					new WorldTile(target.getX() + 1, target.getY() + 1, 1));
    			WorldTasksManager.schedule(new WorldTask() {
    				
    				int fire = Utils.random(1);
    				
    				
    				
    
    				@Override
    				public void run() {
    					for (int i = 0; i < 20; i++) {
    						if (fire == 1) {
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() + i, target
    											.getY() + i, 1));
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() - i, target
    											.getY() - i, 1));
    							target.getY();
    							target.getX();
    						}
    						if (fire == 0 || fire == 2) {
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() + i, target
    											.getY() - i, 1));
    							World.sendGraphics(
    									target,
    									new Graphics(6112),
    									new WorldTile(target.getX() - i, target
    											.getY() + i, 1));
    						}
    						stop();
    					}
    				}
    			}, 0, 1);
    	}
    	
    	
    	public void checkCoords(NPC npc, Entity target) {
    		for (int i = 0; i < 20; i++) {
    				if ((target.getX() == target.getY()
    						- i || target.getX() == target.getX()
    						+ i)
    						&& (target.getY() == target.getY()
    								- i || target.getX() == target.getX()
    								+ i)) {
    					target.applyHit(new Hit(target,
    							Utils.random(5, 10),
    							HitLook.MAGIC_DAMAGE));
    				}
    			}
    		}
    			
    
    	@Override
    	public int attack(NPC npc, Entity target) {
    		if (npc.getId() == 22459) {
    			switch (Utils.getRandom(6)) {
    			case 0:
    				slice(npc, target);
    				break;
    			case 1:
    				slice(npc, target);
    				break;
    			case 2:
    				hurricane(npc, target);
    				break;
    			case 4:
    				slice(npc, target);
    				break;
    			case 5:
    				slice(npc, target);
    				break;
    			case 6:
    				startDragonFire(npc, target);
    				break;
    			}
    			return npc.getAttackSpeed();
    		} else if (npc.getId() == 22460) {
    			switch (Utils.getRandom(5)) {
    			case 0:
    				stab(npc, target);
    				break;
    			case 2:
    				rangedAttack(npc, target);
    				break;
    			case 3:
    				stab(npc, target);
    				break;
    			case 4:
    				fly(npc);
    				break;
    			case 5:
    				dragonBreath(npc, target);
    				break;
    			}
    			return npc.getAttackSpeed() - 1;
    		}
    		return npc.getAttackSpeed();
    	}
    
    }







    i am trying to damage the player when the player is in the fire and when he moves out of fire no more damages but i cant work it out lol
    Reply With Quote  
     

  2. #2  
    Registered Member
    King Zeus's Avatar
    Join Date
    Jan 2018
    Posts
    205
    Thanks given
    40
    Thanks received
    82
    Rep Power
    178
    I messaged you a way on your discord. Hope that it helps
    ---------------------------------------------
    My Contributions:
    [317]
    Run Regeneration
    [OSRS]
    Prifddinas Agility Course
    Priffdinnas NPC Spawns
    ---------------------------------------------
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2012
    Posts
    23
    Thanks given
    1
    Thanks received
    2
    Rep Power
    44
    [code] public class vindybossCombat extends CombatScript {


    private int location = Utils.random(3);

    @Override
    public Object[] getKeys() {
    return new Object[] { 22459, 22460 };
    }

    private void slice(NPC npc, Entity target) {
    if (npc.getId() == 22459) {
    npc.setNextAnimation(new Animation(28253));
    Hit hit = getMeleeHit(
    npc,
    getMaxHit(npc, Utils.random(1500, 3000),
    NPCCombatDefinitions.MELEE, target));
    delayHit(npc, 0, target, hit);
    }
    }

    private void hurricane(NPC npc, Entity target) {
    npc.setNextAnimation(new Animation(28256));
    npc.setNextGraphics(new Graphics(6111));
    for (Entity t : npc.getPossibleTargets()) {
    Hit hit = getMeleeHit(
    npc,
    getMaxHit(npc, Utils.random(2000, 3000),
    NPCCombatDefinitions.MELEE, t));
    delayHit(npc, 0, t, hit);
    }
    }

    private void fly(NPC npc) {
    if (npc.getId() == 22460) {
    npc.setNextAnimation(new Animation(28275));
    npc.setNextGraphics(new Graphics(6118));
    npc.setCantInteract(true);
    WorldTasksManager.schedule(new WorldTask() {
    @Override
    public void run() {
    land(npc);
    npc.setCantInteract(false);
    stop();
    }
    }, 2, 1);
    }
    }

    private void land(NPC npc) {
    if (npc.getId() == 22460) {
    npc.setNextAnimation(new Animation(28276));
    npc.setNextGraphics(new Graphics(6118));
    }
    }

    private void stab(NPC npc, Entity target) {
    npc.setNextAnimation(new Animation(28273));
    Hit hit = getMeleeHit(
    npc,
    getMaxHit(npc, Utils.random(2000, 3500),
    NPCCombatDefinitions.MELEE, target));
    delayHit(npc, 0, target, hit);
    }

    private void dragonBreath(NPC npc, Entity target) {
    npc.setNextAnimation(new Animation(28277));
    WorldTasksManager.schedule(new WorldTask() {
    @Override
    public void run() {
    for (int i = 0; i < 20; i++) {
    if (location == 0 || location == 1) {
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() + i, target
    .getY() + i, 1));
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() - i, target
    .getY() - i, 1));

    } else if (location == 2 || location == 3) {
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() + i, target
    .getY() - i, 1));
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() - i, target
    .getY() + i, 1));
    }
    stop();
    }
    }
    }, 1, 1);
    }


    private void rangedAttack(NPC npc, Entity target) {
    npc.setNextAnimation(new Animation(28271));
    }

    private void startDragonFire(NPC npc, Entity target) {
    npc.setNextAnimation(new Animation(28259));
    World.sendGraphics(target, new Graphics(6114),
    new WorldTile(target.getX() + 1, target.getY() + 1, 1));
    WorldTasksManager.schedule(new WorldTask() {

    int fire = Utils.random(1);




    @Override
    public void run() {
    for (int i = 0; i < 20; i++) {
    if (fire == 1) {
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() + i, target
    .getY() + i, 1));
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() - i, target
    .getY() - i, 1));
    target.getY();
    target.getX();
    }
    if (fire == 0 || fire == 2) {
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() + i, target
    .getY() - i, 1));
    World.sendGraphics(
    target,
    new Graphics(6112),
    new WorldTile(target.getX() - i, target
    .getY() + i, 1));
    }
    stop();
    }
    }
    }, 0, 1);
    }


    public void checkCoords(NPC npc, Entity target) {
    for (int i = 0; i < 20; i++) {
    if ((target.getX() == target.getY()
    - i || target.getX() == target.getX()
    + i)
    && (target.getY() == target.getY()
    - i || target.getX() == target.getX()
    + i)) {
    target.applyHit(new Hit(target,
    Utils.random(5, 10),
    HitLook.MAGIC_DAMAGE));
    }
    }
    }


    @Override
    public int attack(NPC npc, Entity target) {
    if (npc.getId() == 22459) {
    switch (Utils.getRandom(6)) {
    case 0:
    slice(npc, target);
    break;
    case 1:
    slice(npc, target);
    break;
    case 2:
    hurricane(npc, target);
    break;
    case 4:
    slice(npc, target);
    break;
    case 5:
    slice(npc, target);
    break;
    case 6:
    startDragonFire(npc, target);
    break;
    }
    return npc.getAttackSpeed();
    } else if (npc.getId() == 22460) {
    switch (Utils.getRandom(5)) {
    case 0:
    stab(npc, target);
    break;
    case 2:
    rangedAttack(npc, target);
    break;
    case 3:
    stab(npc, target);
    break;
    case 4:
    fly(npc);
    break;
    case 5:
    dragonBreath(npc, target);
    break;
    }
    return npc.getAttackSpeed() - 1;
    }
    return npc.getAttackSpeed();
    }

    } [ /code]
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jun 2019
    Posts
    203
    Thanks given
    99
    Thanks received
    44
    Rep Power
    0
    Use [code] [ /code] tags .
    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. boss help
    By Xxp3restr in forum Help
    Replies: 1
    Last Post: 06-28-2012, 11:03 AM
  2. new boss help
    By videowiz07 in forum Help
    Replies: 1
    Last Post: 06-13-2012, 04:25 PM
  3. new boss help
    By videowiz07 in forum Requests
    Replies: 0
    Last Post: 06-11-2012, 04:31 AM
  4. Replies: 0
    Last Post: 01-13-2011, 04:06 AM
  5. GWD Bosses help?!
    By daone11 in forum Help
    Replies: 1
    Last Post: 08-16-2010, 09:14 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
  •