Preemptive bugfixing part 3
This commit is contained in:
@@ -58,7 +58,7 @@ public final class NPCDefinition extends Definition<NPC> {
|
|||||||
public boolean isVisibleOnMap;
|
public boolean isVisibleOnMap;
|
||||||
|
|
||||||
|
|
||||||
public String examine;
|
/* public String examine;*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The drop tables.
|
* The drop tables.
|
||||||
@@ -623,6 +623,8 @@ public final class NPCDefinition extends Definition<NPC> {
|
|||||||
case 4:
|
case 4:
|
||||||
name = NPCConfigParser.DEATH_ANIMATION;
|
name = NPCConfigParser.DEATH_ANIMATION;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return getConfiguration(name, null);
|
return getConfiguration(name, null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,12 +64,11 @@ public class RenderAnimationDefinition {
|
|||||||
* @return The render animation definitions.
|
* @return The render animation definitions.
|
||||||
*/
|
*/
|
||||||
public static RenderAnimationDefinition forId(int animId) {
|
public static RenderAnimationDefinition forId(int animId) {
|
||||||
RenderAnimationDefinition defs = new RenderAnimationDefinition();
|
|
||||||
if (animId == -1) {
|
if (animId == -1) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
byte[] data = Cache.getIndexes()[2].getFileData(32, animId);
|
byte[] data = Cache.getIndexes()[2].getFileData(32, animId);
|
||||||
defs = new RenderAnimationDefinition();
|
RenderAnimationDefinition defs = new RenderAnimationDefinition();
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
defs.parse(ByteBuffer.wrap(data));
|
defs.parse(ByteBuffer.wrap(data));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1164,7 +1164,7 @@ public final class RangingGuildPlugin extends OptionHandler {
|
|||||||
cumulativeStr += 1;
|
cumulativeStr += 1;
|
||||||
}*/
|
}*/
|
||||||
cumulativeStr *= 1.0;
|
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));
|
hit = hit + RandomFunction.randomSign(RandomFunction.random(3));
|
||||||
|
|
||||||
int target = Math.max(0, 13 - hit);
|
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.Entity;
|
||||||
import core.game.node.entity.combat.BattleState;
|
import core.game.node.entity.combat.BattleState;
|
||||||
import core.game.node.entity.combat.CombatStyle;
|
import core.game.node.entity.combat.CombatStyle;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import rs09.game.node.entity.combat.CombatSwingHandler;
|
import rs09.game.node.entity.combat.CombatSwingHandler;
|
||||||
import core.game.node.entity.combat.InteractionType;
|
import core.game.node.entity.combat.InteractionType;
|
||||||
import core.game.node.entity.combat.equipment.ArmourSet;
|
import core.game.node.entity.combat.equipment.ArmourSet;
|
||||||
@@ -76,7 +77,7 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
|
|||||||
}
|
}
|
||||||
BattleState[] targets;
|
BattleState[] targets;
|
||||||
state.setStyle(CombatStyle.RANGE);
|
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) {
|
for (BattleState s : targets) {
|
||||||
s.setStyle(CombatStyle.RANGE);
|
s.setStyle(CombatStyle.RANGE);
|
||||||
int hit = 0;
|
int hit = 0;
|
||||||
@@ -93,41 +94,46 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||||
switch (state.getStyle()) {
|
if(state != null) {
|
||||||
case MELEE:
|
if (state.getStyle() == CombatStyle.MELEE) {
|
||||||
entity.animate(MELEE_ATTACK);
|
entity.animate(MELEE_ATTACK);
|
||||||
break;
|
} else {
|
||||||
default:
|
entity.animate(RANGE_ATTACK);
|
||||||
entity.animate(RANGE_ATTACK);
|
for (BattleState s : state.getTargets()) {
|
||||||
for (BattleState s : state.getTargets()) {
|
Projectile.ranged(entity, s.getVictim(), 1200, 0, 0, 46, 1).send();
|
||||||
Projectile.ranged(entity, s.getVictim(), 1200, 0, 0, 46, 1).send();
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArmourSet getArmourSet(Entity e) {
|
public ArmourSet getArmourSet(Entity e) {
|
||||||
return getType().getSwingHandler().getArmourSet(e);
|
if(getType() != null)
|
||||||
|
return getType().getSwingHandler().getArmourSet(e);
|
||||||
|
else return ArmourSet.AHRIM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getSetMultiplier(Entity e, int skillId) {
|
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
|
@Override
|
||||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
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);
|
state.getStyle().getSwingHandler().impact(entity, victim, state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (BattleState s : state.getTargets()) {
|
if(state != null && state.getTargets() != null) {
|
||||||
if (s == null || s.getEstimatedHit() < 0) {
|
for (BattleState s : state.getTargets()) {
|
||||||
continue;
|
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
|
@Override
|
||||||
public int calculateAccuracy(Entity entity) {
|
public int calculateAccuracy(Entity entity) {
|
||||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
if(getType() != null)
|
||||||
|
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||||
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int calculateDefence(Entity victim, Entity attacker) {
|
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
|
@Override
|
||||||
public int calculateHit(Entity entity, Entity victim, double modifier) {
|
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
|
@Override
|
||||||
public int swing(Entity entity, Entity victim, BattleState state) {
|
public int swing(Entity entity, Entity victim, BattleState state) {
|
||||||
int ticks = 1;
|
int ticks = 1;
|
||||||
int distance = entity.size() >> 1;
|
int distance = entity != null ? entity.size() >> 1 : 0;
|
||||||
if (!entity.inCombat()) {
|
if (entity != null && !entity.inCombat()) {
|
||||||
distance++;
|
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 hit = 0;
|
||||||
int max = CombatStyle.MELEE.getSwingHandler().calculateHit(entity, victim, 1.0);
|
int max = CombatStyle.MELEE.getSwingHandler().calculateHit(entity, victim, 1.0);
|
||||||
if (CombatStyle.MELEE.getSwingHandler().isAccurateImpact(entity, victim, CombatStyle.MELEE)) {
|
if (CombatStyle.MELEE.getSwingHandler().isAccurateImpact(entity, victim, CombatStyle.MELEE)) {
|
||||||
@@ -80,7 +80,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
|||||||
state.setMaximumHit(max);
|
state.setMaximumHit(max);
|
||||||
state.setStyle(CombatStyle.MELEE);
|
state.setStyle(CombatStyle.MELEE);
|
||||||
} else {
|
} 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;
|
NPC npc = (NPC) entity;
|
||||||
List<BattleState> list = new ArrayList<>(20);
|
List<BattleState> list = new ArrayList<>(20);
|
||||||
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
|
||||||
@@ -93,7 +93,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
|||||||
}
|
}
|
||||||
BattleState[] targets;
|
BattleState[] targets;
|
||||||
state.setStyle(CombatStyle.RANGE);
|
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) {
|
for (BattleState s : targets) {
|
||||||
CombatStyle style = RandomFunction.randomize(10) < 3 ? CombatStyle.MAGIC : CombatStyle.RANGE;
|
CombatStyle style = RandomFunction.randomize(10) < 3 ? CombatStyle.MAGIC : CombatStyle.RANGE;
|
||||||
s.setStyle(style);
|
s.setStyle(style);
|
||||||
@@ -114,62 +114,69 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||||
switch (state.getStyle()) {
|
if(state != null) {
|
||||||
case MELEE:
|
if (state.getStyle() == CombatStyle.MELEE) {
|
||||||
entity.animate(MELEE_ATTACK);
|
entity.animate(MELEE_ATTACK);
|
||||||
break;
|
} else {
|
||||||
default:
|
entity.animate(RANGE_ATTACK);
|
||||||
entity.animate(RANGE_ATTACK);
|
for (BattleState s : state.getTargets()) {
|
||||||
for (BattleState s : state.getTargets()) {
|
int gfxId = 1197;
|
||||||
int gfxId = 1197;
|
if (s.getStyle() == CombatStyle.MAGIC) {
|
||||||
if (s.getStyle() == CombatStyle.MAGIC) {
|
gfxId = 1198;
|
||||||
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
|
@Override
|
||||||
public ArmourSet getArmourSet(Entity e) {
|
public ArmourSet getArmourSet(Entity e) {
|
||||||
return getType().getSwingHandler().getArmourSet(e);
|
if(getType() != null)
|
||||||
|
return getType().getSwingHandler().getArmourSet(e);
|
||||||
|
else return ArmourSet.AHRIM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getSetMultiplier(Entity e, int skillId) {
|
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
|
@Override
|
||||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
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);
|
state.getStyle().getSwingHandler().impact(entity, victim, state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (BattleState s : state.getTargets()) {
|
if(state != null) {
|
||||||
if (s == null || s.getEstimatedHit() < 0) {
|
for (BattleState s : state.getTargets()) {
|
||||||
continue;
|
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
|
@Override
|
||||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
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());
|
victim.animate(victim.getProperties().getDefenceAnimation());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (BattleState s : state.getTargets()) {
|
if(state != null) {
|
||||||
s.getVictim().animate(s.getVictim().getProperties().getDefenceAnimation());
|
for (BattleState s : state.getTargets()) {
|
||||||
if (RandomFunction.randomize(10) < 8) {
|
s.getVictim().animate(s.getVictim().getProperties().getDefenceAnimation());
|
||||||
Direction dir = Direction.getLogicalDirection(entity.getLocation(), s.getVictim().getLocation());
|
if (RandomFunction.randomize(10) < 8) {
|
||||||
Location destination = s.getVictim().getLocation().transform(dir.getStepX(), dir.getStepY(), 0);
|
Direction dir = Direction.getLogicalDirection(entity.getLocation(), s.getVictim().getLocation());
|
||||||
if (CHAMBER.insideBorder(destination)) {
|
Location destination = s.getVictim().getLocation().transform(dir.getStepX(), dir.getStepY(), 0);
|
||||||
s.getVictim().getProperties().setTeleportLocation(destination);
|
if (CHAMBER.insideBorder(destination)) {
|
||||||
s.getVictim().graphics(END_GRAPHIC);
|
s.getVictim().getProperties().setTeleportLocation(destination);
|
||||||
|
s.getVictim().graphics(END_GRAPHIC);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -188,17 +195,23 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int calculateAccuracy(Entity entity) {
|
public int calculateAccuracy(Entity entity) {
|
||||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
if(getType() != null)
|
||||||
|
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||||
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int calculateDefence(Entity victim, Entity attacker) {
|
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
|
@Override
|
||||||
public int calculateHit(Entity entity, Entity victim, double modifier) {
|
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);
|
victim.getStateManager().register(EntityState.POISONED, false, 168, entity);
|
||||||
}
|
}
|
||||||
if (special) {
|
if (special) {
|
||||||
((Player) victim).getSkills().decrementPrayerPoints(hit / 2);
|
((Player) victim).getSkills().decrementPrayerPoints((double) hit / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state.setEstimatedHit(hit);
|
state.setEstimatedHit(hit);
|
||||||
@@ -85,14 +85,14 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||||
switch (state.getStyle()) {
|
if(entity == null || state == null || state.getStyle() == null){
|
||||||
case MELEE:
|
return;
|
||||||
|
}
|
||||||
|
if (state.getStyle() == CombatStyle.MELEE) {
|
||||||
entity.animate(MELEE_ATTACK);
|
entity.animate(MELEE_ATTACK);
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
entity.visualize(MAGIC_ATTACK, MAGIC_START);
|
entity.visualize(MAGIC_ATTACK, MAGIC_START);
|
||||||
Projectile.magic(entity, victim, 1211, 0, 0, 46, 1).send();
|
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));
|
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);
|
state.setStyle(CombatStyle.MAGIC);
|
||||||
setType(CombatStyle.MAGIC);
|
setType(CombatStyle.MAGIC);
|
||||||
}
|
}
|
||||||
@@ -83,31 +83,38 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||||
switch (getType()) {
|
if(getType() != null) {
|
||||||
case MELEE:
|
switch (getType()) {
|
||||||
entity.animate(MELEE_ATTACK);
|
case MELEE:
|
||||||
break;
|
entity.animate(MELEE_ATTACK);
|
||||||
case MAGIC:
|
break;
|
||||||
entity.animate(MAGIC_ATTACK);
|
case MAGIC:
|
||||||
break;
|
entity.animate(MAGIC_ATTACK);
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArmourSet getArmourSet(Entity e) {
|
public ArmourSet getArmourSet(Entity e) {
|
||||||
return getType().getSwingHandler().getArmourSet(e);
|
if(getType() != null)
|
||||||
|
return getType().getSwingHandler().getArmourSet(e);
|
||||||
|
else return ArmourSet.AHRIM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getSetMultiplier(Entity e, int skillId) {
|
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
|
@Override
|
||||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
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
|
@Override
|
||||||
@@ -117,22 +124,28 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int calculateAccuracy(Entity entity) {
|
public int calculateAccuracy(Entity entity) {
|
||||||
return getType().getSwingHandler().calculateAccuracy(entity);
|
if(getType() != null)
|
||||||
|
return getType().getSwingHandler().calculateAccuracy(entity);
|
||||||
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int calculateDefence(Entity victim, Entity attacker) {
|
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
|
@Override
|
||||||
public int calculateHit(Entity entity, Entity victim, double modifier) {
|
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
|
@Override
|
||||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
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()) {
|
for (BattleState s : state.getTargets()) {
|
||||||
if (s.getEstimatedHit() > 0) {
|
if (s.getEstimatedHit() > 0) {
|
||||||
s.getVictim().graphics(MAGIC_END_GRAPHIC);
|
s.getVictim().graphics(MAGIC_END_GRAPHIC);
|
||||||
@@ -140,7 +153,8 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
|
|||||||
}
|
}
|
||||||
return;
|
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;
|
thievingLevel += 15;
|
||||||
}
|
}
|
||||||
int currentLevel = RandomFunction.random(thievingLevel) + 1;
|
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;
|
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());
|
PlunderObject object = target instanceof NPC ? null : new PlunderObject(target.asScenery()); //PlunderObject(target.getId(),target.getLocation());
|
||||||
PlunderObjectManager manager = player.getPlunderObjectManager();
|
PlunderObjectManager manager = player.getPlunderObjectManager();
|
||||||
|
if(manager == null) return super.interact(e, target, option);
|
||||||
boolean alreadyOpened = manager.openedMap.getOrDefault(object.getLocation(),false);
|
boolean alreadyOpened = manager.openedMap.getOrDefault(object.getLocation(),false);
|
||||||
boolean charmed = manager.charmedMap.getOrDefault(object.getLocation(),false);
|
boolean charmed = manager.charmedMap.getOrDefault(object.getLocation(),false);
|
||||||
boolean success = success(player, Skills.THIEVING);
|
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_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)});
|
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;
|
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){
|
PyramidPlunderRoom(int roomNum, int reqLevel, int spearX, int spearY, Location entrance, Location[] door_locations){
|
||||||
this.roomNum = roomNum;
|
this.roomNum = roomNum;
|
||||||
this.reqLevel = reqLevel;
|
this.reqLevel = reqLevel;
|
||||||
|
|||||||
@@ -217,12 +217,15 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
|||||||
}
|
}
|
||||||
return InteractionType.NO_INTERACT;
|
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
|
@Override
|
||||||
public int swing(Entity entity, Entity victim, BattleState state) {
|
public int swing(Entity entity, Entity victim, BattleState state) {
|
||||||
style = super.getType();
|
if(super.getType() != null)
|
||||||
|
style = super.getType();
|
||||||
int ticks = 1;
|
int ticks = 1;
|
||||||
if (jad) {
|
if (jad) {
|
||||||
main = CombatStyle.values()[1 + RandomFunction.RANDOM.nextInt(2)];
|
main = CombatStyle.values()[1 + RandomFunction.RANDOM.nextInt(2)];
|
||||||
@@ -262,7 +265,7 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||||
if (state.getStyle() == null) {
|
if (state == null || state.getStyle() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (state.getStyle()) {
|
switch (state.getStyle()) {
|
||||||
@@ -291,19 +294,19 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void impact(Entity entity, Entity victim, BattleState state) {
|
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);
|
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();
|
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;
|
n = npc;
|
||||||
}
|
}
|
||||||
((TzhaarFightCaveNPC) n).heal(state.getEstimatedHit());
|
((TzhaarFightCaveNPC) n).heal(state.getEstimatedHit());
|
||||||
n.graphics(new Graphics(444, 96));
|
n.graphics(new Graphics(444, 96));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.getEstimatedHit() > 0) {
|
if (state != null && state.getEstimatedHit() > 0) {
|
||||||
state.setEstimatedHit(formatHit(victim, state.getEstimatedHit()));
|
state.setEstimatedHit(formatHit(victim, state.getEstimatedHit()));
|
||||||
if (((NPC) entity).getId() == 2734 || ((NPC) entity).getId() == 2735) {
|
if (((NPC) entity).getId() == 2734 || ((NPC) entity).getId() == 2735) {
|
||||||
victim.getSkills().decrementPrayerPoints(state.getEstimatedHit());
|
victim.getSkills().decrementPrayerPoints(state.getEstimatedHit());
|
||||||
@@ -316,11 +319,11 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
||||||
if (state.getStyle() == null) {
|
if (state != null && state.getStyle() == null) {
|
||||||
return;
|
return;
|
||||||
} else if (state.getStyle() == CombatStyle.MAGIC && !jad) {
|
} else if (state != null && state.getStyle() == CombatStyle.MAGIC && !jad) {
|
||||||
victim.graphics(Graphics.create(1624));
|
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));
|
victim.graphics(Graphics.create(451));
|
||||||
}
|
}
|
||||||
style.getSwingHandler().visualizeImpact(entity, victim, state);
|
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();
|
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));
|
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);
|
Audio sound = new Audio(1911);
|
||||||
for (Player p : players) {
|
for (Player p : players) {
|
||||||
p.getAudioManager().send(sound);
|
p.getAudioManager().send(sound);
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ public class SkillEffect extends ConsumableEffect {
|
|||||||
@Override
|
@Override
|
||||||
public void activate(Player p) {
|
public void activate(Player p) {
|
||||||
Skills skills = p.getSkills();
|
Skills skills = p.getSkills();
|
||||||
int level = skills.getLevel(skill_slot);
|
|
||||||
int slevel = skills.getStaticLevel(skill_slot);
|
int slevel = skills.getStaticLevel(skill_slot);
|
||||||
skills.updateLevel(skill_slot,(int)(base + (bonus * slevel)),slevel + (int)(base + (bonus * slevel)));
|
skills.updateLevel(skill_slot,(int)(base + (bonus * slevel)),slevel + (int)(base + (bonus * slevel)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -603,10 +603,13 @@ public final class DBRCutscenePlugin extends CutscenePlugin {
|
|||||||
break;
|
break;
|
||||||
case 55:
|
case 55:
|
||||||
Scenery wall = RegionManager.getObject(base.transform(16, 46, 0));
|
Scenery wall = RegionManager.getObject(base.transform(16, 46, 0));
|
||||||
SceneryBuilder.replace(wall, wall.transform(9151, 0, 10));
|
if(wall != null)
|
||||||
getWiseOldMan().getWalkingQueue().reset();
|
SceneryBuilder.replace(wall, wall.transform(9151, 0, 10));
|
||||||
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 16, base.getY() + 46);
|
if(getWiseOldMan() != null) {
|
||||||
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 17, base.getY() + 46);
|
getWiseOldMan().getWalkingQueue().reset();
|
||||||
|
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 16, base.getY() + 46);
|
||||||
|
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 17, base.getY() + 46);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 58:
|
case 58:
|
||||||
camera(21, 38, -36, 43, 495, 99);
|
camera(21, 38, -36, 43, 495, 99);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public final class ChemistDialogue extends DialoguePlugin {
|
|||||||
public boolean open(Object... args) {
|
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");
|
interpreter.sendOptions("Do you want to talk about lamps?", "Yes.", "No.", "No, I'm more interested in impling jars.", "Falador Achievement Diary");
|
||||||
stage = 0;
|
stage = 0;
|
||||||
AchievementDiary diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
||||||
replacementReward = diary.isLevelRewarded(level)
|
replacementReward = diary.isLevelRewarded(level)
|
||||||
&& diary.isComplete(level, true)
|
&& diary.isComplete(level, true)
|
||||||
&& !player.hasItem(diary.getType().getRewards(level)[0]);
|
&& !player.hasItem(diary.getType().getRewards(level)[0]);
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public final class DialogueInterpreter {
|
|||||||
public void startScript(int dialogueKey, ScriptContext script, Object... args) {
|
public void startScript(int dialogueKey, ScriptContext script, Object... args) {
|
||||||
key = dialogueKey;
|
key = dialogueKey;
|
||||||
(dialogueStage = script).execute(args);
|
(dialogueStage = script).execute(args);
|
||||||
if (script != null && script.isInstant()) {
|
if (script.isInstant()) {
|
||||||
dialogueStage = script = ScriptManager.run(script, args);
|
dialogueStage = script = ScriptManager.run(script, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class EblisDialogue extends DialoguePlugin {
|
|||||||
@Override
|
@Override
|
||||||
public boolean open(Object... args) {
|
public boolean open(Object... args) {
|
||||||
//TODO: Add proper dialogue once DT is implemented
|
//TODO: Add proper dialogue once DT is implemented
|
||||||
NPC npc = (NPC) args[0];
|
npc = (NPC) args[0];
|
||||||
if(!player.getAttribute("DT:staff-bought",false)) {
|
if(!player.getAttribute("DT:staff-bought",false)) {
|
||||||
player("Hey.");
|
player("Hey.");
|
||||||
stage = 0;
|
stage = 0;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ReadbeardFrankDialogue extends DialoguePlugin {
|
|||||||
quest = player.getQuestRepository().getQuest("Pirate's Treasure");
|
quest = player.getQuestRepository().getQuest("Pirate's Treasure");
|
||||||
npc("Arr, Matey!");
|
npc("Arr, Matey!");
|
||||||
stage = 0;
|
stage = 0;
|
||||||
AchievementDiary diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
|
||||||
replacementReward = diary.isLevelRewarded(level)
|
replacementReward = diary.isLevelRewarded(level)
|
||||||
&& diary.isComplete(level, true)
|
&& diary.isComplete(level, true)
|
||||||
&& !player.hasItem(diary.getType().getRewards(level)[0]);
|
&& !player.hasItem(diary.getType().getRewards(level)[0]);
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public class SirReniteeDialogue extends DialoguePlugin {
|
|||||||
stage = 500;
|
stage = 500;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case 200:
|
case 200:
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?");
|
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?");
|
||||||
stage = 210;
|
stage = 210;
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ public class StankersDialogue extends DialoguePlugin {
|
|||||||
case 90:
|
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");
|
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++;
|
stage++;
|
||||||
|
break;
|
||||||
case 91:
|
case 91:
|
||||||
npc("your flax allowance in acknowledgement of your", "standing.");
|
npc("your flax allowance in acknowledgement of your", "standing.");
|
||||||
stage = 999;
|
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!");
|
npc("Beware of players trying to lue you into the wilderness.", "Your items cannot be returned if you lose them!");
|
||||||
stage = 2;
|
stage = 2;
|
||||||
break;
|
break;
|
||||||
case 5:
|
default:
|
||||||
npc("" + GameWorld.getSettings().getName() + " will never email you asking for your log-in details.");
|
npc("" + GameWorld.getSettings().getName() + " will never email you asking for your log-in details.");
|
||||||
stage = 2;
|
stage = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
stage = 2;
|
|
||||||
break;
|
break;
|
||||||
case 150:
|
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");
|
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) {
|
public static Location getEndLocation(Entity entity, Scenery object, Boolean isAutoWalk) {
|
||||||
Location l = object.getLocation();
|
Location l = object.getLocation();
|
||||||
Location end = DestinationFlag.OBJECT.getDestination(entity,object);
|
|
||||||
switch (object.getRotation()) {
|
switch (object.getRotation()) {
|
||||||
case 0:
|
case 0:
|
||||||
if (entity.getLocation().getX() >= l.getX()) {
|
if (entity.getLocation().getX() >= l.getX()) {
|
||||||
@@ -183,7 +182,7 @@ public final class DoorActionHandler {
|
|||||||
l = l.transform(1, 0, 0);
|
l = l.transform(1, 0, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
default:
|
||||||
if (entity.getLocation().getY() >= l.getY()) {
|
if (entity.getLocation().getY() >= l.getY()) {
|
||||||
l = l.transform(0, -1, 0);
|
l = l.transform(0, -1, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class PresetManager {
|
|||||||
|
|
||||||
private Player player;
|
private Player player;
|
||||||
|
|
||||||
private Map<String, Preset> current_presets;
|
private final Map<String, Preset> current_presets;
|
||||||
|
|
||||||
public PresetManager() {
|
public PresetManager() {
|
||||||
current_presets = new HashMap<>();
|
current_presets = new HashMap<>();
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ public enum Canoe {
|
|||||||
this.maxDist = ordinal() + 1;
|
this.maxDist = ordinal() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int silhouetteChild;
|
public final int silhouetteChild;
|
||||||
public int textChild;
|
public final int textChild;
|
||||||
public int maxDist;
|
public final int maxDist;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the woodcutting level requirement to craft the canoe.
|
* 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];
|
final Item other = args.length == 2 ? null : (Item) args[2];
|
||||||
if (other != null) {
|
if (other != null) {
|
||||||
identifier = "equip";
|
identifier = "equip";
|
||||||
item = other;
|
|
||||||
}
|
}
|
||||||
switch (identifier) {
|
switch (identifier) {
|
||||||
case "equip":
|
case "equip":
|
||||||
|
|||||||
+1
@@ -187,6 +187,7 @@ public final class LadyKeliDialogue extends DialoguePlugin {
|
|||||||
case 56:
|
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.");
|
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;
|
stage = 57;
|
||||||
|
break;
|
||||||
case 57:
|
case 57:
|
||||||
interpreter.sendDialogue("Keli shows you a small key on a strong looking chain.");
|
interpreter.sendDialogue("Keli shows you a small key on a strong looking chain.");
|
||||||
stage = 58;
|
stage = 58;
|
||||||
|
|||||||
-1
@@ -23,7 +23,6 @@ public class VineInteraction extends PluginInteraction {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(Player player, Node node) {
|
public boolean handle(Player player, Node node) {
|
||||||
if(node instanceof Scenery){
|
if(node instanceof Scenery){
|
||||||
Scenery obj = node.asScenery();
|
|
||||||
if(player.getQuestRepository().getStage("Fishing Contest") > 0 && player.getQuestRepository().getStage("Fishing Contest") < 100){
|
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)) {
|
player.getPulseManager().run(new MovementPulse(player, node.asScenery().getLocation().transform(0, 0, 0)) {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+6
-9
@@ -529,7 +529,7 @@ public final class MerlinCrystalPlugin extends OptionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleTickActions() {
|
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();
|
clear();
|
||||||
}
|
}
|
||||||
super.handleTickActions();
|
super.handleTickActions();
|
||||||
@@ -545,10 +545,7 @@ public final class MerlinCrystalPlugin extends OptionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAttack(Entity entity) {
|
public boolean canAttack(Entity entity) {
|
||||||
if (getAttribute("thrantax_owner", entity) == entity) {
|
return getAttribute("thrantax_owner", entity) == entity;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -591,20 +588,20 @@ public final class MerlinCrystalPlugin extends OptionHandler {
|
|||||||
Item useditem = event.getUsedItem();
|
Item useditem = event.getUsedItem();
|
||||||
final Scenery object = (Scenery) event.getUsedWith();
|
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.");
|
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.getDialogueInterpreter().sendDialogue("You pour insect repellent on the beehive. You see the bees leaving the", "hive.");
|
||||||
player.setAttribute("cleared-beehives", true);
|
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.getDialogueInterpreter().sendDialogue("You get some wax from the beehive.");
|
||||||
player.getInventory().remove(new Item(BUCKET.getId(), 1));
|
player.getInventory().remove(new Item(BUCKET.getId(), 1));
|
||||||
player.getInventory().add(new Item(BUCKET_OF_WAX.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.");
|
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:
|
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");
|
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++;
|
stage++;
|
||||||
|
break;
|
||||||
case 91:
|
case 91:
|
||||||
npc("your flax allowance in acknowledgement of your", "standing.");
|
npc("your flax allowance in acknowledgement of your", "standing.");
|
||||||
stage = 999;
|
stage = 999;
|
||||||
|
|||||||
-1
@@ -28,7 +28,6 @@ public class SheepPoisonHandler extends PluginInteraction {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(Player player, NodeUsageEvent event) {
|
public boolean handle(Player player, NodeUsageEvent event) {
|
||||||
Node n = event.getUsedWith();
|
Node n = event.getUsedWith();
|
||||||
Item i = event.getUsedItem();
|
|
||||||
if(n instanceof HerderSheepNPC){
|
if(n instanceof HerderSheepNPC){
|
||||||
if (withinBorders(n.getLocation(),Location.create(2595, 3364, 0),Location.create(2609, 3351, 0))){
|
if (withinBorders(n.getLocation(),Location.create(2595, 3364, 0),Location.create(2609, 3351, 0))){
|
||||||
handlePoisoning(player,(HerderSheepNPC) n);
|
handlePoisoning(player,(HerderSheepNPC) n);
|
||||||
|
|||||||
-1
@@ -42,7 +42,6 @@ public class WitchsHousePlugin extends OptionHandler {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(Player player, Node node, String option) {
|
public boolean handle(Player player, Node node, String option) {
|
||||||
final Quest quest = player.getQuestRepository().getQuest("Witch's House");
|
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();
|
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 killedExperiment = player.getAttribute("witchs_house:experiment_killed",false);
|
||||||
// boolean experimentAlive = !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.
|
* Represents if it is a login stage.
|
||||||
* @param login the login value.
|
* @param login the login value.
|
||||||
*/
|
*/
|
||||||
public void isLogin(boolean login) {
|
private void isLogin(boolean login) {
|
||||||
this.login = login;
|
this.login = login;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,14 +84,6 @@ public enum GEItemSet {
|
|||||||
return Arrays.copyOf(components, components.length);
|
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.
|
* Gets the item array.
|
||||||
* @return 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())) {
|
if (option.getHandler() == null || !option.getHandler().handle(player, node, option.getName().toLowerCase())) {
|
||||||
player.getPacketDispatch().sendMessage("Nothing interesting happens.");
|
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());
|
player.debug("Using item handler " + option.getHandler().getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ public final class LumbridgeNodePlugin extends OptionHandler {
|
|||||||
cumulativeStr += 1;
|
cumulativeStr += 1;
|
||||||
}
|
}
|
||||||
cumulativeStr *= 1.0;
|
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));
|
player.getSkills().addExperience(Skills.RANGE, ((hit * 1.33) / 10));
|
||||||
return !player.getEquipment().contains(9706, 1) || !player.getEquipment().contains(9705, 1);
|
return !player.getEquipment().contains(9706, 1) || !player.getEquipment().contains(9705, 1);
|
||||||
} else {
|
} 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());
|
bandaid(player, player.getLocation(), object.getLocation().transform(0, -3, 0), CLIMB_DOWN, CLIMB_DOWN, object.getDirection());
|
||||||
break;
|
break;
|
||||||
case 3790:// rock scalling.
|
case 3790:// rock scalling.
|
||||||
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
|
case 3791:
|
||||||
direction = getOpposite(ForceMovement.direction(player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0)));
|
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
|
||||||
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_DOWN, CLIMB_DOWN, direction);
|
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_DOWN, CLIMB_DOWN, direction);
|
||||||
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
|
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
|
||||||
break;
|
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);
|
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_UP);
|
||||||
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
|
case 3748:
|
||||||
break;
|
|
||||||
case 3748:
|
|
||||||
player.getPacketDispatch().sendMessage("You climb onto the rock...");
|
player.getPacketDispatch().sendMessage("You climb onto the rock...");
|
||||||
if (loc.equals(new Location(2821, 3635, 0))) {
|
if (loc.equals(new Location(2821, 3635, 0))) {
|
||||||
bandaid(player, player.getLocation(), loc.transform(player.getLocation().getX() > loc.getX() ? -1 : 1, 0, 0), JUMP);
|
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.
|
* Gets the runes.
|
||||||
* @return The runes.
|
* @return The runes.
|
||||||
*/
|
*/
|
||||||
public Item[] getRunes() {
|
private Item[] getRunes() {
|
||||||
return runes;
|
return runes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the runes.
|
|
||||||
* @param runes The runes to set.
|
|
||||||
*/
|
|
||||||
public void setRunes(Item[] runes) {
|
|
||||||
this.runes = runes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the exp.
|
* Gets the exp.
|
||||||
* @return The exp.
|
* @return The exp.
|
||||||
@@ -225,14 +217,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
|
|||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the exp.
|
|
||||||
* @param exp The exp to set.
|
|
||||||
*/
|
|
||||||
public void setExp(double exp) {
|
|
||||||
this.exp = exp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the enchanted.
|
* Gets the enchanted.
|
||||||
* @return The enchanted.
|
* @return The enchanted.
|
||||||
@@ -241,14 +225,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
|
|||||||
return enchanted;
|
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.
|
* Gets the bolt by the id.
|
||||||
* @param button the button.
|
* @param button the button.
|
||||||
|
|||||||
@@ -101,14 +101,14 @@ public class TeleTabsOptionPlugin extends OptionHandler {
|
|||||||
/**
|
/**
|
||||||
* @param item the item to set
|
* @param item the item to set
|
||||||
*/
|
*/
|
||||||
public void setItem(int item) {
|
private void setItem(int item) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param location the location to set
|
* @param location the location to set
|
||||||
*/
|
*/
|
||||||
public void setLocation(Location location) {
|
private void setLocation(Location location) {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ public class TeleTabsOptionPlugin extends OptionHandler {
|
|||||||
/**
|
/**
|
||||||
* @param exp the exp to set.
|
* @param exp the exp to set.
|
||||||
*/
|
*/
|
||||||
public void setExp(double exp) {
|
private void setExp(double exp) {
|
||||||
this.exp = exp;
|
this.exp = exp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,34 +287,6 @@ public class PoisonRemovePlugin extends UseWithHandler {
|
|||||||
return third;
|
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.
|
* Method used to get the poisioned weapon for the id.
|
||||||
* @param i the id.
|
* @param i the id.
|
||||||
|
|||||||
@@ -261,34 +261,6 @@ public class PoisonWeaponPlugin extends UseWithHandler {
|
|||||||
return third;
|
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.
|
* Method used to get the poisioned weapon for the id.
|
||||||
* @param i the id.
|
* @param i the id.
|
||||||
@@ -320,8 +292,10 @@ public class PoisonWeaponPlugin extends UseWithHandler {
|
|||||||
product = weapon.getThird();
|
product = weapon.getThird();
|
||||||
player.getInventory().remove(new Item(5940, 1));
|
player.getInventory().remove(new Item(5940, 1));
|
||||||
break;
|
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().remove(new Item(weaponItem.getId(), amt));
|
||||||
player.getInventory().add(new Item(229, 1));
|
player.getInventory().add(new Item(229, 1));
|
||||||
player.getInventory().add(new Item(product, amt));
|
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.");
|
player.sendMessage("You don't have enough inventory space.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (egg != null) {
|
{
|
||||||
String name = egg.getProduct().getName().toLowerCase();
|
String name = egg.getProduct().getName().toLowerCase();
|
||||||
player.varpManager.get(1160).setVarbit(4,0).send(player);
|
player.varpManager.get(1160).setVarbit(4,0).send(player);
|
||||||
player.sendMessage("You take your " + name + " out of the incubator.");
|
player.sendMessage("You take your " + name + " out of the incubator.");
|
||||||
if(!player.getInventory().add(egg.getProduct())){
|
if(!player.getInventory().add(egg.getProduct())){
|
||||||
GroundItemManager.create(egg.getProduct(),player);
|
GroundItemManager.create(egg.getProduct(),player);
|
||||||
}
|
|
||||||
player.removeAttribute("inc");
|
|
||||||
}
|
}
|
||||||
|
player.removeAttribute("inc");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
case "inspect":
|
case "inspect":
|
||||||
if (player.states.get("incubator") != null || inc != -1) {
|
if (player.states.get("incubator") != null || inc != -1) {
|
||||||
IncubatorState p = (IncubatorState) player.states.get("incubator");
|
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);
|
player.varpManager.get(1160).setVarbit(4,0).send(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public class ReadSignPostPlugin extends OptionHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
player.getPacketDispatch();
|
|
||||||
final Scenery object = (Scenery) node;
|
final Scenery object = (Scenery) node;
|
||||||
Signs sign = Signs.forId(object.getId());
|
Signs sign = Signs.forId(object.getId());
|
||||||
if (sign == null) {
|
if (sign == null) {
|
||||||
|
|||||||
+1
-1
@@ -564,7 +564,7 @@ public final class GardenObjectsPlugin extends OptionHandler {
|
|||||||
Item with = event.getBaseItem();
|
Item with = event.getBaseItem();
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
SeasonDefinitions def = SeasonDefinitions.forFruitId(item.getId());
|
SeasonDefinitions def = SeasonDefinitions.forFruitId(item.getId());
|
||||||
if (item == null || with == null || player == null || def == null)
|
if (with == null || player == null || def == null)
|
||||||
return true;
|
return true;
|
||||||
int amt = player.getInventory().getAmount(item);
|
int amt = player.getInventory().getAmount(item);
|
||||||
if (!player.getInventory().containItems(1919)) {
|
if (!player.getInventory().containItems(1919)) {
|
||||||
|
|||||||
@@ -237,9 +237,8 @@ public enum BoltEffect {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public void impact(BattleState state) {
|
public void impact(BattleState state) {
|
||||||
Entity entity = state.getAttacker();
|
|
||||||
Entity victim = state.getVictim();
|
Entity victim = state.getVictim();
|
||||||
if (sound != null && victim != null && victim instanceof Player) {
|
if (sound != null && victim instanceof Player) {
|
||||||
sound.send(victim.asPlayer(), true);
|
sound.send(victim.asPlayer(), true);
|
||||||
}
|
}
|
||||||
if (graphics != null) {
|
if (graphics != null) {
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ public final class RampageSpecialHandler extends MeleeSwingHandler implements Pl
|
|||||||
boost += drain;
|
boost += drain;
|
||||||
p.getSkills().updateLevel(i, (int) -drain, (int) (p.getSkills().getStaticLevel(i) - 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.getSkills().updateLevel(Skills.STRENGTH, (int) (p.getSkills().getStaticLevel(Skills.STRENGTH) * 0.20));
|
||||||
p.getAudioManager().send(new Audio(386), true);
|
p.getAudioManager().send(new Audio(386), true);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
-1
@@ -68,7 +68,6 @@ public final class SliceAndDiceSpecialHandler extends MeleeSwingHandler implemen
|
|||||||
} else {
|
} else {
|
||||||
hit = getHit(entity, victim, (int) (maximum * 1.5));
|
hit = getHit(entity, victim, (int) (maximum * 1.5));
|
||||||
if (hit > 0) {
|
if (hit > 0) {
|
||||||
maximum *= 1.5;
|
|
||||||
hits = new int[] {0, 0, 0, hit};
|
hits = new int[] {0, 0, 0, hit};
|
||||||
} else {
|
} else {
|
||||||
hits = new int[] {0, RandomFunction.random(2)};
|
hits = new int[] {0, RandomFunction.random(2)};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class AliTheCarter extends DialoguePlugin {
|
|||||||
@Override
|
@Override
|
||||||
public DialoguePlugin newInstance(Player player){return new AliTheCarter(player);}
|
public DialoguePlugin newInstance(Player player){return new AliTheCarter(player);}
|
||||||
public boolean open(Object... args){
|
public boolean open(Object... args){
|
||||||
NPC npc = (NPC)args[0];
|
npc = (NPC)args[0];
|
||||||
player("Hello");
|
player("Hello");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ public class AliTheKebabSeller extends DialoguePlugin {
|
|||||||
public DialoguePlugin newInstance(Player player){return new AliTheKebabSeller(player);}
|
public DialoguePlugin newInstance(Player player){return new AliTheKebabSeller(player);}
|
||||||
@Override
|
@Override
|
||||||
public boolean open(Object... args){
|
public boolean open(Object... args){
|
||||||
NPC npc = (NPC)args[0];
|
npc = (NPC)args[0];
|
||||||
player("Hello");
|
player("Hello");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ public final class SphinxDialogue extends DialoguePlugin {
|
|||||||
case 52:
|
case 52:
|
||||||
player.getFamiliarManager().getFamiliar().sendChat("Meow");
|
player.getFamiliarManager().getFamiliar().sendChat("Meow");
|
||||||
stage = 53;
|
stage = 53;
|
||||||
|
break;
|
||||||
case 53:
|
case 53:
|
||||||
player.getDialogueInterpreter().sendDialogue("The Sphinx and the cat have a chat.");
|
player.getDialogueInterpreter().sendDialogue("The Sphinx and the cat have a chat.");
|
||||||
stage = 54;
|
stage = 54;
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ public final class NPCDropTables {
|
|||||||
*/
|
*/
|
||||||
private boolean handleBoneCrusher(Player player, Item item) {
|
private boolean handleBoneCrusher(Player player, Item item) {
|
||||||
Bones bone = Bones.forId(item.getId());
|
Bones bone = Bones.forId(item.getId());
|
||||||
if (bone == null || item == null) {
|
if (bone == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!player.getGlobalData().isEnableBoneCrusher()) {
|
if (!player.getGlobalData().isEnableBoneCrusher()) {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public final class RareDropTable {
|
|||||||
* Initializes the rare drop table.
|
* Initializes the rare drop table.
|
||||||
*/
|
*/
|
||||||
public static void init(){
|
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);
|
SystemLogger.logErr("Can't locate RDT file at " + ServerConstants.RDT_DATA_PATH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class SpiritTerrorbirdNPC extends BurdenBeast {
|
|||||||
protected boolean specialMove(FamiliarSpecial special) {
|
protected boolean specialMove(FamiliarSpecial special) {
|
||||||
visualize(Animation.create(1009), Graphics.create(1521));
|
visualize(Animation.create(1009), Graphics.create(1521));
|
||||||
owner.getSkills().updateLevel(Skills.AGILITY, 2);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -229,9 +229,9 @@ public class BorkNPC extends AbstractNPC {
|
|||||||
unlock();
|
unlock();
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
attack(player);
|
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) {
|
for (NPC n : legions) {
|
||||||
n.getProperties().getCombatPulse().attack(player);
|
n.getProperties().getCombatPulse().attack(player);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ public class RevenantNPC extends AbstractNPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void finalizeDeath(Entity killer) {
|
public void finalizeDeath(Entity killer) {
|
||||||
Location itemLoc = getLocation();
|
|
||||||
super.finalizeDeath(killer);
|
super.finalizeDeath(killer);
|
||||||
if (killer instanceof Player) {
|
if (killer instanceof Player) {
|
||||||
killer.asPlayer().getAudioManager().send(4063, true);
|
killer.asPlayer().getAudioManager().send(4063, true);
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class Player extends Entity {
|
|||||||
|
|
||||||
public Location startLocation = null;
|
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;
|
public boolean newPlayer = getSkills().getTotalLevel() < 50;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public enum LoginType {
|
|||||||
/**
|
/**
|
||||||
* @param type the type to set.
|
* @param type the type to set.
|
||||||
*/
|
*/
|
||||||
public void setType(int type) {
|
private void setType(int type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -445,8 +445,4 @@ public enum PrayerType {
|
|||||||
return defenceReq;
|
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];
|
Location l = set.entrance[i];
|
||||||
for (int x = 1; x < set.exit[i].getX() - l.getX(); x++) {
|
for (int x = 1; x < set.exit[i].getX() - l.getX(); x++) {
|
||||||
Scenery object = RegionManager.getObject(l.transform(x, 0, 0));
|
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.entrance[i]).setCharge(avail ? 1000 : 500);
|
||||||
RegionManager.getObject(set.exit[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));
|
Direction d = Direction.getLogicalDirection(player.getLocation(), getLedgeLocation(player, object));
|
||||||
final Direction dir = d;
|
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 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) ;
|
final boolean fail = player.getSkills().getLevel(Skills.AGILITY) < 75 && hasFailed(player);
|
||||||
player.getSkills().getLevel(Skills.AGILITY);
|
|
||||||
final Location end = player.getLocation().transform(dir.getStepX() * (fail ? 3 : 5), dir.getStepY() * (fail ? 3 : 5), 0);
|
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...");
|
player.getPacketDispatch().sendMessage("You put your foot on the ledge and try to edge across...");
|
||||||
if (fail) {
|
if (fail) {
|
||||||
|
|||||||
-2
@@ -59,8 +59,6 @@ public class WaterOrbGrapple extends OptionHandler {
|
|||||||
Location current = player.getLocation();
|
Location current = player.getLocation();
|
||||||
Scenery rock = RegionManager.getObject(Location.create(2841, 3426, 0));
|
Scenery rock = RegionManager.getObject(Location.create(2841, 3426, 0));
|
||||||
Scenery tree = RegionManager.getObject(Location.create(2841, 3434, 0));
|
Scenery tree = RegionManager.getObject(Location.create(2841, 3434, 0));
|
||||||
System.out.println(rock);
|
|
||||||
System.out.println(tree);
|
|
||||||
|
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case "grapple":
|
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
|
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);
|
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 final static HashMap<Integer,CookableItems>cookingMap = new HashMap<>();
|
||||||
public static HashMap<Integer, CookableItems>intentionalBurnMap = new HashMap<>();
|
public final static HashMap<Integer, CookableItems>intentionalBurnMap = new HashMap<>();
|
||||||
public int raw,cooked,level,burnLevel,burnt;
|
public final int raw,cooked,level,burnLevel,burnt;
|
||||||
public double experience;
|
public final double experience;
|
||||||
double low,high;
|
double low,high;
|
||||||
CookableItems(int cooked, int raw, int burnt, int level, double experience, int burnLevel, double low, double high){
|
CookableItems(int cooked, int raw, int burnt, int level, double experience, int burnLevel, double low, double high){
|
||||||
this.raw = raw;
|
this.raw = raw;
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ public class Fletching {
|
|||||||
|
|
||||||
|
|
||||||
public int unfinished,product,string,level;
|
public int unfinished,product,string,level;
|
||||||
public double experience;
|
public final double experience;
|
||||||
public Animation animation;
|
public final Animation animation;
|
||||||
String(byte indicator, final int unfinished, final int product, final int level, final double experience, 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.unfinished = unfinished;
|
||||||
this.product = product;
|
this.product = product;
|
||||||
@@ -159,6 +159,8 @@ public class Fletching {
|
|||||||
case 2:
|
case 2:
|
||||||
this.string = org.rs09.consts.Items.CROSSBOW_STRING_9438;
|
this.string = org.rs09.consts.Items.CROSSBOW_STRING_9438;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ public enum SkillingResource {
|
|||||||
public int getRespawnDuration() {
|
public int getRespawnDuration() {
|
||||||
int minimum = respawnRate & 0xFFFF;
|
int minimum = respawnRate & 0xFFFF;
|
||||||
int maximum = (respawnRate >> 16) & 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));
|
return (int) (minimum + ((maximum - minimum) / playerRatio));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -636,7 +636,7 @@ public enum MiningNode{
|
|||||||
public int getRespawnDuration() {
|
public int getRespawnDuration() {
|
||||||
int minimum = respawnRate & 0xFFFF;
|
int minimum = respawnRate & 0xFFFF;
|
||||||
int maximum = (respawnRate >> 16) & 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));
|
return (int) (minimum + ((maximum - minimum) / playerRatio));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -416,7 +416,7 @@ public enum WoodcuttingNode {
|
|||||||
public int getRespawnDuration() {
|
public int getRespawnDuration() {
|
||||||
int minimum = respawnRate & 0xFFFF;
|
int minimum = respawnRate & 0xFFFF;
|
||||||
int maximum = (respawnRate >> 16) & 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));
|
return (int) (minimum + ((maximum - minimum) / playerRatio));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public final class BNetPulse extends SkillPulse<NPC> {
|
|||||||
huntingLevel *= 0.5;
|
huntingLevel *= 0.5;
|
||||||
}
|
}
|
||||||
int currentLevel = RandomFunction.random(huntingLevel) + 1;
|
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;
|
return Math.round(ratio * huntingLevel) >= level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public final class ImplingNode extends BNetNode {
|
|||||||
strengthLevel /= 0.5;
|
strengthLevel /= 0.5;
|
||||||
int level = getLevel();
|
int level = getLevel();
|
||||||
int currentLevel = RandomFunction.random(strengthLevel) + 1;
|
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;
|
return Math.round(ratio * strengthLevel) < level;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,10 +93,8 @@ public final class ImplingNode extends BNetNode {
|
|||||||
if (!success) {
|
if (!success) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (type) {
|
if(type == 1){
|
||||||
case 1:
|
|
||||||
player.sendMessage("You manage to catch the impling and squeeze it into a jar.");
|
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;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the baid.
|
|
||||||
* @param id the id to set.
|
|
||||||
*/
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the book.
|
* Gets the book.
|
||||||
* @return the book
|
* @return the book
|
||||||
@@ -245,30 +237,13 @@ public class PrayerAltarPlugin extends OptionHandler {
|
|||||||
return book;
|
return book;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the babook.
|
|
||||||
* @param book the book to set.
|
|
||||||
*/
|
|
||||||
public void setBook(int book) {
|
|
||||||
this.book = book;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the messages.
|
* Gets the messages.
|
||||||
* @return the messages
|
* @return the messages
|
||||||
*/
|
*/
|
||||||
public String[] getMessages() {
|
private String[] getMessages() {
|
||||||
return messages;
|
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) {
|
for (int i : SKILLS) {
|
||||||
player.getSkills().updateLevel(i, -player.getSkills().getStaticLevel(i), 0);
|
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);
|
state.setEstimatedHit(14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,15 +168,15 @@ public enum SmithingType {
|
|||||||
*/
|
*/
|
||||||
TYPE_PICKAXE(2, 267, 268, new int[] { 273, 272, 271, 270 }, 1);
|
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}.
|
* Constructs a new {@code SmithingType.java} {@code Object}.
|
||||||
@@ -229,13 +229,6 @@ public enum SmithingType {
|
|||||||
return product_amount;
|
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) {
|
public static int forButton(Player player, Bars bar, int button, int item) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (bar == null) {
|
if (bar == null) {
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ public final class SystemTermination {
|
|||||||
dmc.clear(false);
|
dmc.clear(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
save(ServerConstants.DATA_PATH);
|
if(ServerConstants.DATA_PATH != null)
|
||||||
|
save(ServerConstants.DATA_PATH);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ public final class ScriptManager {
|
|||||||
*/
|
*/
|
||||||
public static void load() {
|
public static void load() {
|
||||||
amount = 0;
|
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") + "...");
|
SystemLogger.logInfo("Parsed " + amount + " " + GameWorld.getSettings().getName() + " script" + (amount == 1 ? "" : "s") + "...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -254,19 +254,11 @@ public enum Direction {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the traversal.
|
|
||||||
* @return The traversal.
|
|
||||||
*/
|
|
||||||
public int[] getTraversal() {
|
|
||||||
return traversal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the traversal.
|
* Sets the traversal.
|
||||||
* @param traversal The traversal to set.
|
* @param traversal The traversal to set.
|
||||||
*/
|
*/
|
||||||
public void setTraversal(int[] traversal) {
|
private void setTraversal(int[] traversal) {
|
||||||
this.traversal = traversal;
|
this.traversal = traversal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ import java.io.File;
|
|||||||
public class ObjectParser extends StartupPlugin {
|
public class ObjectParser extends StartupPlugin {
|
||||||
|
|
||||||
public void parseObjects(){
|
public void parseObjects(){
|
||||||
|
if(ServerConstants.OBJECT_PARSER_PATH == null) return;
|
||||||
File f = new File(ServerConstants.OBJECT_PARSER_PATH);
|
File f = new File(ServerConstants.OBJECT_PARSER_PATH);
|
||||||
if(!f.exists()){
|
if(!f.exists()){
|
||||||
System.out.println("[ObjectParser]: Can't find file " + ServerConstants.OBJECT_PARSER_PATH);
|
System.out.println("[ObjectParser]: Can't find file " + ServerConstants.OBJECT_PARSER_PATH);
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public class PlayerTab extends ConsoleTab {
|
|||||||
public void populatePlayerSearch() {
|
public void populatePlayerSearch() {
|
||||||
playerNames.clear();
|
playerNames.clear();
|
||||||
model.clear();
|
model.clear();
|
||||||
|
if(ServerConstants.PLAYER_SAVE_PATH == null) return;
|
||||||
File f = new File(ServerConstants.PLAYER_SAVE_PATH);
|
File f = new File(ServerConstants.PLAYER_SAVE_PATH);
|
||||||
if (f.listFiles() == null) {
|
if (f.listFiles() == null) {
|
||||||
System.out.println("Player directory was null!");
|
System.out.println("Player directory was null!");
|
||||||
|
|||||||
@@ -330,7 +330,6 @@ public final class UtilityTab extends ConsoleTab {
|
|||||||
public List<String> itemScanner(Item item) {
|
public List<String> itemScanner(Item item) {
|
||||||
Map<String, Integer> map = new HashMap<>();
|
Map<String, Integer> map = new HashMap<>();
|
||||||
for (Player p : players) {
|
for (Player p : players) {
|
||||||
p.getAnimator();
|
|
||||||
List<core.game.container.Container> containers = new ArrayList<>(20);
|
List<core.game.container.Container> containers = new ArrayList<>(20);
|
||||||
containers.add(p.getInventory());
|
containers.add(p.getInventory());
|
||||||
containers.add(p.getBank());
|
containers.add(p.getBank());
|
||||||
|
|||||||
@@ -599,8 +599,8 @@ public final class MSPacketRepository {
|
|||||||
Player player = Repository.getPlayerByName(key);
|
Player player = Repository.getPlayerByName(key);
|
||||||
if (player != null && player.isActive()) {
|
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.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;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
player = Repository.getPlayerByName(key);
|
player = Repository.getPlayerByName(key);
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ public class IoBuffer {
|
|||||||
*/
|
*/
|
||||||
public int getSmart() {
|
public int getSmart() {
|
||||||
int peek = buf.get(buf.position());
|
int peek = buf.get(buf.position());
|
||||||
if (peek <= Byte.MAX_VALUE) {
|
if (peek <= (0xFF & peek)) {
|
||||||
return buf.get() & 0xFF;
|
return buf.get() & 0xFF;
|
||||||
}
|
}
|
||||||
return (buf.getShort() & 0xFFFF) - 32768;
|
return (buf.getShort() & 0xFFFF) - 32768;
|
||||||
|
|||||||
@@ -298,9 +298,6 @@ public final class InteractionPacket implements IncomingPacket {
|
|||||||
}
|
}
|
||||||
final Option option = player.getInteraction().get(optionIndex);
|
final Option option = player.getInteraction().get(optionIndex);
|
||||||
//Handling for "Pelt" option
|
//Handling for "Pelt" option
|
||||||
if(option.getName().toLowerCase().equals("pelt")){
|
|
||||||
|
|
||||||
}
|
|
||||||
if (option == null) {
|
if (option == null) {
|
||||||
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ public class InterfaceUseOnPacket implements IncomingPacket {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 195: // Interface On Player
|
case 195: // Interface On Player
|
||||||
payload = buffer.getShortA();
|
//payload = buffer.getShortA();
|
||||||
|
buffer.getShortA();
|
||||||
componentId = buffer.getLEShort();
|
componentId = buffer.getLEShort();
|
||||||
interfaceId = buffer.getLEShort();
|
interfaceId = buffer.getLEShort();
|
||||||
int targetIndex = buffer.getLEShortA();
|
int targetIndex = buffer.getLEShortA();
|
||||||
@@ -175,7 +176,7 @@ public class InterfaceUseOnPacket implements IncomingPacket {
|
|||||||
case 239: // Interface On NPC
|
case 239: // Interface On NPC
|
||||||
componentId = buffer.getLEShort();
|
componentId = buffer.getLEShort();
|
||||||
interfaceId = buffer.getLEShort();
|
interfaceId = buffer.getLEShort();
|
||||||
int unknown = buffer.getShortA();
|
buffer.getShortA();
|
||||||
int index = buffer.getLEShortA();
|
int index = buffer.getLEShortA();
|
||||||
if (index < 1 || index > ServerConstants.MAX_NPCS) {
|
if (index < 1 || index > ServerConstants.MAX_NPCS) {
|
||||||
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public enum ResourceTasks {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
private ResourceTask resourceTask;
|
private final ResourceTask resourceTask;
|
||||||
|
|
||||||
|
|
||||||
ResourceTasks(ResourceTask resourceTask) {
|
ResourceTasks(ResourceTask resourceTask) {
|
||||||
@@ -39,9 +39,6 @@ public enum ResourceTasks {
|
|||||||
return resourceTask;
|
return resourceTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResourceTask(ResourceTask resourceTask) {
|
|
||||||
this.resourceTask = resourceTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String reqirementMessage() {
|
private static String reqirementMessage() {
|
||||||
return "You do not meet the requirements for this task.";
|
return "You do not meet the requirements for this task.";
|
||||||
|
|||||||
@@ -538,13 +538,4 @@ public final class PvPBotsBuilder{
|
|||||||
player.getAppearance().sync();
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class CombatState(val bot: PestControlTestBot) {
|
|||||||
if (bot.justStartedGame) {
|
if (bot.justStartedGame) {
|
||||||
bot.customState = "Walking randomly"
|
bot.customState = "Walking randomly"
|
||||||
bot.justStartedGame = false
|
bot.justStartedGame = false
|
||||||
bot.randomWalkAroundPoint(getMyPestControlSession1(bot)?.squire?.location, 15)
|
bot.randomWalkAroundPoint(getMyPestControlSession1(bot)?.squire?.location ?: bot.location, 15)
|
||||||
bot.movetimer = Random.nextInt(7) + 6
|
bot.movetimer = Random.nextInt(7) + 6
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ class CombatStateIntermediate(val bot: PestControlTestBot2) {
|
|||||||
if (bot.justStartedGame) {
|
if (bot.justStartedGame) {
|
||||||
bot.customState = "Walking randomly"
|
bot.customState = "Walking randomly"
|
||||||
bot.justStartedGame = false
|
bot.justStartedGame = false
|
||||||
bot.randomWalkAroundPoint(getMyPestControlSession2(bot)?.squire?.location, 15)
|
bot.randomWalkAroundPoint(getMyPestControlSession2(bot)?.squire?.location ?: bot.location, 15)
|
||||||
bot.movetimer = Random.nextInt(7) + 6
|
bot.movetimer = Random.nextInt(7) + 6
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -98,7 +98,7 @@ class PestControlTestBot2(l: Location) : PvMBots(legitimizeLocation(l)) {
|
|||||||
combathandler.goToPortals()
|
combathandler.goToPortals()
|
||||||
} else {
|
} else {
|
||||||
movetimer = RandomFunction.random(2,10)
|
movetimer = RandomFunction.random(2,10)
|
||||||
randomWalkAroundPoint(PestControlHelper.getMyPestControlSession2(this)?.squire?.location,5)
|
randomWalkAroundPoint(PestControlHelper.getMyPestControlSession2(this)?.squire?.location ?: location,5)
|
||||||
combathandler.fightNPCs()
|
combathandler.fightNPCs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -97,7 +97,7 @@ class PestControlTestBot(l: Location) : PvMBots(legitimizeLocation(l)){
|
|||||||
combathandler.goToPortals()
|
combathandler.goToPortals()
|
||||||
} else {
|
} else {
|
||||||
movetimer = RandomFunction.random(2,10)
|
movetimer = RandomFunction.random(2,10)
|
||||||
randomWalkAroundPoint(PestControlHelper.getMyPestControlSession1(this)?.squire?.location,5)
|
randomWalkAroundPoint(PestControlHelper.getMyPestControlSession1(this)?.squire?.location ?: location,5)
|
||||||
combathandler.fightNPCs()
|
combathandler.fightNPCs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ object PestControlHelper {
|
|||||||
return p.getAttribute<Any?>("pc_zeal") != null
|
return p.getAttribute<Any?>("pc_zeal") != null
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class BoatInfo(var boatBorder: ZoneBorders, var outsideBoatBorder: ZoneBorders, var ladderId: Int) {
|
enum class BoatInfo(val boatBorder: ZoneBorders, val outsideBoatBorder: ZoneBorders, val ladderId: Int) {
|
||||||
NOVICE(ZoneBorders(2660, 2638, 2663, 2643), ZoneBorders(2658, 2635, 2656, 2646), 14315),
|
NOVICE(ZoneBorders(2660, 2638, 2663, 2643), ZoneBorders(2658, 2635, 2656, 2646), 14315),
|
||||||
INTERMEDIATE(ZoneBorders(2638, 2642, 2641, 2647), ZoneBorders(2645, 2639, 2643, 2652), 25631),
|
INTERMEDIATE(ZoneBorders(2638, 2642, 2641, 2647), ZoneBorders(2645, 2639, 2643, 2652), 25631),
|
||||||
VETERAN(ZoneBorders(2632, 2649, 2635, 2654), ZoneBorders(2638, 2652, 2638, 2655), 25632);
|
VETERAN(ZoneBorders(2632, 2649, 2635, 2654), ZoneBorders(2638, 2652, 2638, 2655), 25632);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ enum class RandomEvents(val npc: RandomEventNPC, val loot: WeightBasedTable? = n
|
|||||||
SURPRISE_EXAM(MysteriousOldManNPC(),"sexam");
|
SURPRISE_EXAM(MysteriousOldManNPC(),"sexam");
|
||||||
|
|
||||||
var type: String = ""
|
var type: String = ""
|
||||||
|
private set
|
||||||
|
|
||||||
constructor(npc: RandomEventNPC, type: String) : this(npc,null){
|
constructor(npc: RandomEventNPC, type: String) : this(npc,null){
|
||||||
this.type = type
|
this.type = type
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ object OfferManager {
|
|||||||
|
|
||||||
if(file.exists() && file.length() != 0L) {
|
if(file.exists() && file.length() != 0L) {
|
||||||
val parser = JSONParser()
|
val parser = JSONParser()
|
||||||
val reader: FileReader? = FileReader(DB_PATH)
|
val reader: FileReader = FileReader(DB_PATH)
|
||||||
val saveFile = parser.parse(reader) as JSONObject
|
val saveFile = parser.parse(reader) as JSONObject
|
||||||
|
|
||||||
offsetUID = saveFile["offsetUID"].toString().toLong()
|
offsetUID = saveFile["offsetUID"].toString().toLong()
|
||||||
@@ -122,7 +122,7 @@ object OfferManager {
|
|||||||
|
|
||||||
if(File(BOT_DB_PATH).exists()) {
|
if(File(BOT_DB_PATH).exists()) {
|
||||||
try {
|
try {
|
||||||
val botReader: FileReader? = FileReader(BOT_DB_PATH)
|
val botReader: FileReader = FileReader(BOT_DB_PATH)
|
||||||
val botSave = JSONParser().parse(botReader) as JSONObject
|
val botSave = JSONParser().parse(botReader) as JSONObject
|
||||||
if (botSave.containsKey("offers")) {
|
if (botSave.containsKey("offers")) {
|
||||||
val offers = botSave["offers"] as JSONArray
|
val offers = botSave["offers"] as JSONArray
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ open class MagicSwingHandler
|
|||||||
val level = entity!!.skills.getLevel(Skills.MAGIC, true)
|
val level = entity!!.skills.getLevel(Skills.MAGIC, true)
|
||||||
val bonus = entity.properties.bonuses[if (entity is Player) 14 else 13]
|
val bonus = entity.properties.bonuses[if (entity is Player) 14 else 13]
|
||||||
val cumulativeStr = level.toDouble()
|
val cumulativeStr = level.toDouble()
|
||||||
return 1 + ((14 + cumulativeStr + bonus / 8 + cumulativeStr * bonus * 0.016865) * baseDamage).toInt() / 10
|
return 1 + ((14 + cumulativeStr + bonus.toDouble() / 8 + cumulativeStr * bonus * 0.016865) * baseDamage).toInt() / 10
|
||||||
}
|
}
|
||||||
var levelMod = 1.0
|
var levelMod = 1.0
|
||||||
val entityMod = entity!!.getLevelMod(entity, victim)
|
val entityMod = entity!!.getLevelMod(entity, victim)
|
||||||
|
|||||||
+1
-10
@@ -86,7 +86,7 @@ class AbyssPlugin : InteractionListener() {
|
|||||||
/**
|
/**
|
||||||
* Represents the option.
|
* Represents the option.
|
||||||
*/
|
*/
|
||||||
var option: String,
|
val option: String,
|
||||||
/**
|
/**
|
||||||
* Represents the corssing location.
|
* Represents the corssing location.
|
||||||
*/
|
*/
|
||||||
@@ -445,15 +445,6 @@ class AbyssPlugin : InteractionListener() {
|
|||||||
} else player.inventory.contains(tool.getId(), 1)
|
} else player.inventory.contains(tool.getId(), 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new `RunecraftingOptionPlugin` `Object`.
|
|
||||||
* @param locations the locations.
|
|
||||||
* @param objects the objects.
|
|
||||||
*/
|
|
||||||
init {
|
|
||||||
option = option
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
Reference in New Issue
Block a user