Code:
package com.rs.game.npc;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.rs.cache.Cache;
import com.rs.cache.loaders.NPCDefinitions;
import com.rs.cores.CoresManager;
import com.rs.game.Animation;
import com.rs.game.Entity;
import com.rs.game.Graphics;
import com.rs.game.Hit;
import com.rs.game.Hit.HitLook;
import com.rs.game.World;
import com.rs.game.WorldTile;
import com.rs.game.item.Item;
import com.rs.game.npc.combat.NPCCombat;
import com.rs.game.npc.combat.NPCCombatDefinitions;
import com.rs.game.npc.familiar.Familiar;
import com.rs.game.player.Player;
import com.rs.game.player.controlers.Wilderness;
import com.rs.game.tasks.WorldTask;
import com.rs.game.tasks.WorldTasksManager;
import com.rs.utils.MapAreas;
import com.rs.utils.NPCBonuses;
import com.rs.utils.NPCCombatDefinitionsL;
import com.rs.utils.NPCDrops;
import com.rs.utils.Utils;
public class NPC extends Entity implements Serializable {
private static final long serialVersionUID = -4794678936277614443L;
private int id;
private WorldTile respawnTile;
private int mapAreaNameHash;
private boolean canBeAttackFromOutOfArea;
private boolean randomwalk;
private int[] bonuses; // 0 stab, 1 slash, 2 crush,3 mage, 4 range, 5 stab
// def, blahblah till 9
private boolean spawned;
private transient NPCCombat combat;
private WorldTile forceWalk;
private long lastAttackedByTarget;
private boolean cantInteract;
private int capDamage;
private int lureDelay;
private boolean cantFollowUnderCombat;
private boolean forceAgressive;
private int forceTargetDistance;
private boolean forceFollowClose;
private boolean forceMultiAttacked;
// npc masks
private transient Transformation nextTransformation;
//name changing masks
private String name;
private transient boolean changedName;
private int combatLevel;
private transient boolean changedCombatLevel;
public Player instancedPlayer;
public NPC(int id, WorldTile tile, int mapAreaNameHash,
boolean canBeAttackFromOutOfArea) {
this(id, tile, mapAreaNameHash, canBeAttackFromOutOfArea, false);
}
/*
* creates and adds npc
*/
public NPC(int id, WorldTile tile, int mapAreaNameHash,
boolean canBeAttackFromOutOfArea, boolean spawned) {
super(tile);
this.id = id;
this.respawnTile = new WorldTile(tile);
this.mapAreaNameHash = mapAreaNameHash;
this.canBeAttackFromOutOfArea = canBeAttackFromOutOfArea;
this.spawned = spawned;
combatLevel = -1;
setHitpoints(getMaxHitpoints());
setDirection(getRespawnDirection());
setRandomWalk((getDefinitions().walkMask & 0x2) != 0
|| forceRandomWalk(id));
bonuses = NPCBonuses.getBonuses(id);
combat = new NPCCombat(this);
capDamage = -1;
lureDelay = 12000;
// npc is inited on creating instance
initEntity();
World.addNPC(this);
World.updateEntityRegion(this);
// npc is started on creating instance
loadMapRegions();
checkMultiArea();
}
@Override
public boolean needMasksUpdate() {
return super.needMasksUpdate() || nextTransformation != null || changedCombatLevel || changedName;
}
public void transformIntoNPC(int id) {
setNPC(id);
nextTransformation = new Transformation(id);
}
public void setNPC(int id) {
this.id = id;
bonuses = NPCBonuses.getBonuses(id);
}
@Override
public void resetMasks() {
super.resetMasks();
nextTransformation = null;
changedCombatLevel = false;
changedName = false;
}
public int getMapAreaNameHash() {
return mapAreaNameHash;
}
public boolean canBeAttackFromOutOfArea() {
return canBeAttackFromOutOfArea;
}
public NPCDefinitions getDefinitions() {
return NPCDefinitions.getNPCDefinitions(id);
}
public NPCCombatDefinitions getCombatDefinitions() {
return NPCCombatDefinitionsL.getNPCCombatDefinitions(id);
}
@Override
public int getMaxHitpoints() {
return getCombatDefinitions().getHitpoints();
}
public int getId() {
return id;
}
public static void main(String[] args) throws IOException {
Cache.init();
}
public void processNPC() {
if (isDead())
return;
if (!combat.process()) { // if not under combat
if (!isForceWalking()) {// combat still processed for attack delay
// go down
// random walk
if (!cantInteract) {
if (!checkAgressivity()) {
if (getFreezeDelay() < Utils.currentTimeMillis()) {
if (((hasRandomWalk()) && World.getRotation(
getPlane(), getX(), getY()) == 0) // temporary
// fix
&& Math.random() * 1000.0 < 100.0) {
int moveX = (int) Math
.round(Math.random() * 10.0 - 5.0);
int moveY = (int) Math
.round(Math.random() * 10.0 - 5.0);
resetWalkSteps();
if (getMapAreaNameHash() != -1) {
if (!MapAreas.isAtArea(getMapAreaNameHash(), this)) {
forceWalkRespawnTile();
return;
}
addWalkSteps(getX() + moveX, getY() + moveY, 5);
}else
addWalkSteps(respawnTile.getX() + moveX, respawnTile.getY() + moveY, 5);
}
}
}
}
}
}
if (isForceWalking()) {
if (getFreezeDelay() < Utils.currentTimeMillis()) {
setRandomWalk(false);
if(id == 519)
setRandomWalk(false);
if(id == 550)
setRandomWalk(false);
if(id == 546)
setRandomWalk(false);
if(id == 549)
setRandomWalk(false);
if(id == 683)
setRandomWalk(false);
if(id == 948)
setRandomWalk(false);
if(id == 2676)
setRandomWalk(false);
if(id == 445)
setRandomWalk(false);
if(id == 3299)
setRandomWalk(false);
if(id == 2732)
setRandomWalk(false);
if(id == 4906)
setRandomWalk(false);
if(id == 3706)
setRandomWalk(false);
if(id == 541)
setRandomWalk(false);
if(id == 2676)
setRandomWalk(false);
if(id == 949)
setRandomWalk(false);
if(id == 546)
setRandomWalk(false);
if(id == 683)
setRandomWalk(false);
if(id == 6970)
setRandomWalk(false);
if(id == 1861)
setRandomWalk(false);
if(id == 541)
setRandomWalk(false);
if(id == 4707)
setRandomWalk(false);
if(id == 461)
setRandomWalk(false);
if(id == 8461)
setRandomWalk(false);
if(id == 2537)
setRandomWalk(false);
if(id == 558)
setRandomWalk(false);
if(id == 6537)
setRandomWalk(false);
if(id == 2253)
setRandomWalk(false);
if(id == 520)
setRandomWalk(false);
if(id == 521)
setRandomWalk(false);
if(id == 522)
setRandomWalk(false);
if(id == 523)
setRandomWalk(false);
if(id == 524)
setRandomWalk(false);
if(id == 525)
setRandomWalk(false);
if(id == 526)
setRandomWalk(false);
if(id == 527)
setRandomWalk(false);
if(id == 528)
setRandomWalk(false);
if(id == 529)
setRandomWalk(false);
if(id == 530)
setRandomWalk(false);
if(id == 531)
setRandomWalk(false);
if(id == 532)
setRandomWalk(false);
if(id == 533)
setRandomWalk(false);
if(id == 683)
setRandomWalk(false);
if(id == 445)
setRandomWalk(false);
if(id == 948)
setRandomWalk(false);
if(id == 3299)
setRandomWalk(false);
if(id == 2732)
setRandomWalk(false);
if(id == 4906)
setRandomWalk(false);
if(id == 17)
setRandomWalk(false);
if (getX() != forceWalk.getX() || getY() != forceWalk.getY()) {
if (!hasWalkSteps())
addWalkSteps(forceWalk.getX(), forceWalk.getY(),
getSize(), true);
if (!hasWalkSteps()) { // failing finding route
setNextWorldTile(new WorldTile(forceWalk)); // force
// tele
// to
// the
// forcewalk
// place
forceWalk = null; // so ofc reached forcewalk place
}
} else
// walked till forcewalk place
forceWalk = null;
}
}
}
@Override
public void processEntity() {
super.processEntity();
processNPC();
}
public int getRespawnDirection() {
NPCDefinitions definitions = getDefinitions();
if (definitions.anInt853 << 32 != 0 && definitions.respawnDirection > 0
&& definitions.respawnDirection <= 8)
return (4 + definitions.respawnDirection) << 11;
return 0;
}
/*
* forces npc to random walk even if cache says no, used because of fake
* cache information
*/
private static boolean forceRandomWalk(int npcId) {
switch (npcId) {
case 11226:
return true;
default:
return false;
/*
* default: return NPCDefinitions.getNPCDefinitions(npcId).name
* .equals("Icy Bones");
*/
}
}
@Override
public void handleIngoingHit(final Hit hit) {
if (capDamage != -1 && hit.getDamage() > capDamage)
hit.setDamage(capDamage);
if (hit.getLook() != HitLook.MELEE_DAMAGE
&& hit.getLook() != HitLook.RANGE_DAMAGE
&& hit.getLook() != HitLook.MAGIC_DAMAGE)
return;
Entity source = hit.getSource();
if (source == null)
return;
if (source instanceof Player) {
final Player p2 = (Player) source;
if (p2.getPrayer().hasPrayersOn()) {
if (p2.getPrayer().usingPrayer(1, 18)) {
final NPC target = this;
if (hit.getDamage() > 0)
World.sendProjectile(p2, this, 2263, 11, 11, 20, 5, 0,
0);
p2.heal(hit.getDamage() / 5);
p2.getPrayer().drainPrayer(hit.getDamage() / 5);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2264));
if (hit.getDamage() > 0)
World.sendProjectile(target, p2, 2263, 11, 11,
20, 5, 0, 0);
}
}, 1);
}
if (hit.getDamage() == 0)
return;
if (!p2.getPrayer().isBoostedLeech()) {
if (hit.getLook() == HitLook.MELEE_DAMAGE) {
if (p2.getPrayer().usingPrayer(1, 19)) {
p2.getPrayer().setBoostedLeech(true);
return;
} else if (p2.getPrayer().usingPrayer(1, 1)) { // sap
// att
if (Utils.getRandom(4) == 0) {
if (p2.getPrayer().reachedMax(0)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your sap curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(0);
p2.getPackets()
.sendGameMessage(
"Your curse drains Attack from the enemy, boosting your Attack.",
true);
}
p2.setNextAnimation(new Animation(12569));
p2.setNextGraphics(new Graphics(2214));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2215, 35, 35,
20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2216));
}
}, 1);
return;
}
} else {
if (p2.getPrayer().usingPrayer(1, 10)) {
if (Utils.getRandom(7) == 0) {
if (p2.getPrayer().reachedMax(3)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your leech curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(3);
p2.getPackets()
.sendGameMessage(
"Your curse drains Attack from the enemy, boosting your Attack.",
true);
}
p2.setNextAnimation(new Animation(12575));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2231, 35,
35, 20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2232));
}
}, 1);
return;
}
}
if (p2.getPrayer().usingPrayer(1, 14)) {
if (Utils.getRandom(7) == 0) {
if (p2.getPrayer().reachedMax(7)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your leech curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(7);
p2.getPackets()
.sendGameMessage(
"Your curse drains Strength from the enemy, boosting your Strength.",
true);
}
p2.setNextAnimation(new Animation(12575));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2248, 35,
35, 20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2250));
}
}, 1);
return;
}
}
}
}
if (hit.getLook() == HitLook.RANGE_DAMAGE) {
if (p2.getPrayer().usingPrayer(1, 2)) { // sap range
if (Utils.getRandom(4) == 0) {
if (p2.getPrayer().reachedMax(1)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your sap curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(1);
p2.getPackets()
.sendGameMessage(
"Your curse drains Range from the enemy, boosting your Range.",
true);
}
p2.setNextAnimation(new Animation(12569));
p2.setNextGraphics(new Graphics(2217));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2218, 35, 35,
20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2219));
}
}, 1);
return;
}
} else if (p2.getPrayer().usingPrayer(1, 11)) {
if (Utils.getRandom(7) == 0) {
if (p2.getPrayer().reachedMax(4)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your leech curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(4);
p2.getPackets()
.sendGameMessage(
"Your curse drains Range from the enemy, boosting your Range.",
true);
}
p2.setNextAnimation(new Animation(12575));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2236, 35, 35,
20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2238));
}
});
return;
}
}
}
if (hit.getLook() == HitLook.MAGIC_DAMAGE) {
if (p2.getPrayer().usingPrayer(1, 3)) { // sap mage
if (Utils.getRandom(4) == 0) {
if (p2.getPrayer().reachedMax(2)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your sap curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(2);
p2.getPackets()
.sendGameMessage(
"Your curse drains Magic from the enemy, boosting your Magic.",
true);
}
p2.setNextAnimation(new Animation(12569));
p2.setNextGraphics(new Graphics(2220));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2221, 35, 35,
20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2222));
}
}, 1);
return;
}
} else if (p2.getPrayer().usingPrayer(1, 12)) {
if (Utils.getRandom(7) == 0) {
if (p2.getPrayer().reachedMax(5)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your leech curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(5);
p2.getPackets()
.sendGameMessage(
"Your curse drains Magic from the enemy, boosting your Magic.",
true);
}
p2.setNextAnimation(new Animation(12575));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2240, 35, 35,
20, 5, 0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2242));
}
}, 1);
return;
}
}
}
// overall
if (p2.getPrayer().usingPrayer(1, 13)) { // leech defence
if (Utils.getRandom(10) == 0) {
if (p2.getPrayer().reachedMax(6)) {
p2.getPackets()
.sendGameMessage(
"Your opponent has been weakened so much that your leech curse has no effect.",
true);
} else {
p2.getPrayer().increaseLeechBonus(6);
p2.getPackets()
.sendGameMessage(
"Your curse drains Defence from the enemy, boosting your Defence.",
true);
}
p2.setNextAnimation(new Animation(12575));
p2.getPrayer().setBoostedLeech(true);
World.sendProjectile(p2, this, 2244, 35, 35, 20, 5,
0, 0);
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
setNextGraphics(new Graphics(2246));
}
}, 1);
return;
}
}
}
}
}
}
@Override
public void reset() {
super.reset();
setDirection(getRespawnDirection());
combat.reset();
bonuses = NPCBonuses.getBonuses(id); // back to real bonuses
forceWalk = null;
}
@Override
public void finish() {
if (hasFinished())
return;
setFinished(true);
World.updateEntityRegion(this);
World.removeNPC(this);
}
public void setRespawnTask() {
if (!hasFinished()) {
reset();
setLocation(respawnTile);
finish();
}
CoresManager.slowExecutor.schedule(new Runnable() {
@Override
public void run() {
try {
spawn();
} catch (Exception e) {
e.printStackTrace();
} catch (Error e) {
e.printStackTrace();
}
}
}, getCombatDefinitions().getRespawnDelay() * 600,
TimeUnit.MILLISECONDS);
}
public void deserialize() {
if (combat == null)
combat = new NPCCombat(this);
spawn();
}
public void spawn() {
setFinished(false);
World.addNPC(this);
setLastRegionId(0);
World.updateEntityRegion(this);
loadMapRegions();
checkMultiArea();
}
public NPCCombat getCombat() {
return combat;
}
@Override
public void sendDeath(Entity source) {
final NPCCombatDefinitions defs = getCombatDefinitions();
resetWalkSteps();
combat.removeTarget();
setNextAnimation(null);
WorldTasksManager.schedule(new WorldTask() {
int loop;
@Override
public void run() {
if (loop == 0) {
setNextAnimation(new Animation(defs.getDeathEmote()));
} else if (loop >= defs.getDeathDelay()) {
drop();
reset();
setLocation(respawnTile);
finish();
if (!spawned)
setRespawnTask();
stop();
}
loop++;
}
}, 0, 1);
}
public void drop() {
try {
Drop[] drops = NPCDrops.getDrops(id);
if (drops == null)
return;
Player killer = getMostDamageReceivedSourcePlayer();
if (killer == null)
return;
/*
* SlayerTask task = (SlayerTask)
* killer.getTemporaryAttributtes().get( "SlayerTask"); if (task !=
* null) { if (task.getName().contains(getDefinitions().name)) {
* Slayer.killedTask(killer, this); } }
*/
Drop[] possibleDrops = new Drop[drops.length];
int possibleDropsCount = 0;
for (Drop drop : drops) {
if (drop.getRate() == 100)
sendDrop(killer, drop);
else {
if ((Utils.getRandomDouble(99) + 1) <= drop.getRate() * 1.5)
possibleDrops[possibleDropsCount++] = drop;
}
}
if (possibleDropsCount > 0)
sendDrop(killer,
possibleDrops[Utils.getRandom(possibleDropsCount - 1)]);
} catch (Exception e) {
e.printStackTrace();
} catch (Error e) {
e.printStackTrace();
}
}
public void sendDrop(Player player, Drop drop) {
int size = getSize();
World.addGroundItem(new Item(drop.getItemId(), drop.getMinAmount()
+ Utils.getRandom(drop.getExtraAmount())), new WorldTile(
getCoordFaceX(size), getCoordFaceY(size), getPlane()), player,
false, 180, true);
}
@Override
public int getSize() {
return getDefinitions().size;
}
public int getMaxHit() {
return getCombatDefinitions().getMaxHit();
}
public int[] getBonuses() {
return bonuses;
}
@Override
public double getMagePrayerMultiplier() {
return 0;
}
@Override
public double getRangePrayerMultiplier() {
return 0;
}
@Override
public double getMeleePrayerMultiplier() {
return 0;
}
public WorldTile getRespawnTile() {
return respawnTile;
}
public boolean isUnderCombat() {
return combat.underCombat();
}
@Override
public void setAttackedBy(Entity target) {
super.setAttackedBy(target);
if (target == combat.getTarget()
&& !(combat.getTarget() instanceof Familiar))
lastAttackedByTarget = Utils.currentTimeMillis();
}
public boolean isFamiliar() {
return this instanceof Familiar;
}
public boolean canBeAttackedByAutoRelatie() {
return Utils.currentTimeMillis() - lastAttackedByTarget > lureDelay;
}
public boolean isForceWalking() {
return forceWalk != null;
}
public void setTarget(Entity entity) {
if (isForceWalking()) // if force walk not gonna get target
return;
combat.setTarget(entity);
lastAttackedByTarget = Utils.currentTimeMillis();
}
public void removeTarget() {
if (combat.getTarget() == null)
return;
combat.removeTarget();
}
public void forceWalkRespawnTile() {
setForceWalk(respawnTile);
}
public void setForceWalk(WorldTile tile) {
resetWalkSteps();
forceWalk = tile;
}
public boolean hasForceWalk() {
return forceWalk != null;
}
public ArrayList<Entity> getPossibleTargets() {
ArrayList<Entity> possibleTarget = new ArrayList<Entity>();
for (int regionId : getMapRegionsIds()) {
List<Integer> playerIndexes = World.getRegion(regionId)
.getPlayerIndexes();
if (playerIndexes != null) {
for (int npcIndex : playerIndexes) {
Player player = World.getPlayers().get(npcIndex);
if (player == null
|| player.isDead()
|| player.hasFinished()
|| !player.isRunning()
|| !player
.withinDistance(
this,
forceTargetDistance > 0 ? forceTargetDistance
: (getCombatDefinitions()
.getAttackStyle() == NPCCombatDefinitions.MELEE ? 4
: getCombatDefinitions()
.getAttackStyle() == NPCCombatDefinitions.SPECIAL ? 64
: 8))
|| (!forceMultiAttacked
&& (!isAtMultiArea() || !player
.isAtMultiArea())
&& player.getAttackedBy() != this && (player
.getAttackedByDelay() > System
.currentTimeMillis() || player
.getFindTargetDelay() > System
.currentTimeMillis()))
|| !clipedProjectile(player, false)
|| (!forceAgressive && !Wilderness.isAtWild(this) && player
.getSkills().getCombatLevelWithSummoning() >= getDefinitions().combatLevel * 2))
continue;
possibleTarget.add(player);
}
}
}
return possibleTarget;
}
public boolean checkAgressivity() {
// if(!(Wilderness.isAtWild(this) &&
// getDefinitions().hasAttackOption())) {
if (!forceAgressive) {
NPCCombatDefinitions defs = getCombatDefinitions();
if (defs.getAgressivenessType() == NPCCombatDefinitions.PASSIVE)
return false;
}
// }
ArrayList<Entity> possibleTarget = getPossibleTargets();
if (!possibleTarget.isEmpty()) {
Entity target = possibleTarget.get(Utils.getRandom(possibleTarget
.size() - 1));
setTarget(target);
target.setAttackedBy(target);
target.setFindTargetDelay(Utils.currentTimeMillis() + 10000);
return true;
}
return false;
}
public boolean isCantInteract() {
return cantInteract;
}
public void setCantInteract(boolean cantInteract) {
this.cantInteract = cantInteract;
if (cantInteract)
combat.reset();
}
public int getCapDamage() {
return capDamage;
}
public void setCapDamage(int capDamage) {
this.capDamage = capDamage;
}
public int getLureDelay() {
return lureDelay;
}
public void setLureDelay(int lureDelay) {
this.lureDelay = lureDelay;
}
public boolean isCantFollowUnderCombat() {
return cantFollowUnderCombat;
}
public void setCantFollowUnderCombat(boolean canFollowUnderCombat) {
this.cantFollowUnderCombat = canFollowUnderCombat;
}
public Transformation getNextTransformation() {
return nextTransformation;
}
@Override
public String toString() {
return getDefinitions().name + " - " + id + " - " + getX() + " "
+ getY() + " " + getPlane();
}
public boolean isForceAgressive() {
return forceAgressive;
}
public void setForceAgressive(boolean forceAgressive) {
this.forceAgressive = forceAgressive;
}
public int getForceTargetDistance() {
return forceTargetDistance;
}
public void setForceTargetDistance(int forceTargetDistance) {
this.forceTargetDistance = forceTargetDistance;
}
public boolean isForceFollowClose() {
return forceFollowClose;
}
public void setForceFollowClose(boolean forceFollowClose) {
this.forceFollowClose = forceFollowClose;
}
public boolean isForceMultiAttacked() {
return forceMultiAttacked;
}
public void setForceMultiAttacked(boolean forceMultiAttacked) {
this.forceMultiAttacked = forceMultiAttacked;
}
public boolean hasRandomWalk() {
return randomwalk;
}
public void setRandomWalk(boolean forceRandomWalk) {
this.randomwalk = forceRandomWalk;
}
public String getCustomName() {
return name;
}
public void setName(String string) {
this.name = getDefinitions().name.equals(string) ? null : string;
changedName = true;
}
public int getCustomCombatLevel() {
return combatLevel;
}
public int getCombatLevel() {
return combatLevel >= 0 ? combatLevel : getDefinitions().combatLevel;
}
public String getName() {
return name != null ? name : getDefinitions().name;
}
public void setCombatLevel(int level) {
combatLevel = getDefinitions().combatLevel == level ? -1 : level;
changedCombatLevel = true;
}
public boolean hasChangedName() {
return changedName;
}
public boolean hasChangedCombatLevel() {
return changedCombatLevel;
}
public WorldTile getMiddleWorldTile() {
int size = getSize();
return new WorldTile(getCoordFaceX(size),getCoordFaceY(size), getPlane());
}
}
Thanks for doing this brah