|
@@ -39,26 +39,42 @@ import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
|
|
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
|
|
-import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
|
|
|
|
-import com.l2jserver.gameserver.model.base.PlayerState;
|
|
|
|
-import com.l2jserver.gameserver.model.conditions.ConditionPlayerState;
|
|
|
|
-import com.l2jserver.gameserver.model.conditions.ConditionUsingItemType;
|
|
|
|
import com.l2jserver.gameserver.model.effects.EffectTemplate;
|
|
import com.l2jserver.gameserver.model.effects.EffectTemplate;
|
|
import com.l2jserver.gameserver.model.entity.Castle;
|
|
import com.l2jserver.gameserver.model.entity.Castle;
|
|
import com.l2jserver.gameserver.model.entity.ClanHall;
|
|
import com.l2jserver.gameserver.model.entity.ClanHall;
|
|
import com.l2jserver.gameserver.model.entity.Fort;
|
|
import com.l2jserver.gameserver.model.entity.Fort;
|
|
import com.l2jserver.gameserver.model.entity.Siege;
|
|
import com.l2jserver.gameserver.model.entity.Siege;
|
|
-import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
|
|
|
import com.l2jserver.gameserver.model.items.L2Armor;
|
|
import com.l2jserver.gameserver.model.items.L2Armor;
|
|
import com.l2jserver.gameserver.model.items.L2Item;
|
|
import com.l2jserver.gameserver.model.items.L2Item;
|
|
import com.l2jserver.gameserver.model.items.L2Weapon;
|
|
import com.l2jserver.gameserver.model.items.L2Weapon;
|
|
-import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
|
|
|
import com.l2jserver.gameserver.model.items.type.L2ArmorType;
|
|
import com.l2jserver.gameserver.model.items.type.L2ArmorType;
|
|
import com.l2jserver.gameserver.model.items.type.L2WeaponType;
|
|
import com.l2jserver.gameserver.model.items.type.L2WeaponType;
|
|
import com.l2jserver.gameserver.model.skills.L2Skill;
|
|
import com.l2jserver.gameserver.model.skills.L2Skill;
|
|
import com.l2jserver.gameserver.model.skills.L2SkillType;
|
|
import com.l2jserver.gameserver.model.skills.L2SkillType;
|
|
import com.l2jserver.gameserver.model.skills.L2TraitType;
|
|
import com.l2jserver.gameserver.model.skills.L2TraitType;
|
|
-import com.l2jserver.gameserver.model.skills.funcs.Func;
|
|
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncArmorSet;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncAtkAccuracy;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncAtkCritical;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncAtkEvasion;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncBowAtkRange;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncCrossBowAtkRange;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncGatesMDefMod;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncGatesPDefMod;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncHenna;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMAtkCritical;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMAtkMod;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMAtkSpeed;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMDefMod;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxCpAdd;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxCpMul;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxHpAdd;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxHpMul;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxMpAdd;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMaxMpMul;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncMoveSpeed;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncPAtkMod;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncPAtkSpeed;
|
|
|
|
+import com.l2jserver.gameserver.model.skills.funcs.formulas.FuncPDefMod;
|
|
import com.l2jserver.gameserver.model.zone.type.L2CastleZone;
|
|
import com.l2jserver.gameserver.model.zone.type.L2CastleZone;
|
|
import com.l2jserver.gameserver.model.zone.type.L2ClanHallZone;
|
|
import com.l2jserver.gameserver.model.zone.type.L2ClanHallZone;
|
|
import com.l2jserver.gameserver.model.zone.type.L2FortZone;
|
|
import com.l2jserver.gameserver.model.zone.type.L2FortZone;
|
|
@@ -91,884 +107,6 @@ public final class Formulas
|
|
|
|
|
|
private static final byte MELEE_ATTACK_RANGE = 40;
|
|
private static final byte MELEE_ATTACK_RANGE = 40;
|
|
|
|
|
|
- static class FuncAddLevel3 extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncAddLevel3[] _instancies = new FuncAddLevel3[Stats.NUM_STATS];
|
|
|
|
-
|
|
|
|
- static Func getInstance(Stats stat)
|
|
|
|
- {
|
|
|
|
- int pos = stat.ordinal();
|
|
|
|
- if (_instancies[pos] == null)
|
|
|
|
- {
|
|
|
|
- _instancies[pos] = new FuncAddLevel3(stat);
|
|
|
|
- }
|
|
|
|
- return _instancies[pos];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncAddLevel3(Stats pStat)
|
|
|
|
- {
|
|
|
|
- super(pStat, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.addValue(env.getCharacter().getLevel() / 3.0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMultLevelMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMultLevelMod[] _instancies = new FuncMultLevelMod[Stats.NUM_STATS];
|
|
|
|
-
|
|
|
|
- static Func getInstance(Stats stat)
|
|
|
|
- {
|
|
|
|
- int pos = stat.ordinal();
|
|
|
|
- if (_instancies[pos] == null)
|
|
|
|
- {
|
|
|
|
- _instancies[pos] = new FuncMultLevelMod(stat);
|
|
|
|
- }
|
|
|
|
- return _instancies[pos];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMultLevelMod(Stats pStat)
|
|
|
|
- {
|
|
|
|
- super(pStat, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(env.getCharacter().getLevelMod());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMultRegenResting extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMultRegenResting[] _instancies = new FuncMultRegenResting[Stats.NUM_STATS];
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * @param stat
|
|
|
|
- * @return the Func object corresponding to the state concerned.
|
|
|
|
- */
|
|
|
|
- static Func getInstance(Stats stat)
|
|
|
|
- {
|
|
|
|
- int pos = stat.ordinal();
|
|
|
|
-
|
|
|
|
- if (_instancies[pos] == null)
|
|
|
|
- {
|
|
|
|
- _instancies[pos] = new FuncMultRegenResting(stat);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return _instancies[pos];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Constructor of the FuncMultRegenResting.
|
|
|
|
- * @param pStat
|
|
|
|
- */
|
|
|
|
- private FuncMultRegenResting(Stats pStat)
|
|
|
|
- {
|
|
|
|
- super(pStat, 0x20, null);
|
|
|
|
- setCondition(new ConditionPlayerState(PlayerState.RESTING, true));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Calculate the modifier of the state concerned.
|
|
|
|
- */
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (!cond.test(env))
|
|
|
|
- {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- env.mulValue(1.45);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncPAtkMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncPAtkMod _fpa_instance = new FuncPAtkMod();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fpa_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncPAtkMod()
|
|
|
|
- {
|
|
|
|
- super(Stats.POWER_ATTACK, 0x30, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (env.getCharacter() instanceof L2PcInstance)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.STR.calcBonus(env.getPlayer()) * env.getPlayer().getLevelMod());
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- float level = env.getCharacter().getLevel();
|
|
|
|
- env.mulValue(BaseStats.STR.calcBonus(env.getCharacter()) * ((level + 89) / 100));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMAtkMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMAtkMod _fma_instance = new FuncMAtkMod();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fma_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMAtkMod()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAGIC_ATTACK, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (env.getCharacter() instanceof L2PcInstance)
|
|
|
|
- {
|
|
|
|
- double intb = BaseStats.INT.calcBonus(env.getPlayer());
|
|
|
|
- double lvlb = env.getPlayer().getLevelMod();
|
|
|
|
- env.mulValue((lvlb * lvlb) * (intb * intb));
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- float level = env.getCharacter().getLevel();
|
|
|
|
- double intb = BaseStats.INT.calcBonus(env.getCharacter());
|
|
|
|
- float lvlb = ((level + 89) / 100);
|
|
|
|
- env.mulValue((lvlb * lvlb) * (intb * intb));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMDefMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMDefMod _fmm_instance = new FuncMDefMod();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMDefMod()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAGIC_DEFENCE, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- float level = env.getCharacter().getLevel();
|
|
|
|
- if (env.getCharacter() instanceof L2PcInstance)
|
|
|
|
- {
|
|
|
|
- L2PcInstance p = env.getPlayer();
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(5);
|
|
|
|
- }
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(5);
|
|
|
|
- }
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(9);
|
|
|
|
- }
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(9);
|
|
|
|
- }
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(13);
|
|
|
|
- }
|
|
|
|
- env.mulValue(BaseStats.MEN.calcBonus(env.getPlayer()) * env.getPlayer().getLevelMod());
|
|
|
|
- }
|
|
|
|
- else if ((env.getCharacter() instanceof L2PetInstance) || (env.getCharacter() instanceof L2BabyPetInstance))
|
|
|
|
- {
|
|
|
|
- if (env.getCharacter().getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK) != 0)
|
|
|
|
- {
|
|
|
|
- env.subValue(13);
|
|
|
|
- env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()) * ((level + 89) / 100));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncPDefMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncPDefMod _fmm_instance = new FuncPDefMod();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncPDefMod()
|
|
|
|
- {
|
|
|
|
- super(Stats.POWER_DEFENCE, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (env.getCharacter() instanceof L2PcInstance)
|
|
|
|
- {
|
|
|
|
- L2PcInstance p = env.getPlayer();
|
|
|
|
- boolean hasMagePDef = (p.getClassId().isMage() || (p.getClassId().getId() == 0x31)); // orc mystics are a special case
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(12);
|
|
|
|
- }
|
|
|
|
- L2ItemInstance chest = p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
|
|
|
|
- if (chest != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(hasMagePDef ? 15 : 31);
|
|
|
|
- }
|
|
|
|
- if ((p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) != null) || ((chest != null) && (chest.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR)))
|
|
|
|
- {
|
|
|
|
- env.subValue(hasMagePDef ? 8 : 18);
|
|
|
|
- }
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(8);
|
|
|
|
- }
|
|
|
|
- if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) != null)
|
|
|
|
- {
|
|
|
|
- env.subValue(7);
|
|
|
|
- }
|
|
|
|
- env.mulValue(env.getPlayer().getLevelMod());
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- float level = env.getCharacter().getLevel();
|
|
|
|
- env.mulValue((level + 89) / 100);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncGatesPDefMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncGatesPDefMod _fmm_instance = new FuncGatesPDefMod();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncGatesPDefMod()
|
|
|
|
- {
|
|
|
|
- super(Stats.POWER_DEFENCE, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
|
|
|
|
- {
|
|
|
|
- env.mulValue(Config.ALT_SIEGE_DAWN_GATES_PDEF_MULT);
|
|
|
|
- }
|
|
|
|
- else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
|
|
|
|
- {
|
|
|
|
- env.mulValue(Config.ALT_SIEGE_DUSK_GATES_PDEF_MULT);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncGatesMDefMod extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncGatesMDefMod _fmm_instance = new FuncGatesMDefMod();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncGatesMDefMod()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAGIC_DEFENCE, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DAWN)
|
|
|
|
- {
|
|
|
|
- env.mulValue(Config.ALT_SIEGE_DAWN_GATES_MDEF_MULT);
|
|
|
|
- }
|
|
|
|
- else if (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) == SevenSigns.CABAL_DUSK)
|
|
|
|
- {
|
|
|
|
- env.mulValue(Config.ALT_SIEGE_DUSK_GATES_MDEF_MULT);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncBowAtkRange extends Func
|
|
|
|
- {
|
|
|
|
- private static final FuncBowAtkRange _fbar_instance = new FuncBowAtkRange();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fbar_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncBowAtkRange()
|
|
|
|
- {
|
|
|
|
- super(Stats.POWER_ATTACK_RANGE, 0x10, null);
|
|
|
|
- setCondition(new ConditionUsingItemType(L2WeaponType.BOW.mask()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (!cond.test(env))
|
|
|
|
- {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- // default is 40 and with bow should be 500
|
|
|
|
- env.addValue(460);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncCrossBowAtkRange extends Func
|
|
|
|
- {
|
|
|
|
- private static final FuncCrossBowAtkRange _fcb_instance = new FuncCrossBowAtkRange();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fcb_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncCrossBowAtkRange()
|
|
|
|
- {
|
|
|
|
- super(Stats.POWER_ATTACK_RANGE, 0x10, null);
|
|
|
|
- setCondition(new ConditionUsingItemType(L2WeaponType.CROSSBOW.mask()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- if (!cond.test(env))
|
|
|
|
- {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- // default is 40 and with crossbow should be 400
|
|
|
|
- env.addValue(360);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncAtkAccuracy extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncAtkAccuracy _faa_instance = new FuncAtkAccuracy();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _faa_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncAtkAccuracy()
|
|
|
|
- {
|
|
|
|
- super(Stats.ACCURACY_COMBAT, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- final int level = env.getCharacter().getLevel();
|
|
|
|
- if (env.getCharacter() instanceof L2PcInstance)
|
|
|
|
- {
|
|
|
|
- // [Square(DEX)]*6 + lvl + weapon hitbonus;
|
|
|
|
- env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
|
|
|
|
- if (level > 77)
|
|
|
|
- {
|
|
|
|
- env.addValue((level - 77) + 1);
|
|
|
|
- }
|
|
|
|
- if (level > 69)
|
|
|
|
- {
|
|
|
|
- env.addValue(level - 69);
|
|
|
|
- // if (env.player instanceof L2Summon)
|
|
|
|
- // env.value += (level < 60) ? 4 : 5;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
|
|
|
|
- if (level > 77)
|
|
|
|
- {
|
|
|
|
- env.addValue(level - 76);
|
|
|
|
- }
|
|
|
|
- if (level > 69)
|
|
|
|
- {
|
|
|
|
- env.addValue(level - 69);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncAtkEvasion extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncAtkEvasion _fae_instance = new FuncAtkEvasion();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fae_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncAtkEvasion()
|
|
|
|
- {
|
|
|
|
- super(Stats.EVASION_RATE, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- final int level = env.getCharacter().getLevel();
|
|
|
|
- if (env.getCharacter() instanceof L2PcInstance)
|
|
|
|
- {
|
|
|
|
- // [Square(DEX)]*6 + lvl;
|
|
|
|
- env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
|
|
|
|
- if (level > 77)
|
|
|
|
- {
|
|
|
|
- env.addValue(level - 77);
|
|
|
|
- }
|
|
|
|
- if (level > 69)
|
|
|
|
- {
|
|
|
|
- env.addValue(level - 69);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- // [Square(DEX)]*6 + lvl;
|
|
|
|
- env.addValue((Math.sqrt(env.getCharacter().getDEX()) * 6) + level);
|
|
|
|
- if (level > 69)
|
|
|
|
- {
|
|
|
|
- env.addValue((level - 69) + 2);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncAtkCritical extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncAtkCritical _fac_instance = new FuncAtkCritical();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fac_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncAtkCritical()
|
|
|
|
- {
|
|
|
|
- super(Stats.CRITICAL_RATE, 0x09, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()) * 10);
|
|
|
|
- env.setBaseValue(env.getValue());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMAtkCritical extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMAtkCritical _fac_instance = new FuncMAtkCritical();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fac_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMAtkCritical()
|
|
|
|
- {
|
|
|
|
- super(Stats.MCRITICAL_RATE, 0x30, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2Character p = env.getCharacter();
|
|
|
|
- if (p instanceof L2Summon)
|
|
|
|
- {
|
|
|
|
- env.setValue(8); // TODO: needs retail value
|
|
|
|
- }
|
|
|
|
- else if ((p instanceof L2PcInstance) && (p.getActiveWeaponInstance() != null))
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.WIT.calcBonus(p));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMoveSpeed extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMoveSpeed _fms_instance = new FuncMoveSpeed();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fms_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMoveSpeed()
|
|
|
|
- {
|
|
|
|
- super(Stats.RUN_SPEED, 0x30, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncPAtkSpeed extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncPAtkSpeed _fas_instance = new FuncPAtkSpeed();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fas_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncPAtkSpeed()
|
|
|
|
- {
|
|
|
|
- super(Stats.POWER_ATTACK_SPEED, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.DEX.calcBonus(env.getCharacter()));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMAtkSpeed extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMAtkSpeed _fas_instance = new FuncMAtkSpeed();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fas_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMAtkSpeed()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAGIC_ATTACK_SPEED, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.WIT.calcBonus(env.getCharacter()));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncHennaSTR extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncHennaSTR _fh_instance = new FuncHennaSTR();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fh_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncHennaSTR()
|
|
|
|
- {
|
|
|
|
- super(Stats.STAT_STR, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcInstance pc = env.getPlayer();
|
|
|
|
- if (pc != null)
|
|
|
|
- {
|
|
|
|
- env.addValue(pc.getHennaStatSTR());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncHennaDEX extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncHennaDEX _fh_instance = new FuncHennaDEX();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fh_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncHennaDEX()
|
|
|
|
- {
|
|
|
|
- super(Stats.STAT_DEX, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcInstance pc = env.getPlayer();
|
|
|
|
- if (pc != null)
|
|
|
|
- {
|
|
|
|
- env.addValue(pc.getHennaStatDEX());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncHennaINT extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncHennaINT _fh_instance = new FuncHennaINT();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fh_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncHennaINT()
|
|
|
|
- {
|
|
|
|
- super(Stats.STAT_INT, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcInstance pc = env.getPlayer();
|
|
|
|
- if (pc != null)
|
|
|
|
- {
|
|
|
|
- env.addValue(pc.getHennaStatINT());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncHennaMEN extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncHennaMEN _fh_instance = new FuncHennaMEN();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fh_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncHennaMEN()
|
|
|
|
- {
|
|
|
|
- super(Stats.STAT_MEN, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcInstance pc = env.getPlayer();
|
|
|
|
- if (pc != null)
|
|
|
|
- {
|
|
|
|
- env.addValue(pc.getHennaStatMEN());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncHennaCON extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncHennaCON _fh_instance = new FuncHennaCON();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fh_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncHennaCON()
|
|
|
|
- {
|
|
|
|
- super(Stats.STAT_CON, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcInstance pc = env.getPlayer();
|
|
|
|
- if (pc != null)
|
|
|
|
- {
|
|
|
|
- env.addValue(pc.getHennaStatCON());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncHennaWIT extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncHennaWIT _fh_instance = new FuncHennaWIT();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fh_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncHennaWIT()
|
|
|
|
- {
|
|
|
|
- super(Stats.STAT_WIT, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcInstance pc = env.getPlayer();
|
|
|
|
- if (pc != null)
|
|
|
|
- {
|
|
|
|
- env.addValue(pc.getHennaStatWIT());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMaxHpAdd extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMaxHpAdd _fmha_instance = new FuncMaxHpAdd();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmha_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMaxHpAdd()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAX_HP, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
|
|
|
|
- int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
|
|
|
|
- double hpmod = t.getLvlHpMod() * lvl;
|
|
|
|
- double hpmax = (t.getLvlHpAdd() + hpmod) * lvl;
|
|
|
|
- double hpmin = (t.getLvlHpAdd() * lvl) + hpmod;
|
|
|
|
- env.addValue((hpmax + hpmin) / 2);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMaxHpMul extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMaxHpMul _fmhm_instance = new FuncMaxHpMul();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmhm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMaxHpMul()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAX_HP, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.CON.calcBonus(env.getCharacter()));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMaxCpAdd extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMaxCpAdd _fmca_instance = new FuncMaxCpAdd();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmca_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMaxCpAdd()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAX_CP, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
|
|
|
|
- int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
|
|
|
|
- double cpmod = t.getLvlCpMod() * lvl;
|
|
|
|
- double cpmax = (t.getLvlCpAdd() + cpmod) * lvl;
|
|
|
|
- double cpmin = (t.getLvlCpAdd() * lvl) + cpmod;
|
|
|
|
- env.addValue((cpmax + cpmin) / 2);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMaxCpMul extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMaxCpMul _fmcm_instance = new FuncMaxCpMul();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmcm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMaxCpMul()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAX_CP, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.CON.calcBonus(env.getCharacter()));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMaxMpAdd extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMaxMpAdd _fmma_instance = new FuncMaxMpAdd();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmma_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMaxMpAdd()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAX_MP, 0x10, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- L2PcTemplate t = (L2PcTemplate) env.getCharacter().getTemplate();
|
|
|
|
- int lvl = env.getCharacter().getLevel() - t.getClassBaseLevel();
|
|
|
|
- double mpmod = t.getLvlMpMod() * lvl;
|
|
|
|
- double mpmax = (t.getLvlMpAdd() + mpmod) * lvl;
|
|
|
|
- double mpmin = (t.getLvlMpAdd() * lvl) + mpmod;
|
|
|
|
- env.addValue((mpmax + mpmin) / 2);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static class FuncMaxMpMul extends Func
|
|
|
|
- {
|
|
|
|
- static final FuncMaxMpMul _fmmm_instance = new FuncMaxMpMul();
|
|
|
|
-
|
|
|
|
- static Func getInstance()
|
|
|
|
- {
|
|
|
|
- return _fmmm_instance;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private FuncMaxMpMul()
|
|
|
|
- {
|
|
|
|
- super(Stats.MAX_MP, 0x20, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void calc(Env env)
|
|
|
|
- {
|
|
|
|
- env.mulValue(BaseStats.MEN.calcBonus(env.getCharacter()));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Return the period between 2 regeneration task (3s for L2Character, 5 min for L2DoorInstance).
|
|
* Return the period between 2 regeneration task (3s for L2Character, 5 min for L2DoorInstance).
|
|
* @param cha
|
|
* @param cha
|
|
@@ -1098,12 +236,19 @@ public final class Formulas
|
|
cha.addStatFunc(FuncMAtkSpeed.getInstance());
|
|
cha.addStatFunc(FuncMAtkSpeed.getInstance());
|
|
cha.addStatFunc(FuncMoveSpeed.getInstance());
|
|
cha.addStatFunc(FuncMoveSpeed.getInstance());
|
|
|
|
|
|
- cha.addStatFunc(FuncHennaSTR.getInstance());
|
|
|
|
- cha.addStatFunc(FuncHennaDEX.getInstance());
|
|
|
|
- cha.addStatFunc(FuncHennaINT.getInstance());
|
|
|
|
- cha.addStatFunc(FuncHennaMEN.getInstance());
|
|
|
|
- cha.addStatFunc(FuncHennaCON.getInstance());
|
|
|
|
- cha.addStatFunc(FuncHennaWIT.getInstance());
|
|
|
|
|
|
+ cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_STR));
|
|
|
|
+ cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_DEX));
|
|
|
|
+ cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_INT));
|
|
|
|
+ cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_MEN));
|
|
|
|
+ cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_CON));
|
|
|
|
+ cha.addStatFunc(FuncHenna.getInstance(Stats.STAT_WIT));
|
|
|
|
+
|
|
|
|
+ cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_STR));
|
|
|
|
+ cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_DEX));
|
|
|
|
+ cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_INT));
|
|
|
|
+ cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_MEN));
|
|
|
|
+ cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_CON));
|
|
|
|
+ cha.addStatFunc(FuncArmorSet.getInstance(Stats.STAT_WIT));
|
|
}
|
|
}
|
|
else if (cha instanceof L2PetInstance)
|
|
else if (cha instanceof L2PetInstance)
|
|
{
|
|
{
|