Search in sources :

Example 6 with MonsterStatus

use of client.status.MonsterStatus in project HeavenMS by ronancpl.

the class MaplePacketCreator method writeIntMask.

private static void writeIntMask(final MaplePacketLittleEndianWriter mplew, Map<MonsterStatus, Integer> stats) {
    int firstmask = 0;
    int secondmask = 0;
    for (MonsterStatus stat : stats.keySet()) {
        if (stat.isFirst()) {
            firstmask |= stat.getValue();
        } else {
            secondmask |= stat.getValue();
        }
    }
    mplew.writeInt(firstmask);
    mplew.writeInt(secondmask);
}
Also used : MonsterStatus(client.status.MonsterStatus) Point(java.awt.Point)

Example 7 with MonsterStatus

use of client.status.MonsterStatus in project HeavenMS by ronancpl.

the class MapleStatEffect method loadFromData.

private static MapleStatEffect loadFromData(MapleData source, int sourceid, boolean skill, boolean overTime) {
    MapleStatEffect ret = new MapleStatEffect();
    ret.duration = MapleDataTool.getIntConvert("time", source, -1);
    ret.hp = (short) MapleDataTool.getInt("hp", source, 0);
    ret.hpR = MapleDataTool.getInt("hpR", source, 0) / 100.0;
    ret.mp = (short) MapleDataTool.getInt("mp", source, 0);
    ret.mpR = MapleDataTool.getInt("mpR", source, 0) / 100.0;
    ret.mpCon = (short) MapleDataTool.getInt("mpCon", source, 0);
    ret.hpCon = (short) MapleDataTool.getInt("hpCon", source, 0);
    int iprop = MapleDataTool.getInt("prop", source, 100);
    ret.prop = iprop / 100.0;
    ret.mobCount = MapleDataTool.getInt("mobCount", source, 1);
    ret.cooldown = MapleDataTool.getInt("cooltime", source, 0);
    ret.morphId = MapleDataTool.getInt("morph", source, 0);
    ret.ghost = MapleDataTool.getInt("ghost", source, 0);
    ret.fatigue = MapleDataTool.getInt("incFatigue", source, 0);
    ret.repeatEffect = MapleDataTool.getInt("repeatEffect", source, 0) > 0;
    ret.sourceid = sourceid;
    ret.skill = skill;
    if (!ret.skill && ret.duration > -1) {
        ret.overTime = true;
    } else {
        // items have their times stored in ms, of course
        ret.duration *= 1000;
        ret.overTime = overTime;
    }
    ArrayList<Pair<MapleBuffStat, Integer>> statups = new ArrayList<>();
    ret.watk = (short) MapleDataTool.getInt("pad", source, 0);
    ret.wdef = (short) MapleDataTool.getInt("pdd", source, 0);
    ret.matk = (short) MapleDataTool.getInt("mad", source, 0);
    ret.mdef = (short) MapleDataTool.getInt("mdd", source, 0);
    ret.acc = (short) MapleDataTool.getIntConvert("acc", source, 0);
    ret.avoid = (short) MapleDataTool.getInt("eva", source, 0);
    ret.speed = (short) MapleDataTool.getInt("speed", source, 0);
    ret.jump = (short) MapleDataTool.getInt("jump", source, 0);
    ret.mapProtection = mapProtection(sourceid);
    addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MAP_PROTECTION, Integer.valueOf(ret.mapProtection));
    if (ret.overTime && ret.getSummonMovementType() == null) {
        if (!skill) {
            if (isPyramidBuff(sourceid)) {
                ret.berserk = MapleDataTool.getInt("berserk", source, 0);
                ret.booster = MapleDataTool.getInt("booster", source, 0);
                addBuffStatPairToListIfNotZero(statups, MapleBuffStat.BERSERK, Integer.valueOf(ret.berserk));
                addBuffStatPairToListIfNotZero(statups, MapleBuffStat.BOOSTER, Integer.valueOf(ret.booster));
            } else if (isDojoBuff(sourceid) || isHpMpRecovery(sourceid)) {
                ret.mhpR = (byte) MapleDataTool.getInt("mhpR", source, 0);
                ret.mhpRRate = (short) (MapleDataTool.getInt("mhpRRate", source, 0) * 100);
                ret.mmpR = (byte) MapleDataTool.getInt("mmpR", source, 0);
                ret.mmpRRate = (short) (MapleDataTool.getInt("mmpRRate", source, 0) * 100);
                addBuffStatPairToListIfNotZero(statups, MapleBuffStat.HPREC, Integer.valueOf(ret.mhpR));
                addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MPREC, Integer.valueOf(ret.mmpR));
            } else if (isRateCoupon(sourceid)) {
                switch(MapleDataTool.getInt("expR", source, 0)) {
                    case 1:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_EXP1, 1);
                        break;
                    case 2:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_EXP2, 1);
                        break;
                    case 3:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_EXP3, 1);
                        break;
                    case 4:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_EXP4, 1);
                        break;
                }
                switch(MapleDataTool.getInt("drpR", source, 0)) {
                    case 1:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_DRP1, 1);
                        break;
                    case 2:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_DRP2, 1);
                        break;
                    case 3:
                        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_DRP3, 1);
                        break;
                }
            }
        } else {
            if (isMapChair(sourceid)) {
                addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MAP_CHAIR, 1);
            } else if ((sourceid == Beginner.NIMBLE_FEET || sourceid == Noblesse.NIMBLE_FEET || sourceid == Evan.NIMBLE_FEET || sourceid == Legend.AGILE_BODY) && ServerConstants.USE_ULTRA_NIMBLE_FEET == true) {
                ret.jump = (short) (ret.speed * 4);
                ret.speed *= 15;
            }
        }
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.WATK, Integer.valueOf(ret.watk));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.WDEF, Integer.valueOf(ret.wdef));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MATK, Integer.valueOf(ret.matk));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MDEF, Integer.valueOf(ret.mdef));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.ACC, Integer.valueOf(ret.acc));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.AVOID, Integer.valueOf(ret.avoid));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.SPEED, Integer.valueOf(ret.speed));
        addBuffStatPairToListIfNotZero(statups, MapleBuffStat.JUMP, Integer.valueOf(ret.jump));
    }
    MapleData ltd = source.getChildByPath("lt");
    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);
    if ((sourceid == Beginner.RECOVERY || sourceid == Noblesse.RECOVERY || sourceid == Evan.RECOVERY || sourceid == Legend.RECOVERY) && ServerConstants.USE_ULTRA_RECOVERY == true) {
        x *= 10;
    }
    ret.x = x;
    ret.y = MapleDataTool.getInt("y", source, 0);
    ret.damage = MapleDataTool.getIntConvert("damage", source, 100);
    ret.fixdamage = MapleDataTool.getIntConvert("fixdamage", source, -1);
    ret.attackCount = MapleDataTool.getIntConvert("attackCount", source, 1);
    ret.bulletCount = (byte) MapleDataTool.getIntConvert("bulletCount", source, 1);
    ret.bulletConsume = (byte) MapleDataTool.getIntConvert("bulletConsume", source, 0);
    ret.moneyCon = MapleDataTool.getIntConvert("moneyCon", source, 0);
    ret.itemCon = MapleDataTool.getInt("itemCon", source, 0);
    ret.itemConNo = MapleDataTool.getInt("itemConNo", source, 0);
    ret.moveTo = MapleDataTool.getInt("moveTo", source, -1);
    Map<MonsterStatus, Integer> monsterStatus = new ArrayMap<>();
    if (skill) {
        switch(sourceid) {
            // BEGINNER
            case Beginner.RECOVERY:
            case Noblesse.RECOVERY:
            case Legend.RECOVERY:
            case Evan.RECOVERY:
                statups.add(new Pair<>(MapleBuffStat.RECOVERY, Integer.valueOf(x)));
                break;
            case Beginner.ECHO_OF_HERO:
            case Noblesse.ECHO_OF_HERO:
            case Legend.ECHO_OF_HERO:
            case Evan.ECHO_OF_HERO:
                statups.add(new Pair<>(MapleBuffStat.ECHO_OF_HERO, Integer.valueOf(ret.x)));
                break;
            case Beginner.MONSTER_RIDER:
            case Noblesse.MONSTER_RIDER:
            case Legend.MONSTER_RIDER:
            case Corsair.BATTLE_SHIP:
            case Beginner.SPACESHIP:
            case Noblesse.SPACESHIP:
            case Beginner.YETI_MOUNT1:
            case Beginner.YETI_MOUNT2:
            case Noblesse.YETI_MOUNT1:
            case Noblesse.YETI_MOUNT2:
            case Legend.YETI_MOUNT1:
            case Legend.YETI_MOUNT2:
            case Beginner.WITCH_BROOMSTICK:
            case Noblesse.WITCH_BROOMSTICK:
            case Legend.WITCH_BROOMSTICK:
            case Beginner.BALROG_MOUNT:
            case Noblesse.BALROG_MOUNT:
            case Legend.BALROG_MOUNT:
                statups.add(new Pair<>(MapleBuffStat.MONSTER_RIDING, Integer.valueOf(sourceid)));
                break;
            case Beginner.INVINCIBLE_BARRIER:
            case Noblesse.INVINCIBLE_BARRIER:
            case Legend.INVICIBLE_BARRIER:
            case Evan.INVINCIBLE_BARRIER:
                statups.add(new Pair<>(MapleBuffStat.DIVINE_BODY, Integer.valueOf(1)));
                break;
            case Fighter.POWER_GUARD:
            case Page.POWER_GUARD:
                statups.add(new Pair<>(MapleBuffStat.POWERGUARD, Integer.valueOf(x)));
                break;
            case Spearman.HYPER_BODY:
            case GM.HYPER_BODY:
            case SuperGM.HYPER_BODY:
                statups.add(new Pair<>(MapleBuffStat.HYPERBODYHP, Integer.valueOf(x)));
                statups.add(new Pair<>(MapleBuffStat.HYPERBODYMP, Integer.valueOf(ret.y)));
                break;
            case Crusader.COMBO:
            case DawnWarrior.COMBO:
                statups.add(new Pair<>(MapleBuffStat.COMBO, Integer.valueOf(1)));
                break;
            case WhiteKnight.BW_FIRE_CHARGE:
            case WhiteKnight.BW_ICE_CHARGE:
            case WhiteKnight.BW_LIT_CHARGE:
            case WhiteKnight.SWORD_FIRE_CHARGE:
            case WhiteKnight.SWORD_ICE_CHARGE:
            case WhiteKnight.SWORD_LIT_CHARGE:
            case Paladin.BW_HOLY_CHARGE:
            case Paladin.SWORD_HOLY_CHARGE:
            case DawnWarrior.SOUL_CHARGE:
            case ThunderBreaker.LIGHTNING_CHARGE:
                statups.add(new Pair<>(MapleBuffStat.WK_CHARGE, Integer.valueOf(x)));
                break;
            case DragonKnight.DRAGON_BLOOD:
                statups.add(new Pair<>(MapleBuffStat.DRAGONBLOOD, Integer.valueOf(ret.x)));
                break;
            case DragonKnight.DRAGON_ROAR:
                ret.hpR = -x / 100.0;
                break;
            case Hero.STANCE:
            case Paladin.STANCE:
            case DarkKnight.STANCE:
            case Aran.FREEZE_STANDING:
                statups.add(new Pair<>(MapleBuffStat.STANCE, Integer.valueOf(iprop)));
                break;
            case DawnWarrior.FINAL_ATTACK:
            case WindArcher.FINAL_ATTACK:
                statups.add(new Pair<>(MapleBuffStat.FINALATTACK, Integer.valueOf(x)));
                break;
            // MAGICIAN
            case Magician.MAGIC_GUARD:
            case BlazeWizard.MAGIC_GUARD:
            case Evan.MAGIC_GUARD:
                statups.add(new Pair<>(MapleBuffStat.MAGIC_GUARD, Integer.valueOf(x)));
                break;
            case Cleric.INVINCIBLE:
                statups.add(new Pair<>(MapleBuffStat.INVINCIBLE, Integer.valueOf(x)));
                break;
            case Priest.HOLY_SYMBOL:
            case SuperGM.HOLY_SYMBOL:
                statups.add(new Pair<>(MapleBuffStat.HOLY_SYMBOL, Integer.valueOf(x)));
                break;
            case FPArchMage.INFINITY:
            case ILArchMage.INFINITY:
            case Bishop.INFINITY:
                statups.add(new Pair<>(MapleBuffStat.INFINITY, Integer.valueOf(x)));
                break;
            case FPArchMage.MANA_REFLECTION:
            case ILArchMage.MANA_REFLECTION:
            case Bishop.MANA_REFLECTION:
                statups.add(new Pair<>(MapleBuffStat.MANA_REFLECTION, Integer.valueOf(1)));
                break;
            case Bishop.HOLY_SHIELD:
                statups.add(new Pair<>(MapleBuffStat.HOLY_SHIELD, Integer.valueOf(x)));
                break;
            case BlazeWizard.ELEMENTAL_RESET:
            case Evan.ELEMENTAL_RESET:
                statups.add(new Pair<>(MapleBuffStat.ELEMENTAL_RESET, Integer.valueOf(x)));
                break;
            case Evan.MAGIC_SHIELD:
                statups.add(new Pair<>(MapleBuffStat.MAGIC_SHIELD, Integer.valueOf(x)));
                break;
            case Evan.MAGIC_RESISTANCE:
                statups.add(new Pair<>(MapleBuffStat.MAGIC_RESISTANCE, Integer.valueOf(x)));
                break;
            case Evan.SLOW:
                statups.add(new Pair<>(MapleBuffStat.SLOW, Integer.valueOf(x)));
            // BOWMAN
            case Priest.MYSTIC_DOOR:
            case Hunter.SOUL_ARROW:
            case Crossbowman.SOUL_ARROW:
            case WindArcher.SOUL_ARROW:
                statups.add(new Pair<>(MapleBuffStat.SOULARROW, Integer.valueOf(x)));
                break;
            case Ranger.PUPPET:
            case Sniper.PUPPET:
            case WindArcher.PUPPET:
            case Outlaw.OCTOPUS:
            case Corsair.WRATH_OF_THE_OCTOPI:
                statups.add(new Pair<>(MapleBuffStat.PUPPET, Integer.valueOf(1)));
                break;
            case Bowmaster.CONCENTRATE:
                statups.add(new Pair<>(MapleBuffStat.CONCENTRATE, x));
                break;
            case Bowmaster.HAMSTRING:
                statups.add(new Pair<>(MapleBuffStat.HAMSTRING, Integer.valueOf(x)));
                monsterStatus.put(MonsterStatus.SPEED, x);
                break;
            case Marksman.BLIND:
                statups.add(new Pair<>(MapleBuffStat.BLIND, Integer.valueOf(x)));
                monsterStatus.put(MonsterStatus.ACC, x);
                break;
            case Bowmaster.SHARP_EYES:
            case Marksman.SHARP_EYES:
                statups.add(new Pair<>(MapleBuffStat.SHARP_EYES, Integer.valueOf(ret.x << 8 | ret.y)));
                break;
            case WindArcher.WIND_WALK:
                statups.add(new Pair<>(MapleBuffStat.WIND_WALK, Integer.valueOf(x)));
                break;
            case Rogue.DARK_SIGHT:
            case NightWalker.DARK_SIGHT:
                statups.add(new Pair<>(MapleBuffStat.DARKSIGHT, Integer.valueOf(x)));
                break;
            case Hermit.MESO_UP:
                statups.add(new Pair<>(MapleBuffStat.MESOUP, Integer.valueOf(x)));
                break;
            case Hermit.SHADOW_PARTNER:
            case NightWalker.SHADOW_PARTNER:
                statups.add(new Pair<>(MapleBuffStat.SHADOWPARTNER, Integer.valueOf(x)));
                break;
            case ChiefBandit.MESO_GUARD:
                statups.add(new Pair<>(MapleBuffStat.MESOGUARD, Integer.valueOf(x)));
                break;
            case ChiefBandit.PICKPOCKET:
                statups.add(new Pair<>(MapleBuffStat.PICKPOCKET, Integer.valueOf(x)));
                break;
            case NightLord.SHADOW_STARS:
                statups.add(new Pair<>(MapleBuffStat.SHADOW_CLAW, Integer.valueOf(0)));
                break;
            // PIRATE
            case Pirate.DASH:
            case ThunderBreaker.DASH:
            case Beginner.SPACE_DASH:
            case Noblesse.SPACE_DASH:
                statups.add(new Pair<>(MapleBuffStat.DASH2, Integer.valueOf(ret.x)));
                statups.add(new Pair<>(MapleBuffStat.DASH, Integer.valueOf(ret.y)));
                break;
            case Corsair.SPEED_INFUSION:
            case Buccaneer.SPEED_INFUSION:
            case ThunderBreaker.SPEED_INFUSION:
                statups.add(new Pair<>(MapleBuffStat.SPEED_INFUSION, Integer.valueOf(x)));
                break;
            case Outlaw.HOMING_BEACON:
            case Corsair.BULLSEYE:
                statups.add(new Pair<>(MapleBuffStat.HOMING_BEACON, Integer.valueOf(x)));
                break;
            case ThunderBreaker.SPARK:
                statups.add(new Pair<>(MapleBuffStat.SPARK, Integer.valueOf(x)));
                break;
            // MULTIPLE
            case Aran.POLEARM_BOOSTER:
            case Fighter.AXE_BOOSTER:
            case Fighter.SWORD_BOOSTER:
            case Page.BW_BOOSTER:
            case Page.SWORD_BOOSTER:
            case Spearman.POLEARM_BOOSTER:
            case Spearman.SPEAR_BOOSTER:
            case Hunter.BOW_BOOSTER:
            case Crossbowman.CROSSBOW_BOOSTER:
            case Assassin.CLAW_BOOSTER:
            case Bandit.DAGGER_BOOSTER:
            case FPMage.SPELL_BOOSTER:
            case ILMage.SPELL_BOOSTER:
            case Brawler.KNUCKLER_BOOSTER:
            case Gunslinger.GUN_BOOSTER:
            case DawnWarrior.SWORD_BOOSTER:
            case BlazeWizard.SPELL_BOOSTER:
            case WindArcher.BOW_BOOSTER:
            case NightWalker.CLAW_BOOSTER:
            case ThunderBreaker.KNUCKLER_BOOSTER:
            case Evan.MAGIC_BOOSTER:
            case Beginner.POWER_EXPLOSION:
            case Noblesse.POWER_EXPLOSION:
            case Legend.POWER_EXPLOSION:
                statups.add(new Pair<>(MapleBuffStat.BOOSTER, Integer.valueOf(x)));
                break;
            case Hero.MAPLE_WARRIOR:
            case Paladin.MAPLE_WARRIOR:
            case DarkKnight.MAPLE_WARRIOR:
            case FPArchMage.MAPLE_WARRIOR:
            case ILArchMage.MAPLE_WARRIOR:
            case Bishop.MAPLE_WARRIOR:
            case Bowmaster.MAPLE_WARRIOR:
            case Marksman.MAPLE_WARRIOR:
            case NightLord.MAPLE_WARRIOR:
            case Shadower.MAPLE_WARRIOR:
            case Corsair.MAPLE_WARRIOR:
            case Buccaneer.MAPLE_WARRIOR:
            case Aran.MAPLE_WARRIOR:
            case Evan.MAPLE_WARRIOR:
                statups.add(new Pair<>(MapleBuffStat.MAPLE_WARRIOR, Integer.valueOf(ret.x)));
                break;
            // SUMMON
            case Ranger.SILVER_HAWK:
            case Sniper.GOLDEN_EAGLE:
                statups.add(new Pair<>(MapleBuffStat.SUMMON, Integer.valueOf(1)));
                monsterStatus.put(MonsterStatus.STUN, Integer.valueOf(1));
                break;
            case FPArchMage.ELQUINES:
            case Marksman.FROST_PREY:
                statups.add(new Pair<>(MapleBuffStat.SUMMON, Integer.valueOf(1)));
                monsterStatus.put(MonsterStatus.FREEZE, Integer.valueOf(1));
                break;
            case Priest.SUMMON_DRAGON:
            case Bowmaster.PHOENIX:
            case ILArchMage.IFRIT:
            case Bishop.BAHAMUT:
            case DarkKnight.BEHOLDER:
            case Outlaw.GAVIOTA:
            case DawnWarrior.SOUL:
            case BlazeWizard.FLAME:
            case WindArcher.STORM:
            case NightWalker.DARKNESS:
            case ThunderBreaker.LIGHTNING:
            case BlazeWizard.IFRIT:
                statups.add(new Pair<>(MapleBuffStat.SUMMON, Integer.valueOf(1)));
                break;
            // ----------------------------- MONSTER STATUS ---------------------------------- //
            case Crusader.ARMOR_CRASH:
            case DragonKnight.POWER_CRASH:
            case WhiteKnight.MAGIC_CRASH:
                monsterStatus.put(MonsterStatus.SEAL_SKILL, Integer.valueOf(1));
                break;
            case Rogue.DISORDER:
                monsterStatus.put(MonsterStatus.WATK, Integer.valueOf(ret.x));
                monsterStatus.put(MonsterStatus.WDEF, Integer.valueOf(ret.y));
                break;
            case Corsair.HYPNOTIZE:
                monsterStatus.put(MonsterStatus.INERTMOB, 1);
                break;
            case NightLord.NINJA_AMBUSH:
            case Shadower.NINJA_AMBUSH:
                monsterStatus.put(MonsterStatus.NINJA_AMBUSH, Integer.valueOf(ret.damage));
                break;
            case Page.THREATEN:
                monsterStatus.put(MonsterStatus.WATK, Integer.valueOf(ret.x));
                monsterStatus.put(MonsterStatus.WDEF, Integer.valueOf(ret.y));
                break;
            case Crusader.AXE_COMA:
            case Crusader.SWORD_COMA:
            case Crusader.SHOUT:
            case WhiteKnight.CHARGE_BLOW:
            case Hunter.ARROW_BOMB:
            case ChiefBandit.ASSAULTER:
            case Shadower.BOOMERANG_STEP:
            case Brawler.BACK_SPIN_BLOW:
            case Brawler.DOUBLE_UPPERCUT:
            case Buccaneer.DEMOLITION:
            case Buccaneer.SNATCH:
            case Buccaneer.BARRAGE:
            case Gunslinger.BLANK_SHOT:
            case DawnWarrior.COMA:
            case Aran.ROLLING_SPIN:
            case Evan.FIRE_BREATH:
            case Evan.BLAZE:
                monsterStatus.put(MonsterStatus.STUN, Integer.valueOf(1));
                break;
            case NightLord.TAUNT:
            case Shadower.TAUNT:
                monsterStatus.put(MonsterStatus.SHOWDOWN, ret.x);
                monsterStatus.put(MonsterStatus.MDEF, ret.x);
                monsterStatus.put(MonsterStatus.WDEF, ret.x);
                break;
            case ILWizard.COLD_BEAM:
            case ILMage.ICE_STRIKE:
            case ILArchMage.BLIZZARD:
            case ILMage.ELEMENT_COMPOSITION:
            case Sniper.BLIZZARD:
            case Outlaw.ICE_SPLITTER:
            case FPArchMage.PARALYZE:
            case Aran.COMBO_TEMPEST:
            case Evan.ICE_BREATH:
                monsterStatus.put(MonsterStatus.FREEZE, Integer.valueOf(1));
                // freezing skills are a little strange
                ret.duration *= 2;
                break;
            case FPWizard.SLOW:
            case ILWizard.SLOW:
            case BlazeWizard.SLOW:
                monsterStatus.put(MonsterStatus.SPEED, Integer.valueOf(ret.x));
                break;
            case FPWizard.POISON_BREATH:
            case FPMage.ELEMENT_COMPOSITION:
                monsterStatus.put(MonsterStatus.POISON, Integer.valueOf(1));
                break;
            case Priest.DOOM:
                monsterStatus.put(MonsterStatus.DOOM, Integer.valueOf(1));
                break;
            case ILMage.SEAL:
            case FPMage.SEAL:
                monsterStatus.put(MonsterStatus.SEAL, Integer.valueOf(1));
                break;
            // shadow web
            case Hermit.SHADOW_WEB:
            case NightWalker.SHADOW_WEB:
                monsterStatus.put(MonsterStatus.SHADOW_WEB, Integer.valueOf(1));
                break;
            case FPArchMage.FIRE_DEMON:
            case ILArchMage.ICE_DEMON:
                monsterStatus.put(MonsterStatus.POISON, Integer.valueOf(1));
                monsterStatus.put(MonsterStatus.FREEZE, Integer.valueOf(1));
                break;
            case Evan.PHANTOM_IMPRINT:
                monsterStatus.put(MonsterStatus.PHANTOM_IMPRINT, Integer.valueOf(x));
            // ARAN
            case Aran.COMBO_ABILITY:
                statups.add(new Pair<>(MapleBuffStat.ARAN_COMBO, Integer.valueOf(100)));
                break;
            case Aran.COMBO_BARRIER:
                statups.add(new Pair<>(MapleBuffStat.COMBO_BARRIER, Integer.valueOf(ret.x)));
                break;
            case Aran.COMBO_DRAIN:
                statups.add(new Pair<>(MapleBuffStat.COMBO_DRAIN, Integer.valueOf(ret.x)));
                break;
            case Aran.SMART_KNOCKBACK:
                statups.add(new Pair<>(MapleBuffStat.SMART_KNOCKBACK, Integer.valueOf(ret.x)));
                break;
            case Aran.BODY_PRESSURE:
                statups.add(new Pair<>(MapleBuffStat.BODY_PRESSURE, Integer.valueOf(ret.x)));
                break;
            case Aran.SNOW_CHARGE:
                statups.add(new Pair<>(MapleBuffStat.WK_CHARGE, Integer.valueOf(ret.duration)));
                break;
            default:
                break;
        }
    }
    if (ret.isMorph()) {
        statups.add(new Pair<>(MapleBuffStat.MORPH, Integer.valueOf(ret.getMorph())));
    }
    if (ret.ghost > 0 && !skill) {
        statups.add(new Pair<>(MapleBuffStat.GHOST_MORPH, Integer.valueOf(ret.ghost)));
    }
    ret.monsterStatus = monsterStatus;
    statups.trimToSize();
    ret.statups = statups;
    return ret;
}
Also used : MapleData(provider.MapleData) ArrayList(java.util.ArrayList) MonsterStatus(client.status.MonsterStatus) ArrayMap(tools.ArrayMap) Point(java.awt.Point) Point(java.awt.Point) Pair(tools.Pair)

Aggregations

MonsterStatus (client.status.MonsterStatus)7 Point (java.awt.Point)6 MapleCharacter (client.MapleCharacter)4 MonsterStatusEffect (client.status.MonsterStatusEffect)3 TimerManager (server.TimerManager)2 ArrayMap (tools.ArrayMap)2 MapleDisease (client.MapleDisease)1 Skill (client.Skill)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 MapleData (provider.MapleData)1 MapleMap (server.maps.MapleMap)1 MapleMapObject (server.maps.MapleMapObject)1 MapleMist (server.maps.MapleMist)1 Pair (tools.Pair)1 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)1