AbstractStatPercentEffect stats should use the mul getter.
This commit is contained in:
		| @@ -169,10 +169,10 @@ public class DropSearchBoard implements IParseBoardHandler | ||||
| 				final int start = (page - 1) * 14; | ||||
| 				final int end = Math.min(list.size() - 1, start + 14); | ||||
| 				final StringBuilder builder = new StringBuilder(); | ||||
| 				final double dropAmountAdenaEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_ADENA, 1); | ||||
| 				final double dropAmountEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_AMOUNT, 1); | ||||
| 				final double dropRateEffectBonus = player.getStat().getValue(Stat.BONUS_DROP_RATE, 1); | ||||
| 				final double spoilRateEffectBonus = player.getStat().getValue(Stat.BONUS_SPOIL_RATE, 1); | ||||
| 				final double dropAmountAdenaEffectBonus = player.getStat().getMul(Stat.BONUS_DROP_ADENA, 1); | ||||
| 				final double dropAmountEffectBonus = player.getStat().getMul(Stat.BONUS_DROP_AMOUNT, 1); | ||||
| 				final double dropRateEffectBonus = player.getStat().getMul(Stat.BONUS_DROP_RATE, 1); | ||||
| 				final double spoilRateEffectBonus = player.getStat().getMul(Stat.BONUS_SPOIL_RATE, 1); | ||||
| 				for (int index = start; index <= end; index++) | ||||
| 				{ | ||||
| 					final CBDropHolder cbDropHolder = list.get(index); | ||||
|   | ||||
| @@ -64,7 +64,7 @@ public class RealDamage extends AbstractEffect | ||||
| 		} | ||||
| 		 | ||||
| 		// Calculate resistance. | ||||
| 		final double damage = _power - (_power * (Math.min(effected.getStat().getValue(Stat.REAL_DAMAGE_RESIST, 1), 1.8) - 1)); | ||||
| 		final double damage = _power - (_power * (Math.min(effected.getStat().getMul(Stat.REAL_DAMAGE_RESIST, 1), 1.8) - 1)); | ||||
| 		 | ||||
| 		// Do damage. | ||||
| 		if (damage > 0) | ||||
|   | ||||
| @@ -674,7 +674,7 @@ public class Attackable extends Npc | ||||
| 				double hateValue = (damage * 100) / (getLevel() + 7); | ||||
| 				if (skill == null) | ||||
| 				{ | ||||
| 					hateValue *= attacker.getStat().getValue(Stat.HATE_ATTACK, 1); | ||||
| 					hateValue *= attacker.getStat().getMul(Stat.HATE_ATTACK, 1); | ||||
| 				} | ||||
| 				 | ||||
| 				addDamageHate(attacker, damage, (int) hateValue); | ||||
|   | ||||
| @@ -4404,8 +4404,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe | ||||
| 		double damage = damageValue; | ||||
| 		if (target.isImmobilized()) | ||||
| 		{ | ||||
| 			damage *= _stat.getValue(Stat.IMMOBILE_DAMAGE_BONUS, 1); | ||||
| 			damage /= target.getStat().getValue(Stat.IMMOBILE_DAMAGE_RESIST, 1); | ||||
| 			damage *= _stat.getMul(Stat.IMMOBILE_DAMAGE_BONUS, 1); | ||||
| 			damage /= target.getStat().getMul(Stat.IMMOBILE_DAMAGE_RESIST, 1); | ||||
| 		} | ||||
| 		 | ||||
| 		if (!reflect && !isDOT) | ||||
| @@ -4413,7 +4413,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe | ||||
| 			// RearDamage effect bonus. | ||||
| 			if (isBehind(target)) | ||||
| 			{ | ||||
| 				damage *= _stat.getValue(Stat.REAR_DAMAGE_RATE, 1); | ||||
| 				damage *= _stat.getMul(Stat.REAR_DAMAGE_RATE, 1); | ||||
| 			} | ||||
| 			 | ||||
| 			// Counterattacks happen before damage received. | ||||
|   | ||||
| @@ -473,7 +473,7 @@ public class PlayerStat extends PlayableStat | ||||
| 	 | ||||
| 	public double getVitalityExpBonus() | ||||
| 	{ | ||||
| 		return (getVitalityPoints() > 0) ? getValue(Stat.VITALITY_EXP_RATE, Config.RATE_VITALITY_EXP_MULTIPLIER) : 1.0; | ||||
| 		return (getVitalityPoints() > 0) ? getMul(Stat.VITALITY_EXP_RATE, Config.RATE_VITALITY_EXP_MULTIPLIER) : 1.0; | ||||
| 	} | ||||
| 	 | ||||
| 	public void setVitalityPoints(int value) | ||||
| @@ -549,7 +549,7 @@ public class PlayerStat extends PlayableStat | ||||
| 			 | ||||
| 			if (points < 0) // vitality consumed | ||||
| 			{ | ||||
| 				double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1); | ||||
| 				double consumeRate = getMul(Stat.VITALITY_CONSUME_RATE, 1); | ||||
| 				if (consumeRate <= 0) | ||||
| 				{ | ||||
| 					return; | ||||
|   | ||||
| @@ -840,7 +840,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable | ||||
| 				} | ||||
| 				 | ||||
| 				// bonus drop rate effect | ||||
| 				rateChance *= killer.getStat().getValue(Stat.BONUS_DROP_RATE, 1); | ||||
| 				rateChance *= killer.getStat().getMul(Stat.BONUS_DROP_RATE, 1); | ||||
| 				 | ||||
| 				// calculate if item will drop | ||||
| 				if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) | ||||
| @@ -890,10 +890,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable | ||||
| 					} | ||||
| 					 | ||||
| 					// bonus drop amount effect | ||||
| 					rateAmount *= killer.getStat().getValue(Stat.BONUS_DROP_AMOUNT, 1); | ||||
| 					rateAmount *= killer.getStat().getMul(Stat.BONUS_DROP_AMOUNT, 1); | ||||
| 					if (itemId == Inventory.ADENA_ID) | ||||
| 					{ | ||||
| 						rateAmount *= killer.getStat().getValue(Stat.BONUS_DROP_ADENA, 1); | ||||
| 						rateAmount *= killer.getStat().getMul(Stat.BONUS_DROP_ADENA, 1); | ||||
| 					} | ||||
| 					 | ||||
| 					// finally | ||||
| @@ -911,7 +911,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable | ||||
| 					rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; | ||||
| 				} | ||||
| 				// bonus drop rate effect | ||||
| 				rateChance *= killer.getStat().getValue(Stat.BONUS_SPOIL_RATE, 1); | ||||
| 				rateChance *= killer.getStat().getMul(Stat.BONUS_SPOIL_RATE, 1); | ||||
| 				 | ||||
| 				// calculate if item will be rewarded | ||||
| 				if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) | ||||
|   | ||||
| @@ -313,8 +313,8 @@ public class Fishing | ||||
| 				{ | ||||
| 					final FishingData fishingData = FishingData.getInstance(); | ||||
| 					final double lvlModifier = (Math.pow(_player.getLevel(), 2.2) * fishingCatchData.getMultiplier()); | ||||
| 					final long xp = (long) (Rnd.get(fishingData.getExpRateMin(), fishingData.getExpRateMax()) * lvlModifier * _player.getStat().getValue(Stat.FISHING_EXP_SP_BONUS, 1)); | ||||
| 					final long sp = (long) (Rnd.get(fishingData.getSpRateMin(), fishingData.getSpRateMax()) * lvlModifier * _player.getStat().getValue(Stat.FISHING_EXP_SP_BONUS, 1)); | ||||
| 					final long xp = (long) (Rnd.get(fishingData.getExpRateMin(), fishingData.getExpRateMax()) * lvlModifier * _player.getStat().getMul(Stat.FISHING_EXP_SP_BONUS, 1)); | ||||
| 					final long sp = (long) (Rnd.get(fishingData.getSpRateMin(), fishingData.getSpRateMax()) * lvlModifier * _player.getStat().getMul(Stat.FISHING_EXP_SP_BONUS, 1)); | ||||
| 					_player.addExpAndSp(xp, sp, true); | ||||
| 					_player.getInventory().addItem("Fishing Reward", fishingCatchData.getItemId(), 1, _player, null); | ||||
| 					final SystemMessage msg = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1); | ||||
|   | ||||
| @@ -842,7 +842,7 @@ public class Formulas | ||||
| 		} | ||||
| 		 | ||||
| 		// general magic resist | ||||
| 		final double resModifier = target.getStat().getValue(Stat.MAGIC_SUCCESS_RES, 1); | ||||
| 		final double resModifier = target.getStat().getMul(Stat.MAGIC_SUCCESS_RES, 1); | ||||
| 		final int rate = 100 - Math.round((float) (mAccModifier * lvlModifier * targetModifier * resModifier)); | ||||
| 		 | ||||
| 		return (Rnd.get(100) < rate); | ||||
| @@ -965,7 +965,7 @@ public class Formulas | ||||
| 			return false; | ||||
| 		} | ||||
| 		 | ||||
| 		final double chance = BaseStat.values()[val].calcBonus(actor) * actor.getStat().getValue(Stat.SKILL_CRITICAL_PROBABILITY, 1); | ||||
| 		final double chance = BaseStat.values()[val].calcBonus(actor) * actor.getStat().getMul(Stat.SKILL_CRITICAL_PROBABILITY, 1); | ||||
| 		 | ||||
| 		return ((Rnd.nextDouble() * 100.) < (chance * Config.SKILL_MASTERY_CHANCE_MULTIPLIERS[actor.getActingPlayer().getClassId().getId()])); | ||||
| 	} | ||||
| @@ -1590,21 +1590,21 @@ public class Formulas | ||||
| 				if (skill.isMagic()) | ||||
| 				{ | ||||
| 					// Magical Skill PvP | ||||
| 					pvpAttack = attacker.getStat().getValue(Stat.PVP_MAGICAL_SKILL_DAMAGE, 1) * Config.PVP_MAGICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]; | ||||
| 					pvpDefense = target.getStat().getValue(Stat.PVP_MAGICAL_SKILL_DEFENCE, 1) * Config.PVP_MAGICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; | ||||
| 					pvpAttack = attacker.getStat().getMul(Stat.PVP_MAGICAL_SKILL_DAMAGE, 1) * Config.PVP_MAGICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]; | ||||
| 					pvpDefense = target.getStat().getMul(Stat.PVP_MAGICAL_SKILL_DEFENCE, 1) * Config.PVP_MAGICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					// Physical Skill PvP | ||||
| 					pvpAttack = attacker.getStat().getValue(Stat.PVP_PHYSICAL_SKILL_DAMAGE, 1) * Config.PVP_PHYSICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]; | ||||
| 					pvpDefense = target.getStat().getValue(Stat.PVP_PHYSICAL_SKILL_DEFENCE, 1) * Config.PVP_PHYSICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; | ||||
| 					pvpAttack = attacker.getStat().getMul(Stat.PVP_PHYSICAL_SKILL_DAMAGE, 1) * Config.PVP_PHYSICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]; | ||||
| 					pvpDefense = target.getStat().getMul(Stat.PVP_PHYSICAL_SKILL_DEFENCE, 1) * Config.PVP_PHYSICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; | ||||
| 				} | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				// Autoattack PvP | ||||
| 				pvpAttack = attacker.getStat().getValue(Stat.PVP_PHYSICAL_ATTACK_DAMAGE, 1) * Config.PVP_PHYSICAL_ATTACK_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]; | ||||
| 				pvpDefense = target.getStat().getValue(Stat.PVP_PHYSICAL_ATTACK_DEFENCE, 1) * Config.PVP_PHYSICAL_ATTACK_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; | ||||
| 				pvpAttack = attacker.getStat().getMul(Stat.PVP_PHYSICAL_ATTACK_DAMAGE, 1) * Config.PVP_PHYSICAL_ATTACK_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]; | ||||
| 				pvpDefense = target.getStat().getMul(Stat.PVP_PHYSICAL_ATTACK_DEFENCE, 1) * Config.PVP_PHYSICAL_ATTACK_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; | ||||
| 			} | ||||
| 			 | ||||
| 			return Math.max(0.05, 1 + (pvpAttack - pvpDefense)); // Bonus should not be negative. | ||||
| @@ -1637,27 +1637,27 @@ public class Formulas | ||||
| 				if (skill.isMagic()) | ||||
| 				{ | ||||
| 					// Magical Skill PvE | ||||
| 					pveAttack = attacker.getStat().getValue(Stat.PVE_MAGICAL_SKILL_DAMAGE, 1) * (attackerPlayer == null ? 1 : Config.PVE_MAGICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]); | ||||
| 					pveDefense = target.getStat().getValue(Stat.PVE_MAGICAL_SKILL_DEFENCE, 1) * (targetPlayer == null ? 1 : Config.PVE_MAGICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]); | ||||
| 					pveRaidAttack = attacker.isRaid() ? attacker.getStat().getValue(Stat.PVE_RAID_MAGICAL_SKILL_DAMAGE, 1) : 1; | ||||
| 					pveRaidDefense = attacker.isRaid() ? attacker.getStat().getValue(Stat.PVE_RAID_MAGICAL_SKILL_DEFENCE, 1) : 1; | ||||
| 					pveAttack = attacker.getStat().getMul(Stat.PVE_MAGICAL_SKILL_DAMAGE, 1) * (attackerPlayer == null ? 1 : Config.PVE_MAGICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]); | ||||
| 					pveDefense = target.getStat().getMul(Stat.PVE_MAGICAL_SKILL_DEFENCE, 1) * (targetPlayer == null ? 1 : Config.PVE_MAGICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]); | ||||
| 					pveRaidAttack = attacker.isRaid() ? attacker.getStat().getMul(Stat.PVE_RAID_MAGICAL_SKILL_DAMAGE, 1) : 1; | ||||
| 					pveRaidDefense = attacker.isRaid() ? attacker.getStat().getMul(Stat.PVE_RAID_MAGICAL_SKILL_DEFENCE, 1) : 1; | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					// Physical Skill PvE | ||||
| 					pveAttack = attacker.getStat().getValue(Stat.PVE_PHYSICAL_SKILL_DAMAGE, 1) * (attackerPlayer == null ? 1 : Config.PVE_PHYSICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]); | ||||
| 					pveDefense = target.getStat().getValue(Stat.PVE_PHYSICAL_SKILL_DEFENCE, 1) * (targetPlayer == null ? 1 : Config.PVE_PHYSICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]); | ||||
| 					pveRaidAttack = attacker.isRaid() ? attacker.getStat().getValue(Stat.PVE_RAID_PHYSICAL_SKILL_DAMAGE, 1) : 1; | ||||
| 					pveRaidDefense = attacker.isRaid() ? attacker.getStat().getValue(Stat.PVE_RAID_PHYSICAL_SKILL_DEFENCE, 1) : 1; | ||||
| 					pveAttack = attacker.getStat().getMul(Stat.PVE_PHYSICAL_SKILL_DAMAGE, 1) * (attackerPlayer == null ? 1 : Config.PVE_PHYSICAL_SKILL_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]); | ||||
| 					pveDefense = target.getStat().getMul(Stat.PVE_PHYSICAL_SKILL_DEFENCE, 1) * (targetPlayer == null ? 1 : Config.PVE_PHYSICAL_SKILL_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]); | ||||
| 					pveRaidAttack = attacker.isRaid() ? attacker.getStat().getMul(Stat.PVE_RAID_PHYSICAL_SKILL_DAMAGE, 1) : 1; | ||||
| 					pveRaidDefense = attacker.isRaid() ? attacker.getStat().getMul(Stat.PVE_RAID_PHYSICAL_SKILL_DEFENCE, 1) : 1; | ||||
| 				} | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				// Autoattack PvE | ||||
| 				pveAttack = attacker.getStat().getValue(Stat.PVE_PHYSICAL_ATTACK_DAMAGE, 1) * (attackerPlayer == null ? 1 : Config.PVE_PHYSICAL_ATTACK_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]); | ||||
| 				pveDefense = target.getStat().getValue(Stat.PVE_PHYSICAL_ATTACK_DEFENCE, 1) * (targetPlayer == null ? 1 : Config.PVE_PHYSICAL_ATTACK_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]); | ||||
| 				pveRaidAttack = attacker.isRaid() ? attacker.getStat().getValue(Stat.PVE_RAID_PHYSICAL_ATTACK_DAMAGE, 1) : 1; | ||||
| 				pveRaidDefense = attacker.isRaid() ? attacker.getStat().getValue(Stat.PVE_RAID_PHYSICAL_ATTACK_DEFENCE, 1) : 1; | ||||
| 				pveAttack = attacker.getStat().getMul(Stat.PVE_PHYSICAL_ATTACK_DAMAGE, 1) * (attackerPlayer == null ? 1 : Config.PVE_PHYSICAL_ATTACK_DAMAGE_MULTIPLIERS[attackerPlayer.getClassId().getId()]); | ||||
| 				pveDefense = target.getStat().getMul(Stat.PVE_PHYSICAL_ATTACK_DEFENCE, 1) * (targetPlayer == null ? 1 : Config.PVE_PHYSICAL_ATTACK_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]); | ||||
| 				pveRaidAttack = attacker.isRaid() ? attacker.getStat().getMul(Stat.PVE_RAID_PHYSICAL_ATTACK_DAMAGE, 1) : 1; | ||||
| 				pveRaidDefense = attacker.isRaid() ? attacker.getStat().getMul(Stat.PVE_RAID_PHYSICAL_ATTACK_DEFENCE, 1) : 1; | ||||
| 			} | ||||
| 			 | ||||
| 			return Math.max(0.05, (1 + ((pveAttack * pveRaidAttack) - (pveDefense * pveRaidDefense))) * pvePenalty); // Bonus should not be negative. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment