Enchant bonus data rework.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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 com.l2jmobius.gameserver.model.stats.functions;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
public class FuncEnchantAccEvas extends AbstractFunction
|
||||
{
|
||||
private static final double blessedBonus = 1.5;
|
||||
|
||||
public FuncEnchantAccEvas(Stats stat, int order, Object owner, double value, Condition applayCond)
|
||||
{
|
||||
super(stat, order, owner, value, applayCond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
|
||||
{
|
||||
double value = initVal;
|
||||
if ((getApplayCond() != null) && !getApplayCond().test(effector, effected, skill))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
final L2ItemInstance item = (L2ItemInstance) getFuncOwner();
|
||||
if (item.getEnchantLevel() > 3)
|
||||
{
|
||||
// Increases Phys.Evasion / Mag. Evasion for helmets
|
||||
// Increases Phys.Accuracy / Mag.Accuracy for gloves
|
||||
if (item.getEnchantLevel() == 4)
|
||||
{
|
||||
value += (0.2 * blessedBonus);
|
||||
}
|
||||
else
|
||||
{
|
||||
value += (0.2 * blessedBonus * ((item.getEnchantLevel() * 2) - 9));
|
||||
}
|
||||
}
|
||||
return initVal;
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.model.stats.functions;
|
||||
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.EnchantItemBonusData;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
@@ -44,7 +44,7 @@ public class FuncEnchantHp extends AbstractFunction
|
||||
final L2ItemInstance item = (L2ItemInstance) getFuncOwner();
|
||||
if (item.getEnchantLevel() > 0)
|
||||
{
|
||||
return initVal + EnchantItemHPBonusData.getInstance().getHPBonus(item);
|
||||
return initVal + EnchantItemBonusData.getInstance().getHPBonus(item);
|
||||
}
|
||||
return initVal;
|
||||
}
|
||||
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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 com.l2jmobius.gameserver.model.stats.functions;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
public class FuncEnchantMAtk extends AbstractFunction
|
||||
{
|
||||
private static final double blessedBonus = 1.5;
|
||||
|
||||
public FuncEnchantMAtk(Stats stat, int order, Object owner, double value, Condition applayCond)
|
||||
{
|
||||
super(stat, order, owner, value, applayCond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
|
||||
{
|
||||
double value = initVal;
|
||||
if ((getApplayCond() != null) && !getApplayCond().test(effector, effected, skill))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
final L2ItemInstance item = (L2ItemInstance) getFuncOwner();
|
||||
if (item.getEnchantLevel() > 3)
|
||||
{
|
||||
// Increases Mag. Atk for chest
|
||||
if (item.getEnchantLevel() == 4)
|
||||
{
|
||||
value += (1.4 * blessedBonus);
|
||||
}
|
||||
else
|
||||
{
|
||||
value += (1.4 * blessedBonus * ((item.getEnchantLevel() * 2) - 9));
|
||||
}
|
||||
}
|
||||
return initVal;
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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 com.l2jmobius.gameserver.model.stats.functions;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
public class FuncEnchantPAtk extends AbstractFunction
|
||||
{
|
||||
private static final double blessedBonus = 1.5;
|
||||
|
||||
public FuncEnchantPAtk(Stats stat, int order, Object owner, double value, Condition applayCond)
|
||||
{
|
||||
super(stat, order, owner, value, applayCond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
|
||||
{
|
||||
double value = initVal;
|
||||
if ((getApplayCond() != null) && !getApplayCond().test(effector, effected, skill))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
final L2ItemInstance item = (L2ItemInstance) getFuncOwner();
|
||||
if (item.getEnchantLevel() > 3)
|
||||
{
|
||||
// Increases Phys.Atk for chest
|
||||
if (item.getEnchantLevel() == 4)
|
||||
{
|
||||
value += (2 * blessedBonus);
|
||||
}
|
||||
else
|
||||
{
|
||||
value += (2 * blessedBonus * ((item.getEnchantLevel() * 2) - 9));
|
||||
}
|
||||
}
|
||||
return initVal;
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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 com.l2jmobius.gameserver.model.stats.functions;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
public class FuncEnchantPMCritRate extends AbstractFunction
|
||||
{
|
||||
private static final double blessedBonus = 1.5;
|
||||
|
||||
public FuncEnchantPMCritRate(Stats stat, int order, Object owner, double value, Condition applayCond)
|
||||
{
|
||||
super(stat, order, owner, value, applayCond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
|
||||
{
|
||||
double value = initVal;
|
||||
if ((getApplayCond() != null) && !getApplayCond().test(effector, effected, skill))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
final L2ItemInstance item = (L2ItemInstance) getFuncOwner();
|
||||
if (item.getEnchantLevel() > 3)
|
||||
{
|
||||
// Increases P. Critical Rate / magic damage for legs
|
||||
if (item.getEnchantLevel() == 4)
|
||||
{
|
||||
value += (0.34 * blessedBonus);
|
||||
}
|
||||
else
|
||||
{
|
||||
value += (0.34 * blessedBonus * ((item.getEnchantLevel() * 2) - 9));
|
||||
}
|
||||
}
|
||||
return initVal;
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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 com.l2jmobius.gameserver.model.stats.functions;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
public abstract class FuncEnchantRunSpd extends AbstractFunction
|
||||
{
|
||||
private static final double blessedBonus = 1.5;
|
||||
|
||||
public FuncEnchantRunSpd(Stats stat, int order, Object owner, double value, Condition applayCond)
|
||||
{
|
||||
super(stat, order, owner, value, applayCond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double calc(L2Character effector, L2Character effected, Skill skill, double initVal)
|
||||
{
|
||||
double value = initVal;
|
||||
if ((getApplayCond() != null) && !getApplayCond().test(effector, effected, skill))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
final L2ItemInstance item = (L2ItemInstance) getFuncOwner();
|
||||
if (item.getEnchantLevel() > 3)
|
||||
{
|
||||
// Increases speed for feets
|
||||
if (item.getEnchantLevel() == 4)
|
||||
{
|
||||
value += (0.6 * blessedBonus);
|
||||
}
|
||||
else
|
||||
{
|
||||
value += (0.6 * blessedBonus * ((item.getEnchantLevel() * 2) - 9));
|
||||
}
|
||||
}
|
||||
return initVal;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user