Jump to content

Featured Replies

Posted
comment_12926

Nothing to special, could use a bit of work, with projectile id's, just copied the Crazy Archaeologist and edited.

Easy to modify, just did it quickly as I was testing the area for my own project, but enjoy.

        package com.vencillio.rs2.entity.mob.impl.wild;

        import com.vencillio.core.task.Task;
        import com.vencillio.core.task.TaskQueue;
        import com.vencillio.core.util.Utility;
        import com.vencillio.rs2.content.combat.Hit;
        import com.vencillio.rs2.content.combat.Hit.HitTypes;
        import com.vencillio.rs2.entity.Entity;
        import com.vencillio.rs2.entity.Location;
        import com.vencillio.rs2.entity.Projectile;
        import com.vencillio.rs2.entity.World;
        import com.vencillio.rs2.entity.mob.Mob;
        import com.vencillio.rs2.entity.player.Player;

        /**
         * Handles the Deranged Archaeologist boss
         * @author Bojack
         * You'll have to find the Co-ord yourself. 
         */
        public class Deranged Archaeologist extends Mob {

        	public Deranged Archaeologist() {
        		super(7806, true, new Location(-, -, 0));
        	}
        	
        	private String[] messages = {
        		"Round and round and round and round!",
        		"The plants! They're alive!",
        		"They came from the ground! They came from the ground!!!",
        		"The doors won't stay closed forever!",
        		"They're cheering! Why are they cheering?",
        		"Time is running out! She will rise again!",
        	};
        	
        	private final String specialMessage = "Learn to Read!";
        	
        	private final String deathMessage = "Ow!";
        	
        	private boolean usingSpecial = false;
        	
        	@Override
        	public void onHit(Entity entity, Hit hit) {
        		if (entity != null && !entity.isNpc()) {
        			int random = Utility.random(10);
        			if (random == 1) {
        				usingSpecial = true;
        				getUpdateFlags().sendForceMessage(specialMessage);	
        				special(entity.getPlayer());
        			} else if (!isDead() || !usingSpecial) {
        				getUpdateFlags().sendForceMessage(Utility.randomElement(messages));				
        			}
        		}
        	}
        	
        	@Override
        	public void onDeath() {
        		getUpdateFlags().sendForceMessage(deathMessage);		
        	}
        	
        	public void special(Player player) {
        		for (int i = 0; i < 3; i++) {
        			int offsetX = player.getX() - getX();
        			int offsetY = player.getY() - getY();
        			if (i == 0 || i == 2) {
        				offsetX += i == 0 ? -1 : 1;
        				offsetY++;
        			}
        			Location end = new Location(getX() + offsetX, getY() + offsetY, 0);
        			World.sendProjectile(new Projectile(551, 1, 10, 100, 65, 10, 20), getLocation(), -1, (byte) offsetX, (byte) offsetY);
        			World.sendStillGraphic(659, 100, end);
        			TaskQueue.queue(new Task(player, 3, false) {
        				@Override
        				public void execute() {
        					stop();
        				}
        	
        				@Override
        				public void onStop() {
        					if (player.getLocation().equals(end)) {
        						int damage = Utility.random(15) + Utility.random(15) + 12;
        						if (damage > 53) {
        							damage = 53;
        						}
        						player.hit(new Hit(damage, HitTypes.MAGIC));
        						usingSpecial = false;
        					}
        				}
        			});
        		}			
        	}
        	
        }

 

  • 1 year later...
  • 5 months later...
  • 9 months later...
  • 1 month later...
  • 1 year later...
  • 1 month later...
  • 10 months later...

Create an account or sign in to comment