- Joined
- Nov 27, 2009
- Messages
- 442
- Reaction score
- 230
The title may be a bit misleading, since I don't know if the Damage Calculations have changed because of Big Bang. Anyways, players in the server I work for were complaining that Ninja Ambush was all fucked up, which is pretty much true due to the face that the Dmg. Calculation were never completed) Since I don't really contribute anything, I've released this. Now you no longer need to hear from your players that Ninja Ambush is all messed up !
P.S: If any other developers have an idea on how to improve my code/simplify it, please post. Constructive criticism is allowed!
In MapleStatEffect replace/add:
In AbstractDealDamageHandler add:
In MapleMonster add somewhere in the applyStatus function:
Some Notes/Credits:
(Even though I diddn't define it in SpecialMoveHandler, Moogra did give me a hint on how to handle it.)
(Credits to Fiel for Damage Calculations, even though it might not be the Exact Formula as Fiel's since I suck at math tt1
Screenshot:
P.S: If any other developers have an idea on how to improve my code/simplify it, please post. Constructive criticism is allowed!
In MapleStatEffect replace/add:
PHP:
case NightLord.NINJA_AMBUSH:
case Shadower.NINJA_AMBUSH:
monsterStatus.put(MonsterStatus.NINJA_AMBUSH, Integer.valueOf(ret.damage));
break;
In AbstractDealDamageHandler add:
PHP:
if (attack.skill == NightLord.NINJA_AMBUSH || attack.skill == Shadower.NINJA_AMBUSH) {
ISkill skill = SkillFactory.getSkill(attack.skill);
for (int i = 0; i < attackCount; i++) {
if (monster != null) {
monster.applyStatus(player, new MonsterStatusEffect(Collections.singletonMap(MonsterStatus.NINJA_AMBUSH, 1), skill, false), false, skill.getEffect(player.getSkillLevel(skill)).getDuration(), false);
}
}
player.getClient().getSession().write(MaplePacketCreator.enableActions());
}
In MapleMonster add somewhere in the applyStatus function:
PHP:
} else if (status.getSkill().getId() == NightLord.NINJA_AMBUSH || status.getSkill().getId() == Shadower.NINJA_AMBUSH) {
ISkill skill = SkillFactory.getSkill(status.getSkill().getId());
final int damage = (int) (((from.getStr() + from.getLuk()) * (skill.getEffect(from.getSkillLevel(skill)).getDamage())) / 200); // Forumla from Fiel
if (getHp() - damage <= 1) {
return false;
}
status.setValue(MonsterStatus.NINJA_AMBUSH, damage);
//from.getMap().damageMonster(from, this, damage);
// Wtf do we really need a Timer?
status.setPoisonSchedule(timerManager.schedule(new PoisonTask(damage, from, status, cancelTask, false), skill.getEffect(from.getSkillLevel(skill)).getDuration()));
System.out.println(damage);
Some Notes/Credits:
(Even though I diddn't define it in SpecialMoveHandler, Moogra did give me a hint on how to handle it.)
Depending on how you handle it, this could be either correct or incorrect. Currently it would just display 100 at max. Anyways to make it deal damage take a look at specialmovehandler (use packets) or edit something to do with monsterstatus in maplemonster
(Credits to Fiel for Damage Calculations, even though it might not be the Exact Formula as Fiel's since I suck at math tt1
I figured it out with a few tests:
floor((STR + LUK) * (1.5 + (skillLevel * 0.05)) * damage%)
Screenshot:
Last edited: