L2Character attack rework.
Adapted from: L2jUnity free files.
This commit is contained in:
@@ -44,6 +44,7 @@ public final class EffectMasterHandler
|
||||
EffectHandler.getInstance().registerHandler("AttackAttribute", AttackAttribute::new);
|
||||
EffectHandler.getInstance().registerHandler("AttackAttributeAdd", AttackAttributeAdd::new);
|
||||
EffectHandler.getInstance().registerHandler("AttackBehind", AttackBehind::new);
|
||||
EffectHandler.getInstance().registerHandler("AttackDamagePosition", AttackDamagePosition::new);
|
||||
EffectHandler.getInstance().registerHandler("AttackTrait", AttackTrait::new);
|
||||
EffectHandler.getInstance().registerHandler("Backstab", Backstab::new);
|
||||
EffectHandler.getInstance().registerHandler("Betray", Betray::new);
|
||||
@@ -236,6 +237,7 @@ public final class EffectMasterHandler
|
||||
EffectHandler.getInstance().registerHandler("PhysicalSoulAttack", PhysicalSoulAttack::new);
|
||||
EffectHandler.getInstance().registerHandler("PkCount", PkCount::new);
|
||||
EffectHandler.getInstance().registerHandler("Plunder", Plunder::new);
|
||||
EffectHandler.getInstance().registerHandler("PolearmSingleTarget", PolearmSingleTarget::new);
|
||||
EffectHandler.getInstance().registerHandler("ProtectionBlessing", ProtectionBlessing::new);
|
||||
EffectHandler.getInstance().registerHandler("ProtectDeathPenalty", ProtectDeathPenalty::new);
|
||||
EffectHandler.getInstance().registerHandler("PullBack", PullBack::new);
|
||||
|
53
L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AttackDamagePosition.java
vendored
Normal file
53
L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/AttackDamagePosition.java
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.commons.util.MathUtil;
|
||||
import com.l2jmobius.gameserver.enums.Position;
|
||||
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.BuffInfo;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
/**
|
||||
* @author Nik
|
||||
*/
|
||||
public class AttackDamagePosition extends AbstractEffect
|
||||
{
|
||||
protected final double _amount;
|
||||
protected final Position _position;
|
||||
|
||||
public AttackDamagePosition(StatsSet params)
|
||||
{
|
||||
_amount = params.getDouble("amount");
|
||||
_position = params.getEnum("position", Position.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pump(L2Character effected, Skill skill)
|
||||
{
|
||||
effected.getStat().mergePositionTypeValue(Stats.ATTACK_DAMAGE, _position, (_amount / 100) + 1, MathUtil::mul);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExit(BuffInfo info)
|
||||
{
|
||||
info.getEffected().getStat().mergePositionTypeValue(Stats.ATTACK_DAMAGE, _position, (_amount / 100) + 1, MathUtil::div);
|
||||
}
|
||||
}
|
@@ -88,7 +88,7 @@ public final class Backstab extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, true);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -163,7 +163,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
damage = Math.max(0, damage);
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(attacker, effected, skill, critical);
|
||||
Formulas.calcCounterAttack(attacker, effected, skill, critical);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -119,7 +119,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, true);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -115,6 +115,6 @@ public final class Lethal extends AbstractEffect
|
||||
}
|
||||
|
||||
// No matter if lethal succeeded or not, its reflected.
|
||||
Formulas.calcDamageReflected(effector, effected, skill, false);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, false);
|
||||
}
|
||||
}
|
||||
|
@@ -173,7 +173,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, critical);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
{
|
||||
|
@@ -135,7 +135,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected.
|
||||
Formulas.calcDamageReflected(effector, effected, skill, critical);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -145,7 +145,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, critical);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -166,7 +166,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, critical);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -160,7 +160,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, critical);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, critical);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
52
L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PolearmSingleTarget.java
vendored
Normal file
52
L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PolearmSingleTarget.java
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class PolearmSingleTarget extends AbstractEffect
|
||||
{
|
||||
public PolearmSingleTarget(StatsSet params)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(L2Character effector, L2Character effected, Skill skill)
|
||||
{
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.getStat().addFixedValue(Stats.PHYSICAL_POLEARM_TARGET_SINGLE, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExit(BuffInfo info)
|
||||
{
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
info.getEffected().getStat().removeFixedValue(Stats.PHYSICAL_POLEARM_TARGET_SINGLE);
|
||||
}
|
||||
}
|
||||
}
|
@@ -93,7 +93,7 @@ public final class SoulBlow extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(effector, effected, skill, true);
|
||||
Formulas.calcCounterAttack(effector, effected, skill, true);
|
||||
|
||||
final double damageCap = effected.getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
|
@@ -98,7 +98,7 @@ public class SummonHallucination extends AbstractEffect
|
||||
clone.setSummoner(player);
|
||||
clone.spawnMe(x, y, z);
|
||||
clone.scheduleDespawn(_despawnDelay);
|
||||
clone.doAttack(effected);
|
||||
clone.doAutoAttack(effected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -865,14 +865,14 @@ public final class MemoryOfDisaster extends AbstractInstance
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NO_WAY2);
|
||||
npc.doDie(null);
|
||||
attacker.doAttack(world.getNpc(SILVERA));
|
||||
attacker.doAutoAttack(world.getNpc(SILVERA));
|
||||
break;
|
||||
}
|
||||
case SILVERA:
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.MY_GOD);
|
||||
npc.doDie(null);
|
||||
world.getNpc(SIEGE_GOLEM).doAttack(attacker);
|
||||
world.getNpc(SIEGE_GOLEM).doAutoAttack(attacker);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user