diff --git a/Server/server.sql b/Server/server.sql index a4e2c2fca..a8f3bef1d 100644 --- a/Server/server.sql +++ b/Server/server.sql @@ -15763,6 +15763,7 @@ INSERT INTO `npc_configs` (`id`, `name`, `examine`, `lifepoints`, `attack_level` (4458, 'Ork', 'She works in the bank.', 10, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (4459, 'Ork', 'She works in the bank.', 10, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (4470, 'Tree spirit', 'A very angry nymph.', 12, 9, 9, 9, 1, NULL, NULL, NULL, NULL, 60, 6, NULL, NULL, 94, 0, 97, NULL, 0, 0, NULL, NULL, NULL, 6, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(4474, 'Magic dummy', 'A magic training dummy', 15, 1, 1, 1, 1, NULL, NULL, NULL, NULL, 60, 6, NULL, NULL, 94, 0, 97, NULL, 0, 0, NULL, NULL, NULL, 6, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (4476, 'Guardian mummy', 'Who\'s your mummy?', 10, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (4479, 'Goblin', 'An ugly green creature.', 10, 1, 2, 1, 1, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, 6185, 6183, 6182, NULL, 6185, 6185, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, '469,472,471', NULL, NULL, NULL), (4480, 'Goblin', 'An ugly green creature.', 10, 1, 2, 1, 1, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, 6185, 6183, 6182, NULL, 6185, 6185, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, '469,472,471', NULL, NULL, NULL), @@ -17513,6 +17514,7 @@ INSERT INTO `npc_configs` (`id`, `name`, `examine`, `lifepoints`, `attack_level` (7772, 'Lava monster', 'A monster made of magma.', 54, 28, 28, 38, 38, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, 9337, 0, 9340, NULL, 0, 0, NULL, NULL, NULL, 0, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (7773, 'Fire monster', 'A monster like many others', 54, 28, 28, 38, 38, NULL, NULL, NULL, NULL, 60, NULL, NULL, NULL, 9341, 0, 9344, NULL, 0, 0, NULL, NULL, NULL, 0, NULL, NULL, 2, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (7823, 'Wall Beast', 'A big, scary hand! ', 105, 38, 38, 38, 1, NULL, NULL, NULL, NULL, 60, 6, 1, NULL, 1802, 1803, 1804, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 105, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(7891, 'Melee dummy', 'A melee training dummy', 15, 1, 1, 1, 1, NULL, NULL, NULL, NULL, 60, 6, NULL, NULL, 94, 0, 97, NULL, 0, 0, NULL, NULL, NULL, 6, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (8133, 'Corporeal Beast', 'A vision of supernatural horror.', 2000, 95, 95, 95, 95, 95, '380,250,350,400,650,450,920,850,750,800,1500,250,250,275,200', NULL, 1, 80, 6, 64, 64, 10058, 10386, 10385, NULL, 10053, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), (8149, 'Armoured zombie', 'He sure looks grave.', 62, 50, 50, 50, 50, NULL, '30,30,80,85,80,40,40,60,38,0,0,0,0,0,0', NULL, NULL, 35, 6, NULL, NULL, 5571, 5574, 5575, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, '931,923,922', NULL, NULL, NULL), (8150, 'Armoured zombie', 'This is a rotten one.', 62, 50, 50, 50, 50, NULL, '30,30,80,85,80,40,40,60,38,0,0,0,0,0,0', NULL, NULL, 35, 6, NULL, NULL, 5571, 5574, 5575, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 30, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, '931,923,922', NULL, NULL, NULL), diff --git a/Server/src/org/crandor/game/node/entity/combat/CombatPulse.java b/Server/src/org/crandor/game/node/entity/combat/CombatPulse.java index c738babee..fd34fd2ff 100644 --- a/Server/src/org/crandor/game/node/entity/combat/CombatPulse.java +++ b/Server/src/org/crandor/game/node/entity/combat/CombatPulse.java @@ -97,6 +97,7 @@ public final class CombatPulse extends Pulse { @Override public boolean pulse() { + if (victim == null || DeathTask.isDead(entity) || DeathTask.isDead(victim)) { return true; } @@ -374,6 +375,10 @@ public final class CombatPulse extends Pulse { if (victim == this.victim && isAttacking()) { return; } + //makes sure lumbridge dummies can't attack back (lol) + if (victim instanceof Player && (this.entity.getId() == 4474 || this.entity.getId() == 7891)){ + return; + } if (victim instanceof NPC) { if (entity instanceof Player && victim != this.victim && victim != lastVictim) { // Loar Shade Transformation Animation diff --git a/Server/src/org/crandor/game/node/entity/combat/CombatSwingHandler.java b/Server/src/org/crandor/game/node/entity/combat/CombatSwingHandler.java index d629c7303..16ed3ad16 100644 --- a/Server/src/org/crandor/game/node/entity/combat/CombatSwingHandler.java +++ b/Server/src/org/crandor/game/node/entity/combat/CombatSwingHandler.java @@ -33,7 +33,7 @@ public abstract class CombatSwingHandler { /** * The amount of experience to get per hit. */ - public static final double EXPERIENCE_MOD = 4; + public static double EXPERIENCE_MOD = 4; /** * The mapping of the special attack handlers. @@ -368,12 +368,20 @@ public abstract class CombatSwingHandler { * @param state The battle state. */ public void adjustBattleState(Entity entity, Entity victim, BattleState state) { + this.EXPERIENCE_MOD = 4; int totalHit = 0; if (entity instanceof Player) { ((Player) entity).getFamiliarManager().adjustBattleState(state); } entity.sendImpact(state); victim.checkImpact(state); + //Prevents lumbridge dummies from dying (true to how rs3 / runescape in 2009 does it) + if((victim.getId() == 4474 && this.type == CombatStyle.MAGIC) || (victim.getId() == 7891 && this.type == CombatStyle.MELEE)) { + this.EXPERIENCE_MOD = 0.1; + victim.fullRestore(); + if(state.getEstimatedHit() >= 15){state.setEstimatedHit(14);}; + if(state.getSecondaryHit() >= 15){state.setSecondaryHit(14);} + } if (state.getEstimatedHit() > 0) { state.setEstimatedHit(getFormatedHit(entity, victim, state, state.getEstimatedHit())); totalHit += state.getEstimatedHit(); diff --git a/Server/src/plugin/interaction/player/AttackOptionPlugin.java b/Server/src/plugin/interaction/player/AttackOptionPlugin.java index 9da2b138f..27b852d62 100644 --- a/Server/src/plugin/interaction/player/AttackOptionPlugin.java +++ b/Server/src/plugin/interaction/player/AttackOptionPlugin.java @@ -4,7 +4,9 @@ import org.crandor.cache.def.impl.NPCDefinition; import org.crandor.game.interaction.Option; import org.crandor.game.interaction.OptionHandler; import org.crandor.game.node.Node; +import org.crandor.game.node.entity.combat.CombatStyle; import org.crandor.game.node.entity.player.Player; +import org.crandor.game.node.item.Item; import org.crandor.plugin.InitializablePlugin; import org.crandor.plugin.Plugin; @@ -18,6 +20,9 @@ public final class AttackOptionPlugin extends OptionHandler { @Override public boolean handle(Player player, Node node, String option) { + //Makes sure player uses correct attack styles for lumbridge dummies + if (node.getId() == 4474 && !(player.getSwingHandler(false).getType() == CombatStyle.MAGIC)){ player.sendMessage("You can only attack this with magic."); return true; } + if (node.getId() == 7891 && !(player.getSwingHandler(false).getType() == CombatStyle.MELEE)){ player.sendMessage("You must use the training sword to attack this."); return true; } player.attack(node); return true; }