Addition of WorldChat and DamageByAttack effect handlers.
Adapted from: L2jUnity free files.
This commit is contained in:
+2
@@ -99,6 +99,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
||||||
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("DamageByAttack", DamageByAttack::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
||||||
@@ -361,6 +362,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("WorldChatPoints", WorldChatPoints::new);
|
||||||
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
-5
@@ -333,7 +333,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": has " + targetPlayer.getWorldChatPoints() + " world chat points");
|
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "set":
|
case "set":
|
||||||
@@ -354,19 +354,19 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String valueToken = st.nextToken();
|
final String valueToken = st.nextToken();
|
||||||
if (!Util.isDigit(valueToken))
|
if (!Util.isDigit(valueToken))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": points changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
||||||
targetPlayer.setWorldChatPoints(Integer.parseInt(valueToken));
|
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
|
||||||
if (Config.ENABLE_WORLD_CHAT)
|
if (Config.ENABLE_WORLD_CHAT)
|
||||||
{
|
{
|
||||||
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (activeChar.getWorldChatPoints() < 1)
|
else if (activeChar.getWorldChatUsed() >= activeChar.getWorldChatPoints())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.setWorldChatPoints(activeChar.getWorldChatPoints() - 1);
|
activeChar.setWorldChatUsed(activeChar.getWorldChatUsed() + 1);
|
||||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||||
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backstab effect implementation.
|
* Backstab effect implementation.
|
||||||
@@ -89,12 +88,6 @@ public final class Backstab extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
||||||
|
|||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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 com.l2jmobius.gameserver.enums.DamageByAttackType;
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An effect that changes damage taken from an attack.<br>
|
||||||
|
* The retail implementation seems to be altering whatever damage is taken after the attack has been done and not when attack is being done. <br>
|
||||||
|
* Exceptions for this effect appears to be DOT effects and terrain damage, they are unaffected by this stat.<br>
|
||||||
|
* As for example in retail this effect does reduce reflected damage taken (because it is received damage), as well as it does not decrease reflected damage done,<br>
|
||||||
|
* because reflected damage is being calculated with the original attack damage and not this altered one.<br>
|
||||||
|
* Multiple values of this effect add-up to each other rather than multiplying with each other. Be careful, there were cases in retail where damage is deacreased to 0.
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class DamageByAttack extends AbstractEffect
|
||||||
|
{
|
||||||
|
private final double _value;
|
||||||
|
private final DamageByAttackType _type;
|
||||||
|
|
||||||
|
public DamageByAttack(StatsSet params)
|
||||||
|
{
|
||||||
|
_value = params.getDouble("amount");
|
||||||
|
_type = params.getEnum("type", DamageByAttackType.class, DamageByAttackType.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pump(L2Character target, Skill skill)
|
||||||
|
{
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case PK:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVP_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ENEMY_ALL:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVE_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
-5
@@ -165,11 +165,6 @@ public final class EnergyAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|||||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatal Blow effect implementation.
|
* Fatal Blow effect implementation.
|
||||||
@@ -121,12 +120,6 @@ public final class FatalBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
+1
-5
@@ -174,11 +174,7 @@ public final class PhysicalAttack extends AbstractEffect
|
|||||||
|
|
||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -137,11 +137,6 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
|||||||
// Check if damage should be reflected.
|
// Check if damage should be reflected.
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-6
@@ -147,12 +147,6 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
||||||
|
|
||||||
if ((effected.getCurrentHp() - damage) < minHp)
|
if ((effected.getCurrentHp() - damage) < minHp)
|
||||||
|
|||||||
L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java
Vendored
-5
@@ -168,11 +168,6 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -162,11 +162,6 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Soul Blow effect implementation.
|
* Soul Blow effect implementation.
|
||||||
@@ -94,12 +93,6 @@ public final class SoulBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
+31
@@ -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 com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class WorldChatPoints extends AbstractStatEffect
|
||||||
|
{
|
||||||
|
public WorldChatPoints(StatsSet params)
|
||||||
|
{
|
||||||
|
super(params, Stats.WORLD_CHAT_POINTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,6 +68,7 @@ CriticalRatePositionBonus: Critical Rate depending on position stat. Ignores the
|
|||||||
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
|
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
|
||||||
CubicMastery: Max cubics stat.
|
CubicMastery: Max cubics stat.
|
||||||
DamageBlock: Blocks Hp or Mp damage/heal.
|
DamageBlock: Blocks Hp or Mp damage/heal.
|
||||||
|
DamageByAttack: An effect that changes damage taken from an attack.
|
||||||
DamageShield: Reflect damage percentage stat.
|
DamageShield: Reflect damage percentage stat.
|
||||||
DamageShieldResist: Reflect damage percentage resist.
|
DamageShieldResist: Reflect damage percentage resist.
|
||||||
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
||||||
@@ -328,3 +329,4 @@ VitalityPointsRate: Vitality points consume rate.
|
|||||||
VitalityPointUp: Increases vitality points.
|
VitalityPointUp: Increases vitality points.
|
||||||
WeightLimit: Maximum weight stat.
|
WeightLimit: Maximum weight stat.
|
||||||
WeightPenalty: Weight penalty level stat.
|
WeightPenalty: Weight penalty level stat.
|
||||||
|
WorldChatPoints: Modify world chat points to use per day.
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
public enum DamageByAttackType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
PK, // Players and summons.
|
||||||
|
MOB, // Regular monsters.
|
||||||
|
BOSS, // Boss monsters
|
||||||
|
ENEMY_ALL; // All NPCs
|
||||||
|
}
|
||||||
+3
-3
@@ -156,7 +156,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.getVariables().set(PlayerVariables.EXTEND_DROP, "");
|
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, Config.WORLD_CHAT_POINTS_PER_DAY);
|
ps.setInt(1, 0);
|
||||||
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.setWorldChatPoints(Config.WORLD_CHAT_POINTS_PER_DAY);
|
player.setWorldChatUsed(0);
|
||||||
player.sendPacket(new ExWorldChatCnt(player));
|
player.sendPacket(new ExWorldChatCnt(player));
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4552,6 +4552,25 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final double damageCap = getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||||
|
if (damageCap > 0)
|
||||||
|
{
|
||||||
|
value = Math.min(value, damageCap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate PvP/PvE damage received. It is a post-attack stat.
|
||||||
|
if (attacker != null)
|
||||||
|
{
|
||||||
|
if (attacker.isPlayable())
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVP_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVE_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
||||||
{
|
{
|
||||||
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||||
|
|||||||
+12
-4
@@ -13450,16 +13450,24 @@ public final class L2PcInstance extends L2Playable
|
|||||||
*/
|
*/
|
||||||
public int getWorldChatPoints()
|
public int getWorldChatPoints()
|
||||||
{
|
{
|
||||||
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 1);
|
return (int) getStat().getValue(Stats.WORLD_CHAT_POINTS, Config.WORLD_CHAT_POINTS_PER_DAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The amount of times player has used world chat
|
||||||
|
*/
|
||||||
|
public int getWorldChatUsed()
|
||||||
|
{
|
||||||
|
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the amount of times player can use world chat
|
* Sets the amount of times player can use world chat
|
||||||
* @param points
|
* @param timesUsed how many times world chat has been used up until now.
|
||||||
*/
|
*/
|
||||||
public void setWorldChatPoints(int points)
|
public void setWorldChatUsed(int timesUsed)
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, points);
|
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, timesUsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prohibiteCeremonyOfChaos()
|
public void prohibiteCeremonyOfChaos()
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ public enum Stats
|
|||||||
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
||||||
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
||||||
|
|
||||||
|
// FIXED BONUS
|
||||||
|
PVP_DAMAGE_TAKEN("pvpDamageTaken"),
|
||||||
|
PVE_DAMAGE_TAKEN("pveDamageTaken"),
|
||||||
|
|
||||||
// ATTACK & DEFENCE RATES
|
// ATTACK & DEFENCE RATES
|
||||||
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
||||||
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
||||||
@@ -268,6 +272,7 @@ public enum Stats
|
|||||||
STAT_BONUS_SKILL_CRITICAL("statSkillCritical"),
|
STAT_BONUS_SKILL_CRITICAL("statSkillCritical"),
|
||||||
STAT_BONUS_SPEED("statSpeed"),
|
STAT_BONUS_SPEED("statSpeed"),
|
||||||
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
||||||
|
WORLD_CHAT_POINTS("worldChatPoints"),
|
||||||
ATTACK_DAMAGE("attackDamage");
|
ATTACK_DAMAGE("attackDamage");
|
||||||
|
|
||||||
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
|
|
||||||
// Public variable names
|
// Public variable names
|
||||||
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
||||||
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_POINTS";
|
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
|
||||||
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
||||||
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
||||||
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public class ExWorldChatCnt implements IClientOutgoingPacket
|
|||||||
|
|
||||||
public ExWorldChatCnt(L2PcInstance activeChar)
|
public ExWorldChatCnt(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : activeChar.getWorldChatPoints();
|
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : Math.max(activeChar.getWorldChatPoints() - activeChar.getWorldChatUsed(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -99,6 +99,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
||||||
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("DamageByAttack", DamageByAttack::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
||||||
@@ -361,6 +362,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("WorldChatPoints", WorldChatPoints::new);
|
||||||
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
-5
@@ -333,7 +333,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": has " + targetPlayer.getWorldChatPoints() + " world chat points");
|
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "set":
|
case "set":
|
||||||
@@ -354,19 +354,19 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String valueToken = st.nextToken();
|
final String valueToken = st.nextToken();
|
||||||
if (!Util.isDigit(valueToken))
|
if (!Util.isDigit(valueToken))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": points changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
||||||
targetPlayer.setWorldChatPoints(Integer.parseInt(valueToken));
|
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
|
||||||
if (Config.ENABLE_WORLD_CHAT)
|
if (Config.ENABLE_WORLD_CHAT)
|
||||||
{
|
{
|
||||||
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (activeChar.getWorldChatPoints() < 1)
|
else if (activeChar.getWorldChatUsed() >= activeChar.getWorldChatPoints())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.setWorldChatPoints(activeChar.getWorldChatPoints() - 1);
|
activeChar.setWorldChatUsed(activeChar.getWorldChatUsed() + 1);
|
||||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||||
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backstab effect implementation.
|
* Backstab effect implementation.
|
||||||
@@ -89,12 +88,6 @@ public final class Backstab extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
||||||
|
|||||||
Vendored
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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 com.l2jmobius.gameserver.enums.DamageByAttackType;
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An effect that changes damage taken from an attack.<br>
|
||||||
|
* The retail implementation seems to be altering whatever damage is taken after the attack has been done and not when attack is being done. <br>
|
||||||
|
* Exceptions for this effect appears to be DOT effects and terrain damage, they are unaffected by this stat.<br>
|
||||||
|
* As for example in retail this effect does reduce reflected damage taken (because it is received damage), as well as it does not decrease reflected damage done,<br>
|
||||||
|
* because reflected damage is being calculated with the original attack damage and not this altered one.<br>
|
||||||
|
* Multiple values of this effect add-up to each other rather than multiplying with each other. Be careful, there were cases in retail where damage is deacreased to 0.
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class DamageByAttack extends AbstractEffect
|
||||||
|
{
|
||||||
|
private final double _value;
|
||||||
|
private final DamageByAttackType _type;
|
||||||
|
|
||||||
|
public DamageByAttack(StatsSet params)
|
||||||
|
{
|
||||||
|
_value = params.getDouble("amount");
|
||||||
|
_type = params.getEnum("type", DamageByAttackType.class, DamageByAttackType.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pump(L2Character target, Skill skill)
|
||||||
|
{
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case PK:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVP_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ENEMY_ALL:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVE_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
-5
@@ -165,11 +165,6 @@ public final class EnergyAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|||||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatal Blow effect implementation.
|
* Fatal Blow effect implementation.
|
||||||
@@ -121,12 +120,6 @@ public final class FatalBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
Vendored
+1
-5
@@ -174,11 +174,7 @@ public final class PhysicalAttack extends AbstractEffect
|
|||||||
|
|
||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -137,11 +137,6 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
|||||||
// Check if damage should be reflected.
|
// Check if damage should be reflected.
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-6
@@ -147,12 +147,6 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
||||||
|
|
||||||
if ((effected.getCurrentHp() - damage) < minHp)
|
if ((effected.getCurrentHp() - damage) < minHp)
|
||||||
|
|||||||
-5
@@ -168,11 +168,6 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -162,11 +162,6 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Soul Blow effect implementation.
|
* Soul Blow effect implementation.
|
||||||
@@ -94,12 +93,6 @@ public final class SoulBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
Vendored
+31
@@ -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 com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class WorldChatPoints extends AbstractStatEffect
|
||||||
|
{
|
||||||
|
public WorldChatPoints(StatsSet params)
|
||||||
|
{
|
||||||
|
super(params, Stats.WORLD_CHAT_POINTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,6 +68,7 @@ CriticalRatePositionBonus: Critical Rate depending on position stat. Ignores the
|
|||||||
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
|
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
|
||||||
CubicMastery: Max cubics stat.
|
CubicMastery: Max cubics stat.
|
||||||
DamageBlock: Blocks Hp or Mp damage/heal.
|
DamageBlock: Blocks Hp or Mp damage/heal.
|
||||||
|
DamageByAttack: An effect that changes damage taken from an attack.
|
||||||
DamageShield: Reflect damage percentage stat.
|
DamageShield: Reflect damage percentage stat.
|
||||||
DamageShieldResist: Reflect damage percentage resist.
|
DamageShieldResist: Reflect damage percentage resist.
|
||||||
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
||||||
@@ -328,3 +329,4 @@ VitalityPointsRate: Vitality points consume rate.
|
|||||||
VitalityPointUp: Increases vitality points.
|
VitalityPointUp: Increases vitality points.
|
||||||
WeightLimit: Maximum weight stat.
|
WeightLimit: Maximum weight stat.
|
||||||
WeightPenalty: Weight penalty level stat.
|
WeightPenalty: Weight penalty level stat.
|
||||||
|
WorldChatPoints: Modify world chat points to use per day.
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
public enum DamageByAttackType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
PK, // Players and summons.
|
||||||
|
MOB, // Regular monsters.
|
||||||
|
BOSS, // Boss monsters
|
||||||
|
ENEMY_ALL; // All NPCs
|
||||||
|
}
|
||||||
+3
-3
@@ -159,7 +159,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.getVariables().set(PlayerVariables.EXTEND_DROP, "");
|
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, Config.WORLD_CHAT_POINTS_PER_DAY);
|
ps.setInt(1, 0);
|
||||||
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.setWorldChatPoints(Config.WORLD_CHAT_POINTS_PER_DAY);
|
player.setWorldChatUsed(0);
|
||||||
player.sendPacket(new ExWorldChatCnt(player));
|
player.sendPacket(new ExWorldChatCnt(player));
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4552,6 +4552,25 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final double damageCap = getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||||
|
if (damageCap > 0)
|
||||||
|
{
|
||||||
|
value = Math.min(value, damageCap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate PvP/PvE damage received. It is a post-attack stat.
|
||||||
|
if (attacker != null)
|
||||||
|
{
|
||||||
|
if (attacker.isPlayable())
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVP_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVE_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
||||||
{
|
{
|
||||||
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||||
|
|||||||
+12
-4
@@ -13451,16 +13451,24 @@ public final class L2PcInstance extends L2Playable
|
|||||||
*/
|
*/
|
||||||
public int getWorldChatPoints()
|
public int getWorldChatPoints()
|
||||||
{
|
{
|
||||||
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 1);
|
return (int) getStat().getValue(Stats.WORLD_CHAT_POINTS, Config.WORLD_CHAT_POINTS_PER_DAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The amount of times player has used world chat
|
||||||
|
*/
|
||||||
|
public int getWorldChatUsed()
|
||||||
|
{
|
||||||
|
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the amount of times player can use world chat
|
* Sets the amount of times player can use world chat
|
||||||
* @param points
|
* @param timesUsed how many times world chat has been used up until now.
|
||||||
*/
|
*/
|
||||||
public void setWorldChatPoints(int points)
|
public void setWorldChatUsed(int timesUsed)
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, points);
|
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, timesUsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prohibiteCeremonyOfChaos()
|
public void prohibiteCeremonyOfChaos()
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ public enum Stats
|
|||||||
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
||||||
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
||||||
|
|
||||||
|
// FIXED BONUS
|
||||||
|
PVP_DAMAGE_TAKEN("pvpDamageTaken"),
|
||||||
|
PVE_DAMAGE_TAKEN("pveDamageTaken"),
|
||||||
|
|
||||||
// ATTACK & DEFENCE RATES
|
// ATTACK & DEFENCE RATES
|
||||||
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
||||||
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
||||||
@@ -268,6 +272,7 @@ public enum Stats
|
|||||||
STAT_BONUS_SKILL_CRITICAL("statSkillCritical"),
|
STAT_BONUS_SKILL_CRITICAL("statSkillCritical"),
|
||||||
STAT_BONUS_SPEED("statSpeed"),
|
STAT_BONUS_SPEED("statSpeed"),
|
||||||
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
||||||
|
WORLD_CHAT_POINTS("worldChatPoints"),
|
||||||
ATTACK_DAMAGE("attackDamage");
|
ATTACK_DAMAGE("attackDamage");
|
||||||
|
|
||||||
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
|
|
||||||
// Public variable names
|
// Public variable names
|
||||||
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
||||||
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_POINTS";
|
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
|
||||||
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
||||||
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
||||||
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public class ExWorldChatCnt implements IClientOutgoingPacket
|
|||||||
|
|
||||||
public ExWorldChatCnt(L2PcInstance activeChar)
|
public ExWorldChatCnt(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : activeChar.getWorldChatPoints();
|
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : Math.max(activeChar.getWorldChatPoints() - activeChar.getWorldChatUsed(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -99,6 +99,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
||||||
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("DamageByAttack", DamageByAttack::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
||||||
@@ -361,6 +362,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("WorldChatPoints", WorldChatPoints::new);
|
||||||
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -333,7 +333,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": has " + targetPlayer.getWorldChatPoints() + " world chat points");
|
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "set":
|
case "set":
|
||||||
@@ -354,19 +354,19 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String valueToken = st.nextToken();
|
final String valueToken = st.nextToken();
|
||||||
if (!Util.isDigit(valueToken))
|
if (!Util.isDigit(valueToken))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": points changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
||||||
targetPlayer.setWorldChatPoints(Integer.parseInt(valueToken));
|
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
|
||||||
if (Config.ENABLE_WORLD_CHAT)
|
if (Config.ENABLE_WORLD_CHAT)
|
||||||
{
|
{
|
||||||
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (activeChar.getWorldChatPoints() < 1)
|
else if (activeChar.getWorldChatUsed() >= activeChar.getWorldChatPoints())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.setWorldChatPoints(activeChar.getWorldChatPoints() - 1);
|
activeChar.setWorldChatUsed(activeChar.getWorldChatUsed() + 1);
|
||||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||||
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backstab effect implementation.
|
* Backstab effect implementation.
|
||||||
@@ -89,12 +88,6 @@ public final class Backstab extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
||||||
|
|||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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 com.l2jmobius.gameserver.enums.DamageByAttackType;
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An effect that changes damage taken from an attack.<br>
|
||||||
|
* The retail implementation seems to be altering whatever damage is taken after the attack has been done and not when attack is being done. <br>
|
||||||
|
* Exceptions for this effect appears to be DOT effects and terrain damage, they are unaffected by this stat.<br>
|
||||||
|
* As for example in retail this effect does reduce reflected damage taken (because it is received damage), as well as it does not decrease reflected damage done,<br>
|
||||||
|
* because reflected damage is being calculated with the original attack damage and not this altered one.<br>
|
||||||
|
* Multiple values of this effect add-up to each other rather than multiplying with each other. Be careful, there were cases in retail where damage is deacreased to 0.
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class DamageByAttack extends AbstractEffect
|
||||||
|
{
|
||||||
|
private final double _value;
|
||||||
|
private final DamageByAttackType _type;
|
||||||
|
|
||||||
|
public DamageByAttack(StatsSet params)
|
||||||
|
{
|
||||||
|
_value = params.getDouble("amount");
|
||||||
|
_type = params.getEnum("type", DamageByAttackType.class, DamageByAttackType.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pump(L2Character target, Skill skill)
|
||||||
|
{
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case PK:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVP_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ENEMY_ALL:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVE_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
-5
@@ -165,11 +165,6 @@ public final class EnergyAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|||||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatal Blow effect implementation.
|
* Fatal Blow effect implementation.
|
||||||
@@ -121,12 +120,6 @@ public final class FatalBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
+1
-5
@@ -174,11 +174,7 @@ public final class PhysicalAttack extends AbstractEffect
|
|||||||
|
|
||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -137,11 +137,6 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
|||||||
// Check if damage should be reflected.
|
// Check if damage should be reflected.
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-6
@@ -147,12 +147,6 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
||||||
|
|
||||||
if ((effected.getCurrentHp() - damage) < minHp)
|
if ((effected.getCurrentHp() - damage) < minHp)
|
||||||
|
|||||||
Vendored
-5
@@ -168,11 +168,6 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -162,11 +162,6 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Soul Blow effect implementation.
|
* Soul Blow effect implementation.
|
||||||
@@ -94,12 +93,6 @@ public final class SoulBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
+31
@@ -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 com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class WorldChatPoints extends AbstractStatEffect
|
||||||
|
{
|
||||||
|
public WorldChatPoints(StatsSet params)
|
||||||
|
{
|
||||||
|
super(params, Stats.WORLD_CHAT_POINTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,6 +68,7 @@ CriticalRatePositionBonus: Critical Rate depending on position stat. Ignores the
|
|||||||
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
|
CrystalGradeModify: Sets your Expertise Grade level. With this effect you can make lv. 40 player (C Grade) to wear S grade.
|
||||||
CubicMastery: Max cubics stat.
|
CubicMastery: Max cubics stat.
|
||||||
DamageBlock: Blocks Hp or Mp damage/heal.
|
DamageBlock: Blocks Hp or Mp damage/heal.
|
||||||
|
DamageByAttack: An effect that changes damage taken from an attack.
|
||||||
DamageShield: Reflect damage percentage stat.
|
DamageShield: Reflect damage percentage stat.
|
||||||
DamageShieldResist: Reflect damage percentage resist.
|
DamageShieldResist: Reflect damage percentage resist.
|
||||||
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
||||||
@@ -328,3 +329,4 @@ VitalityPointsRate: Vitality points consume rate.
|
|||||||
VitalityPointUp: Increases vitality points.
|
VitalityPointUp: Increases vitality points.
|
||||||
WeightLimit: Maximum weight stat.
|
WeightLimit: Maximum weight stat.
|
||||||
WeightPenalty: Weight penalty level stat.
|
WeightPenalty: Weight penalty level stat.
|
||||||
|
WorldChatPoints: Modify world chat points to use per day.
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
public enum DamageByAttackType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
PK, // Players and summons.
|
||||||
|
MOB, // Regular monsters.
|
||||||
|
BOSS, // Boss monsters
|
||||||
|
ENEMY_ALL; // All NPCs
|
||||||
|
}
|
||||||
+3
-3
@@ -159,7 +159,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.getVariables().set(PlayerVariables.EXTEND_DROP, "");
|
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, Config.WORLD_CHAT_POINTS_PER_DAY);
|
ps.setInt(1, 0);
|
||||||
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.setWorldChatPoints(Config.WORLD_CHAT_POINTS_PER_DAY);
|
player.setWorldChatUsed(0);
|
||||||
player.sendPacket(new ExWorldChatCnt(player));
|
player.sendPacket(new ExWorldChatCnt(player));
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4552,6 +4552,25 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final double damageCap = getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||||
|
if (damageCap > 0)
|
||||||
|
{
|
||||||
|
value = Math.min(value, damageCap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate PvP/PvE damage received. It is a post-attack stat.
|
||||||
|
if (attacker != null)
|
||||||
|
{
|
||||||
|
if (attacker.isPlayable())
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVP_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVE_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
||||||
{
|
{
|
||||||
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||||
|
|||||||
+12
-4
@@ -13462,16 +13462,24 @@ public final class L2PcInstance extends L2Playable
|
|||||||
*/
|
*/
|
||||||
public int getWorldChatPoints()
|
public int getWorldChatPoints()
|
||||||
{
|
{
|
||||||
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 1);
|
return (int) getStat().getValue(Stats.WORLD_CHAT_POINTS, Config.WORLD_CHAT_POINTS_PER_DAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The amount of times player has used world chat
|
||||||
|
*/
|
||||||
|
public int getWorldChatUsed()
|
||||||
|
{
|
||||||
|
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the amount of times player can use world chat
|
* Sets the amount of times player can use world chat
|
||||||
* @param points
|
* @param timesUsed how many times world chat has been used up until now.
|
||||||
*/
|
*/
|
||||||
public void setWorldChatPoints(int points)
|
public void setWorldChatUsed(int timesUsed)
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, points);
|
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, timesUsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prohibiteCeremonyOfChaos()
|
public void prohibiteCeremonyOfChaos()
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ public enum Stats
|
|||||||
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
||||||
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
||||||
|
|
||||||
|
// FIXED BONUS
|
||||||
|
PVP_DAMAGE_TAKEN("pvpDamageTaken"),
|
||||||
|
PVE_DAMAGE_TAKEN("pveDamageTaken"),
|
||||||
|
|
||||||
// ATTACK & DEFENCE RATES
|
// ATTACK & DEFENCE RATES
|
||||||
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
||||||
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
||||||
@@ -268,6 +272,7 @@ public enum Stats
|
|||||||
STAT_BONUS_SKILL_CRITICAL("statSkillCritical"),
|
STAT_BONUS_SKILL_CRITICAL("statSkillCritical"),
|
||||||
STAT_BONUS_SPEED("statSpeed"),
|
STAT_BONUS_SPEED("statSpeed"),
|
||||||
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
||||||
|
WORLD_CHAT_POINTS("worldChatPoints"),
|
||||||
ATTACK_DAMAGE("attackDamage");
|
ATTACK_DAMAGE("attackDamage");
|
||||||
|
|
||||||
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
|
|
||||||
// Public variable names
|
// Public variable names
|
||||||
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
||||||
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_POINTS";
|
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
|
||||||
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
||||||
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
||||||
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public class ExWorldChatCnt implements IClientOutgoingPacket
|
|||||||
|
|
||||||
public ExWorldChatCnt(L2PcInstance activeChar)
|
public ExWorldChatCnt(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : activeChar.getWorldChatPoints();
|
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : Math.max(activeChar.getWorldChatPoints() - activeChar.getWorldChatUsed(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -103,6 +103,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("Crystallize", Crystallize::new);
|
EffectHandler.getInstance().registerHandler("Crystallize", Crystallize::new);
|
||||||
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("DamageByAttack", DamageByAttack::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
||||||
@@ -366,6 +367,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("WorldChatPoints", WorldChatPoints::new);
|
||||||
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
-5
@@ -333,7 +333,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": has " + targetPlayer.getWorldChatPoints() + " world chat points");
|
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "set":
|
case "set":
|
||||||
@@ -354,19 +354,19 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String valueToken = st.nextToken();
|
final String valueToken = st.nextToken();
|
||||||
if (!Util.isDigit(valueToken))
|
if (!Util.isDigit(valueToken))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": points changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
||||||
targetPlayer.setWorldChatPoints(Integer.parseInt(valueToken));
|
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
|
||||||
if (Config.ENABLE_WORLD_CHAT)
|
if (Config.ENABLE_WORLD_CHAT)
|
||||||
{
|
{
|
||||||
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (activeChar.getWorldChatPoints() < 1)
|
else if (activeChar.getWorldChatUsed() >= activeChar.getWorldChatPoints())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.setWorldChatPoints(activeChar.getWorldChatPoints() - 1);
|
activeChar.setWorldChatUsed(activeChar.getWorldChatUsed() + 1);
|
||||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||||
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backstab effect implementation.
|
* Backstab effect implementation.
|
||||||
@@ -89,12 +88,6 @@ public final class Backstab extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
||||||
|
|||||||
Vendored
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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 com.l2jmobius.gameserver.enums.DamageByAttackType;
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An effect that changes damage taken from an attack.<br>
|
||||||
|
* The retail implementation seems to be altering whatever damage is taken after the attack has been done and not when attack is being done. <br>
|
||||||
|
* Exceptions for this effect appears to be DOT effects and terrain damage, they are unaffected by this stat.<br>
|
||||||
|
* As for example in retail this effect does reduce reflected damage taken (because it is received damage), as well as it does not decrease reflected damage done,<br>
|
||||||
|
* because reflected damage is being calculated with the original attack damage and not this altered one.<br>
|
||||||
|
* Multiple values of this effect add-up to each other rather than multiplying with each other. Be careful, there were cases in retail where damage is deacreased to 0.
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class DamageByAttack extends AbstractEffect
|
||||||
|
{
|
||||||
|
private final double _value;
|
||||||
|
private final DamageByAttackType _type;
|
||||||
|
|
||||||
|
public DamageByAttack(StatsSet params)
|
||||||
|
{
|
||||||
|
_value = params.getDouble("amount");
|
||||||
|
_type = params.getEnum("type", DamageByAttackType.class, DamageByAttackType.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pump(L2Character target, Skill skill)
|
||||||
|
{
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case PK:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVP_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ENEMY_ALL:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVE_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
-5
@@ -165,11 +165,6 @@ public final class EnergyAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|||||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatal Blow effect implementation.
|
* Fatal Blow effect implementation.
|
||||||
@@ -121,12 +120,6 @@ public final class FatalBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
Vendored
+1
-5
@@ -174,11 +174,7 @@ public final class PhysicalAttack extends AbstractEffect
|
|||||||
|
|
||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java
Vendored
-5
@@ -137,11 +137,6 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
|||||||
// Check if damage should be reflected.
|
// Check if damage should be reflected.
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java
Vendored
-6
@@ -147,12 +147,6 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
||||||
|
|
||||||
if ((effected.getCurrentHp() - damage) < minHp)
|
if ((effected.getCurrentHp() - damage) < minHp)
|
||||||
|
|||||||
-5
@@ -168,11 +168,6 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-5
@@ -162,11 +162,6 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Soul Blow effect implementation.
|
* Soul Blow effect implementation.
|
||||||
@@ -94,12 +93,6 @@ public final class SoulBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
Vendored
+31
@@ -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 com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class WorldChatPoints extends AbstractStatEffect
|
||||||
|
{
|
||||||
|
public WorldChatPoints(StatsSet params)
|
||||||
|
{
|
||||||
|
super(params, Stats.WORLD_CHAT_POINTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -72,6 +72,7 @@ CrystalGradeModify: Sets your Expertise Grade level. With this effect you can ma
|
|||||||
Crystallize: Allows the player to crystallize items up to a certain grade.
|
Crystallize: Allows the player to crystallize items up to a certain grade.
|
||||||
CubicMastery: Max cubics stat.
|
CubicMastery: Max cubics stat.
|
||||||
DamageBlock: Blocks Hp or Mp damage/heal.
|
DamageBlock: Blocks Hp or Mp damage/heal.
|
||||||
|
DamageByAttack: An effect that changes damage taken from an attack.
|
||||||
DamageShield: Reflect damage percentage stat.
|
DamageShield: Reflect damage percentage stat.
|
||||||
DamageShieldResist: Reflect damage percentage resist.
|
DamageShieldResist: Reflect damage percentage resist.
|
||||||
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
DamOverTime: Damage over time effect. Magic Critical results in 10 times amount to me instantly inflicted before the effect is started.
|
||||||
@@ -333,3 +334,4 @@ VitalityPointsRate: Vitality points consume rate.
|
|||||||
VitalityPointUp: Increases vitality points.
|
VitalityPointUp: Increases vitality points.
|
||||||
WeightLimit: Maximum weight stat.
|
WeightLimit: Maximum weight stat.
|
||||||
WeightPenalty: Weight penalty level stat.
|
WeightPenalty: Weight penalty level stat.
|
||||||
|
WorldChatPoints: Modify world chat points to use per day.
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* 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.enums;
|
||||||
|
|
||||||
|
public enum DamageByAttackType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
PK, // Players and summons.
|
||||||
|
MOB, // Regular monsters.
|
||||||
|
BOSS, // Boss monsters
|
||||||
|
ENEMY_ALL; // All NPCs
|
||||||
|
}
|
||||||
+3
-3
@@ -159,7 +159,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.getVariables().set(PlayerVariables.EXTEND_DROP, "");
|
player.getVariables().remove(PlayerVariables.EXTEND_DROP);
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
PreparedStatement ps = con.prepareStatement("UPDATE character_variables SET val = ? WHERE var = ?"))
|
||||||
{
|
{
|
||||||
ps.setInt(1, Config.WORLD_CHAT_POINTS_PER_DAY);
|
ps.setInt(1, 0);
|
||||||
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
ps.setString(2, PlayerVariables.WORLD_CHAT_VARIABLE_NAME);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
|||||||
// Update data for online players.
|
// Update data for online players.
|
||||||
L2World.getInstance().getPlayers().stream().forEach(player ->
|
L2World.getInstance().getPlayers().stream().forEach(player ->
|
||||||
{
|
{
|
||||||
player.setWorldChatPoints(Config.WORLD_CHAT_POINTS_PER_DAY);
|
player.setWorldChatUsed(0);
|
||||||
player.sendPacket(new ExWorldChatCnt(player));
|
player.sendPacket(new ExWorldChatCnt(player));
|
||||||
player.getVariables().storeMe();
|
player.getVariables().storeMe();
|
||||||
});
|
});
|
||||||
|
|||||||
+19
@@ -4552,6 +4552,25 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final double damageCap = getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||||
|
if (damageCap > 0)
|
||||||
|
{
|
||||||
|
value = Math.min(value, damageCap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate PvP/PvE damage received. It is a post-attack stat.
|
||||||
|
if (attacker != null)
|
||||||
|
{
|
||||||
|
if (attacker.isPlayable())
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVP_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value *= (100 + getStat().getValue(Stats.PVE_DAMAGE_TAKEN)) / 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
||||||
{
|
{
|
||||||
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||||
|
|||||||
+12
-4
@@ -13436,16 +13436,24 @@ public final class L2PcInstance extends L2Playable
|
|||||||
*/
|
*/
|
||||||
public int getWorldChatPoints()
|
public int getWorldChatPoints()
|
||||||
{
|
{
|
||||||
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 1);
|
return (int) getStat().getValue(Stats.WORLD_CHAT_POINTS, Config.WORLD_CHAT_POINTS_PER_DAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The amount of times player has used world chat
|
||||||
|
*/
|
||||||
|
public int getWorldChatUsed()
|
||||||
|
{
|
||||||
|
return getVariables().getInt(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the amount of times player can use world chat
|
* Sets the amount of times player can use world chat
|
||||||
* @param points
|
* @param timesUsed how many times world chat has been used up until now.
|
||||||
*/
|
*/
|
||||||
public void setWorldChatPoints(int points)
|
public void setWorldChatUsed(int timesUsed)
|
||||||
{
|
{
|
||||||
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, points);
|
getVariables().set(PlayerVariables.WORLD_CHAT_VARIABLE_NAME, timesUsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prohibiteCeremonyOfChaos()
|
public void prohibiteCeremonyOfChaos()
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ public enum Stats
|
|||||||
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
PVE_RAID_PHYSICAL_SKILL_DEFENCE("pveRaidPhysSkillsDef"),
|
||||||
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
PVE_RAID_MAGICAL_SKILL_DEFENCE("pveRaidMagicalDef"),
|
||||||
|
|
||||||
|
// FIXED BONUS
|
||||||
|
PVP_DAMAGE_TAKEN("pvpDamageTaken"),
|
||||||
|
PVE_DAMAGE_TAKEN("pveDamageTaken"),
|
||||||
|
|
||||||
// ATTACK & DEFENCE RATES
|
// ATTACK & DEFENCE RATES
|
||||||
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
MAGIC_CRITICAL_DAMAGE("mCritPower"),
|
||||||
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
PHYSICAL_SKILL_POWER("physicalSkillPower"), // Adding skill power (not multipliers) results in points added directly to final value unmodified by defence, traits, elements, criticals etc.
|
||||||
@@ -269,6 +273,7 @@ public enum Stats
|
|||||||
STAT_BONUS_SPEED("statSpeed"),
|
STAT_BONUS_SPEED("statSpeed"),
|
||||||
CRAFTING_CRITICAL("craftingCritical"),
|
CRAFTING_CRITICAL("craftingCritical"),
|
||||||
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
SHOTS_BONUS("shotBonus", new ShotsBonusFinalizer()),
|
||||||
|
WORLD_CHAT_POINTS("worldChatPoints"),
|
||||||
ATTACK_DAMAGE("attackDamage");
|
ATTACK_DAMAGE("attackDamage");
|
||||||
|
|
||||||
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
static final Logger LOGGER = Logger.getLogger(Stats.class.getName());
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
|
|
||||||
// Public variable names
|
// Public variable names
|
||||||
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
public static final String HAIR_ACCESSORY_VARIABLE_NAME = "HAIR_ACCESSORY_ENABLED";
|
||||||
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_POINTS";
|
public static final String WORLD_CHAT_VARIABLE_NAME = "WORLD_CHAT_USED";
|
||||||
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
public static final String VITALITY_ITEMS_USED_VARIABLE_NAME = "VITALITY_ITEMS_USED";
|
||||||
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
private static final String DAILY_MISSION_REWARDS = "DAILY_MISSION_REWARDS";
|
||||||
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
public static final String CEREMONY_OF_CHAOS_PROHIBITED_PENALTIES = "CEREMONY_OF_CHAOS_PENALTIES";
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public class ExWorldChatCnt implements IClientOutgoingPacket
|
|||||||
|
|
||||||
public ExWorldChatCnt(L2PcInstance activeChar)
|
public ExWorldChatCnt(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : activeChar.getWorldChatPoints();
|
_points = activeChar.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : Math.max(activeChar.getWorldChatPoints() - activeChar.getWorldChatUsed(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -98,6 +98,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
EffectHandler.getInstance().registerHandler("CrystalGradeModify", CrystalGradeModify::new);
|
||||||
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
EffectHandler.getInstance().registerHandler("CubicMastery", CubicMastery::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
EffectHandler.getInstance().registerHandler("DamageBlock", DamageBlock::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("DamageByAttack", DamageByAttack::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
EffectHandler.getInstance().registerHandler("DamageShield", DamageShield::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
EffectHandler.getInstance().registerHandler("DamageShieldResist", DamageShieldResist::new);
|
||||||
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
EffectHandler.getInstance().registerHandler("DamOverTime", DamOverTime::new);
|
||||||
@@ -360,6 +361,7 @@ public final class EffectMasterHandler
|
|||||||
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
EffectHandler.getInstance().registerHandler("VitalityPointUp", VitalityPointUp::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
EffectHandler.getInstance().registerHandler("WeightLimit", WeightLimit::new);
|
||||||
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
EffectHandler.getInstance().registerHandler("WeightPenalty", WeightPenalty::new);
|
||||||
|
EffectHandler.getInstance().registerHandler("WorldChatPoints", WorldChatPoints::new);
|
||||||
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
LOGGER.info(EffectMasterHandler.class.getSimpleName() + ": Loaded " + EffectHandler.getInstance().size() + " effect handlers.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
-5
@@ -333,7 +333,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": has " + targetPlayer.getWorldChatPoints() + " world chat points");
|
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "set":
|
case "set":
|
||||||
@@ -354,19 +354,19 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String valueToken = st.nextToken();
|
final String valueToken = st.nextToken();
|
||||||
if (!Util.isDigit(valueToken))
|
if (!Util.isDigit(valueToken))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <points>");
|
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.sendMessage(targetPlayer.getName() + ": points changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
|
||||||
targetPlayer.setWorldChatPoints(Integer.parseInt(valueToken));
|
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
|
||||||
if (Config.ENABLE_WORLD_CHAT)
|
if (Config.ENABLE_WORLD_CHAT)
|
||||||
{
|
{
|
||||||
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
targetPlayer.sendPacket(new ExWorldChatCnt(targetPlayer));
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (activeChar.getWorldChatPoints() < 1)
|
else if (activeChar.getWorldChatUsed() >= activeChar.getWorldChatPoints())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
activeChar.sendPacket(SystemMessageId.YOU_HAVE_SPENT_YOUR_WORLD_CHAT_QUOTA_FOR_THE_DAY_A_NEW_DAY_STARTS_EVERY_DAY_AT_18_30);
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ public final class ChatWorld implements IChatHandler
|
|||||||
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
L2World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
activeChar.setWorldChatPoints(activeChar.getWorldChatPoints() - 1);
|
activeChar.setWorldChatUsed(activeChar.getWorldChatUsed() + 1);
|
||||||
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
activeChar.sendPacket(new ExWorldChatCnt(activeChar));
|
||||||
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
if (Config.WORLD_CHAT_INTERVAL.getSeconds() > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
-7
@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
|||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backstab effect implementation.
|
* Backstab effect implementation.
|
||||||
@@ -89,12 +88,6 @@ public final class Backstab extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, true, true, false);
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
if (!effected.isRaid() && Formulas.calcAtkBreak(effected, damage))
|
||||||
|
|||||||
Vendored
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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 com.l2jmobius.gameserver.enums.DamageByAttackType;
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
|
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An effect that changes damage taken from an attack.<br>
|
||||||
|
* The retail implementation seems to be altering whatever damage is taken after the attack has been done and not when attack is being done. <br>
|
||||||
|
* Exceptions for this effect appears to be DOT effects and terrain damage, they are unaffected by this stat.<br>
|
||||||
|
* As for example in retail this effect does reduce reflected damage taken (because it is received damage), as well as it does not decrease reflected damage done,<br>
|
||||||
|
* because reflected damage is being calculated with the original attack damage and not this altered one.<br>
|
||||||
|
* Multiple values of this effect add-up to each other rather than multiplying with each other. Be careful, there were cases in retail where damage is deacreased to 0.
|
||||||
|
* @author Nik
|
||||||
|
*/
|
||||||
|
public class DamageByAttack extends AbstractEffect
|
||||||
|
{
|
||||||
|
private final double _value;
|
||||||
|
private final DamageByAttackType _type;
|
||||||
|
|
||||||
|
public DamageByAttack(StatsSet params)
|
||||||
|
{
|
||||||
|
_value = params.getDouble("amount");
|
||||||
|
_type = params.getEnum("type", DamageByAttackType.class, DamageByAttackType.NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pump(L2Character target, Skill skill)
|
||||||
|
{
|
||||||
|
switch (_type)
|
||||||
|
{
|
||||||
|
case PK:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVP_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ENEMY_ALL:
|
||||||
|
{
|
||||||
|
target.getStat().mergeAdd(Stats.PVE_DAMAGE_TAKEN, _value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
-5
@@ -165,11 +165,6 @@ public final class EnergyAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// attacker.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-7
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|||||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatal Blow effect implementation.
|
* Fatal Blow effect implementation.
|
||||||
@@ -121,12 +120,6 @@ public final class FatalBlow extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, true, false);
|
||||||
|
|
||||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||||
|
|||||||
Vendored
+1
-5
@@ -174,11 +174,7 @@ public final class PhysicalAttack extends AbstractEffect
|
|||||||
|
|
||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-5
@@ -137,11 +137,6 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
|||||||
// Check if damage should be reflected.
|
// Check if damage should be reflected.
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -147,12 +147,6 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
|
|
||||||
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
final double minHp = (effected.getMaxHp() * _saveHp) / 100;
|
||||||
|
|
||||||
if ((effected.getCurrentHp() - damage) < minHp)
|
if ((effected.getCurrentHp() - damage) < minHp)
|
||||||
|
|||||||
-5
@@ -168,11 +168,6 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
-5
@@ -162,11 +162,6 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
|||||||
// Check if damage should be reflected
|
// Check if damage should be reflected
|
||||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||||
|
|
||||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
|
||||||
if (damageCap > 0)
|
|
||||||
{
|
|
||||||
damage = Math.min(damage, damageCap);
|
|
||||||
}
|
|
||||||
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
effected.reduceCurrentHp(damage, effector, skill, false, false, critical, false);
|
||||||
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
// effector.sendDamageMessage(effected, skill, (int) damage, critical, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user