From 96ea6cc2d6872477cb039f05502d749ba6ba05a8 Mon Sep 17 00:00:00 2001 From: latifundio Date: Fri, 7 Sep 2012 07:56:03 -0300 Subject: [PATCH 1/6] Update GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix Npc suddenly stopping when chasing player, and fix Npc not attacking if you move while player has moved.  --- .../src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java b/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java index 40e99b2..825a197 100644 --- a/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java +++ b/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java @@ -67,8 +67,11 @@ public abstract class WalkMobToMobEvent extends DelayedEvent { if (owner.withinRange(affectedMob, radius)) arrived(); - else if (owner.hasMoved()) + else if (owner.hasMoved() || affectedMob.hasMoved()) { + owner.resetPath(); + owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob.getX(), affectedMob.getY())); return; // We're still moving + } else { if (GameEngine.getTime() - startTime <= 10000) // Make NPCs // give a 10 From 05277352b5b3aeb38eb51dd4200872eaad1e9061 Mon Sep 17 00:00:00 2001 From: latifundio Date: Fri, 7 Sep 2012 08:05:42 -0300 Subject: [PATCH 2/6] Update GameServer/src/org/moparscape/msc/gs/model/Npc.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check if Npc is about to start chasing player so it doesn't do a random walking path.  --- .../src/org/moparscape/msc/gs/model/Npc.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/GameServer/src/org/moparscape/msc/gs/model/Npc.java b/GameServer/src/org/moparscape/msc/gs/model/Npc.java index 44588e7..6bd6131 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/Npc.java +++ b/GameServer/src/org/moparscape/msc/gs/model/Npc.java @@ -578,13 +578,18 @@ public class Npc extends Mob { Instance.getDelayedEventHandler().add(fighting); } - if (now - lastMovement > 2200) { - lastMovement = now; - int rand = DataConversions.random(0, 1); - if (!isBusy() && finishedPath() && rand == 1 && !this.isRemoved()) { - int newX = DataConversions.random(loc.minX(), loc.maxX()); - int newY = DataConversions.random(loc.minY(), loc.maxY()); - super.setPath(new Path(getX(), getY(), newX, newY)); + if (now - lastMovement > 1800) { + if (now - getCombatTimer() < (getCombatState() == + CombatState.WAITING ? 5000 : 500)) { + } + else { + lastMovement = now; + int rand = DataConversions.random(0, 1); + if (!isBusy() && finishedPath() && rand == 1 && !this.isRemoved()) { + int newX = DataConversions.random(loc.minX(), loc.maxX()); + int newY = DataConversions.random(loc.minY(), loc.maxY()); + super.setPath(new Path(getX(), getY(), newX, newY)); + } } } From e9d3ec94217166a34224da9b796dd3dcb215622f Mon Sep 17 00:00:00 2001 From: latifundio Date: Fri, 7 Sep 2012 08:15:03 -0300 Subject: [PATCH 3/6] Update GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java Fix picks not doing correct swings and gems doesn't give xp on classic --- .../msc/gs/plugins/plugs/skills/Mining.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java b/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java index 83b5c94..31abe46 100644 --- a/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java +++ b/GameServer/src/org/moparscape/msc/gs/plugins/plugs/skills/Mining.java @@ -64,7 +64,7 @@ public class Mining implements ObjectListener { if (owner.getClick() == 1) { owner.getActionSender().sendMessage("You examine the rock for ores..."); Instance.getDelayedEventHandler() - .add(new MiniEvent(owner, 1000) { + .add(new MiniEvent(owner, 2400) { @Override public void action() { owner.getActionSender().sendMessage( @@ -94,22 +94,22 @@ public class Mining implements ObjectListener { int reqlvl = 1; switch (axeID) { case 1258: - retrytimes = 2; + retrytimes = 1; // 1 retry + initial swing = 2 break; case 1259: - retrytimes = 4; + retrytimes = 3; reqlvl = 6; break; case 1260: - retrytimes = 6; + retrytimes = 5; reqlvl = 21; break; case 1261: - retrytimes = 8; + retrytimes = 7; reqlvl = 31; break; case 1262: - retrytimes = 12; + retrytimes = 11; reqlvl = 41; break; @@ -140,9 +140,9 @@ public class Mining implements ObjectListener { //return; //} if (Formulae.getOre(def, owner.getCurStat(14), axeID)) { - if (DataConversions.random(0, 200) == 0) { + if (DataConversions.random(0, 100) == 0) { InvItem gem = new InvItem(Formulae.getGem(), 1); - owner.incExp(14, 100, true); + //owner.incExp(14, 100, true); owner.getInventory().add(gem); owner.getActionSender().sendMessage("You found a gem!"); } else { @@ -172,7 +172,8 @@ public class Mining implements ObjectListener { new SingleEvent(owner, 500) { public void action() { - if(!owner.isMining() || owner.inCombat()) { + //if(!owner.isMining() || owner.inCombat()) { + if (owner.inCombat()) { return; } owner.setSkillLoops(swings + 1); From 467c8ec594c35b370f4f05afdc3497ed5de3cf70 Mon Sep 17 00:00:00 2001 From: latifundio Date: Fri, 7 Sep 2012 23:32:55 -0300 Subject: [PATCH 4/6] Update GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If player is close to gate npc stay aggressive like rsc and previous change to npc chasing path was to dangerous in some situations (looked like npc got ac lol)  --- .../org/moparscape/msc/gs/event/WalkMobToMobEvent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java b/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java index 825a197..7153a20 100644 --- a/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java +++ b/GameServer/src/org/moparscape/msc/gs/event/WalkMobToMobEvent.java @@ -67,9 +67,12 @@ public abstract class WalkMobToMobEvent extends DelayedEvent { if (owner.withinRange(affectedMob, radius)) arrived(); - else if (owner.hasMoved() || affectedMob.hasMoved()) { + else if (affectedMob.hasMoved()){ owner.resetPath(); owner.setPath(new Path(owner.getX(), owner.getY(), affectedMob.getX(), affectedMob.getY())); + return; // Target is moving.. correcting path + } + else if (owner.hasMoved()) { return; // We're still moving } else { @@ -87,6 +90,9 @@ public abstract class WalkMobToMobEvent extends DelayedEvent { failed(); return; } + else if (owner.nextTo(affectedMob) && owner.finishedPath()) { + return; // if stuck behind gate, keep chasing in case it opens + } } if (owner.isBusy()) From b362dcf93074beb47b055874a5c6a5ba10176de3 Mon Sep 17 00:00:00 2001 From: latifundio Date: Fri, 7 Sep 2012 23:36:37 -0300 Subject: [PATCH 5/6] Fix range skill Fix player suddenly stopping ranged attacks. --- GameServer/src/org/moparscape/msc/gs/event/RangeEvent.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GameServer/src/org/moparscape/msc/gs/event/RangeEvent.java b/GameServer/src/org/moparscape/msc/gs/event/RangeEvent.java index be066b3..cc0f0fd 100644 --- a/GameServer/src/org/moparscape/msc/gs/event/RangeEvent.java +++ b/GameServer/src/org/moparscape/msc/gs/event/RangeEvent.java @@ -304,6 +304,10 @@ public class RangeEvent extends DelayedEvent { npc.setChasing(null); } }); + // target is still alive? is still around? + if (!npc.isRemoved() || owner.withinRange(npc)) { + return; + } this.stop(); } } From 23085708384b7c869e8806fda52d5a011e1e48eb Mon Sep 17 00:00:00 2001 From: latifundio Date: Fri, 7 Sep 2012 23:40:46 -0300 Subject: [PATCH 6/6] reverted npc movement delay it was fine at 2200 ms --- GameServer/src/org/moparscape/msc/gs/model/Npc.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameServer/src/org/moparscape/msc/gs/model/Npc.java b/GameServer/src/org/moparscape/msc/gs/model/Npc.java index 6bd6131..a77ba29 100644 --- a/GameServer/src/org/moparscape/msc/gs/model/Npc.java +++ b/GameServer/src/org/moparscape/msc/gs/model/Npc.java @@ -578,7 +578,7 @@ public class Npc extends Mob { Instance.getDelayedEventHandler().add(fighting); } - if (now - lastMovement > 1800) { + if (now - lastMovement > 2200) { if (now - getCombatTimer() < (getCombatState() == CombatState.WAITING ? 5000 : 500)) { }