-Added two new effects (BlockTarget & Duel).
-Added <target hp="n%" /> condition (example - Last Attack skill). -Updated DamOverTime effect - add increase charges count over time. -Updated EnergyAttack effect to new charges system. -Updated FatalBlow effect (able to increase skill power damage if target has affected by selected abnormal type). -Added parameter ignorePhysDefPercent for skills that ignores some % of enemy pDef. -Added function isInvulnerableFor(player) and updated PcCondOverride for this function. -NPC and NPC buffers data updated for Othell Ground skill Poison Zone. -Updated PhysicalAttack effect for skills, that decreases power when using some weapon types, and increases power when using some weapon types. also added isLastAttack parameter (for skill Last Attack atm). -Added stat momentumSkillPower (for Tyrr' passive). Increases power when player have more charges (max 3). -Updated some effect for working with maxSkillDamage parameter. -Updated some old and new skills to 10531. Contributed by NviX.
This commit is contained in:
60
trunk/dist/game/data/scripts/handlers/effecthandlers/BlockTarget.java
vendored
Normal file
60
trunk/dist/game/data/scripts/handlers/effecthandlers/BlockTarget.java
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server 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.
|
||||
*
|
||||
* L2J Server 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.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Playable;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
|
||||
/**
|
||||
* @author NviX
|
||||
*/
|
||||
public final class BlockTarget extends AbstractEffect
|
||||
{
|
||||
|
||||
public BlockTarget(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
if (info.getEffected().isPlayable())
|
||||
{
|
||||
info.getEffected().setTarget(null);
|
||||
info.getEffected().abortAttack();
|
||||
info.getEffected().abortCast();
|
||||
info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, info.getEffected());
|
||||
((L2Playable) info.getEffected()).setLockedTarget(info.getEffected());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExit(BuffInfo info)
|
||||
{
|
||||
if (info.getEffected().isPlayable())
|
||||
{
|
||||
((L2Playable) info.getEffected()).setLockedTarget(null);
|
||||
}
|
||||
}
|
||||
}
|
@@ -32,6 +32,7 @@ public final class DamOverTime extends AbstractEffect
|
||||
{
|
||||
private final boolean _canKill;
|
||||
private final double _power;
|
||||
private final int _charge;
|
||||
|
||||
public DamOverTime(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
@@ -39,6 +40,7 @@ public final class DamOverTime extends AbstractEffect
|
||||
|
||||
_canKill = params.getBoolean("canKill", false);
|
||||
_power = params.getDouble("power", 0);
|
||||
_charge = params.getInt("charge", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,6 +78,16 @@ public final class DamOverTime extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
if ((_charge != 0) && (info.getEffected().getActingPlayer().getCharges() >= _charge))
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_FORCE_HAS_REACHED_MAXIMUM_CAPACITY);
|
||||
return false;
|
||||
}
|
||||
else if (_charge != 0)
|
||||
{
|
||||
info.getEffected().getActingPlayer().increaseCharges(1, _charge);
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentHpByDOT(damage, info.getEffector(), info.getSkill());
|
||||
info.getEffected().notifyDamageReceived(damage, info.getEffector(), info.getSkill(), false, true);
|
||||
return info.getSkill().isToggle();
|
||||
|
69
trunk/dist/game/data/scripts/handlers/effecthandlers/Duel.java
vendored
Normal file
69
trunk/dist/game/data/scripts/handlers/effecthandlers/Duel.java
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server 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.
|
||||
*
|
||||
* L2J Server 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.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.model.PcCondOverride;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
|
||||
/**
|
||||
* @author NviX
|
||||
*/
|
||||
public final class Duel extends AbstractEffect
|
||||
{
|
||||
|
||||
public Duel(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
L2PcInstance effected = info.getEffected().getActingPlayer();
|
||||
|
||||
if (effected.isDead() || (effector == null) || (effected.getPvpFlag() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Skill skill = SkillData.getInstance().getSkill(10319, 1);
|
||||
skill.applyEffects(effector, effector);
|
||||
|
||||
effector.setIsInvul(true);
|
||||
effected.addOverrideCond(PcCondOverride.VULNERABLE_ALL_PLAYERS);
|
||||
effected.setTarget(effector);
|
||||
effected.setLockedTarget(effector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExit(BuffInfo info)
|
||||
{
|
||||
info.getEffected().getActingPlayer().setLockedTarget(null);
|
||||
info.getEffected().removeOverridedCond(PcCondOverride.VULNERABLE_ALL_PLAYERS);
|
||||
info.getEffector().setIsInvul(false);
|
||||
info.getEffector().getEffectList().remove(true, info.getEffector().getEffectList().getBuffInfoBySkillId(10319));
|
||||
}
|
||||
}
|
@@ -130,11 +130,27 @@ public final class EnergyAttack extends AbstractEffect
|
||||
weaponTypeBoost = 77;
|
||||
}
|
||||
|
||||
// charge count should be the count before casting the skill but since its reduced before calling effects
|
||||
// we add skill consume charges to current charges
|
||||
double energyChargesBoost = (((attacker.getCharges() + skill.getChargeConsume()) - 1) * 0.2) + 1;
|
||||
double energyChargesBoost = 1;
|
||||
if (attacker.getCharges() == 1)
|
||||
{
|
||||
energyChargesBoost = 1.1;
|
||||
attacker.decreaseCharges(1);
|
||||
}
|
||||
else if (attacker.getCharges() == 2)
|
||||
{
|
||||
energyChargesBoost = 1.2;
|
||||
attacker.decreaseCharges(2);
|
||||
}
|
||||
else if (attacker.getCharges() >= 3)
|
||||
{
|
||||
energyChargesBoost = 1.3;
|
||||
attacker.decreaseCharges(3);
|
||||
}
|
||||
|
||||
double addPower = (attacker.getStat().calcStat(Stats.MOMENTUM_SKILL_POWER, 1, null, null));
|
||||
|
||||
attack += _power;
|
||||
attack *= addPower;
|
||||
attack *= ssBoost;
|
||||
attack *= energyChargesBoost;
|
||||
attack *= weaponTypeBoost;
|
||||
@@ -157,6 +173,13 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
attacker.sendDamageMessage(target, (int) damage, false, critical, false);
|
||||
target.reduceCurrentHp(damage, attacker, skill);
|
||||
target.notifyDamageReceived(damage, attacker, skill, critical, false);
|
||||
@@ -165,4 +188,4 @@ public final class EnergyAttack extends AbstractEffect
|
||||
Formulas.calcDamageReflected(attacker, target, skill, critical);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ShotType;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
@@ -25,9 +27,11 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
|
||||
/**
|
||||
* Fatal Blow effect implementation.
|
||||
@@ -35,9 +39,15 @@ import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
*/
|
||||
public final class FatalBlow extends AbstractEffect
|
||||
{
|
||||
private final String _targetAbnormalType;
|
||||
private final double _skillAddPower;
|
||||
|
||||
public FatalBlow(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
_targetAbnormalType = params.getString("targetAbnormalType", "NULL");
|
||||
_skillAddPower = params.getDouble("skillAddPower", 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,6 +83,20 @@ public final class FatalBlow extends AbstractEffect
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
double damage = Formulas.calcBlowDamage(activeChar, target, info.getSkill(), shld, ss);
|
||||
|
||||
if (_targetAbnormalType != "NULL")
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(_targetAbnormalType, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String abnormal = st.nextToken().trim();
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(abnormal)) != null)
|
||||
{
|
||||
damage *= _skillAddPower;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Crit rate base crit rate for skill, modified with STR bonus
|
||||
boolean crit = Formulas.calcCrit(info.getSkill().getBaseCritRate() * 10 * BaseStats.STR.calcBonus(activeChar), true, target);
|
||||
if (crit)
|
||||
@@ -80,6 +104,13 @@ public final class FatalBlow extends AbstractEffect
|
||||
damage *= 2;
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
|
||||
|
@@ -18,12 +18,15 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ShotType;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
@@ -37,9 +40,21 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
*/
|
||||
public final class PhysicalAttack extends AbstractEffect
|
||||
{
|
||||
private final String _type1;
|
||||
private final double _valueReduce;
|
||||
private final String _type2;
|
||||
private final double _valueIncrease;
|
||||
private final boolean _isLastAttack;
|
||||
|
||||
public PhysicalAttack(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
_type1 = params.getString("weaponTypeDec", "NONE");
|
||||
_valueReduce = params.getDouble("valueDec", 1);
|
||||
_type2 = params.getString("weaponTypeInc", "NONE");
|
||||
_valueIncrease = params.getDouble("valueInc", 1);
|
||||
_isLastAttack = params.getBoolean("isLastAttack", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,6 +116,30 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
damage *= 2;
|
||||
}
|
||||
|
||||
if ((activeChar.getActiveWeaponItem() != null) && (_type1 != "NONE") && (_type2 != "NONE"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(_type1, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
{
|
||||
damage *= _valueReduce;
|
||||
break;
|
||||
}
|
||||
}
|
||||
st = new StringTokenizer(_type2, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
{
|
||||
damage *= _valueIncrease;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
@@ -111,8 +150,22 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
activeChar.sendDamageMessage(target, damage, false, crit, false);
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
if (_isLastAttack && !target.isPlayer() && !target.isRaid())
|
||||
{
|
||||
if (damage < target.getCurrentHp())
|
||||
{
|
||||
target.setCurrentHp(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), crit);
|
||||
|
@@ -22,6 +22,7 @@ import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
|
||||
/**
|
||||
* Static Damage effect implementation.
|
||||
@@ -29,7 +30,7 @@ import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
*/
|
||||
public final class StaticDamage extends AbstractEffect
|
||||
{
|
||||
private final int _power;
|
||||
private int _power;
|
||||
|
||||
public StaticDamage(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
@@ -52,6 +53,13 @@ public final class StaticDamage extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
double maxDamage = (info.getEffected().getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
_power = (int) maxDamage;
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentHp(_power, info.getEffector(), info.getSkill());
|
||||
info.getEffected().notifyDamageReceived(_power, info.getEffector(), info.getSkill(), false, false);
|
||||
|
||||
|
Reference in New Issue
Block a user