Skip to content
Snippets Groups Projects
Commit 2e792ed8 authored by Rumen Nikiforov's avatar Rumen Nikiforov
Browse files

BETA: DP-Part for [L5727]

	* And fixing Issues with shots not recharged while casting skills like:
		* Raging waves
		* Gehenna
		* Cyclone 
		* Volcano
		* Reported by: St3eT
parent 6f32cacd
No related branches found
No related tags found
No related merge requests found
Showing
with 55 additions and 44 deletions
......@@ -18,7 +18,8 @@
*/
package handlers.effecthandlers;
import javolution.util.FastList;
import java.util.ArrayList;
import java.util.List;
import com.l2jserver.gameserver.ai.CtrlEvent;
import com.l2jserver.gameserver.datatables.NpcTable;
......@@ -59,22 +60,25 @@ public class SignetMDam extends L2Effect
{
L2NpcTemplate template;
if (getSkill() instanceof L2SkillSignetCasttime)
{
template = NpcTable.getInstance().getTemplate(getSkill().getNpcId());
}
else
{
return false;
}
L2EffectPointInstance effectPoint = new L2EffectPointInstance(IdFactory.getInstance().getNextId(), template, getEffector());
final L2EffectPointInstance effectPoint = new L2EffectPointInstance(IdFactory.getInstance().getNextId(), template, getEffector());
effectPoint.setCurrentHp(effectPoint.getMaxHp());
effectPoint.setCurrentMp(effectPoint.getMaxMp());
//L2World.getInstance().storeObject(effectPoint);
int x = getEffector().getX();
int y = getEffector().getY();
int z = getEffector().getZ();
if (getEffector().isPlayer() && getSkill().getTargetType() == L2TargetType.TARGET_GROUND)
if (getEffector().isPlayer() && (getSkill().getTargetType() == L2TargetType.TARGET_GROUND))
{
Point3D wordPosition = getEffector().getActingPlayer().getCurrentSkillWorldPosition();
final Point3D wordPosition = getEffector().getActingPlayer().getCurrentSkillWorldPosition();
if (wordPosition != null)
{
......@@ -94,26 +98,34 @@ public class SignetMDam extends L2Effect
@Override
public boolean onActionTime()
{
if (getCount() >= getTotalCount() - 2)
if (getCount() >= (getTotalCount() - 2))
{
return true; // do nothing first 2 times
}
int mpConsume = getSkill().getMpConsume();
L2PcInstance activeChar = getEffector().getActingPlayer();
final L2PcInstance activeChar = getEffector().getActingPlayer();
boolean sps = getSkill().isMagic() && getEffector().isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = getSkill().isMagic() && getEffector().isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
FastList<L2Character> targets = new FastList<>();
activeChar.rechargeShots(getSkill().useSoulShot(), getSkill().useSpiritShot());
boolean sps = getSkill().useSpiritShot() && getEffector().isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = getSkill().useSpiritShot() && getEffector().isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
List<L2Character> targets = new ArrayList<>();
for (L2Character cha : _actor.getKnownList().getKnownCharactersInRadius(getSkill().getSkillRadius()))
{
if (cha == null || cha == activeChar)
if ((cha == null) || (cha == activeChar))
{
continue;
}
if (cha.isL2Attackable() || cha.isPlayable())
{
if (cha.isAlikeDead())
{
continue;
}
if (mpConsume > activeChar.getCurrentMp())
{
......@@ -131,7 +143,9 @@ public class SignetMDam extends L2Effect
}
}
else
{
targets.add(cha);
}
}
}
......@@ -140,17 +154,18 @@ public class SignetMDam extends L2Effect
activeChar.broadcastPacket(new MagicSkillLaunched(activeChar, getSkill().getId(), getSkill().getLevel(), targets.toArray(new L2Character[targets.size()])));
for (L2Character target : targets)
{
boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, getSkill()));
byte shld = Formulas.calcShldUse(activeChar, target, getSkill());
int mdam = (int) Formulas.calcMagicDam(activeChar, target, getSkill(), shld, sps, bss, mcrit);
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, getSkill()));
final byte shld = Formulas.calcShldUse(activeChar, target, getSkill());
final int mdam = (int) Formulas.calcMagicDam(activeChar, target, getSkill(), shld, sps, bss, mcrit);
if (target.isSummon())
{
target.broadcastStatusUpdate();
}
if (mdam > 0)
{
if (!target.isRaid()
&& Formulas.calcAtkBreak(target, mdam))
if (!target.isRaid() && Formulas.calcAtkBreak(target, mdam))
{
target.breakAttack();
target.breakCast();
......@@ -169,6 +184,8 @@ public class SignetMDam extends L2Effect
public void onExit()
{
if (_actor != null)
{
_actor.deleteMe();
}
}
}
......@@ -52,9 +52,9 @@ public class Blow implements ISkillHandler
if (activeChar.isAlikeDead())
return;
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
for (L2Character target: (L2Character[]) targets)
{
......
......@@ -72,7 +72,7 @@ public class Continuous implements ISkillHandler
skill = sk;
}
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
......
......@@ -38,9 +38,9 @@ public class CpDam implements ISkillHandler
return;
}
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
for (L2Character target : (L2Character[]) targets)
{
......
......@@ -36,9 +36,9 @@ public class CpDamPercent implements ISkillHandler
if (activeChar.isAlikeDead())
return;
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
for (L2Character target: (L2Character[]) targets)
{
......
......@@ -75,9 +75,9 @@ public class Disablers implements ISkillHandler
L2SkillType type = skill.getSkillType();
byte shld = 0;
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
for (L2Object obj: targets)
{
......
......@@ -46,9 +46,9 @@ public class Manadam implements ISkillHandler
return;
}
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
for (L2Character target : (L2Character[]) targets)
{
......
......@@ -50,9 +50,9 @@ public class Mdam implements ISkillHandler
return;
}
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean sps = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
boolean bss = skill.useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
for (L2Character target : (L2Character[]) targets)
{
......
......@@ -35,7 +35,6 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
public class Pdam implements ISkillHandler
{
private static final Logger _log = Logger.getLogger(Pdam.class.getName());
private static final Logger _logDamage = Logger.getLogger("damage");
private static final L2SkillType[] SKILL_IDS =
......@@ -59,12 +58,7 @@ public class Pdam implements ISkillHandler
int damage = 0;
if (Config.DEBUG)
{
_log.fine("Begin Skill processing in Pdam.java " + skill.getSkillType());
}
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
for (L2Character target: (L2Character[]) targets)
{
......
......@@ -72,7 +72,7 @@ public class StrSiegeAssault implements ISkillHandler
{
// damage calculation
int damage = 0;
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
for (L2Character target: (L2Character[]) targets)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment