Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[v116] Summoning Skill Damage

Initiate Mage
Joined
Nov 10, 2012
Messages
8
Reaction score
0
Apparently, yes I've encountered another bug which I've spent so long trying to find out what's the cause of it. Summoning Skill's damage is bugged... Client wise, the damage that the summons deal is decent. However, the actual damage that is being dealt to the monster is roughly about a few hundred million as I've killed Zakum with 3 hits of my Phoenix (Bowmaster's Summon). On the player's screen, the damage that's being dealt to Zakum is for example 300k. Damage that's being done, though, is a 1-hit-ko to Zakum.

I've tried looking around in SummonHandler & DamageParse. This has caught my eye.
PHP:
public static void SummonAttack(final LittleEndianAccessor slea, final MapleClient c, final MapleCharacter chr) {
        if (chr == null || !chr.isAlive() || chr.getMap() == null) {
            return;
        }
        final MapleMap map = chr.getMap();
        final MapleMapObject obj = map.getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
        if (obj == null || !(obj instanceof MapleSummon)) {
            chr.dropMessage(5, "The summon has disappeared.");
            return;
        }
        final MapleSummon summon = (MapleSummon) obj;
        if (summon.getOwnerId() != chr.getId() || summon.getSkillLevel() <= 0) {
            chr.dropMessage(5, "Error.");
            return;
        }
        final SummonSkillEntry sse = SkillFactory.getSummonData(summon.getSkill());
        if (summon.getSkill() / 1000000 != 35 && summon.getSkill() != 33101008 && sse == null) {
            chr.dropMessage(5, "Error in processing attack.");
            return;
        }
        if (!ServerConstants.GMS) {
            slea.skip(8);
        }
        int tick = slea.readInt();
        if (sse != null && sse.delay > 0) {
            chr.updateTick(tick);
        }
        if (!ServerConstants.GMS) {
            slea.skip(8);
        }
        final byte animation = slea.readByte();
        if (!ServerConstants.GMS) {
            slea.skip(8);
        }
        final byte numAttacked = slea.readByte();
        if (sse != null && numAttacked > sse.mobCount) {
            chr.dropMessage(5, "Warning: Attacking more monster than summon can do");
            chr.getCheatTracker().registerOffense(CheatingOffense.SUMMON_HACK_MOBS);
            return;
        }
        slea.skip(summon.getSkill() == 35111002 ? 24 : 12);
        final List<Pair<Integer, Integer>> allDamage = new ArrayList<Pair<Integer, Integer>>();
        for (int i = 0; i < numAttacked; i++) {
            final MapleMonster mob = map.getMonsterByOid(slea.readInt());

            if (mob == null) {
                continue;
            }
            slea.skip(18);
            final int damge = slea.readInt();
            allDamage.add(new Pair<Integer, Integer>(mob.getObjectId(), damge));
        }
        map.broadcastMessage(chr, SummonPacket.summonAttack(summon.getOwnerId(), summon.getObjectId(), animation, allDamage, chr.getLevel(), false), summon.getTruePosition());
        final Skill summonSkill = SkillFactory.getSkill(summon.getSkill());
        final MapleStatEffect summonEffect = summonSkill.getEffect(summon.getSkillLevel());
        if (summonEffect == null) {
            chr.dropMessage(5, "Error in attack.");
            return;
        }
        for (Pair<Integer, Integer> attackEntry : allDamage) {
            final int toDamage = attackEntry.right;
            final MapleMonster mob = map.getMonsterByOid(attackEntry.left);
            if (mob == null) {
                continue;
            }
            if (toDamage > 0 && summonEffect.getMonsterStati().size() > 0) {
                if (summonEffect.makeChanceResult()) {
                    for (Map.Entry<MonsterStatus, Integer> z : summonEffect.getMonsterStati().entrySet()) {
                        mob.applyStatus(chr, new MonsterStatusEffect(z.getKey(), z.getValue(), summonSkill.getId(), null, false), summonEffect.isPoison(), 4000, true, summonEffect);
                    }
                }
            }
            if (chr.isStaff() || toDamage < (chr.getStat().getCurrentMaxBaseDamage() * 5.0 * (summonEffect.getSelfDestruction() + summonEffect.getDamage() + chr.getStat().getDamageIncrease(summonEffect.getSourceId())) / 100.0)) { //10 x dmg.. eh
                mob.damage(chr, toDamage, true);
                chr.checkMonsterAggro(mob);
                if (!mob.isAlive()) {
                    chr.getClient().getSession().write(GeneralPacket.killMonster(mob.getObjectId(), 1));
                }
            } else {
                chr.dropMessage(5, "Warning - high damage.");
                break;
            }
        }
        if (!summon.isMultiAttack()) {
            chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
            chr.getMap().removeMapObject(summon);
            chr.removeVisibleMapObject(summon);
            chr.removeSummon(summon);
            if (summon.getSkill() != 35121011) {
                chr.cancelEffectFromBuffStat(MapleBuffStat.SUMMON);
            }
        }
    }
However, I've no idea where is the part that's causing the problem. :(
Hopefully anyone would help me out. Thanks in advance!
 
Experienced Elementalist
Joined
Apr 8, 2008
Messages
203
Reaction score
29
The only difference I can see between yours and mine is the slea.skip(18), mine reads slea.skip(22).
 
Upvote 0
Initiate Mage
Joined
Nov 10, 2012
Messages
8
Reaction score
0
The only difference I can see between yours and mine is the slea.skip(18), mine reads slea.skip(22).

Hmmm.. I'll test it out I guess.. Thanks in advance!
*Edit: Problem has been solved. Thank you so much, Dichotome!
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Apr 8, 2008
Messages
203
Reaction score
29
You're right sunnyboy, but as most people on here only want a solution, and not the reason why things don't work. I saw no reason to post the fact the packet had changed.
 
Upvote 0
Back
Top