Preemptive bugfixing part 3
This commit is contained in:
@@ -58,7 +58,7 @@ public final class NPCDefinition extends Definition<NPC> {
|
||||
public boolean isVisibleOnMap;
|
||||
|
||||
|
||||
public String examine;
|
||||
/* public String examine;*/
|
||||
|
||||
/**
|
||||
* The drop tables.
|
||||
@@ -623,6 +623,8 @@ public final class NPCDefinition extends Definition<NPC> {
|
||||
case 4:
|
||||
name = NPCConfigParser.DEATH_ANIMATION;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return getConfiguration(name, null);
|
||||
}
|
||||
|
||||
@@ -64,12 +64,11 @@ public class RenderAnimationDefinition {
|
||||
* @return The render animation definitions.
|
||||
*/
|
||||
public static RenderAnimationDefinition forId(int animId) {
|
||||
RenderAnimationDefinition defs = new RenderAnimationDefinition();
|
||||
if (animId == -1) {
|
||||
return null;
|
||||
}
|
||||
byte[] data = Cache.getIndexes()[2].getFileData(32, animId);
|
||||
defs = new RenderAnimationDefinition();
|
||||
RenderAnimationDefinition defs = new RenderAnimationDefinition();
|
||||
if (data != null) {
|
||||
defs.parse(ByteBuffer.wrap(data));
|
||||
} else {
|
||||
|
||||
@@ -1164,7 +1164,7 @@ public final class RangingGuildPlugin extends OptionHandler {
|
||||
cumulativeStr += 1;
|
||||
}*/
|
||||
cumulativeStr *= 1.0;
|
||||
int hit = (int) ((14 + cumulativeStr + (bonus / 8) + ((cumulativeStr * bonus) * 0.016865)) * 1.0) / 10 + 1;
|
||||
int hit = (int) ((14 + cumulativeStr + (bonus / 8) + ((cumulativeStr * bonus) * 0.016865))) / 10 + 1;
|
||||
hit = hit + RandomFunction.randomSign(RandomFunction.random(3));
|
||||
|
||||
int target = Math.max(0, 13 - hit);
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import core.game.node.entity.Entity;
|
||||
import core.game.node.entity.combat.BattleState;
|
||||
import core.game.node.entity.combat.CombatStyle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import rs09.game.node.entity.combat.CombatSwingHandler;
|
||||
import core.game.node.entity.combat.InteractionType;
|
||||
import core.game.node.entity.combat.equipment.ArmourSet;
|
||||
@@ -76,7 +77,7 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
|
||||
}
|
||||
BattleState[] targets;
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
state.setTargets(targets = list.toArray(new BattleState[list.size()]));
|
||||
state.setTargets(targets = list.toArray(new BattleState[0]));
|
||||
for (BattleState s : targets) {
|
||||
s.setStyle(CombatStyle.RANGE);
|
||||
int hit = 0;
|
||||
@@ -93,41 +94,46 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
switch (state.getStyle()) {
|
||||
case MELEE:
|
||||
entity.animate(MELEE_ATTACK);
|
||||
break;
|
||||
default:
|
||||
entity.animate(RANGE_ATTACK);
|
||||
for (BattleState s : state.getTargets()) {
|
||||
Projectile.ranged(entity, s.getVictim(), 1200, 0, 0, 46, 1).send();
|
||||
if(state != null) {
|
||||
if (state.getStyle() == CombatStyle.MELEE) {
|
||||
entity.animate(MELEE_ATTACK);
|
||||
} else {
|
||||
entity.animate(RANGE_ATTACK);
|
||||
for (BattleState s : state.getTargets()) {
|
||||
Projectile.ranged(entity, s.getVictim(), 1200, 0, 0, 46, 1).send();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmourSet getArmourSet(Entity e) {
|
||||
return getType().getSwingHandler().getArmourSet(e);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().getArmourSet(e);
|
||||
else return ArmourSet.AHRIM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSetMultiplier(Entity e, int skillId) {
|
||||
return getType().getSwingHandler().getSetMultiplier(e, skillId);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().getSetMultiplier(e, skillId);
|
||||
else return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() == CombatStyle.MELEE) {
|
||||
if (state != null && state.getStyle() != null && state.getStyle() == CombatStyle.MELEE) {
|
||||
state.getStyle().getSwingHandler().impact(entity, victim, state);
|
||||
return;
|
||||
}
|
||||
for (BattleState s : state.getTargets()) {
|
||||
if (s == null || s.getEstimatedHit() < 0) {
|
||||
continue;
|
||||
if(state != null && state.getTargets() != null) {
|
||||
for (BattleState s : state.getTargets()) {
|
||||
if (s == null || s.getEstimatedHit() < 0) {
|
||||
continue;
|
||||
}
|
||||
int hit = s.getEstimatedHit();
|
||||
s.getVictim().getImpactHandler().handleImpact(entity, hit, CombatStyle.RANGE, s);
|
||||
}
|
||||
int hit = s.getEstimatedHit();
|
||||
s.getVictim().getImpactHandler().handleImpact(entity, hit, CombatStyle.RANGE, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,17 +161,23 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public int calculateAccuracy(Entity entity) {
|
||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateDefence(Entity victim, Entity attacker) {
|
||||
return getType().getSwingHandler().calculateDefence(victim, attacker);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateDefence(victim, attacker);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateHit(Entity entity, Entity victim, double modifier) {
|
||||
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,11 +61,11 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
||||
@Override
|
||||
public int swing(Entity entity, Entity victim, BattleState state) {
|
||||
int ticks = 1;
|
||||
int distance = entity.size() >> 1;
|
||||
if (!entity.inCombat()) {
|
||||
int distance = entity != null ? entity.size() >> 1 : 0;
|
||||
if (entity != null && !entity.inCombat()) {
|
||||
distance++;
|
||||
}
|
||||
if (victim.getLocation().withinDistance(entity.getCenterLocation(), distance) && RandomFunction.RANDOM.nextBoolean()) {
|
||||
if (entity != null && victim.getLocation().withinDistance(entity.getCenterLocation(), distance) && RandomFunction.RANDOM.nextBoolean()) {
|
||||
int hit = 0;
|
||||
int max = CombatStyle.MELEE.getSwingHandler().calculateHit(entity, victim, 1.0);
|
||||
if (CombatStyle.MELEE.getSwingHandler().isAccurateImpact(entity, victim, CombatStyle.MELEE)) {
|
||||
@@ -80,7 +80,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
||||
state.setMaximumHit(max);
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
} else {
|
||||
ticks += (int) Math.ceil(entity.getLocation().getDistance(victim.getLocation()) * 0.3);
|
||||
ticks += (int) Math.ceil(entity != null ? entity.getLocation().getDistance(victim.getLocation()) : 0.0 * 0.3);
|
||||
NPC npc = (NPC) entity;
|
||||
List<BattleState> list = new ArrayList<>(20);
|
||||
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
||||
@@ -93,7 +93,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
||||
}
|
||||
BattleState[] targets;
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
state.setTargets(targets = list.toArray(new BattleState[list.size()]));
|
||||
state.setTargets(targets = list.toArray(new BattleState[0]));
|
||||
for (BattleState s : targets) {
|
||||
CombatStyle style = RandomFunction.randomize(10) < 3 ? CombatStyle.MAGIC : CombatStyle.RANGE;
|
||||
s.setStyle(style);
|
||||
@@ -114,62 +114,69 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
switch (state.getStyle()) {
|
||||
case MELEE:
|
||||
entity.animate(MELEE_ATTACK);
|
||||
break;
|
||||
default:
|
||||
entity.animate(RANGE_ATTACK);
|
||||
for (BattleState s : state.getTargets()) {
|
||||
int gfxId = 1197;
|
||||
if (s.getStyle() == CombatStyle.MAGIC) {
|
||||
gfxId = 1198;
|
||||
if(state != null) {
|
||||
if (state.getStyle() == CombatStyle.MELEE) {
|
||||
entity.animate(MELEE_ATTACK);
|
||||
} else {
|
||||
entity.animate(RANGE_ATTACK);
|
||||
for (BattleState s : state.getTargets()) {
|
||||
int gfxId = 1197;
|
||||
if (s.getStyle() == CombatStyle.MAGIC) {
|
||||
gfxId = 1198;
|
||||
}
|
||||
Projectile.ranged(entity, s.getVictim(), gfxId, 92, 36, 46, 5).send();
|
||||
}
|
||||
Projectile.ranged(entity, s.getVictim(), gfxId, 92, 36, 46, 5).send();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmourSet getArmourSet(Entity e) {
|
||||
return getType().getSwingHandler().getArmourSet(e);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().getArmourSet(e);
|
||||
else return ArmourSet.AHRIM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSetMultiplier(Entity e, int skillId) {
|
||||
return getType().getSwingHandler().getSetMultiplier(e, skillId);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().getSetMultiplier(e, skillId);
|
||||
else return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() == CombatStyle.MELEE) {
|
||||
if (state != null && state.getStyle() == CombatStyle.MELEE) {
|
||||
state.getStyle().getSwingHandler().impact(entity, victim, state);
|
||||
return;
|
||||
}
|
||||
for (BattleState s : state.getTargets()) {
|
||||
if (s == null || s.getEstimatedHit() < 0) {
|
||||
continue;
|
||||
if(state != null) {
|
||||
for (BattleState s : state.getTargets()) {
|
||||
if (s == null || s.getEstimatedHit() < 0) {
|
||||
continue;
|
||||
}
|
||||
int hit = s.getEstimatedHit();
|
||||
s.getVictim().getImpactHandler().handleImpact(entity, hit, s.getStyle(), s);
|
||||
}
|
||||
int hit = s.getEstimatedHit();
|
||||
s.getVictim().getImpactHandler().handleImpact(entity, hit, s.getStyle(), s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() == CombatStyle.MELEE) {
|
||||
if (state != null && state.getStyle() == CombatStyle.MELEE) {
|
||||
victim.animate(victim.getProperties().getDefenceAnimation());
|
||||
return;
|
||||
}
|
||||
for (BattleState s : state.getTargets()) {
|
||||
s.getVictim().animate(s.getVictim().getProperties().getDefenceAnimation());
|
||||
if (RandomFunction.randomize(10) < 8) {
|
||||
Direction dir = Direction.getLogicalDirection(entity.getLocation(), s.getVictim().getLocation());
|
||||
Location destination = s.getVictim().getLocation().transform(dir.getStepX(), dir.getStepY(), 0);
|
||||
if (CHAMBER.insideBorder(destination)) {
|
||||
s.getVictim().getProperties().setTeleportLocation(destination);
|
||||
s.getVictim().graphics(END_GRAPHIC);
|
||||
if(state != null) {
|
||||
for (BattleState s : state.getTargets()) {
|
||||
s.getVictim().animate(s.getVictim().getProperties().getDefenceAnimation());
|
||||
if (RandomFunction.randomize(10) < 8) {
|
||||
Direction dir = Direction.getLogicalDirection(entity.getLocation(), s.getVictim().getLocation());
|
||||
Location destination = s.getVictim().getLocation().transform(dir.getStepX(), dir.getStepY(), 0);
|
||||
if (CHAMBER.insideBorder(destination)) {
|
||||
s.getVictim().getProperties().setTeleportLocation(destination);
|
||||
s.getVictim().graphics(END_GRAPHIC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,17 +195,23 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public int calculateAccuracy(Entity entity) {
|
||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateDefence(Entity victim, Entity attacker) {
|
||||
return getType().getSwingHandler().calculateDefence(victim, attacker);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateDefence(victim, attacker);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateHit(Entity entity, Entity victim, double modifier) {
|
||||
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
|
||||
victim.getStateManager().register(EntityState.POISONED, false, 168, entity);
|
||||
}
|
||||
if (special) {
|
||||
((Player) victim).getSkills().decrementPrayerPoints(hit / 2);
|
||||
((Player) victim).getSkills().decrementPrayerPoints((double) hit / 2);
|
||||
}
|
||||
}
|
||||
state.setEstimatedHit(hit);
|
||||
@@ -85,14 +85,14 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
switch (state.getStyle()) {
|
||||
case MELEE:
|
||||
if(entity == null || state == null || state.getStyle() == null){
|
||||
return;
|
||||
}
|
||||
if (state.getStyle() == CombatStyle.MELEE) {
|
||||
entity.animate(MELEE_ATTACK);
|
||||
break;
|
||||
default:
|
||||
} else {
|
||||
entity.visualize(MAGIC_ATTACK, MAGIC_START);
|
||||
Projectile.magic(entity, victim, 1211, 0, 0, 46, 1).send();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
||||
list.add(new BattleState(entity, t));
|
||||
}
|
||||
}
|
||||
state.setTargets(targets = list.toArray(new BattleState[list.size()]));
|
||||
state.setTargets(targets = list.toArray(new BattleState[0]));
|
||||
state.setStyle(CombatStyle.MAGIC);
|
||||
setType(CombatStyle.MAGIC);
|
||||
}
|
||||
@@ -83,31 +83,38 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
switch (getType()) {
|
||||
case MELEE:
|
||||
entity.animate(MELEE_ATTACK);
|
||||
break;
|
||||
case MAGIC:
|
||||
entity.animate(MAGIC_ATTACK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if(getType() != null) {
|
||||
switch (getType()) {
|
||||
case MELEE:
|
||||
entity.animate(MELEE_ATTACK);
|
||||
break;
|
||||
case MAGIC:
|
||||
entity.animate(MAGIC_ATTACK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmourSet getArmourSet(Entity e) {
|
||||
return getType().getSwingHandler().getArmourSet(e);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().getArmourSet(e);
|
||||
else return ArmourSet.AHRIM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSetMultiplier(Entity e, int skillId) {
|
||||
return getType().getSwingHandler().getSetMultiplier(e, skillId);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().getSetMultiplier(e, skillId);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
||||
state.getStyle().getSwingHandler().impact(entity, victim, state);
|
||||
if(state != null)
|
||||
state.getStyle().getSwingHandler().impact(entity, victim, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,22 +124,28 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
||||
|
||||
@Override
|
||||
public int calculateAccuracy(Entity entity) {
|
||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateDefence(Entity victim, Entity attacker) {
|
||||
return getType().getSwingHandler().calculateDefence(victim, attacker);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateDefence(victim, attacker);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculateHit(Entity entity, Entity victim, double modifier) {
|
||||
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
|
||||
else return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() == CombatStyle.MAGIC) {
|
||||
if (state != null && state.getStyle() == CombatStyle.MAGIC) {
|
||||
for (BattleState s : state.getTargets()) {
|
||||
if (s.getEstimatedHit() > 0) {
|
||||
s.getVictim().graphics(MAGIC_END_GRAPHIC);
|
||||
@@ -140,7 +153,8 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
||||
}
|
||||
return;
|
||||
}
|
||||
state.getStyle().getSwingHandler().visualizeImpact(entity, victim, state);
|
||||
if(state != null)
|
||||
state.getStyle().getSwingHandler().visualizeImpact(entity, victim, state);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public final class ImpDefenderNPC extends AbstractNPC {
|
||||
thievingLevel += 15;
|
||||
}
|
||||
int currentLevel = RandomFunction.random(thievingLevel) + 1;
|
||||
double ratio = currentLevel / (new Random().nextInt(level + 5) + 1);
|
||||
double ratio = (double) currentLevel / (new Random().nextInt(level + 5) + 1);
|
||||
return Math.round(ratio * thievingLevel) < level;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ public class PlunderZones implements Plugin<Object> {
|
||||
}
|
||||
PlunderObject object = target instanceof NPC ? null : new PlunderObject(target.asScenery()); //PlunderObject(target.getId(),target.getLocation());
|
||||
PlunderObjectManager manager = player.getPlunderObjectManager();
|
||||
if(manager == null) return super.interact(e, target, option);
|
||||
boolean alreadyOpened = manager.openedMap.getOrDefault(object.getLocation(),false);
|
||||
boolean charmed = manager.charmedMap.getOrDefault(object.getLocation(),false);
|
||||
boolean success = success(player, Skills.THIEVING);
|
||||
|
||||
+2
-2
@@ -17,9 +17,9 @@ public enum PyramidPlunderRoom {
|
||||
ROOM_7(7, 81, 0, 2,new Location(1927, 4424), new Location[] {Location.create(1923, 4432, 0),Location.create(1925, 4440, 0),Location.create(1929, 4440, 0),Location.create(1931, 4432, 0)}),
|
||||
ROOM_8(8, 91, -2, 0,new Location(1965,4444), new Location[] {Location.create(1952, 4447, 0),Location.create(1953, 4445, 0),Location.create(1957, 4444, 0),Location.create(1962, 4448, 0)});
|
||||
|
||||
public int roomNum, reqLevel, spearX, spearY;
|
||||
public final int roomNum, reqLevel, spearX, spearY;
|
||||
Location entrance;
|
||||
public List<Location> doorLocations;
|
||||
public final List<Location> doorLocations;
|
||||
PyramidPlunderRoom(int roomNum, int reqLevel, int spearX, int spearY, Location entrance, Location[] door_locations){
|
||||
this.roomNum = roomNum;
|
||||
this.reqLevel = reqLevel;
|
||||
|
||||
@@ -217,12 +217,15 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
||||
}
|
||||
return InteractionType.NO_INTERACT;
|
||||
}
|
||||
return getType().getSwingHandler().canSwing(entity, victim);
|
||||
if(getType() != null)
|
||||
return getType().getSwingHandler().canSwing(entity, victim);
|
||||
else return InteractionType.NO_INTERACT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int swing(Entity entity, Entity victim, BattleState state) {
|
||||
style = super.getType();
|
||||
if(super.getType() != null)
|
||||
style = super.getType();
|
||||
int ticks = 1;
|
||||
if (jad) {
|
||||
main = CombatStyle.values()[1 + RandomFunction.RANDOM.nextInt(2)];
|
||||
@@ -262,7 +265,7 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
||||
|
||||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() == null) {
|
||||
if (state == null || state.getStyle() == null) {
|
||||
return;
|
||||
}
|
||||
switch (state.getStyle()) {
|
||||
@@ -291,19 +294,19 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
||||
|
||||
@Override
|
||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() != null && victim.hasProtectionPrayer(state.getStyle())) {
|
||||
if (state != null && state.getStyle() != null && victim.hasProtectionPrayer(state.getStyle())) {
|
||||
state.setEstimatedHit(0);
|
||||
}
|
||||
if (state.getStyle() == null) {
|
||||
if (state != null && state.getStyle() == null) {
|
||||
NPC n = victim instanceof NPC ? ((NPC) victim) : (NPC) npc.activity.getPlayer().getProperties().getCombatPulse().getVictim();
|
||||
if (n == null || !(n instanceof TzhaarFightCaveNPC)) {
|
||||
if (!(n instanceof TzhaarFightCaveNPC)) {
|
||||
n = npc;
|
||||
}
|
||||
((TzhaarFightCaveNPC) n).heal(state.getEstimatedHit());
|
||||
n.graphics(new Graphics(444, 96));
|
||||
return;
|
||||
}
|
||||
if (state.getEstimatedHit() > 0) {
|
||||
if (state != null && state.getEstimatedHit() > 0) {
|
||||
state.setEstimatedHit(formatHit(victim, state.getEstimatedHit()));
|
||||
if (((NPC) entity).getId() == 2734 || ((NPC) entity).getId() == 2735) {
|
||||
victim.getSkills().decrementPrayerPoints(state.getEstimatedHit());
|
||||
@@ -316,11 +319,11 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
||||
|
||||
@Override
|
||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
||||
if (state.getStyle() == null) {
|
||||
if (state != null && state.getStyle() == null) {
|
||||
return;
|
||||
} else if (state.getStyle() == CombatStyle.MAGIC && !jad) {
|
||||
} else if (state != null && state.getStyle() == CombatStyle.MAGIC && !jad) {
|
||||
victim.graphics(Graphics.create(1624));
|
||||
} else if (jad && state.getStyle() == CombatStyle.RANGE) {
|
||||
} else if (state != null && jad && state.getStyle() == CombatStyle.RANGE) {
|
||||
victim.graphics(Graphics.create(451));
|
||||
}
|
||||
style.getSwingHandler().visualizeImpact(entity, victim, state);
|
||||
|
||||
@@ -144,7 +144,8 @@ public final class CatapultRoom extends MapZone implements Plugin<Object> {
|
||||
});
|
||||
Projectile.create(Location.create(2842, 3554, 1), Location.create(2842, 3545, 1), attack.graphicId, 70, 32, 80, 220, 20, 11).send();
|
||||
Scenery object = RegionManager.getObject(Location.create(2840, 3552, 1));
|
||||
SceneryBuilder.replace(object, object.transform(attack.objectId), 4);
|
||||
if(object != null)
|
||||
SceneryBuilder.replace(object, object.transform(attack.objectId), 4);
|
||||
Audio sound = new Audio(1911);
|
||||
for (Player p : players) {
|
||||
p.getAudioManager().send(sound);
|
||||
|
||||
@@ -16,7 +16,6 @@ public class SkillEffect extends ConsumableEffect {
|
||||
@Override
|
||||
public void activate(Player p) {
|
||||
Skills skills = p.getSkills();
|
||||
int level = skills.getLevel(skill_slot);
|
||||
int slevel = skills.getStaticLevel(skill_slot);
|
||||
skills.updateLevel(skill_slot,(int)(base + (bonus * slevel)),slevel + (int)(base + (bonus * slevel)));
|
||||
}
|
||||
|
||||
@@ -603,10 +603,13 @@ public final class DBRCutscenePlugin extends CutscenePlugin {
|
||||
break;
|
||||
case 55:
|
||||
Scenery wall = RegionManager.getObject(base.transform(16, 46, 0));
|
||||
SceneryBuilder.replace(wall, wall.transform(9151, 0, 10));
|
||||
getWiseOldMan().getWalkingQueue().reset();
|
||||
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 16, base.getY() + 46);
|
||||
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 17, base.getY() + 46);
|
||||
if(wall != null)
|
||||
SceneryBuilder.replace(wall, wall.transform(9151, 0, 10));
|
||||
if(getWiseOldMan() != null) {
|
||||
getWiseOldMan().getWalkingQueue().reset();
|
||||
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 16, base.getY() + 46);
|
||||
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 17, base.getY() + 46);
|
||||
}
|
||||
break;
|
||||
case 58:
|
||||
camera(21, 38, -36, 43, 495, 99);
|
||||
|
||||
@@ -45,7 +45,7 @@ public final class ChemistDialogue extends DialoguePlugin {
|
||||
public boolean open(Object... args) {
|
||||
interpreter.sendOptions("Do you want to talk about lamps?", "Yes.", "No.", "No, I'm more interested in impling jars.", "Falador Achievement Diary");
|
||||
stage = 0;
|
||||
AchievementDiary diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
||||
diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
||||
replacementReward = diary.isLevelRewarded(level)
|
||||
&& diary.isComplete(level, true)
|
||||
&& !player.hasItem(diary.getType().getRewards(level)[0]);
|
||||
|
||||
@@ -164,7 +164,7 @@ public final class DialogueInterpreter {
|
||||
public void startScript(int dialogueKey, ScriptContext script, Object... args) {
|
||||
key = dialogueKey;
|
||||
(dialogueStage = script).execute(args);
|
||||
if (script != null && script.isInstant()) {
|
||||
if (script.isInstant()) {
|
||||
dialogueStage = script = ScriptManager.run(script, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class EblisDialogue extends DialoguePlugin {
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
//TODO: Add proper dialogue once DT is implemented
|
||||
NPC npc = (NPC) args[0];
|
||||
npc = (NPC) args[0];
|
||||
if(!player.getAttribute("DT:staff-bought",false)) {
|
||||
player("Hey.");
|
||||
stage = 0;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ReadbeardFrankDialogue extends DialoguePlugin {
|
||||
quest = player.getQuestRepository().getQuest("Pirate's Treasure");
|
||||
npc("Arr, Matey!");
|
||||
stage = 0;
|
||||
AchievementDiary diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
||||
diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
||||
replacementReward = diary.isLevelRewarded(level)
|
||||
&& diary.isComplete(level, true)
|
||||
&& !player.hasItem(diary.getType().getRewards(level)[0]);
|
||||
|
||||
@@ -85,6 +85,7 @@ public class SirReniteeDialogue extends DialoguePlugin {
|
||||
stage = 500;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 200:
|
||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?");
|
||||
stage = 210;
|
||||
|
||||
@@ -158,6 +158,7 @@ public class StankersDialogue extends DialoguePlugin {
|
||||
case 90:
|
||||
npc("Your headband will help you get experience when", "woodcutting maple trees, and an extra log or two when", "cutting normal trees. I've also told Geoff to increase");
|
||||
stage++;
|
||||
break;
|
||||
case 91:
|
||||
npc("your flax allowance in acknowledgement of your", "standing.");
|
||||
stage = 999;
|
||||
|
||||
@@ -154,12 +154,11 @@ public final class TownCrierDialogue extends DialoguePlugin {
|
||||
npc("Beware of players trying to lue you into the wilderness.", "Your items cannot be returned if you lose them!");
|
||||
stage = 2;
|
||||
break;
|
||||
case 5:
|
||||
default:
|
||||
npc("" + GameWorld.getSettings().getName() + " will never email you asking for your log-in details.");
|
||||
stage = 2;
|
||||
break;
|
||||
}
|
||||
stage = 2;
|
||||
break;
|
||||
case 150:
|
||||
npc("Player Moderators are normal players of the game, just", "like you. However, since they have shown themselves to be", "trustworthy and active reporters, they have been invited", "by Jagex to monitor the game and take appropriate");
|
||||
|
||||
@@ -166,7 +166,6 @@ public final class DoorActionHandler {
|
||||
}
|
||||
public static Location getEndLocation(Entity entity, Scenery object, Boolean isAutoWalk) {
|
||||
Location l = object.getLocation();
|
||||
Location end = DestinationFlag.OBJECT.getDestination(entity,object);
|
||||
switch (object.getRotation()) {
|
||||
case 0:
|
||||
if (entity.getLocation().getX() >= l.getX()) {
|
||||
@@ -183,7 +182,7 @@ public final class DoorActionHandler {
|
||||
l = l.transform(1, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
if (entity.getLocation().getY() >= l.getY()) {
|
||||
l = l.transform(0, -1, 0);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class PresetManager {
|
||||
|
||||
private Player player;
|
||||
|
||||
private Map<String, Preset> current_presets;
|
||||
private final Map<String, Preset> current_presets;
|
||||
|
||||
public PresetManager() {
|
||||
current_presets = new HashMap<>();
|
||||
|
||||
@@ -26,9 +26,9 @@ public enum Canoe {
|
||||
this.maxDist = ordinal() + 1;
|
||||
}
|
||||
|
||||
public int silhouetteChild;
|
||||
public int textChild;
|
||||
public int maxDist;
|
||||
public final int silhouetteChild;
|
||||
public final int textChild;
|
||||
public final int maxDist;
|
||||
|
||||
/**
|
||||
* Represents the woodcutting level requirement to craft the canoe.
|
||||
|
||||
@@ -1099,7 +1099,6 @@ public class ChristmasEvent extends HolidayEvent {
|
||||
final Item other = args.length == 2 ? null : (Item) args[2];
|
||||
if (other != null) {
|
||||
identifier = "equip";
|
||||
item = other;
|
||||
}
|
||||
switch (identifier) {
|
||||
case "equip":
|
||||
|
||||
+1
@@ -187,6 +187,7 @@ public final class LadyKeliDialogue extends DialoguePlugin {
|
||||
case 56:
|
||||
interpreter.sendDialogues(npc, null, "As you put it that way I am sure you can see it. You", "cannot steal the key, it is on a Runite chain.");
|
||||
stage = 57;
|
||||
break;
|
||||
case 57:
|
||||
interpreter.sendDialogue("Keli shows you a small key on a strong looking chain.");
|
||||
stage = 58;
|
||||
|
||||
-1
@@ -23,7 +23,6 @@ public class VineInteraction extends PluginInteraction {
|
||||
@Override
|
||||
public boolean handle(Player player, Node node) {
|
||||
if(node instanceof Scenery){
|
||||
Scenery obj = node.asScenery();
|
||||
if(player.getQuestRepository().getStage("Fishing Contest") > 0 && player.getQuestRepository().getStage("Fishing Contest") < 100){
|
||||
player.getPulseManager().run(new MovementPulse(player, node.asScenery().getLocation().transform(0, 0, 0)) {
|
||||
@Override
|
||||
|
||||
+6
-9
@@ -529,7 +529,7 @@ public final class MerlinCrystalPlugin extends OptionHandler {
|
||||
|
||||
@Override
|
||||
public void handleTickActions() {
|
||||
if (player != null && !player.isActive() || !player.getLocation().withinDistance(getLocation(), 20)) {
|
||||
if (player != null && !player.isActive() || player != null && !player.getLocation().withinDistance(getLocation(), 20)) {
|
||||
clear();
|
||||
}
|
||||
super.handleTickActions();
|
||||
@@ -545,10 +545,7 @@ public final class MerlinCrystalPlugin extends OptionHandler {
|
||||
|
||||
@Override
|
||||
public boolean canAttack(Entity entity) {
|
||||
if (getAttribute("thrantax_owner", entity) == entity) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return getAttribute("thrantax_owner", entity) == entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -591,20 +588,20 @@ public final class MerlinCrystalPlugin extends OptionHandler {
|
||||
Item useditem = event.getUsedItem();
|
||||
final Scenery object = (Scenery) event.getUsedWith();
|
||||
|
||||
if (player.getAttribute("cleared-beehives", false) && useditem.getId() == REPELLENT.getId() && object.getId() == 68) {
|
||||
if (useditem != null && player.getAttribute("cleared-beehives", false) && useditem.getId() == REPELLENT.getId() && object.getId() == 68) {
|
||||
player.getDialogueInterpreter().sendDialogue("You have already cleared the hive of its bees.", "You can now safely collect wax from the hive.");
|
||||
}
|
||||
|
||||
if (useditem.getId() == REPELLENT.getId() && object.getId() == 68 && player.getAttribute("cleared-beehives", false)) {
|
||||
if (useditem != null && useditem.getId() == REPELLENT.getId() && object.getId() == 68 && player.getAttribute("cleared-beehives", false)) {
|
||||
player.getDialogueInterpreter().sendDialogue("You pour insect repellent on the beehive. You see the bees leaving the", "hive.");
|
||||
player.setAttribute("cleared-beehives", true);
|
||||
}
|
||||
|
||||
if (useditem.getId() == BUCKET.getId() && player.getAttribute("cleared-beehives", false)) {
|
||||
if (useditem != null && useditem.getId() == BUCKET.getId() && player.getAttribute("cleared-beehives", false)) {
|
||||
player.getDialogueInterpreter().sendDialogue("You get some wax from the beehive.");
|
||||
player.getInventory().remove(new Item(BUCKET.getId(), 1));
|
||||
player.getInventory().add(new Item(BUCKET_OF_WAX.getId(), 1));
|
||||
} else if (useditem.getId() == BUCKET.getId() && !player.getAttribute("cleared-beehives", false)) {
|
||||
} else if (useditem != null && useditem.getId() == BUCKET.getId() && !player.getAttribute("cleared-beehives", false)) {
|
||||
player.getDialogueInterpreter().sendDialogue("It would be dangerous to stick the bucket into the hive while", "the bees are still in it. Perhaps you can clear them out", "somehow.");
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -161,6 +161,7 @@ public final class SirKayDialogue extends DialoguePlugin {
|
||||
case 90:
|
||||
npc("Your headband will help you get experience when", "woodcutting maple trees, and an extra log or two when", "cutting normal trees. I've also told Geoff to increase");
|
||||
stage++;
|
||||
break;
|
||||
case 91:
|
||||
npc("your flax allowance in acknowledgement of your", "standing.");
|
||||
stage = 999;
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ public class SheepPoisonHandler extends PluginInteraction {
|
||||
@Override
|
||||
public boolean handle(Player player, NodeUsageEvent event) {
|
||||
Node n = event.getUsedWith();
|
||||
Item i = event.getUsedItem();
|
||||
if(n instanceof HerderSheepNPC){
|
||||
if (withinBorders(n.getLocation(),Location.create(2595, 3364, 0),Location.create(2609, 3351, 0))){
|
||||
handlePoisoning(player,(HerderSheepNPC) n);
|
||||
|
||||
-1
@@ -42,7 +42,6 @@ public class WitchsHousePlugin extends OptionHandler {
|
||||
@Override
|
||||
public boolean handle(Player player, Node node, String option) {
|
||||
final Quest quest = player.getQuestRepository().getQuest("Witch's House");
|
||||
final GroundItem ball = GroundItemManager.get(2407, new Location(2935, 3460, 0), null);
|
||||
final int id = node instanceof Item ? ((Item) node).getId() : node instanceof Scenery ? ((Scenery) node).getId() : node instanceof NPC ? ((NPC) node).getId() : node.getId();
|
||||
// boolean killedExperiment = player.getAttribute("witchs_house:experiment_killed",false);
|
||||
// boolean experimentAlive = !player.getAttribute("witchs_house:experiment_killed", false);
|
||||
|
||||
+1
-1
@@ -968,7 +968,7 @@ public enum TutorialStage {
|
||||
* Represents if it is a login stage.
|
||||
* @param login the login value.
|
||||
*/
|
||||
public void isLogin(boolean login) {
|
||||
private void isLogin(boolean login) {
|
||||
this.login = login;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,14 +84,6 @@ public enum GEItemSet {
|
||||
return Arrays.copyOf(components, components.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the components.
|
||||
* @param components The components to set.
|
||||
*/
|
||||
public void setComponents(int[] components) {
|
||||
this.components = components;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item array.
|
||||
* @return The item array.
|
||||
|
||||
@@ -112,7 +112,7 @@ public class Interaction {
|
||||
if (option.getHandler() == null || !option.getHandler().handle(player, node, option.getName().toLowerCase())) {
|
||||
player.getPacketDispatch().sendMessage("Nothing interesting happens.");
|
||||
}
|
||||
if (option != null && option.getHandler() != null) {
|
||||
if (option.getHandler() != null) {
|
||||
player.debug("Using item handler " + option.getHandler().getClass().getSimpleName());
|
||||
}
|
||||
} catch (Exception e){
|
||||
|
||||
@@ -188,7 +188,7 @@ public final class LumbridgeNodePlugin extends OptionHandler {
|
||||
cumulativeStr += 1;
|
||||
}
|
||||
cumulativeStr *= 1.0;
|
||||
int hit = (int) ((14 + cumulativeStr + (bonus / 8) + ((cumulativeStr * bonus) * 0.016865)) * 1.0) / 10 + 1;
|
||||
int hit = (int) ((14.0 + cumulativeStr + ((double) bonus / 8) + ((cumulativeStr * bonus) * 0.016865))) / 10 + 1;
|
||||
player.getSkills().addExperience(Skills.RANGE, ((hit * 1.33) / 10));
|
||||
return !player.getEquipment().contains(9706, 1) || !player.getEquipment().contains(9705, 1);
|
||||
} else {
|
||||
|
||||
@@ -270,17 +270,13 @@ public final class TrollheimPlugin extends OptionHandler {
|
||||
bandaid(player, player.getLocation(), object.getLocation().transform(0, -3, 0), CLIMB_DOWN, CLIMB_DOWN, object.getDirection());
|
||||
break;
|
||||
case 3790:// rock scalling.
|
||||
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
|
||||
direction = getOpposite(ForceMovement.direction(player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0)));
|
||||
case 3791:
|
||||
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
|
||||
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_DOWN, CLIMB_DOWN, direction);
|
||||
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
|
||||
break;
|
||||
case 3791:// rock scalling.
|
||||
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
|
||||
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_UP);
|
||||
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
|
||||
break;
|
||||
case 3748:
|
||||
case 3748:
|
||||
player.getPacketDispatch().sendMessage("You climb onto the rock...");
|
||||
if (loc.equals(new Location(2821, 3635, 0))) {
|
||||
bandaid(player, player.getLocation(), loc.transform(player.getLocation().getX() > loc.getX() ? -1 : 1, 0, 0), JUMP);
|
||||
|
||||
@@ -205,18 +205,10 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
|
||||
* Gets the runes.
|
||||
* @return The runes.
|
||||
*/
|
||||
public Item[] getRunes() {
|
||||
private Item[] getRunes() {
|
||||
return runes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the runes.
|
||||
* @param runes The runes to set.
|
||||
*/
|
||||
public void setRunes(Item[] runes) {
|
||||
this.runes = runes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the exp.
|
||||
* @return The exp.
|
||||
@@ -225,14 +217,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
|
||||
return exp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the exp.
|
||||
* @param exp The exp to set.
|
||||
*/
|
||||
public void setExp(double exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the enchanted.
|
||||
* @return The enchanted.
|
||||
@@ -241,14 +225,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
|
||||
return enchanted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the enchanted.
|
||||
* @param enchanted The enchanted to set.
|
||||
*/
|
||||
public void setEnchanted(int enchanted) {
|
||||
this.enchanted = enchanted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bolt by the id.
|
||||
* @param button the button.
|
||||
|
||||
@@ -101,14 +101,14 @@ public class TeleTabsOptionPlugin extends OptionHandler {
|
||||
/**
|
||||
* @param item the item to set
|
||||
*/
|
||||
public void setItem(int item) {
|
||||
private void setItem(int item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param location the location to set
|
||||
*/
|
||||
public void setLocation(Location location) {
|
||||
private void setLocation(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class TeleTabsOptionPlugin extends OptionHandler {
|
||||
/**
|
||||
* @param exp the exp to set.
|
||||
*/
|
||||
public void setExp(double exp) {
|
||||
private void setExp(double exp) {
|
||||
this.exp = exp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,34 +287,6 @@ public class PoisonRemovePlugin extends UseWithHandler {
|
||||
return third;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param first the first to set.
|
||||
*/
|
||||
public void setFirst(int first) {
|
||||
this.first = first;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param item the item to set.
|
||||
*/
|
||||
public void setItem(int item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param second the second to set.
|
||||
*/
|
||||
public void setSecond(int second) {
|
||||
this.second = second;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param third the third to set.
|
||||
*/
|
||||
public void setThird(int third) {
|
||||
this.third = third;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to get the poisioned weapon for the id.
|
||||
* @param i the id.
|
||||
|
||||
@@ -261,34 +261,6 @@ public class PoisonWeaponPlugin extends UseWithHandler {
|
||||
return third;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param first the first to set.
|
||||
*/
|
||||
public void setFirst(int first) {
|
||||
this.first = first;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param item the item to set.
|
||||
*/
|
||||
public void setItem(int item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param second the second to set.
|
||||
*/
|
||||
public void setSecond(int second) {
|
||||
this.second = second;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param third the third to set.
|
||||
*/
|
||||
public void setThird(int third) {
|
||||
this.third = third;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to get the poisioned weapon for the id.
|
||||
* @param i the id.
|
||||
@@ -320,8 +292,10 @@ public class PoisonWeaponPlugin extends UseWithHandler {
|
||||
product = weapon.getThird();
|
||||
player.getInventory().remove(new Item(5940, 1));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
int amt = weaponItem.getAmount() > 5 ? 5 : weaponItem.getAmount();
|
||||
int amt = Math.min(weaponItem.getAmount(), 5);
|
||||
player.getInventory().remove(new Item(weaponItem.getId(), amt));
|
||||
player.getInventory().add(new Item(229, 1));
|
||||
player.getInventory().add(new Item(product, amt));
|
||||
|
||||
@@ -44,20 +44,20 @@ public class IncubatorPlugin extends OptionHandler {
|
||||
player.sendMessage("You don't have enough inventory space.");
|
||||
return true;
|
||||
}
|
||||
if (egg != null) {
|
||||
String name = egg.getProduct().getName().toLowerCase();
|
||||
player.varpManager.get(1160).setVarbit(4,0).send(player);
|
||||
player.sendMessage("You take your " + name + " out of the incubator.");
|
||||
if(!player.getInventory().add(egg.getProduct())){
|
||||
GroundItemManager.create(egg.getProduct(),player);
|
||||
}
|
||||
player.removeAttribute("inc");
|
||||
{
|
||||
String name = egg.getProduct().getName().toLowerCase();
|
||||
player.varpManager.get(1160).setVarbit(4,0).send(player);
|
||||
player.sendMessage("You take your " + name + " out of the incubator.");
|
||||
if(!player.getInventory().add(egg.getProduct())){
|
||||
GroundItemManager.create(egg.getProduct(),player);
|
||||
}
|
||||
player.removeAttribute("inc");
|
||||
}
|
||||
return true;
|
||||
case "inspect":
|
||||
if (player.states.get("incubator") != null || inc != -1) {
|
||||
IncubatorState p = (IncubatorState) player.states.get("incubator");
|
||||
if(p.getPulse() == null){
|
||||
if(p != null && p.getPulse() == null){
|
||||
player.varpManager.get(1160).setVarbit(4,0).send(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ public class ReadSignPostPlugin extends OptionHandler {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
player.getPacketDispatch();
|
||||
final Scenery object = (Scenery) node;
|
||||
Signs sign = Signs.forId(object.getId());
|
||||
if (sign == null) {
|
||||
|
||||
+1
-1
@@ -564,7 +564,7 @@ public final class GardenObjectsPlugin extends OptionHandler {
|
||||
Item with = event.getBaseItem();
|
||||
Player player = event.getPlayer();
|
||||
SeasonDefinitions def = SeasonDefinitions.forFruitId(item.getId());
|
||||
if (item == null || with == null || player == null || def == null)
|
||||
if (with == null || player == null || def == null)
|
||||
return true;
|
||||
int amt = player.getInventory().getAmount(item);
|
||||
if (!player.getInventory().containItems(1919)) {
|
||||
|
||||
@@ -237,9 +237,8 @@ public enum BoltEffect {
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public void impact(BattleState state) {
|
||||
Entity entity = state.getAttacker();
|
||||
Entity victim = state.getVictim();
|
||||
if (sound != null && victim != null && victim instanceof Player) {
|
||||
if (sound != null && victim instanceof Player) {
|
||||
sound.send(victim.asPlayer(), true);
|
||||
}
|
||||
if (graphics != null) {
|
||||
|
||||
@@ -69,7 +69,6 @@ public final class RampageSpecialHandler extends MeleeSwingHandler implements Pl
|
||||
boost += drain;
|
||||
p.getSkills().updateLevel(i, (int) -drain, (int) (p.getSkills().getStaticLevel(i) - drain));
|
||||
}
|
||||
boost *= 0.25;
|
||||
p.getSkills().updateLevel(Skills.STRENGTH, (int) (p.getSkills().getStaticLevel(Skills.STRENGTH) * 0.20));
|
||||
p.getAudioManager().send(new Audio(386), true);
|
||||
return -1;
|
||||
|
||||
-1
@@ -68,7 +68,6 @@ public final class SliceAndDiceSpecialHandler extends MeleeSwingHandler implemen
|
||||
} else {
|
||||
hit = getHit(entity, victim, (int) (maximum * 1.5));
|
||||
if (hit > 0) {
|
||||
maximum *= 1.5;
|
||||
hits = new int[] {0, 0, 0, hit};
|
||||
} else {
|
||||
hits = new int[] {0, RandomFunction.random(2)};
|
||||
|
||||
@@ -23,7 +23,7 @@ public class AliTheCarter extends DialoguePlugin {
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player){return new AliTheCarter(player);}
|
||||
public boolean open(Object... args){
|
||||
NPC npc = (NPC)args[0];
|
||||
npc = (NPC)args[0];
|
||||
player("Hello");
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public class AliTheKebabSeller extends DialoguePlugin {
|
||||
public DialoguePlugin newInstance(Player player){return new AliTheKebabSeller(player);}
|
||||
@Override
|
||||
public boolean open(Object... args){
|
||||
NPC npc = (NPC)args[0];
|
||||
npc = (NPC)args[0];
|
||||
player("Hello");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ public final class SphinxDialogue extends DialoguePlugin {
|
||||
case 52:
|
||||
player.getFamiliarManager().getFamiliar().sendChat("Meow");
|
||||
stage = 53;
|
||||
break;
|
||||
case 53:
|
||||
player.getDialogueInterpreter().sendDialogue("The Sphinx and the cat have a chat.");
|
||||
stage = 54;
|
||||
|
||||
@@ -221,7 +221,7 @@ public final class NPCDropTables {
|
||||
*/
|
||||
private boolean handleBoneCrusher(Player player, Item item) {
|
||||
Bones bone = Bones.forId(item.getId());
|
||||
if (bone == null || item == null) {
|
||||
if (bone == null) {
|
||||
return false;
|
||||
}
|
||||
if (!player.getGlobalData().isEnableBoneCrusher()) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class RareDropTable {
|
||||
* Initializes the rare drop table.
|
||||
*/
|
||||
public static void init(){
|
||||
if(!new File(ServerConstants.RDT_DATA_PATH).exists()){
|
||||
if(ServerConstants.RDT_DATA_PATH != null && !new File(ServerConstants.RDT_DATA_PATH).exists()){
|
||||
SystemLogger.logErr("Can't locate RDT file at " + ServerConstants.RDT_DATA_PATH);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SpiritTerrorbirdNPC extends BurdenBeast {
|
||||
protected boolean specialMove(FamiliarSpecial special) {
|
||||
visualize(Animation.create(1009), Graphics.create(1521));
|
||||
owner.getSkills().updateLevel(Skills.AGILITY, 2);
|
||||
owner.getSettings().updateRunEnergy(-owner.getSkills().getStaticLevel(Skills.AGILITY) / 2);
|
||||
owner.getSettings().updateRunEnergy(-owner.getSkills().getStaticLevel(Skills.AGILITY) / 2.0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -229,9 +229,9 @@ public class BorkNPC extends AbstractNPC {
|
||||
unlock();
|
||||
if (player != null) {
|
||||
attack(player);
|
||||
player.getInterfaceManager().restoreTabs();
|
||||
PacketRepository.send(MinimapState.class, new MinimapStateContext(player, 0));
|
||||
}
|
||||
player.getInterfaceManager().restoreTabs();
|
||||
PacketRepository.send(MinimapState.class, new MinimapStateContext(player, 0));
|
||||
for (NPC n : legions) {
|
||||
n.getProperties().getCombatPulse().attack(player);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,6 @@ public class RevenantNPC extends AbstractNPC {
|
||||
|
||||
@Override
|
||||
public void finalizeDeath(Entity killer) {
|
||||
Location itemLoc = getLocation();
|
||||
super.finalizeDeath(killer);
|
||||
if (killer instanceof Player) {
|
||||
killer.asPlayer().getAudioManager().send(4063, true);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class Player extends Entity {
|
||||
|
||||
public Location startLocation = null;
|
||||
|
||||
private Graphics wardrobe_hold_graphics = new Graphics(1182,0,0);
|
||||
private final Graphics wardrobe_hold_graphics = new Graphics(1182,0,0);
|
||||
|
||||
public boolean newPlayer = getSkills().getTotalLevel() < 50;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public enum LoginType {
|
||||
/**
|
||||
* @param type the type to set.
|
||||
*/
|
||||
public void setType(int type) {
|
||||
private void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,8 +445,4 @@ public enum PrayerType {
|
||||
return defenceReq;
|
||||
}
|
||||
|
||||
public void setDefenceReq(int defenceReq) {
|
||||
this.defenceReq = defenceReq;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -281,7 +281,8 @@ public final class BrimhavenArena extends MapZone implements Plugin<Object> {
|
||||
Location l = set.entrance[i];
|
||||
for (int x = 1; x < set.exit[i].getX() - l.getX(); x++) {
|
||||
Scenery object = RegionManager.getObject(l.transform(x, 0, 0));
|
||||
SceneryBuilder.replace(object, object.transform(avail ? 3573 : 3576));
|
||||
if(object != null)
|
||||
SceneryBuilder.replace(object, object.transform(avail ? 3573 : 3576));
|
||||
}
|
||||
RegionManager.getObject(set.entrance[i]).setCharge(avail ? 1000 : 500);
|
||||
RegionManager.getObject(set.exit[i]).setCharge(avail ? 1000 : 500);
|
||||
|
||||
+1
-2
@@ -239,8 +239,7 @@ public final class AgilityPyramidCourse extends AgilityCourse {
|
||||
Direction d = Direction.getLogicalDirection(player.getLocation(), getLedgeLocation(player, object));
|
||||
final Direction dir = d;
|
||||
final int diff = object.getRotation() == 3 && dir == Direction.EAST ? 1 : object.getRotation() == 3 && dir == Direction.WEST ? 0 : d == Direction.EAST || (d == Direction.SOUTH && object.getRotation() != 0) || d == Direction.NORTH ? 0 : 1;
|
||||
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) >= 75 ? false : hasFailed(player) ;
|
||||
player.getSkills().getLevel(Skills.AGILITY);
|
||||
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) < 75 && hasFailed(player);
|
||||
final Location end = player.getLocation().transform(dir.getStepX() * (fail ? 3 : 5), dir.getStepY() * (fail ? 3 : 5), 0);
|
||||
player.getPacketDispatch().sendMessage("You put your foot on the ledge and try to edge across...");
|
||||
if (fail) {
|
||||
|
||||
-2
@@ -59,8 +59,6 @@ public class WaterOrbGrapple extends OptionHandler {
|
||||
Location current = player.getLocation();
|
||||
Scenery rock = RegionManager.getObject(Location.create(2841, 3426, 0));
|
||||
Scenery tree = RegionManager.getObject(Location.create(2841, 3434, 0));
|
||||
System.out.println(rock);
|
||||
System.out.println(tree);
|
||||
|
||||
switch (option) {
|
||||
case "grapple":
|
||||
|
||||
@@ -91,10 +91,10 @@ public enum CookableItems {
|
||||
RAW_OOMLIE(Items.RAW_OOMLIE_2337, 0, Items.BURNT_OOMLIE_2426, 50, 0, 999,0,0), // always burns
|
||||
OOMLIE_WRAP(Items.COOKED_OOMLIE_WRAP_2343, Items.WRAPPED_OOMLIE_2341, Items.BURNT_OOMLIE_WRAP_2345, 50, 110, 999,0,0);
|
||||
|
||||
public static HashMap<Integer,CookableItems>cookingMap = new HashMap<>();
|
||||
public static HashMap<Integer, CookableItems>intentionalBurnMap = new HashMap<>();
|
||||
public int raw,cooked,level,burnLevel,burnt;
|
||||
public double experience;
|
||||
public final static HashMap<Integer,CookableItems>cookingMap = new HashMap<>();
|
||||
public final static HashMap<Integer, CookableItems>intentionalBurnMap = new HashMap<>();
|
||||
public final int raw,cooked,level,burnLevel,burnt;
|
||||
public final double experience;
|
||||
double low,high;
|
||||
CookableItems(int cooked, int raw, int burnt, int level, double experience, int burnLevel, double low, double high){
|
||||
this.raw = raw;
|
||||
|
||||
@@ -144,8 +144,8 @@ public class Fletching {
|
||||
|
||||
|
||||
public int unfinished,product,string,level;
|
||||
public double experience;
|
||||
public Animation animation;
|
||||
public final double experience;
|
||||
public final Animation animation;
|
||||
String(byte indicator, final int unfinished, final int product, final int level, final double experience, final Animation animation) {
|
||||
this.unfinished = unfinished;
|
||||
this.product = product;
|
||||
@@ -159,6 +159,8 @@ public class Fletching {
|
||||
case 2:
|
||||
this.string = org.rs09.consts.Items.CROSSBOW_STRING_9438;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -799,7 +799,7 @@ public enum SkillingResource {
|
||||
public int getRespawnDuration() {
|
||||
int minimum = respawnRate & 0xFFFF;
|
||||
int maximum = (respawnRate >> 16) & 0xFFFF;
|
||||
double playerRatio = ServerConstants.MAX_PLAYERS / Repository.getPlayers().size();
|
||||
double playerRatio = (double) ServerConstants.MAX_PLAYERS / Repository.getPlayers().size();
|
||||
return (int) (minimum + ((maximum - minimum) / playerRatio));
|
||||
}
|
||||
|
||||
|
||||
@@ -636,7 +636,7 @@ public enum MiningNode{
|
||||
public int getRespawnDuration() {
|
||||
int minimum = respawnRate & 0xFFFF;
|
||||
int maximum = (respawnRate >> 16) & 0xFFFF;
|
||||
double playerRatio = ServerConstants.MAX_PLAYERS / Repository.getPlayers().size();
|
||||
double playerRatio = (double) ServerConstants.MAX_PLAYERS / Repository.getPlayers().size();
|
||||
return (int) (minimum + ((maximum - minimum) / playerRatio));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -416,7 +416,7 @@ public enum WoodcuttingNode {
|
||||
public int getRespawnDuration() {
|
||||
int minimum = respawnRate & 0xFFFF;
|
||||
int maximum = (respawnRate >> 16) & 0xFFFF;
|
||||
double playerRatio = ServerConstants.MAX_PLAYERS / Repository.getPlayers().size();
|
||||
double playerRatio = (double) ServerConstants.MAX_PLAYERS / Repository.getPlayers().size();
|
||||
return (int) (minimum + ((maximum - minimum) / playerRatio));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public final class BNetPulse extends SkillPulse<NPC> {
|
||||
huntingLevel *= 0.5;
|
||||
}
|
||||
int currentLevel = RandomFunction.random(huntingLevel) + 1;
|
||||
double ratio = currentLevel / (new Random().nextInt(level + 5) + 1);
|
||||
double ratio = (double) currentLevel / (new Random().nextInt(level + 5) + 1);
|
||||
return Math.round(ratio * huntingLevel) >= level;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class ImplingNode extends BNetNode {
|
||||
strengthLevel /= 0.5;
|
||||
int level = getLevel();
|
||||
int currentLevel = RandomFunction.random(strengthLevel) + 1;
|
||||
double ratio = currentLevel / (new Random().nextInt(level + 5) + 1);
|
||||
double ratio = (double) currentLevel / (new Random().nextInt(level + 5) + 1);
|
||||
return Math.round(ratio * strengthLevel) < level;
|
||||
}
|
||||
|
||||
@@ -93,10 +93,8 @@ public final class ImplingNode extends BNetNode {
|
||||
if (!success) {
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case 1:
|
||||
if(type == 1){
|
||||
player.sendMessage("You manage to catch the impling and squeeze it into a jar.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,14 +229,6 @@ public class PrayerAltarPlugin extends OptionHandler {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the baid.
|
||||
* @param id the id to set.
|
||||
*/
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the book.
|
||||
* @return the book
|
||||
@@ -245,30 +237,13 @@ public class PrayerAltarPlugin extends OptionHandler {
|
||||
return book;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the babook.
|
||||
* @param book the book to set.
|
||||
*/
|
||||
public void setBook(int book) {
|
||||
this.book = book;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the messages.
|
||||
* @return the messages
|
||||
*/
|
||||
public String[] getMessages() {
|
||||
private String[] getMessages() {
|
||||
return messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bamessages.
|
||||
* @param messages the messages to set.
|
||||
*/
|
||||
public void setMessages(String[] messages) {
|
||||
this.messages = messages;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class DustDevilNPC extends AbstractNPC {
|
||||
for (int i : SKILLS) {
|
||||
player.getSkills().updateLevel(i, -player.getSkills().getStaticLevel(i), 0);
|
||||
}
|
||||
player.getSkills().decrementPrayerPoints(player.getSkills().getStaticLevel(Skills.PRAYER) / 2);
|
||||
player.getSkills().decrementPrayerPoints((double) player.getSkills().getStaticLevel(Skills.PRAYER) / 2);
|
||||
state.setEstimatedHit(14);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,15 +168,15 @@ public enum SmithingType {
|
||||
*/
|
||||
TYPE_PICKAXE(2, 267, 268, new int[] { 273, 272, 271, 270 }, 1);
|
||||
|
||||
private int name;
|
||||
private final int name;
|
||||
|
||||
private int[] button;
|
||||
private final int[] button;
|
||||
|
||||
private int child;
|
||||
private final int child;
|
||||
|
||||
private int required;
|
||||
private final int required;
|
||||
|
||||
private int product_amount;
|
||||
private final int product_amount;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmithingType.java} {@code Object}.
|
||||
@@ -229,13 +229,6 @@ public enum SmithingType {
|
||||
return product_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the name to set.
|
||||
*/
|
||||
public void setName(int name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static int forButton(Player player, Bars bar, int button, int item) {
|
||||
int count = 0;
|
||||
if (bar == null) {
|
||||
|
||||
@@ -43,7 +43,8 @@ public final class SystemTermination {
|
||||
dmc.clear(false);
|
||||
}
|
||||
}
|
||||
save(ServerConstants.DATA_PATH);
|
||||
if(ServerConstants.DATA_PATH != null)
|
||||
save(ServerConstants.DATA_PATH);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,8 @@ public final class ScriptManager {
|
||||
*/
|
||||
public static void load() {
|
||||
amount = 0;
|
||||
load(new File(ServerConstants.SCRIPTS_PATH));
|
||||
if(ServerConstants.SCRIPTS_PATH != null)
|
||||
load(new File(ServerConstants.SCRIPTS_PATH));
|
||||
SystemLogger.logInfo("Parsed " + amount + " " + GameWorld.getSettings().getName() + " script" + (amount == 1 ? "" : "s") + "...");
|
||||
}
|
||||
|
||||
|
||||
@@ -254,19 +254,11 @@ public enum Direction {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the traversal.
|
||||
* @return The traversal.
|
||||
*/
|
||||
public int[] getTraversal() {
|
||||
return traversal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the traversal.
|
||||
* @param traversal The traversal to set.
|
||||
*/
|
||||
public void setTraversal(int[] traversal) {
|
||||
private void setTraversal(int[] traversal) {
|
||||
this.traversal = traversal;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import java.io.File;
|
||||
public class ObjectParser extends StartupPlugin {
|
||||
|
||||
public void parseObjects(){
|
||||
if(ServerConstants.OBJECT_PARSER_PATH == null) return;
|
||||
File f = new File(ServerConstants.OBJECT_PARSER_PATH);
|
||||
if(!f.exists()){
|
||||
System.out.println("[ObjectParser]: Can't find file " + ServerConstants.OBJECT_PARSER_PATH);
|
||||
|
||||
@@ -143,6 +143,7 @@ public class PlayerTab extends ConsoleTab {
|
||||
public void populatePlayerSearch() {
|
||||
playerNames.clear();
|
||||
model.clear();
|
||||
if(ServerConstants.PLAYER_SAVE_PATH == null) return;
|
||||
File f = new File(ServerConstants.PLAYER_SAVE_PATH);
|
||||
if (f.listFiles() == null) {
|
||||
System.out.println("Player directory was null!");
|
||||
|
||||
@@ -330,7 +330,6 @@ public final class UtilityTab extends ConsoleTab {
|
||||
public List<String> itemScanner(Item item) {
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
for (Player p : players) {
|
||||
p.getAnimator();
|
||||
List<core.game.container.Container> containers = new ArrayList<>(20);
|
||||
containers.add(p.getInventory());
|
||||
containers.add(p.getBank());
|
||||
|
||||
@@ -599,8 +599,8 @@ public final class MSPacketRepository {
|
||||
Player player = Repository.getPlayerByName(key);
|
||||
if (player != null && player.isActive()) {
|
||||
player.getPacketDispatch().sendMessages((duration > 0L ? new String[]{"You have been muted.", "To prevent further mutes please read the rules."} : new String[]{"You have been unmuted."}));
|
||||
player.getDetails().setMuteTime(duration);
|
||||
}
|
||||
player.getDetails().setMuteTime(duration);
|
||||
break;
|
||||
case 1:
|
||||
player = Repository.getPlayerByName(key);
|
||||
|
||||
@@ -529,7 +529,7 @@ public class IoBuffer {
|
||||
*/
|
||||
public int getSmart() {
|
||||
int peek = buf.get(buf.position());
|
||||
if (peek <= Byte.MAX_VALUE) {
|
||||
if (peek <= (0xFF & peek)) {
|
||||
return buf.get() & 0xFF;
|
||||
}
|
||||
return (buf.getShort() & 0xFFFF) - 32768;
|
||||
|
||||
@@ -298,9 +298,6 @@ public final class InteractionPacket implements IncomingPacket {
|
||||
}
|
||||
final Option option = player.getInteraction().get(optionIndex);
|
||||
//Handling for "Pelt" option
|
||||
if(option.getName().toLowerCase().equals("pelt")){
|
||||
|
||||
}
|
||||
if (option == null) {
|
||||
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||
return;
|
||||
|
||||
@@ -85,7 +85,8 @@ public class InterfaceUseOnPacket implements IncomingPacket {
|
||||
}
|
||||
break;
|
||||
case 195: // Interface On Player
|
||||
payload = buffer.getShortA();
|
||||
//payload = buffer.getShortA();
|
||||
buffer.getShortA();
|
||||
componentId = buffer.getLEShort();
|
||||
interfaceId = buffer.getLEShort();
|
||||
int targetIndex = buffer.getLEShortA();
|
||||
@@ -175,7 +176,7 @@ public class InterfaceUseOnPacket implements IncomingPacket {
|
||||
case 239: // Interface On NPC
|
||||
componentId = buffer.getLEShort();
|
||||
interfaceId = buffer.getLEShort();
|
||||
int unknown = buffer.getShortA();
|
||||
buffer.getShortA();
|
||||
int index = buffer.getLEShortA();
|
||||
if (index < 1 || index > ServerConstants.MAX_NPCS) {
|
||||
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||
|
||||
@@ -28,7 +28,7 @@ public enum ResourceTasks {
|
||||
}
|
||||
});
|
||||
|
||||
private ResourceTask resourceTask;
|
||||
private final ResourceTask resourceTask;
|
||||
|
||||
|
||||
ResourceTasks(ResourceTask resourceTask) {
|
||||
@@ -39,9 +39,6 @@ public enum ResourceTasks {
|
||||
return resourceTask;
|
||||
}
|
||||
|
||||
public void setResourceTask(ResourceTask resourceTask) {
|
||||
this.resourceTask = resourceTask;
|
||||
}
|
||||
|
||||
private static String reqirementMessage() {
|
||||
return "You do not meet the requirements for this task.";
|
||||
|
||||
@@ -537,14 +537,5 @@ public final class PvPBotsBuilder{
|
||||
player.getSkills().updateCombatLevel();
|
||||
player.getAppearance().sync();
|
||||
}
|
||||
|
||||
public void RandomItem()
|
||||
{
|
||||
Item test = null;
|
||||
ArrayList<Item> tests = new ArrayList<Item>();
|
||||
for (int x = 0; x < 9999; x++)
|
||||
test = new Item(x);
|
||||
if (test.getDefinition().getEquipId() != 0)
|
||||
tests.add(test);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user