mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Merge branch 'special-attack-types' into 'master'
Special attacks now have proper types (so they no longer ignore prayer) and give experience. See merge request 2009scape/2009scape!261
This commit is contained in:
commit
4716c35c6a
31 changed files with 73 additions and 8 deletions
|
|
@ -51,6 +51,7 @@ public final class AncientMaceSpecialHandler extends MeleeSwingHandler implement
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.1, 0.98)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1));
|
||||
|
|
@ -72,5 +73,6 @@ public final class AncientMaceSpecialHandler extends MeleeSwingHandler implement
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public final class BackstabSpecialHandler extends MeleeSwingHandler implements P
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
double accuracy = 1.0;
|
||||
if (!victim.getProperties().getCombatPulse().isAttacking()) {
|
||||
|
|
@ -70,5 +71,6 @@ public final class BackstabSpecialHandler extends MeleeSwingHandler implements P
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ public final class ChainhitSpecialHandler extends RangeSwingHandler implements P
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
if (victim instanceof NPC) {
|
||||
NPC npc = victim.asNpc();
|
||||
if (npc.getId() == 2440) {
|
||||
|
|
@ -106,6 +107,7 @@ public final class ChainhitSpecialHandler extends RangeSwingHandler implements P
|
|||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
int speed = (int) (32 + (entity.getLocation().getDistance(victim.getLocation()) * 5));
|
||||
Projectile.create(entity, victim, 258, 40, 36, 32, speed, 5, 11).send();
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class CleaveSpecialHandler extends MeleeSwingHandler implements Plu
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.18, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.2203));
|
||||
|
|
@ -65,5 +66,6 @@ public final class CleaveSpecialHandler extends MeleeSwingHandler implements Plu
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public final class ClobberSpecialHandler extends MeleeSwingHandler implements Pl
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (entity instanceof Player) {
|
||||
entity.asPlayer().sendChat("Chop chop!");
|
||||
|
|
@ -72,5 +73,6 @@ public final class ClobberSpecialHandler extends MeleeSwingHandler implements Pl
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ public final class DescentOfDarknessSpecialHandler extends RangeSwingHandler imp
|
|||
}
|
||||
Weapon w = new Weapon(p.getEquipment().get(3), rw.getAmmunitionSlot(), p.getEquipment().getNew(rw.getAmmunitionSlot()));
|
||||
w.setType(rw.getWeaponType());
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
state.setRangeWeapon(rw);
|
||||
state.setAmmunition(Ammunition.get(w.getAmmunition().getId()));
|
||||
state.setWeapon(w);
|
||||
|
|
@ -145,5 +146,6 @@ public final class DescentOfDarknessSpecialHandler extends RangeSwingHandler imp
|
|||
@Override
|
||||
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
|
||||
victim.visualize(victim.getProperties().getDefenceAnimation(), state.isFrozen() ? DRAGON_IMPACT : DARKNESS_IMPACT);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public final class EnergyDrainSpecialHandler extends MeleeSwingHandler implement
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.2, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1));
|
||||
|
|
@ -69,5 +70,6 @@ public final class EnergyDrainSpecialHandler extends MeleeSwingHandler implement
|
|||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.animate(ANIMATION);
|
||||
victim.graphics(GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public final class FeintSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.0, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, RandomFunction.random(1.0, 2.50)));
|
||||
|
|
@ -58,5 +59,6 @@ public final class FeintSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.animate(ANIMATION);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class HealingBladeSpecialHandler extends MeleeSwingHandler implemen
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.12, 0.98)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.005));
|
||||
|
|
@ -75,6 +76,7 @@ public final class HealingBladeSpecialHandler extends MeleeSwingHandler implemen
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class IceCleaveSpecialHandler extends MeleeSwingHandler implements
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.075, 0.98)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.005));
|
||||
|
|
@ -74,5 +75,6 @@ public final class IceCleaveSpecialHandler extends MeleeSwingHandler implements
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class ImpaleSpecialHandler extends MeleeSwingHandler implements Plu
|
|||
if (!player.getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.1, 0.98)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.1));
|
||||
|
|
@ -68,5 +69,6 @@ public final class ImpaleSpecialHandler extends MeleeSwingHandler implements Plu
|
|||
return;
|
||||
}
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class JudgementSpecialHandler extends MeleeSwingHandler implements
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.25, 0.98)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.25));
|
||||
|
|
@ -65,5 +66,6 @@ public final class JudgementSpecialHandler extends MeleeSwingHandler implements
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public final class PowershotSpecialHandler extends RangeSwingHandler implements
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.RANGE, 1.98, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.0));
|
||||
|
|
@ -67,5 +68,6 @@ public final class PowershotSpecialHandler extends RangeSwingHandler implements
|
|||
entity.visualize(state.getRangeWeapon().getAnimation(), GRAPHIC);
|
||||
int speed = (int) (46 + (entity.getLocation().getDistance(victim.getLocation()) * 5));
|
||||
Projectile.create(entity, victim, 249, 40, 36, 45, speed, 5, 11).send();
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ public final class PowerstabSpecialHandler extends MeleeSwingHandler implements
|
|||
if (isAccurateImpact(entity, e)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, e, 1.0));
|
||||
}
|
||||
s.setStyle(CombatStyle.MELEE);
|
||||
s.setEstimatedHit(hit);
|
||||
}
|
||||
}
|
||||
|
|
@ -94,6 +95,7 @@ public final class PowerstabSpecialHandler extends MeleeSwingHandler implements
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public final class PunctureSpecialHandler extends MeleeSwingHandler implements P
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
// First hit
|
||||
//double accuracyMod, double defenceMod
|
||||
int hit = 0;
|
||||
|
|
@ -80,5 +81,6 @@ public final class PunctureSpecialHandler extends MeleeSwingHandler implements P
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public final class QuickSmashSpecialHandler extends MeleeSwingHandler implements
|
|||
if (!p.getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
// TODO: apply protection prayers/experience manually (since this is bypassing normal BattleState machinery)
|
||||
visualize(entity, victim, null);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim)) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ public final class SaradominsLightningHandler extends MeleeSwingHandler implemen
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
// TODO: target states to make the first hit melee and the second hit magic
|
||||
state.setStyle(CombatStyle.MAGIC);
|
||||
int hit = 0;
|
||||
int secondary = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.10, 0.98)) {
|
||||
|
|
@ -74,6 +76,7 @@ public final class SaradominsLightningHandler extends MeleeSwingHandler implemen
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public final class SeverSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
public int swing(Entity entity, Entity victim, BattleState state) {
|
||||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY))
|
||||
return -1;
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.124, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.0));
|
||||
|
|
@ -78,5 +79,6 @@ public final class SeverSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public final class ShatterSpecialHandler extends MeleeSwingHandler implements Pl
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 0.87, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.3546));
|
||||
|
|
@ -64,5 +65,6 @@ public final class ShatterSpecialHandler extends MeleeSwingHandler implements Pl
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,5 +102,6 @@ public final class SliceAndDiceSpecialHandler extends MeleeSwingHandler implemen
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class SmashSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.0, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, RandomFunction.random(1.0, 1.5)));
|
||||
|
|
@ -66,5 +67,6 @@ public final class SmashSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ public final class SnapshotSpecialHandler extends RangeSwingHandler implements P
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
int max = calculateHit(entity, victim, 1.0);
|
||||
state.setMaximumHit(max);
|
||||
int hit = 0;
|
||||
|
|
@ -104,5 +105,6 @@ public final class SnapshotSpecialHandler extends RangeSwingHandler implements P
|
|||
Projectile.create(entity, victim, 249, 40, 36, 20, speed, 15, 11).send();
|
||||
speed = (int) (32 + (entity.getLocation().getDistance(victim.getLocation()) * 10));
|
||||
Projectile.create(entity, victim, 249, 40, 36, 50, speed, 15, 11).send();
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public final class SnipeSpecialHandler extends RangeSwingHandler implements Plug
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.RANGE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.RANGE, 1.05, 1.0)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.0));
|
||||
|
|
@ -69,5 +70,6 @@ public final class SnipeSpecialHandler extends RangeSwingHandler implements Plug
|
|||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.animate(ANIMATION);
|
||||
Projectile.create(entity, victim, 698, 36, 25, 35, 72).send();
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public final class SpearWallSpecialHandler extends MeleeSwingHandler implements
|
|||
BattleState s = targets[count++] = new BattleState(entity, e);
|
||||
int hit = 0;
|
||||
hit = RandomFunction.random(calculateHit(entity, e, 1.0));
|
||||
s.setStyle(CombatStyle.MELEE);
|
||||
s.setEstimatedHit(hit);
|
||||
}
|
||||
}
|
||||
|
|
@ -93,6 +94,7 @@ public final class SpearWallSpecialHandler extends MeleeSwingHandler implements
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public final class SweepSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
BattleState[] targets = getTargets(entity, victim, state);
|
||||
state.setTargets(targets);
|
||||
for (BattleState s : targets) {
|
||||
s.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, s.getVictim(), CombatStyle.MELEE, 1, 0.94)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, s.getVictim(), 1.1));
|
||||
|
|
@ -156,6 +157,7 @@ public final class SweepSpecialHandler extends MeleeSwingHandler implements Plug
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public final class WarstrikeSpecialHandler extends MeleeSwingHandler implements
|
|||
if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
|
||||
return -1;
|
||||
}
|
||||
state.setStyle(CombatStyle.MELEE);
|
||||
int hit = 0;
|
||||
if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.049, 0.98)) {
|
||||
hit = RandomFunction.random(calculateHit(entity, victim, 1.1));
|
||||
|
|
@ -84,5 +85,6 @@ public final class WarstrikeSpecialHandler extends MeleeSwingHandler implements
|
|||
@Override
|
||||
public void visualize(Entity entity, Entity victim, BattleState state) {
|
||||
entity.visualize(ANIMATION, GRAPHIC);
|
||||
addExperience(entity, victim, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -497,6 +497,9 @@ public class Player extends Entity {
|
|||
details.getSession().disconnect();
|
||||
getSession().setLastPing(Long.MAX_VALUE);
|
||||
}
|
||||
if(getAttribute("infinite-special", false)) {
|
||||
settings.setSpecialEnergy(100);
|
||||
}
|
||||
|
||||
//Decrements prayer points
|
||||
getPrayer().tick();
|
||||
|
|
@ -1384,4 +1387,4 @@ public class Player extends Entity {
|
|||
state.getPulse().stop();
|
||||
states.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ open class MagicSwingHandler
|
|||
}
|
||||
if(state.estimatedHit > victim.skills.lifepoints) state.estimatedHit = victim.skills.lifepoints
|
||||
if(state.estimatedHit + state.secondaryHit > victim.skills.lifepoints) state.secondaryHit -= ((state.estimatedHit + state.secondaryHit) - victim.skills.lifepoints)
|
||||
addExperience(entity, victim, state)
|
||||
return ticks
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +111,7 @@ open class MagicSwingHandler
|
|||
|
||||
override fun visualize(entity: Entity, victim: Entity?, state: BattleState?) {
|
||||
state!!.spell.visualize(entity, victim)
|
||||
addExperience(entity, victim, state)
|
||||
}
|
||||
|
||||
override fun impact(entity: Entity?, victim: Entity?, state: BattleState?) {
|
||||
|
|
@ -274,4 +274,4 @@ open class MagicSwingHandler
|
|||
ArmourSet.AHRIM
|
||||
} else super.getArmourSet(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ open class MeleeSwingHandler
|
|||
if (state.estimatedHit > victim.skills.lifepoints) state.estimatedHit = victim.skills.lifepoints
|
||||
if (state.estimatedHit + state.secondaryHit > victim.skills.lifepoints) state.secondaryHit -= ((state.estimatedHit + state.secondaryHit) - victim.skills.lifepoints)
|
||||
}
|
||||
addExperience(entity, victim, state)
|
||||
return 1
|
||||
}
|
||||
|
||||
override fun visualize(entity: Entity, victim: Entity?, state: BattleState?) {
|
||||
entity.animate(entity.properties.attackAnimation)
|
||||
addExperience(entity, victim, state)
|
||||
}
|
||||
|
||||
override fun impact(entity: Entity?, victim: Entity?, state: BattleState?) {
|
||||
|
|
@ -347,4 +347,4 @@ open class MeleeSwingHandler
|
|||
return entity.centerLocation.withinDistance(victim.centerLocation, distance + (size shr 1) + (victim.size() shr 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ open class RangeSwingHandler
|
|||
if(state.estimatedHit > victim.skills.lifepoints) state.estimatedHit = victim.skills.lifepoints
|
||||
if(state.estimatedHit + state.secondaryHit > victim.skills.lifepoints) state.secondaryHit -= ((state.estimatedHit + state.secondaryHit) - victim.skills.lifepoints)
|
||||
useAmmo(entity, state, victim.location)
|
||||
addExperience(entity, victim, state)
|
||||
return 1 + ceil(entity.location.getDistance(victim.location) * 0.3).toInt()
|
||||
}
|
||||
|
||||
|
|
@ -210,6 +209,7 @@ open class RangeSwingHandler
|
|||
}
|
||||
}
|
||||
entity.visualize(entity.properties.attackAnimation, start)
|
||||
addExperience(entity, victim, state)
|
||||
}
|
||||
|
||||
override fun impact(entity: Entity?, victim: Entity?, state: BattleState?) {
|
||||
|
|
@ -435,4 +435,4 @@ open class RangeSwingHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -455,6 +455,17 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
|
|||
notify(player,"No parent NPC found.")
|
||||
}
|
||||
}
|
||||
define("infinitespecial",Command.Privilege.ADMIN){player,args ->
|
||||
val usageStr = "Usage: ::infinitespecial true|false"
|
||||
if(args.size < 2){
|
||||
reject(player, usageStr)
|
||||
}
|
||||
when(args[1]){
|
||||
"true" -> player.setAttribute("infinite-special", true)
|
||||
"false" -> player.removeAttribute("infinite-special")
|
||||
else -> reject(player, usageStr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showGeSell(player: Player){
|
||||
|
|
@ -584,4 +595,4 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
|
|||
}
|
||||
|
||||
class FakeOffer(val sell: Boolean,val name: String,val amount: Int)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue