Improved Mushroom Castle + Body Pressure patch
Improved the gameplay around the Mushroom Castle region. Solved an issue with HP threshold on MoveLifeHandler. Fixed Body Pressure being refreshed every time it hits a mob.
This commit is contained in:
@@ -1881,13 +1881,15 @@ public class Commands {
|
||||
MapleMap map = player.getMap();
|
||||
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
|
||||
int count = 0;
|
||||
for (MapleMapObject monstermo : monsters) {
|
||||
monster = (MapleMonster) monstermo;
|
||||
if (!monster.getStats().isFriendly()) {
|
||||
if (!monster.getStats().isFriendly() && !(monster.getId() >= 8810010 && monster.getId() <= 8810018)) {
|
||||
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
player.dropMessage(5, "Killed " + monsters.size() + " monsters.");
|
||||
player.dropMessage(5, "Killed " + count + " monsters.");
|
||||
break;
|
||||
|
||||
case "notice":
|
||||
|
||||
@@ -35,14 +35,6 @@ public class MapleCodecFactory implements ProtocolCodecFactory {
|
||||
decoder = new MaplePacketDecoder();
|
||||
}
|
||||
|
||||
public ProtocolEncoder getEncoder() throws Exception {
|
||||
return encoder;
|
||||
}
|
||||
|
||||
public ProtocolDecoder getDecoder() throws Exception {
|
||||
return decoder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
|
||||
return encoder;
|
||||
|
||||
@@ -162,7 +162,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
|
||||
if (player.isAlive()) {
|
||||
if(attack.skill == NightWalker.POISON_BOMB) // Poison Bomb
|
||||
attackEffect.applyTo(player, new Point(attack.position.x, attack.position.y));
|
||||
else
|
||||
else if(attack.skill != Aran.BODY_PRESSURE) // prevent BP refreshing
|
||||
attackEffect.applyTo(player);
|
||||
} else {
|
||||
player.getClient().announce(MaplePacketCreator.enableActions());
|
||||
|
||||
@@ -78,8 +78,8 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
|
||||
|
||||
MobSkill toUse = null;
|
||||
|
||||
int percHpLeft = (int) ((monster.getHp() / monster.getMaxHp()) * 100);
|
||||
|
||||
int percHpLeft = (int) (((float) monster.getHp() / monster.getMaxHp()) * 100);
|
||||
|
||||
if (nextMovementCouldBeSkill && monster.getNoSkills() > 0) {
|
||||
int Random = Randomizer.nextInt(monster.getNoSkills());
|
||||
Pair<Integer, Integer> skillToUse = monster.getSkills().get(Random);
|
||||
|
||||
@@ -48,7 +48,6 @@ public final class LoginPasswordHandler implements MaplePacketHandler {
|
||||
|
||||
String login = slea.readMapleAsciiString();
|
||||
String pwd = slea.readMapleAsciiString();
|
||||
String bcryptedpass = BCrypt.hashpw(pwd, BCrypt.gensalt(12));
|
||||
c.setAccountName(login);
|
||||
|
||||
int loginok = c.login(login, pwd);
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
import server.MaplePortal;
|
||||
import server.quest.MapleQuest;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
@@ -80,7 +81,23 @@ public class PortalPlayerInteraction extends AbstractPlayerInteraction {
|
||||
|
||||
return getPlayer().getLevel() >= 30;
|
||||
}
|
||||
|
||||
public boolean forceStartQuest(int id) {
|
||||
return forceStartQuest(id, 9010000);
|
||||
}
|
||||
|
||||
public boolean forceStartQuest(int id, int npc) {
|
||||
return MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
|
||||
}
|
||||
|
||||
public boolean forceCompleteQuest(int id) {
|
||||
return forceCompleteQuest(id, 9010000);
|
||||
}
|
||||
|
||||
public boolean forceCompleteQuest(int id, int npc) {
|
||||
return MapleQuest.getInstance(id).forceComplete(getPlayer(), npc);
|
||||
}
|
||||
|
||||
public void blockPortal() {
|
||||
c.getPlayer().blockPortal(getPortal().getScriptName());
|
||||
}
|
||||
|
||||
@@ -162,4 +162,9 @@ public class QuestScriptManager extends AbstractScriptManager {
|
||||
public QuestActionManager getQM(MapleClient c) {
|
||||
return qms.get(c);
|
||||
}
|
||||
|
||||
public void reloadQuestScripts() {
|
||||
scripts.clear();
|
||||
qms.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,6 @@ public class MapleShopFactory {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void reloadShops() {
|
||||
shops.clear();
|
||||
}
|
||||
|
||||
private MapleShop loadShop(int id, boolean isShopId) {
|
||||
MapleShop ret = MapleShop.createFromDB(id, isShopId);
|
||||
if (ret != null) {
|
||||
@@ -67,4 +63,9 @@ public class MapleShopFactory {
|
||||
}
|
||||
return loadShop(npcId, false);
|
||||
}
|
||||
|
||||
public void reloadShops() {
|
||||
shops.clear();
|
||||
npcShops.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public class MobSkill {
|
||||
case 155: // avoid up
|
||||
case 156: // speed up
|
||||
break;
|
||||
case 200:
|
||||
case 200: // summon
|
||||
if (monster.getMap().getSpawnedMonstersOnMap() < 80) {
|
||||
for (Integer mobId : getSummons()) {
|
||||
MapleMonster toSpawn = MapleLifeFactory.getMonster(mobId);
|
||||
|
||||
Reference in New Issue
Block a user