Ahh thats the function I was looking at but where is the damage being parsed in there (applyMonsterStatus)?
Code:
public static byte[] applyMonsterStatus(final int oid, final MonsterStatusEffect mse) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.APPLY_MONSTER_STATUS.getValue());
mplew.writeInt(oid);
mplew.writeLong(0);
writeIntMask(mplew, mse.getStati());
for (Map.Entry<MonsterStatus, Integer> stat : mse.getStati().entrySet()) {
mplew.writeShort(stat.getValue());
if (mse.isMonsterSkill()) {
mplew.writeShort(mse.getMobSkill().getSkillId());
mplew.writeShort(mse.getMobSkill().getSkillLevel());
} else {
mplew.writeInt(mse.getSkill().getId());
}
mplew.writeShort(-1); // might actually be the buffTime but it's not displayed anywhere
}
mplew.writeShort(0);
mplew.writeInt(0);
return mplew.getPacket();
}
Why is the damageTask being passed down a damage variable then?
Code:
private final class DamageTask implements Runnable {
private final int dealDamage;
private final MapleCharacter chr;
private final MonsterStatusEffect status;
private final Runnable cancelTask;
private final int type;
private final MapleMap map;
private DamageTask(int dealDamage, MapleCharacter chr, MonsterStatusEffect status, Runnable cancelTask, int type) {
this.dealDamage = dealDamage;
this.chr = chr;
this.status = status;
this.cancelTask = cancelTask;
this.type = type;
this.map = chr.getMap();
}
@Override
public void run() {
int damage = dealDamage;
if (damage >= hp) {
damage = hp - 1;
if (type == 1 || type == 2) {
map.broadcastMessage(MaplePacketCreator.damageMonster(getObjectId(), damage), getPosition());
cancelTask.run();
status.getCancelTask().cancel(false);
}
}
if (hp > 1 && damage > 0) {
damage(chr, damage, false);
if (type == 1) {
map.broadcastMessage(MaplePacketCreator.damageMonster(getObjectId(), damage), getPosition());
}
}
}
}
So when I use dragon roar the packet to show the other players the animation is being invoked in mapleStateEffect?