Browse Source

BETA: DP-Part for [L5727]
* And fixing Issues with shots not recharged while casting skills like:
* Raging waves
* Gehenna
* Cyclone
* Volcano
* Reported by: St3eT

Rumen Nikiforov 12 years ago
parent
commit
2e792ed898

+ 34 - 17
L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/SignetMDam.java

@@ -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();
+		}
 	}
 }

+ 3 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Blow.java

@@ -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)
 		{

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Continuous.java

@@ -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);
 				

+ 3 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDam.java

@@ -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)
 		{

+ 3 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/CpDamPercent.java

@@ -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)
 		{

+ 3 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Disablers.java

@@ -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)
 		{

+ 3 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Manadam.java

@@ -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)
 		{

+ 3 - 3
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Mdam.java

@@ -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)
 		{

+ 1 - 7
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/Pdam.java

@@ -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)
 		{

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/StrSiegeAssault.java

@@ -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)
 			{