Reformat and clean up "net" package
This commit is contained in:
@@ -44,12 +44,12 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class SummonDamageHandler extends AbstractDealDamageHandler {
|
||||
|
||||
|
||||
public final class SummonAttackEntry {
|
||||
|
||||
private int monsterOid;
|
||||
private int damage;
|
||||
|
||||
private final int monsterOid;
|
||||
private final int damage;
|
||||
|
||||
public SummonAttackEntry(int monsterOid, int damage) {
|
||||
this.monsterOid = monsterOid;
|
||||
this.damage = damage;
|
||||
@@ -62,7 +62,7 @@ public final class SummonDamageHandler extends AbstractDealDamageHandler {
|
||||
public int getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,11 +95,11 @@ public final class SummonDamageHandler extends AbstractDealDamageHandler {
|
||||
allDamage.add(new SummonAttackEntry(monsterOid, damage));
|
||||
}
|
||||
player.getMap().broadcastMessage(player, PacketCreator.summonAttack(player.getId(), summon.getObjectId(), direction, allDamage), summon.getPosition());
|
||||
|
||||
|
||||
if (player.getMap().isOwnershipRestricted(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
boolean magic = summonEffect.getWatk() == 0;
|
||||
int maxDmg = calcMaxDamage(summonEffect, player, magic); // thanks Darter (YungMoozi) for reporting unchecked max dmg
|
||||
for (SummonAttackEntry attackEntry : allDamage) {
|
||||
@@ -112,7 +112,7 @@ public final class SummonDamageHandler extends AbstractDealDamageHandler {
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " used a summon of skillid " + summon.getSkill() + " to attack " + MonsterInformationProvider.getInstance().getMobNameFromId(target.getId()) + " with damage " + damage + " (max: " + maxDmg + ")");
|
||||
damage = maxDmg;
|
||||
}
|
||||
|
||||
|
||||
if (damage > 0 && summonEffect.getMonsterStati().size() > 0) {
|
||||
if (summonEffect.makeChanceResult()) {
|
||||
target.applyStatus(player, new MonsterStatusEffect(summonEffect.getMonsterStati(), summonSkill, null, false), summonEffect.isPoison(), 4000);
|
||||
@@ -121,33 +121,33 @@ public final class SummonDamageHandler extends AbstractDealDamageHandler {
|
||||
player.getMap().damageMonster(player, target, damage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (summon.getSkill() == Outlaw.GAVIOTA) { // thanks Periwinks for noticing Gaviota not cancelling after grenade toss
|
||||
player.cancelEffect(summonEffect, false, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static int calcMaxDamage(StatEffect summonEffect, Character player, boolean magic) {
|
||||
double maxDamage;
|
||||
|
||||
|
||||
if (magic) {
|
||||
int matk = Math.max(player.getTotalMagic(), 14);
|
||||
maxDamage = player.calculateMaxBaseMagicDamage(matk) * (0.05 * summonEffect.getMatk());
|
||||
} else {
|
||||
int watk = Math.max(player.getTotalWatk(), 14);
|
||||
Item weapon_item = player.getInventory(InventoryType.EQUIPPED).getItem((short) -11);
|
||||
|
||||
|
||||
int maxBaseDmg; // thanks Conrad, Atoot for detecting some summons legitimately hitting over the calculated limit
|
||||
if (weapon_item != null) {
|
||||
maxBaseDmg = player.calculateMaxBaseDamage(watk, ItemInformationProvider.getInstance().getWeaponType(weapon_item.getItemId()));
|
||||
} else {
|
||||
maxBaseDmg = player.calculateMaxBaseDamage(watk, WeaponType.SWORD1H);
|
||||
}
|
||||
|
||||
|
||||
float summonDmgMod = (maxBaseDmg >= 438) ? 0.054f : 0.077f;
|
||||
maxDamage = maxBaseDmg * (summonDmgMod * summonEffect.getWatk());
|
||||
}
|
||||
|
||||
|
||||
return (int) maxDamage;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user