cleanup: remove unnecessary boxing

This commit is contained in:
P0nk
2021-04-08 07:39:02 +02:00
parent 5c6f515d18
commit 7ff8190977
14 changed files with 150 additions and 151 deletions

View File

@@ -49,7 +49,7 @@ public class BuddyList {
public boolean contains(int characterId) { public boolean contains(int characterId) {
synchronized(buddies) { synchronized(buddies) {
return buddies.containsKey(Integer.valueOf(characterId)); return buddies.containsKey(characterId);
} }
} }
@@ -76,7 +76,7 @@ public class BuddyList {
public BuddylistEntry get(int characterId) { public BuddylistEntry get(int characterId) {
synchronized(buddies) { synchronized(buddies) {
return buddies.get(Integer.valueOf(characterId)); return buddies.get(characterId);
} }
} }
@@ -93,13 +93,13 @@ public class BuddyList {
public void put(BuddylistEntry entry) { public void put(BuddylistEntry entry) {
synchronized(buddies) { synchronized(buddies) {
buddies.put(Integer.valueOf(entry.getCharacterId()), entry); buddies.put(entry.getCharacterId(), entry);
} }
} }
public void remove(int characterId) { public void remove(int characterId) {
synchronized(buddies) { synchronized(buddies) {
buddies.remove(Integer.valueOf(characterId)); buddies.remove(characterId);
} }
} }

View File

@@ -36,7 +36,7 @@ public class SkillFactory {
public static Skill getSkill(int id) { public static Skill getSkill(int id) {
if (!skills.isEmpty()) { if (!skills.isEmpty()) {
return skills.get(Integer.valueOf(id)); return skills.get(id);
} }
return null; return null;
} }

View File

@@ -21,14 +21,15 @@
*/ */
package client.inventory; package client.inventory;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import provider.MapleData; import provider.MapleData;
import provider.MapleDataProvider; import provider.MapleDataProvider;
import provider.MapleDataProviderFactory; import provider.MapleDataProviderFactory;
import provider.MapleDataTool; import provider.MapleDataTool;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
/** /**
* *
* @author Danny (Leifde) * @author Danny (Leifde)
@@ -39,7 +40,7 @@ public class PetDataFactory {
private static Map<Integer, Integer> petHunger = new HashMap<Integer, Integer>(); private static Map<Integer, Integer> petHunger = new HashMap<Integer, Integer>();
public static PetCommand getPetCommand(int petId, int skillId) { public static PetCommand getPetCommand(int petId, int skillId) {
PetCommand ret = petCommands.get(Integer.valueOf(petId) + "" + skillId); PetCommand ret = petCommands.get(petId + "" + skillId);
if (ret != null) { if (ret != null) {
return ret; return ret;
} }
@@ -61,14 +62,14 @@ public class PetDataFactory {
} }
public static int getHunger(int petId) { public static int getHunger(int petId) {
Integer ret = petHunger.get(Integer.valueOf(petId)); Integer ret = petHunger.get(petId);
if (ret != null) { if (ret != null) {
return ret; return ret;
} }
synchronized (petHunger) { synchronized (petHunger) {
ret = petHunger.get(Integer.valueOf(petId)); ret = petHunger.get(petId);
if (ret == null) { if (ret == null) {
ret = Integer.valueOf(MapleDataTool.getInt(dataRoot.getData("Pet/" + petId + ".img").getChildByPath("info/hungry"), 1)); ret = MapleDataTool.getInt(dataRoot.getData("Pet/" + petId + ".img").getChildByPath("info/hungry"), 1);
} }
return ret; return ret;
} }

View File

@@ -558,7 +558,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
for (int j = 0; j < bullets; j++) { for (int j = 0; j < bullets; j++) {
int mesoid = lea.readInt(); int mesoid = lea.readInt();
lea.skip(1); lea.skip(1);
ret.allDamage.put(Integer.valueOf(mesoid), null); ret.allDamage.put(mesoid, null);
} }
return ret; return ret;
} else { } else {
@@ -572,16 +572,16 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
List<Integer> allDamageNumbers = new ArrayList<>(); List<Integer> allDamageNumbers = new ArrayList<>();
for (int j = 0; j < bullets; j++) { for (int j = 0; j < bullets; j++) {
int damage = lea.readInt(); int damage = lea.readInt();
allDamageNumbers.add(Integer.valueOf(damage)); allDamageNumbers.add(damage);
} }
ret.allDamage.put(Integer.valueOf(oid), allDamageNumbers); ret.allDamage.put(oid, allDamageNumbers);
lea.skip(4); lea.skip(4);
} else { } else {
int bullets = lea.readByte(); int bullets = lea.readByte();
for (int j = 0; j < bullets; j++) { for (int j = 0; j < bullets; j++) {
int mesoid = lea.readInt(); int mesoid = lea.readInt();
lea.skip(1); lea.skip(1);
ret.allDamage.put(Integer.valueOf(mesoid), null); ret.allDamage.put(mesoid, null);
} }
} }
} }
@@ -859,7 +859,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
if (ret.skill != Corsair.RAPID_FIRE || ret.skill != Aran.HIDDEN_FULL_DOUBLE || ret.skill != Aran.HIDDEN_FULL_TRIPLE || ret.skill != Aran.HIDDEN_OVER_DOUBLE || ret.skill != Aran.HIDDEN_OVER_TRIPLE) { if (ret.skill != Corsair.RAPID_FIRE || ret.skill != Aran.HIDDEN_FULL_DOUBLE || ret.skill != Aran.HIDDEN_FULL_TRIPLE || ret.skill != Aran.HIDDEN_OVER_DOUBLE || ret.skill != Aran.HIDDEN_OVER_TRIPLE) {
lea.skip(4); lea.skip(4);
} }
ret.allDamage.put(Integer.valueOf(oid), allDamageNumbers); ret.allDamage.put(oid, allDamageNumbers);
} }
if (ret.skill == NightWalker.POISON_BOMB) { // Poison Bomb if (ret.skill == NightWalker.POISON_BOMB) { // Poison Bomb
lea.skip(4); lea.skip(4);

View File

@@ -360,7 +360,7 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
if(diseases != null) { if(diseases != null) {
for(Entry<MapleDisease, Pair<Long, MobSkill>> e : diseases.entrySet()) { for(Entry<MapleDisease, Pair<Long, MobSkill>> e : diseases.entrySet()) {
final List<Pair<MapleDisease, Integer>> debuff = Collections.singletonList(new Pair<>(e.getKey(), Integer.valueOf(e.getValue().getRight().getX()))); final List<Pair<MapleDisease, Integer>> debuff = Collections.singletonList(new Pair<>(e.getKey(), e.getValue().getRight().getX()));
c.announce(MaplePacketCreator.giveDebuff(debuff, e.getValue().getRight())); c.announce(MaplePacketCreator.giveDebuff(debuff, e.getValue().getRight()));
} }
} }

View File

@@ -21,16 +21,13 @@
*/ */
package provider.wz; package provider.wz;
import java.awt.Point;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import tools.data.input.GenericSeekableLittleEndianAccessor; import tools.data.input.GenericSeekableLittleEndianAccessor;
import tools.data.input.RandomAccessByteStream; import tools.data.input.RandomAccessByteStream;
import tools.data.input.SeekableLittleEndianAccessor; import tools.data.input.SeekableLittleEndianAccessor;
import java.awt.*;
import java.io.*;
public class WZIMGFile { public class WZIMGFile {
private WZFileEntry file; private WZFileEntry file;
private WZIMGEntry root; private WZIMGEntry root;
@@ -91,19 +88,19 @@ public class WZIMGFile {
case 2: case 2:
case 11: //??? no idea, since 0.49 case 11: //??? no idea, since 0.49
entry.setType(MapleDataType.SHORT); entry.setType(MapleDataType.SHORT);
entry.setData(Short.valueOf(slea.readShort())); entry.setData(slea.readShort());
break; break;
case 3: case 3:
entry.setType(MapleDataType.INT); entry.setType(MapleDataType.INT);
entry.setData(Integer.valueOf(WZTool.readValue(slea))); entry.setData(WZTool.readValue(slea));
break; break;
case 4: case 4:
entry.setType(MapleDataType.FLOAT); entry.setType(MapleDataType.FLOAT);
entry.setData(Float.valueOf(WZTool.readFloatValue(slea))); entry.setData(WZTool.readFloatValue(slea));
break; break;
case 5: case 5:
entry.setType(MapleDataType.DOUBLE); entry.setType(MapleDataType.DOUBLE);
entry.setData(Double.valueOf(slea.readDouble())); entry.setData(slea.readDouble());
break; break;
case 8: case 8:
entry.setType(MapleDataType.STRING); entry.setType(MapleDataType.STRING);

View File

@@ -249,7 +249,7 @@ public class MapleStatEffect {
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.AURA, ret.barrier); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.AURA, ret.barrier);
ret.mapProtection = mapProtection(sourceid); ret.mapProtection = mapProtection(sourceid);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MAP_PROTECTION, Integer.valueOf(ret.mapProtection)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MAP_PROTECTION, (int) ret.mapProtection);
if (ret.overTime && ret.getSummonMovementType() == null) { if (ret.overTime && ret.getSummonMovementType() == null) {
if (!skill) { if (!skill) {
@@ -257,8 +257,8 @@ public class MapleStatEffect {
ret.berserk = MapleDataTool.getInt("berserk", source, 0); ret.berserk = MapleDataTool.getInt("berserk", source, 0);
ret.booster = MapleDataTool.getInt("booster", source, 0); ret.booster = MapleDataTool.getInt("booster", source, 0);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.BERSERK, Integer.valueOf(ret.berserk)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.BERSERK, ret.berserk);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.BOOSTER, Integer.valueOf(ret.booster)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.BOOSTER, ret.booster);
} else if (isDojoBuff(sourceid) || isHpMpRecovery(sourceid)) { } else if (isDojoBuff(sourceid) || isHpMpRecovery(sourceid)) {
ret.mhpR = (byte) MapleDataTool.getInt("mhpR", source, 0); ret.mhpR = (byte) MapleDataTool.getInt("mhpR", source, 0);
@@ -266,8 +266,8 @@ public class MapleStatEffect {
ret.mmpR = (byte) MapleDataTool.getInt("mmpR", source, 0); ret.mmpR = (byte) MapleDataTool.getInt("mmpR", source, 0);
ret.mmpRRate = (short) (MapleDataTool.getInt("mmpRRate", source, 0) * 100); ret.mmpRRate = (short) (MapleDataTool.getInt("mmpRRate", source, 0) * 100);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.HPREC, Integer.valueOf(ret.mhpR)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.HPREC, (int) ret.mhpR);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MPREC, Integer.valueOf(ret.mmpR)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MPREC, (int) ret.mmpR);
} else if (isRateCoupon(sourceid)) { } else if (isRateCoupon(sourceid)) {
switch (MapleDataTool.getInt("expR", source, 0)) { switch (MapleDataTool.getInt("expR", source, 0)) {
@@ -383,14 +383,14 @@ public class MapleStatEffect {
} }
} }
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.WATK, Integer.valueOf(ret.watk)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.WATK, (int) ret.watk);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.WDEF, Integer.valueOf(ret.wdef)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.WDEF, (int) ret.wdef);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MATK, Integer.valueOf(ret.matk)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MATK, (int) ret.matk);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MDEF, Integer.valueOf(ret.mdef)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MDEF, (int) ret.mdef);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.ACC, Integer.valueOf(ret.acc)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.ACC, (int) ret.acc);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.AVOID, Integer.valueOf(ret.avoid)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.AVOID, (int) ret.avoid);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.SPEED, Integer.valueOf(ret.speed)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.SPEED, (int) ret.speed);
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.JUMP, Integer.valueOf(ret.jump)); addBuffStatPairToListIfNotZero(statups, MapleBuffStat.JUMP, (int) ret.jump);
} }
MapleData ltd = source.getChildByPath("lt"); MapleData ltd = source.getChildByPath("lt");
@@ -429,13 +429,13 @@ public class MapleStatEffect {
case Noblesse.RECOVERY: case Noblesse.RECOVERY:
case Legend.RECOVERY: case Legend.RECOVERY:
case Evan.RECOVERY: case Evan.RECOVERY:
statups.add(new Pair<>(MapleBuffStat.RECOVERY, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.RECOVERY, x));
break; break;
case Beginner.ECHO_OF_HERO: case Beginner.ECHO_OF_HERO:
case Noblesse.ECHO_OF_HERO: case Noblesse.ECHO_OF_HERO:
case Legend.ECHO_OF_HERO: case Legend.ECHO_OF_HERO:
case Evan.ECHO_OF_HERO: case Evan.ECHO_OF_HERO:
statups.add(new Pair<>(MapleBuffStat.ECHO_OF_HERO, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.ECHO_OF_HERO, ret.x));
break; break;
case Beginner.MONSTER_RIDER: case Beginner.MONSTER_RIDER:
case Noblesse.MONSTER_RIDER: case Noblesse.MONSTER_RIDER:
@@ -455,27 +455,27 @@ public class MapleStatEffect {
case Beginner.BALROG_MOUNT: case Beginner.BALROG_MOUNT:
case Noblesse.BALROG_MOUNT: case Noblesse.BALROG_MOUNT:
case Legend.BALROG_MOUNT: case Legend.BALROG_MOUNT:
statups.add(new Pair<>(MapleBuffStat.MONSTER_RIDING, Integer.valueOf(sourceid))); statups.add(new Pair<>(MapleBuffStat.MONSTER_RIDING, sourceid));
break; break;
case Beginner.INVINCIBLE_BARRIER: case Beginner.INVINCIBLE_BARRIER:
case Noblesse.INVINCIBLE_BARRIER: case Noblesse.INVINCIBLE_BARRIER:
case Legend.INVICIBLE_BARRIER: case Legend.INVICIBLE_BARRIER:
case Evan.INVINCIBLE_BARRIER: case Evan.INVINCIBLE_BARRIER:
statups.add(new Pair<>(MapleBuffStat.DIVINE_BODY, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.DIVINE_BODY, 1));
break; break;
case Fighter.POWER_GUARD: case Fighter.POWER_GUARD:
case Page.POWER_GUARD: case Page.POWER_GUARD:
statups.add(new Pair<>(MapleBuffStat.POWERGUARD, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.POWERGUARD, x));
break; break;
case Spearman.HYPER_BODY: case Spearman.HYPER_BODY:
case GM.HYPER_BODY: case GM.HYPER_BODY:
case SuperGM.HYPER_BODY: case SuperGM.HYPER_BODY:
statups.add(new Pair<>(MapleBuffStat.HYPERBODYHP, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.HYPERBODYHP, x));
statups.add(new Pair<>(MapleBuffStat.HYPERBODYMP, Integer.valueOf(ret.y))); statups.add(new Pair<>(MapleBuffStat.HYPERBODYMP, ret.y));
break; break;
case Crusader.COMBO: case Crusader.COMBO:
case DawnWarrior.COMBO: case DawnWarrior.COMBO:
statups.add(new Pair<>(MapleBuffStat.COMBO, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.COMBO, 1));
break; break;
case WhiteKnight.BW_FIRE_CHARGE: case WhiteKnight.BW_FIRE_CHARGE:
case WhiteKnight.BW_ICE_CHARGE: case WhiteKnight.BW_ICE_CHARGE:
@@ -487,130 +487,130 @@ public class MapleStatEffect {
case Paladin.SWORD_HOLY_CHARGE: case Paladin.SWORD_HOLY_CHARGE:
case DawnWarrior.SOUL_CHARGE: case DawnWarrior.SOUL_CHARGE:
case ThunderBreaker.LIGHTNING_CHARGE: case ThunderBreaker.LIGHTNING_CHARGE:
statups.add(new Pair<>(MapleBuffStat.WK_CHARGE, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.WK_CHARGE, x));
break; break;
case DragonKnight.DRAGON_BLOOD: case DragonKnight.DRAGON_BLOOD:
statups.add(new Pair<>(MapleBuffStat.DRAGONBLOOD, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.DRAGONBLOOD, ret.x));
break; break;
case Hero.STANCE: case Hero.STANCE:
case Paladin.STANCE: case Paladin.STANCE:
case DarkKnight.STANCE: case DarkKnight.STANCE:
case Aran.FREEZE_STANDING: case Aran.FREEZE_STANDING:
statups.add(new Pair<>(MapleBuffStat.STANCE, Integer.valueOf(iprop))); statups.add(new Pair<>(MapleBuffStat.STANCE, iprop));
break; break;
case DawnWarrior.FINAL_ATTACK: case DawnWarrior.FINAL_ATTACK:
case WindArcher.FINAL_ATTACK: case WindArcher.FINAL_ATTACK:
statups.add(new Pair<>(MapleBuffStat.FINALATTACK, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.FINALATTACK, x));
break; break;
// MAGICIAN // MAGICIAN
case Magician.MAGIC_GUARD: case Magician.MAGIC_GUARD:
case BlazeWizard.MAGIC_GUARD: case BlazeWizard.MAGIC_GUARD:
case Evan.MAGIC_GUARD: case Evan.MAGIC_GUARD:
statups.add(new Pair<>(MapleBuffStat.MAGIC_GUARD, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.MAGIC_GUARD, x));
break; break;
case Cleric.INVINCIBLE: case Cleric.INVINCIBLE:
statups.add(new Pair<>(MapleBuffStat.INVINCIBLE, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.INVINCIBLE, x));
break; break;
case Priest.HOLY_SYMBOL: case Priest.HOLY_SYMBOL:
case SuperGM.HOLY_SYMBOL: case SuperGM.HOLY_SYMBOL:
statups.add(new Pair<>(MapleBuffStat.HOLY_SYMBOL, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.HOLY_SYMBOL, x));
break; break;
case FPArchMage.INFINITY: case FPArchMage.INFINITY:
case ILArchMage.INFINITY: case ILArchMage.INFINITY:
case Bishop.INFINITY: case Bishop.INFINITY:
statups.add(new Pair<>(MapleBuffStat.INFINITY, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.INFINITY, x));
break; break;
case FPArchMage.MANA_REFLECTION: case FPArchMage.MANA_REFLECTION:
case ILArchMage.MANA_REFLECTION: case ILArchMage.MANA_REFLECTION:
case Bishop.MANA_REFLECTION: case Bishop.MANA_REFLECTION:
statups.add(new Pair<>(MapleBuffStat.MANA_REFLECTION, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.MANA_REFLECTION, 1));
break; break;
case Bishop.HOLY_SHIELD: case Bishop.HOLY_SHIELD:
statups.add(new Pair<>(MapleBuffStat.HOLY_SHIELD, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.HOLY_SHIELD, x));
break; break;
case BlazeWizard.ELEMENTAL_RESET: case BlazeWizard.ELEMENTAL_RESET:
case Evan.ELEMENTAL_RESET: case Evan.ELEMENTAL_RESET:
statups.add(new Pair<>(MapleBuffStat.ELEMENTAL_RESET, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.ELEMENTAL_RESET, x));
break; break;
case Evan.MAGIC_SHIELD: case Evan.MAGIC_SHIELD:
statups.add(new Pair<>(MapleBuffStat.MAGIC_SHIELD, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.MAGIC_SHIELD, x));
break; break;
case Evan.MAGIC_RESISTANCE: case Evan.MAGIC_RESISTANCE:
statups.add(new Pair<>(MapleBuffStat.MAGIC_RESISTANCE, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.MAGIC_RESISTANCE, x));
break; break;
case Evan.SLOW: case Evan.SLOW:
statups.add(new Pair<>(MapleBuffStat.SLOW, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.SLOW, x));
// BOWMAN // BOWMAN
case Priest.MYSTIC_DOOR: case Priest.MYSTIC_DOOR:
case Hunter.SOUL_ARROW: case Hunter.SOUL_ARROW:
case Crossbowman.SOUL_ARROW: case Crossbowman.SOUL_ARROW:
case WindArcher.SOUL_ARROW: case WindArcher.SOUL_ARROW:
statups.add(new Pair<>(MapleBuffStat.SOULARROW, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.SOULARROW, x));
break; break;
case Ranger.PUPPET: case Ranger.PUPPET:
case Sniper.PUPPET: case Sniper.PUPPET:
case WindArcher.PUPPET: case WindArcher.PUPPET:
case Outlaw.OCTOPUS: case Outlaw.OCTOPUS:
case Corsair.WRATH_OF_THE_OCTOPI: case Corsair.WRATH_OF_THE_OCTOPI:
statups.add(new Pair<>(MapleBuffStat.PUPPET, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.PUPPET, 1));
break; break;
case Bowmaster.CONCENTRATE: case Bowmaster.CONCENTRATE:
statups.add(new Pair<>(MapleBuffStat.CONCENTRATE, x)); statups.add(new Pair<>(MapleBuffStat.CONCENTRATE, x));
break; break;
case Bowmaster.HAMSTRING: case Bowmaster.HAMSTRING:
statups.add(new Pair<>(MapleBuffStat.HAMSTRING, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.HAMSTRING, x));
monsterStatus.put(MonsterStatus.SPEED, x); monsterStatus.put(MonsterStatus.SPEED, x);
break; break;
case Marksman.BLIND: case Marksman.BLIND:
statups.add(new Pair<>(MapleBuffStat.BLIND, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.BLIND, x));
monsterStatus.put(MonsterStatus.ACC, x); monsterStatus.put(MonsterStatus.ACC, x);
break; break;
case Bowmaster.SHARP_EYES: case Bowmaster.SHARP_EYES:
case Marksman.SHARP_EYES: case Marksman.SHARP_EYES:
statups.add(new Pair<>(MapleBuffStat.SHARP_EYES, Integer.valueOf(ret.x << 8 | ret.y))); statups.add(new Pair<>(MapleBuffStat.SHARP_EYES, ret.x << 8 | ret.y));
break; break;
case WindArcher.WIND_WALK: case WindArcher.WIND_WALK:
statups.add(new Pair<>(MapleBuffStat.WIND_WALK, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.WIND_WALK, x));
//break; thanks Vcoc for noticing WW not showing for other players when changing maps //break; thanks Vcoc for noticing WW not showing for other players when changing maps
case Rogue.DARK_SIGHT: case Rogue.DARK_SIGHT:
case NightWalker.DARK_SIGHT: case NightWalker.DARK_SIGHT:
statups.add(new Pair<>(MapleBuffStat.DARKSIGHT, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.DARKSIGHT, x));
break; break;
case Hermit.MESO_UP: case Hermit.MESO_UP:
statups.add(new Pair<>(MapleBuffStat.MESOUP, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.MESOUP, x));
break; break;
case Hermit.SHADOW_PARTNER: case Hermit.SHADOW_PARTNER:
case NightWalker.SHADOW_PARTNER: case NightWalker.SHADOW_PARTNER:
statups.add(new Pair<>(MapleBuffStat.SHADOWPARTNER, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.SHADOWPARTNER, x));
break; break;
case ChiefBandit.MESO_GUARD: case ChiefBandit.MESO_GUARD:
statups.add(new Pair<>(MapleBuffStat.MESOGUARD, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.MESOGUARD, x));
break; break;
case ChiefBandit.PICKPOCKET: case ChiefBandit.PICKPOCKET:
statups.add(new Pair<>(MapleBuffStat.PICKPOCKET, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.PICKPOCKET, x));
break; break;
case NightLord.SHADOW_STARS: case NightLord.SHADOW_STARS:
statups.add(new Pair<>(MapleBuffStat.SHADOW_CLAW, Integer.valueOf(0))); statups.add(new Pair<>(MapleBuffStat.SHADOW_CLAW, 0));
break; break;
// PIRATE // PIRATE
case Pirate.DASH: case Pirate.DASH:
case ThunderBreaker.DASH: case ThunderBreaker.DASH:
case Beginner.SPACE_DASH: case Beginner.SPACE_DASH:
case Noblesse.SPACE_DASH: case Noblesse.SPACE_DASH:
statups.add(new Pair<>(MapleBuffStat.DASH2, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.DASH2, ret.x));
statups.add(new Pair<>(MapleBuffStat.DASH, Integer.valueOf(ret.y))); statups.add(new Pair<>(MapleBuffStat.DASH, ret.y));
break; break;
case Corsair.SPEED_INFUSION: case Corsair.SPEED_INFUSION:
case Buccaneer.SPEED_INFUSION: case Buccaneer.SPEED_INFUSION:
case ThunderBreaker.SPEED_INFUSION: case ThunderBreaker.SPEED_INFUSION:
statups.add(new Pair<>(MapleBuffStat.SPEED_INFUSION, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.SPEED_INFUSION, x));
break; break;
case Outlaw.HOMING_BEACON: case Outlaw.HOMING_BEACON:
case Corsair.BULLSEYE: case Corsair.BULLSEYE:
statups.add(new Pair<>(MapleBuffStat.HOMING_BEACON, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.HOMING_BEACON, x));
break; break;
case ThunderBreaker.SPARK: case ThunderBreaker.SPARK:
statups.add(new Pair<>(MapleBuffStat.SPARK, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.SPARK, x));
break; break;
// MULTIPLE // MULTIPLE
case Aran.POLEARM_BOOSTER: case Aran.POLEARM_BOOSTER:
@@ -637,7 +637,7 @@ public class MapleStatEffect {
case Beginner.POWER_EXPLOSION: case Beginner.POWER_EXPLOSION:
case Noblesse.POWER_EXPLOSION: case Noblesse.POWER_EXPLOSION:
case Legend.POWER_EXPLOSION: case Legend.POWER_EXPLOSION:
statups.add(new Pair<>(MapleBuffStat.BOOSTER, Integer.valueOf(x))); statups.add(new Pair<>(MapleBuffStat.BOOSTER, x));
break; break;
case Hero.MAPLE_WARRIOR: case Hero.MAPLE_WARRIOR:
case Paladin.MAPLE_WARRIOR: case Paladin.MAPLE_WARRIOR:
@@ -653,18 +653,18 @@ public class MapleStatEffect {
case Buccaneer.MAPLE_WARRIOR: case Buccaneer.MAPLE_WARRIOR:
case Aran.MAPLE_WARRIOR: case Aran.MAPLE_WARRIOR:
case Evan.MAPLE_WARRIOR: case Evan.MAPLE_WARRIOR:
statups.add(new Pair<>(MapleBuffStat.MAPLE_WARRIOR, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.MAPLE_WARRIOR, ret.x));
break; break;
// SUMMON // SUMMON
case Ranger.SILVER_HAWK: case Ranger.SILVER_HAWK:
case Sniper.GOLDEN_EAGLE: case Sniper.GOLDEN_EAGLE:
statups.add(new Pair<>(MapleBuffStat.SUMMON, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.SUMMON, 1));
monsterStatus.put(MonsterStatus.STUN, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.STUN, 1);
break; break;
case FPArchMage.ELQUINES: case FPArchMage.ELQUINES:
case Marksman.FROST_PREY: case Marksman.FROST_PREY:
statups.add(new Pair<>(MapleBuffStat.SUMMON, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.SUMMON, 1));
monsterStatus.put(MonsterStatus.FREEZE, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.FREEZE, 1);
break; break;
case Priest.SUMMON_DRAGON: case Priest.SUMMON_DRAGON:
case Bowmaster.PHOENIX: case Bowmaster.PHOENIX:
@@ -678,32 +678,32 @@ public class MapleStatEffect {
case NightWalker.DARKNESS: case NightWalker.DARKNESS:
case ThunderBreaker.LIGHTNING: case ThunderBreaker.LIGHTNING:
case BlazeWizard.IFRIT: case BlazeWizard.IFRIT:
statups.add(new Pair<>(MapleBuffStat.SUMMON, Integer.valueOf(1))); statups.add(new Pair<>(MapleBuffStat.SUMMON, 1));
break; break;
// ----------------------------- MONSTER STATUS ---------------------------------- // // ----------------------------- MONSTER STATUS ---------------------------------- //
case Crusader.ARMOR_CRASH: case Crusader.ARMOR_CRASH:
case DragonKnight.POWER_CRASH: case DragonKnight.POWER_CRASH:
case WhiteKnight.MAGIC_CRASH: case WhiteKnight.MAGIC_CRASH:
monsterStatus.put(MonsterStatus.SEAL_SKILL, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.SEAL_SKILL, 1);
break; break;
case Rogue.DISORDER: case Rogue.DISORDER:
monsterStatus.put(MonsterStatus.WATK, Integer.valueOf(ret.x)); monsterStatus.put(MonsterStatus.WATK, ret.x);
monsterStatus.put(MonsterStatus.WDEF, Integer.valueOf(ret.y)); monsterStatus.put(MonsterStatus.WDEF, ret.y);
break; break;
case Corsair.HYPNOTIZE: case Corsair.HYPNOTIZE:
monsterStatus.put(MonsterStatus.INERTMOB, 1); monsterStatus.put(MonsterStatus.INERTMOB, 1);
break; break;
case NightLord.NINJA_AMBUSH: case NightLord.NINJA_AMBUSH:
case Shadower.NINJA_AMBUSH: case Shadower.NINJA_AMBUSH:
monsterStatus.put(MonsterStatus.NINJA_AMBUSH, Integer.valueOf(ret.damage)); monsterStatus.put(MonsterStatus.NINJA_AMBUSH, ret.damage);
break; break;
case Page.THREATEN: case Page.THREATEN:
monsterStatus.put(MonsterStatus.WATK, Integer.valueOf(ret.x)); monsterStatus.put(MonsterStatus.WATK, ret.x);
monsterStatus.put(MonsterStatus.WDEF, Integer.valueOf(ret.y)); monsterStatus.put(MonsterStatus.WDEF, ret.y);
break; break;
case DragonKnight.DRAGON_ROAR: case DragonKnight.DRAGON_ROAR:
ret.hpR = -x / 100.0; ret.hpR = -x / 100.0;
monsterStatus.put(MonsterStatus.STUN, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.STUN, 1);
break; break;
case Crusader.AXE_COMA: case Crusader.AXE_COMA:
case Crusader.SWORD_COMA: case Crusader.SWORD_COMA:
@@ -723,7 +723,7 @@ public class MapleStatEffect {
case Aran.ROLLING_SPIN: case Aran.ROLLING_SPIN:
case Evan.FIRE_BREATH: case Evan.FIRE_BREATH:
case Evan.BLAZE: case Evan.BLAZE:
monsterStatus.put(MonsterStatus.STUN, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.STUN, 1);
break; break;
case NightLord.TAUNT: case NightLord.TAUNT:
case Shadower.TAUNT: case Shadower.TAUNT:
@@ -740,65 +740,65 @@ public class MapleStatEffect {
case FPArchMage.PARALYZE: case FPArchMage.PARALYZE:
case Aran.COMBO_TEMPEST: case Aran.COMBO_TEMPEST:
case Evan.ICE_BREATH: case Evan.ICE_BREATH:
monsterStatus.put(MonsterStatus.FREEZE, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.FREEZE, 1);
ret.duration *= 2; // freezing skills are a little strange ret.duration *= 2; // freezing skills are a little strange
break; break;
case FPWizard.SLOW: case FPWizard.SLOW:
case ILWizard.SLOW: case ILWizard.SLOW:
case BlazeWizard.SLOW: case BlazeWizard.SLOW:
monsterStatus.put(MonsterStatus.SPEED, Integer.valueOf(ret.x)); monsterStatus.put(MonsterStatus.SPEED, ret.x);
break; break;
case FPWizard.POISON_BREATH: case FPWizard.POISON_BREATH:
case FPMage.ELEMENT_COMPOSITION: case FPMage.ELEMENT_COMPOSITION:
monsterStatus.put(MonsterStatus.POISON, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.POISON, 1);
break; break;
case Priest.DOOM: case Priest.DOOM:
monsterStatus.put(MonsterStatus.DOOM, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.DOOM, 1);
break; break;
case ILMage.SEAL: case ILMage.SEAL:
case FPMage.SEAL: case FPMage.SEAL:
case BlazeWizard.SEAL: case BlazeWizard.SEAL:
monsterStatus.put(MonsterStatus.SEAL, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.SEAL, 1);
break; break;
case Hermit.SHADOW_WEB: // shadow web case Hermit.SHADOW_WEB: // shadow web
case NightWalker.SHADOW_WEB: case NightWalker.SHADOW_WEB:
monsterStatus.put(MonsterStatus.SHADOW_WEB, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.SHADOW_WEB, 1);
break; break;
case FPArchMage.FIRE_DEMON: case FPArchMage.FIRE_DEMON:
case ILArchMage.ICE_DEMON: case ILArchMage.ICE_DEMON:
monsterStatus.put(MonsterStatus.POISON, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.POISON, 1);
monsterStatus.put(MonsterStatus.FREEZE, Integer.valueOf(1)); monsterStatus.put(MonsterStatus.FREEZE, 1);
break; break;
case Evan.PHANTOM_IMPRINT: case Evan.PHANTOM_IMPRINT:
monsterStatus.put(MonsterStatus.PHANTOM_IMPRINT, Integer.valueOf(x)); monsterStatus.put(MonsterStatus.PHANTOM_IMPRINT, x);
//ARAN //ARAN
case Aran.COMBO_ABILITY: case Aran.COMBO_ABILITY:
statups.add(new Pair<>(MapleBuffStat.ARAN_COMBO, Integer.valueOf(100))); statups.add(new Pair<>(MapleBuffStat.ARAN_COMBO, 100));
break; break;
case Aran.COMBO_BARRIER: case Aran.COMBO_BARRIER:
statups.add(new Pair<>(MapleBuffStat.COMBO_BARRIER, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.COMBO_BARRIER, ret.x));
break; break;
case Aran.COMBO_DRAIN: case Aran.COMBO_DRAIN:
statups.add(new Pair<>(MapleBuffStat.COMBO_DRAIN, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.COMBO_DRAIN, ret.x));
break; break;
case Aran.SMART_KNOCKBACK: case Aran.SMART_KNOCKBACK:
statups.add(new Pair<>(MapleBuffStat.SMART_KNOCKBACK, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.SMART_KNOCKBACK, ret.x));
break; break;
case Aran.BODY_PRESSURE: case Aran.BODY_PRESSURE:
statups.add(new Pair<>(MapleBuffStat.BODY_PRESSURE, Integer.valueOf(ret.x))); statups.add(new Pair<>(MapleBuffStat.BODY_PRESSURE, ret.x));
break; break;
case Aran.SNOW_CHARGE: case Aran.SNOW_CHARGE:
statups.add(new Pair<>(MapleBuffStat.WK_CHARGE, Integer.valueOf(ret.duration))); statups.add(new Pair<>(MapleBuffStat.WK_CHARGE, ret.duration));
break; break;
default: default:
break; break;
} }
} }
if (ret.isMorph()) { if (ret.isMorph()) {
statups.add(new Pair<>(MapleBuffStat.MORPH, Integer.valueOf(ret.getMorph()))); statups.add(new Pair<>(MapleBuffStat.MORPH, ret.getMorph()));
} }
if (ret.ghost > 0 && !skill) { if (ret.ghost > 0 && !skill) {
statups.add(new Pair<>(MapleBuffStat.GHOST_MORPH, Integer.valueOf(ret.ghost))); statups.add(new Pair<>(MapleBuffStat.GHOST_MORPH, ret.ghost));
} }
ret.monsterStatus = monsterStatus; ret.monsterStatus = monsterStatus;
statups.trimToSize(); statups.trimToSize();
@@ -1309,7 +1309,7 @@ public class MapleStatEffect {
} else if (isEnrage()) { } else if (isEnrage()) {
applyto.handleOrbconsume(); applyto.handleOrbconsume();
} else if (isMorph()) { } else if (isMorph()) {
List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.MORPH, Integer.valueOf(getMorph(applyto)))); List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.MORPH, getMorph(applyto)));
mbuff = MaplePacketCreator.giveForeignBuff(applyto.getId(), stat); mbuff = MaplePacketCreator.giveForeignBuff(applyto.getId(), stat);
} else if (isAriantShield()) { } else if (isAriantShield()) {
List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.AURA, 1)); List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.AURA, 1));

