Addition of MAtkByPAtk and MagicCriticalRateByCriticalRate effects.
This commit is contained in:
31
L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/MAtkByPAtk.java
vendored
Normal file
31
L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/MAtkByPAtk.java
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import org.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class MAtkByPAtk extends AbstractStatPercentEffect
|
||||||
|
{
|
||||||
|
public MAtkByPAtk(StatsSet params)
|
||||||
|
{
|
||||||
|
super(params, Stats.MAGIC_ATTACK_BY_PHYSICAL_ATTACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import org.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import org.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Mobius
|
||||||
|
*/
|
||||||
|
public class MagicCriticalRateByCriticalRate extends AbstractStatPercentEffect
|
||||||
|
{
|
||||||
|
public MagicCriticalRateByCriticalRate(StatsSet params)
|
||||||
|
{
|
||||||
|
super(params, Stats.MAGIC_CRITICAL_RATE_BY_CRITICAL_RATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -175,6 +175,7 @@ MagicalSkillPower: Magical Skill Power stat (use only MUL). (l2jmobius)
|
|||||||
MagicalSoulAttack: Magical attack based on souls formula.
|
MagicalSoulAttack: Magical attack based on souls formula.
|
||||||
MagicCriticalDamage: Magical Critical Damage stat
|
MagicCriticalDamage: Magical Critical Damage stat
|
||||||
MagicCriticalRate: Magical Critical Rate stat.
|
MagicCriticalRate: Magical Critical Rate stat.
|
||||||
|
MagicCriticalRateByCriticalRate: Magical Critical Rate bonus from Critical Rate stat. (l2jmobius)
|
||||||
MagicMpCost: Sets mana cost per magic type. Clarity.
|
MagicMpCost: Sets mana cost per magic type. Clarity.
|
||||||
ManaCharge: Mana Recharge stat.
|
ManaCharge: Mana Recharge stat.
|
||||||
ManaDamOverTime: Mana damage over time.
|
ManaDamOverTime: Mana damage over time.
|
||||||
@@ -183,6 +184,7 @@ ManaHeal: Increases current MP.
|
|||||||
ManaHealOverTime: Increases current MP over time.
|
ManaHealOverTime: Increases current MP over time.
|
||||||
ManaHealPercent: Increases current MP by a given percentage.
|
ManaHealPercent: Increases current MP by a given percentage.
|
||||||
MAtk: M. Atk. stat.
|
MAtk: M. Atk. stat.
|
||||||
|
MAtkByPAtk: M. Atk. bonus from P. Atk stat. (l2jmobius)
|
||||||
MaxCp: Max. CP stat.
|
MaxCp: Max. CP stat.
|
||||||
MaxHp: Max. HP stat.
|
MaxHp: Max. HP stat.
|
||||||
MaxMp: Max. MP stat.
|
MaxMp: Max. MP stat.
|
||||||
|
|||||||
@@ -53,8 +53,9 @@ public class MAttackFinalizer implements IStatsFunction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate modifiers Magic Attack
|
// Calculate modifiers Magic Attack
|
||||||
|
final double physicalBonus = creature.getStat().getValue(Stats.MAGIC_ATTACK_BY_PHYSICAL_ATTACK, 0) * creature.getPAtk();
|
||||||
baseValue *= Math.pow(BaseStats.INT.calcBonus(creature) * creature.getLevelMod(), 2.2072);
|
baseValue *= Math.pow(BaseStats.INT.calcBonus(creature) * creature.getLevelMod(), 2.2072);
|
||||||
return validateValue(creature, Stats.defaultValue(creature, stat, baseValue), 0, Config.MAX_MATK);
|
return validateValue(creature, Stats.defaultValue(creature, stat, baseValue * (physicalBonus > 0 ? physicalBonus : 1)), 0, Config.MAX_MATK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,8 +42,9 @@ public class MCritRateFinalizer implements IStatsFunction
|
|||||||
baseValue += calcEnchantBodyPart(creature, Item.SLOT_LEGS);
|
baseValue += calcEnchantBodyPart(creature, Item.SLOT_LEGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final double physicalBonus = creature.getStat().getValue(Stats.MAGIC_CRITICAL_RATE_BY_CRITICAL_RATE, 0) * creature.getStat().getCriticalHit();
|
||||||
final double witBonus = creature.getWIT() > 0 ? BaseStats.WIT.calcBonus(creature) : 1.;
|
final double witBonus = creature.getWIT() > 0 ? BaseStats.WIT.calcBonus(creature) : 1.;
|
||||||
return validateValue(creature, Stats.defaultValue(creature, stat, baseValue * witBonus * 10), 0, Config.MAX_MCRIT_RATE);
|
return validateValue(creature, Stats.defaultValue(creature, stat, baseValue * witBonus * 10 * (physicalBonus > 0 ? physicalBonus : 1)), 0, Config.MAX_MCRIT_RATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user