Equip stat gain optimization + New commands

New optimization on stat gain methods, further improving server
performance on equip levelups. Added new commands for GMs/admins.
This commit is contained in:
ronancpl
2017-06-04 22:59:28 -03:00
parent 809d90564c
commit 9d00f33783
22 changed files with 187 additions and 41 deletions

View File

@@ -143,6 +143,10 @@ public class MapleInventoryManipulator {
return true;
}
public static boolean addFromDrop(MapleClient c, Item item) {
return addFromDrop(c, item, true);
}
public static boolean addFromDrop(MapleClient c, Item item, boolean show) {
return addFromDrop(c, item, show, -1);
}

View File

@@ -228,6 +228,11 @@ public class MapleStatEffect {
if (ltd != null) {
ret.lt = (Point) ltd.getData();
ret.rb = (Point) source.getChildByPath("rb").getData();
if(ServerConstants.USE_MAXRANGE_ECHO_OF_HERO && (sourceid == Beginner.ECHO_OF_HERO || sourceid == Noblesse.ECHO_OF_HERO || sourceid == Legend.ECHO_OF_HERO || sourceid == Evan.ECHO_OF_HERO)) {
ret.lt = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
ret.rb = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
}
int x = MapleDataTool.getInt("x", source, 0);
@@ -703,7 +708,7 @@ public class MapleStatEffect {
AutobanFactory.MPCON.addPoint(applyfrom.getAutobanManager(), "mpCon hack for skill:" + sourceid + "; Player MP: " + applyto.getMp() + " MP Needed: " + getMpCon());
} */
if (hpchange != 0) {
if (hpchange < 0 && (-hpchange) > applyto.getHp() && !applyto.hasDisease(MapleDisease.ZOMBIFY)) {
if (hpchange < 0 && (-hpchange) >= applyto.getHp() && (!applyto.hasDisease(MapleDisease.ZOMBIFY) || hpCon == 0)) {
applyto.getClient().announce(MaplePacketCreator.enableActions());
return false;
}
@@ -1053,6 +1058,7 @@ public class MapleStatEffect {
hpchange += makeHealHP(hp / 100.0, applyfrom.getTotalMagic(), 3, 5);
if (applyfrom.hasDisease(MapleDisease.ZOMBIFY)) {
hpchange = -hpchange;
hpCon = 0;
}
}
}

View File

@@ -187,6 +187,7 @@ public class MobSkill {
disease = MapleDisease.CONFUSE;
break;
case 133: // zombify
disease = MapleDisease.ZOMBIFY;
break;
case 140:
if (makeChanceResult() && !monster.isBuffed(MonsterStatus.MAGIC_IMMUNITY)) {
@@ -199,21 +200,21 @@ public class MobSkill {
}
break;
case 143: // Weapon Reflect
stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x));
reflection.add(x);
stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x));
reflection.add(x);
break;
case 144: // Magic Reflect
stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x));
reflection.add(x);
stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x));
reflection.add(x);
break;
case 145: // Weapon / Magic reflect
stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x));
stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x));
reflection.add(x);
stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x));
stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x));
stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x));
reflection.add(x);
break;
case 154: // accuracy up
case 155: // avoid up