View File

@@ -240,13 +240,13 @@ public class MapleLifeFactory {
public static MapleMonster getMonster(int mid) { public static MapleMonster getMonster(int mid) {
try { try {
MapleMonsterStats stats = monsterStats.get(Integer.valueOf(mid)); MapleMonsterStats stats = monsterStats.get(mid);
if (stats == null) { if (stats == null) {
Pair<MapleMonsterStats, List<MobAttackInfoHolder>> mobStats = getMonsterStats(mid); Pair<MapleMonsterStats, List<MobAttackInfoHolder>> mobStats = getMonsterStats(mid);
stats = mobStats.getLeft(); stats = mobStats.getLeft();
setMonsterAttackInfo(mid, mobStats.getRight()); setMonsterAttackInfo(mid, mobStats.getRight());
monsterStats.put(Integer.valueOf(mid), stats); monsterStats.put(mid, stats);
} }
MapleMonster ret = new MapleMonster(mid, stats); MapleMonster ret = new MapleMonster(mid, stats);
return ret; return ret;
@@ -260,7 +260,7 @@ public class MapleLifeFactory {
public static int getMonsterLevel(int mid) { public static int getMonsterLevel(int mid) {
try { try {
MapleMonsterStats stats = monsterStats.get(Integer.valueOf(mid)); MapleMonsterStats stats = monsterStats.get(mid);
if (stats == null) { if (stats == null) {
MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11)); MapleData monsterData = data.getData(StringUtil.getLeftPaddedStr(mid + ".img", '0', 11));
if (monsterData == null) { if (monsterData == null) {

View File

@@ -1195,7 +1195,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
if (poison) { if (poison) {
int poisonLevel = from.getSkillLevel(status.getSkill()); int poisonLevel = from.getSkillLevel(status.getSkill());
int poisonDamage = Math.min(Short.MAX_VALUE, (int) (getMaxHp() / (70.0 - poisonLevel) + 0.999)); int poisonDamage = Math.min(Short.MAX_VALUE, (int) (getMaxHp() / (70.0 - poisonLevel) + 0.999));
status.setValue(MonsterStatus.POISON, Integer.valueOf(poisonDamage)); status.setValue(MonsterStatus.POISON, poisonDamage);
animationTime = broadcastStatusEffect(status); animationTime = broadcastStatusEffect(status);
overtimeAction = new DamageTask(poisonDamage, from, status, 0); overtimeAction = new DamageTask(poisonDamage, from, status, 0);
@@ -1221,8 +1221,8 @@ public class MapleMonster extends AbstractLoadedMapleLife {
poisonDamage += (Randomizer.nextInt(gap) + minDmg); poisonDamage += (Randomizer.nextInt(gap) + minDmg);
} }
poisonDamage = Math.min(Short.MAX_VALUE, poisonDamage); poisonDamage = Math.min(Short.MAX_VALUE, poisonDamage);
status.setValue(MonsterStatus.VENOMOUS_WEAPON, Integer.valueOf(poisonDamage)); status.setValue(MonsterStatus.VENOMOUS_WEAPON, poisonDamage);
status.setValue(MonsterStatus.POISON, Integer.valueOf(poisonDamage)); status.setValue(MonsterStatus.POISON, poisonDamage);
animationTime = broadcastStatusEffect(status); animationTime = broadcastStatusEffect(status);
overtimeAction = new DamageTask(poisonDamage, from, status, 0); overtimeAction = new DamageTask(poisonDamage, from, status, 0);
@@ -1244,7 +1244,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
final byte level = from.getSkillLevel(skill); final byte level = from.getSkillLevel(skill);
final int damage = (int) ((from.getStr() + from.getLuk()) * ((3.7 * skill.getEffect(level).getDamage()) / 100)); final int damage = (int) ((from.getStr() + from.getLuk()) * ((3.7 * skill.getEffect(level).getDamage()) / 100));
status.setValue(MonsterStatus.NINJA_AMBUSH, Integer.valueOf(damage)); status.setValue(MonsterStatus.NINJA_AMBUSH, damage);
animationTime = broadcastStatusEffect(status); animationTime = broadcastStatusEffect(status);
overtimeAction = new DamageTask(damage, from, status, 2); overtimeAction = new DamageTask(damage, from, status, 2);

View File

@@ -123,22 +123,22 @@ public class MobSkill {
case 100: case 100:
case 110: case 110:
case 150: case 150:
stats.put(MonsterStatus.WEAPON_ATTACK_UP, Integer.valueOf(x)); stats.put(MonsterStatus.WEAPON_ATTACK_UP, x);
break; break;
case 101: case 101:
case 111: case 111:
case 151: case 151:
stats.put(MonsterStatus.MAGIC_ATTACK_UP, Integer.valueOf(x)); stats.put(MonsterStatus.MAGIC_ATTACK_UP, x);
break; break;
case 102: case 102:
case 112: case 112:
case 152: case 152:
stats.put(MonsterStatus.WEAPON_DEFENSE_UP, Integer.valueOf(x)); stats.put(MonsterStatus.WEAPON_DEFENSE_UP, x);
break; break;
case 103: case 103:
case 113: case 113:
case 153: case 153:
stats.put(MonsterStatus.MAGIC_DEFENSE_UP, Integer.valueOf(x)); stats.put(MonsterStatus.MAGIC_DEFENSE_UP, x);
break; break;
case 114: case 114:
if (lt != null && rb != null && skill) { if (lt != null && rb != null && skill) {
@@ -204,12 +204,12 @@ public class MobSkill {
break; break;
case 140: case 140:
if (makeChanceResult() && !monster.isBuffed(MonsterStatus.MAGIC_IMMUNITY)) { if (makeChanceResult() && !monster.isBuffed(MonsterStatus.MAGIC_IMMUNITY)) {
stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x)); stats.put(MonsterStatus.WEAPON_IMMUNITY, x);
} }
break; break;
case 141: case 141:
if (makeChanceResult() && !monster.isBuffed(MonsterStatus.WEAPON_IMMUNITY)) { if (makeChanceResult() && !monster.isBuffed(MonsterStatus.WEAPON_IMMUNITY)) {
stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x)); stats.put(MonsterStatus.MAGIC_IMMUNITY, x);
} }
break; break;
case 143: // Weapon Reflect case 143: // Weapon Reflect
@@ -230,13 +230,13 @@ public class MobSkill {
reflection.add(x); reflection.add(x);
break; break;
case 154: case 154:
stats.put(MonsterStatus.ACC, Integer.valueOf(x)); stats.put(MonsterStatus.ACC, x);
break; break;
case 155: case 155:
stats.put(MonsterStatus.AVOID, Integer.valueOf(x)); stats.put(MonsterStatus.AVOID, x);
break; break;
case 156: case 156:
stats.put(MonsterStatus.SPEED, Integer.valueOf(x)); stats.put(MonsterStatus.SPEED, x);
break; break;
case 200: // summon case 200: // summon
int skillLimit = this.getLimit(); int skillLimit = this.getLimit();

View File

@@ -21,12 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package server.life; package server.life;
import java.awt.Point;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.server.audit.locks.MonitoredLockType; import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReadLock; import net.server.audit.locks.MonitoredReadLock;
import net.server.audit.locks.MonitoredReentrantReadWriteLock; import net.server.audit.locks.MonitoredReentrantReadWriteLock;
@@ -38,6 +32,13 @@ import provider.MapleDataProvider;
import provider.MapleDataProviderFactory; import provider.MapleDataProviderFactory;
import provider.MapleDataTool; import provider.MapleDataTool;
import java.awt.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* *
* @author Danny (Leifde) * @author Danny (Leifde)
@@ -75,7 +76,7 @@ public class MobSkillFactory {
if (skillData.getChildByPath(String.valueOf(i)) == null) { if (skillData.getChildByPath(String.valueOf(i)) == null) {
break; break;
} }
toSummon.add(Integer.valueOf(MapleDataTool.getInt(skillData.getChildByPath(String.valueOf(i)), 0))); toSummon.add(MapleDataTool.getInt(skillData.getChildByPath(String.valueOf(i)), 0));
} }
int effect = MapleDataTool.getInt("summonEffect", skillData, 0); int effect = MapleDataTool.getInt("summonEffect", skillData, 0);
int hp = MapleDataTool.getInt("hp", skillData, 100); int hp = MapleDataTool.getInt("hp", skillData, 100);

View File

@@ -465,7 +465,7 @@ public class MapleMap {
public void removeMapObject(int num) { public void removeMapObject(int num) {
objectWLock.lock(); objectWLock.lock();
try { try {
this.mapobjects.remove(Integer.valueOf(num)); this.mapobjects.remove(num);
} finally { } finally {
objectWLock.unlock(); objectWLock.unlock();
} }
@@ -611,7 +611,7 @@ public class MapleMap {
} }
distn = Math.sqrt(distn); distn = Math.sqrt(distn);
return new Pair<>(getRoundedCoordinate(angle), Integer.valueOf((int)distn)); return new Pair<>(getRoundedCoordinate(angle), (int) distn);
} }
private static void sortDropEntries(List<MonsterDropEntry> from, List<MonsterDropEntry> item, List<MonsterDropEntry> visibleQuest, List<MonsterDropEntry> otherQuest, MapleCharacter chr) { private static void sortDropEntries(List<MonsterDropEntry> from, List<MonsterDropEntry> item, List<MonsterDropEntry> visibleQuest, List<MonsterDropEntry> otherQuest, MapleCharacter chr) {
@@ -1730,7 +1730,7 @@ public class MapleMap {
broadcastMessage(MaplePacketCreator.removeNPCController(obj.getObjectId())); broadcastMessage(MaplePacketCreator.removeNPCController(obj.getObjectId()));
broadcastMessage(MaplePacketCreator.removeNPC(obj.getObjectId())); broadcastMessage(MaplePacketCreator.removeNPC(obj.getObjectId()));
this.mapobjects.remove(Integer.valueOf(obj.getObjectId())); this.mapobjects.remove(obj.getObjectId());
} }
} }
} finally { } finally {
@@ -2520,7 +2520,7 @@ public class MapleMap {
} }
objectWLock.lock(); objectWLock.lock();
try { try {
this.mapobjects.put(Integer.valueOf(chr.getObjectId()), chr); this.mapobjects.put(chr.getObjectId(), chr);
} finally { } finally {
objectWLock.unlock(); objectWLock.unlock();
} }

View File

@@ -41,14 +41,14 @@ public class MapleReactorFactory {
public static final MapleReactorStats getReactorS(int rid) { public static final MapleReactorStats getReactorS(int rid) {
MapleReactorStats stats = reactorStats.get(Integer.valueOf(rid)); MapleReactorStats stats = reactorStats.get(rid);
if (stats == null) { if (stats == null) {
int infoId = rid; int infoId = rid;
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11)); MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
MapleData link = reactorData.getChildByPath("info/link"); MapleData link = reactorData.getChildByPath("info/link");
if (link != null) { if (link != null) {
infoId = MapleDataTool.getIntConvert("info/link", reactorData); infoId = MapleDataTool.getIntConvert("info/link", reactorData);
stats = reactorStats.get(Integer.valueOf(infoId)); stats = reactorStats.get(infoId);
} }
if (stats == null) { if (stats == null) {
stats = new MapleReactorStats(); stats = new MapleReactorStats();
@@ -83,26 +83,26 @@ public class MapleReactorFactory {
stats.addState(i, 999, null, (byte) (foundState ? -1 : (i + 1)), 0, (byte) 0); stats.addState(i, 999, null, (byte) (foundState ? -1 : (i + 1)), 0, (byte) 0);
} }
} }
reactorStats.put(Integer.valueOf(infoId), stats); reactorStats.put(infoId, stats);
if (rid != infoId) { if (rid != infoId) {
reactorStats.put(Integer.valueOf(rid), stats); reactorStats.put(rid, stats);
} }
} else { // stats exist at infoId but not rid; add to map } else { // stats exist at infoId but not rid; add to map
reactorStats.put(Integer.valueOf(rid), stats); reactorStats.put(rid, stats);
} }
} }
return stats; return stats;
} }
public static MapleReactorStats getReactor(int rid) { public static MapleReactorStats getReactor(int rid) {
MapleReactorStats stats = reactorStats.get(Integer.valueOf(rid)); MapleReactorStats stats = reactorStats.get(rid);
if (stats == null) { if (stats == null) {
int infoId = rid; int infoId = rid;
MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11)); MapleData reactorData = data.getData(StringUtil.getLeftPaddedStr(infoId + ".img", '0', 11));
MapleData link = reactorData.getChildByPath("info/link"); MapleData link = reactorData.getChildByPath("info/link");
if (link != null) { if (link != null) {
infoId = MapleDataTool.getIntConvert("info/link", reactorData); infoId = MapleDataTool.getIntConvert("info/link", reactorData);
stats = reactorStats.get(Integer.valueOf(infoId)); stats = reactorStats.get(infoId);
} }
MapleData activateOnTouch = reactorData.getChildByPath("info/activateByTouch"); MapleData activateOnTouch = reactorData.getChildByPath("info/activateByTouch");
boolean loadArea = false; boolean loadArea = false;
@@ -159,13 +159,13 @@ public class MapleReactorFactory {
statedatas.add(new StateData(999, null, null, (byte) 0)); statedatas.add(new StateData(999, null, null, (byte) 0));
stats.addState((byte) 0, statedatas, -1); stats.addState((byte) 0, statedatas, -1);
} }
reactorStats.put(Integer.valueOf(infoId), stats); reactorStats.put(infoId, stats);
if (rid != infoId) { if (rid != infoId) {
reactorStats.put(Integer.valueOf(rid), stats); reactorStats.put(rid, stats);
} }
} else // stats exist at infoId but not rid; add to map } else // stats exist at infoId but not rid; add to map
{ {
reactorStats.put(Integer.valueOf(rid), stats); reactorStats.put(rid, stats);
} }
} }
return stats; return stats;

View File

@@ -3639,7 +3639,7 @@ public class MaplePacketCreator {
mplew.writeShort(SendOpcode.KEYMAP.getValue()); mplew.writeShort(SendOpcode.KEYMAP.getValue());
mplew.write(0); mplew.write(0);
for (int x = 0; x < 90; x++) { for (int x = 0; x < 90; x++) {
MapleKeyBinding binding = keybindings.get(Integer.valueOf(x)); MapleKeyBinding binding = keybindings.get(x);
if (binding != null) { if (binding != null) {
mplew.write(binding.getType()); mplew.write(binding.getType());
mplew.writeInt(binding.getAction()); mplew.writeInt(binding.getAction());