فهرست منبع

Cubics shouldn't use Soulshots/Spiritshots

Reported by: @Sdw-, @petpal
Zoey76 9 سال پیش
والد
کامیت
c4beddcc6e

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -5287,7 +5287,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
 			
 			if (newSkill.isPassive())
 			{
-				newSkill.applyEffects(this, null, this, false, true, false, 0);
+				newSkill.applyEffects(this, this, false, true, false, 0);
 			}
 		}
 		return oldSkill;

+ 27 - 28
L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2CubicInstance.java

@@ -33,7 +33,6 @@ import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2Party;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
 import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.actor.L2Playable;
 import com.l2jserver.gameserver.model.actor.tasks.cubics.CubicAction;
 import com.l2jserver.gameserver.model.actor.tasks.cubics.CubicDisappear;
 import com.l2jserver.gameserver.model.actor.tasks.cubics.CubicHeal;
@@ -355,7 +354,7 @@ public final class L2CubicInstance implements IIdentifiable
 			{
 				if (_owner.isOlympiadStart())
 				{
-					if (ownerTarget instanceof L2Playable)
+					if (ownerTarget.isPlayable())
 					{
 						final L2PcInstance targetPlayer = ownerTarget.getActingPlayer();
 						if ((targetPlayer != null) && (targetPlayer.getOlympiadGameId() == _owner.getOlympiadGameId()) && (targetPlayer.getOlympiadSide() != _owner.getOlympiadSide()))
@@ -367,19 +366,20 @@ public final class L2CubicInstance implements IIdentifiable
 				return;
 			}
 			// test owners target if it is valid then use it
-			if ((ownerTarget instanceof L2Character) && (ownerTarget != _owner.getSummon()) && (ownerTarget != _owner))
+			if (ownerTarget.isCharacter() && (ownerTarget != _owner.getSummon()) && (ownerTarget != _owner))
 			{
 				// target mob which has aggro on you or your summon
-				if (ownerTarget instanceof L2Attackable)
+				if (ownerTarget.isAttackable())
 				{
-					if ((((L2Attackable) ownerTarget).getAggroList().get(_owner) != null) && !((L2Attackable) ownerTarget).isDead())
+					final L2Attackable attackable = (L2Attackable) ownerTarget;
+					if ((attackable.getAggroList().get(_owner) != null) && !attackable.isDead())
 					{
 						_target = (L2Character) ownerTarget;
 						return;
 					}
 					if (_owner.hasSummon())
 					{
-						if ((((L2Attackable) ownerTarget).getAggroList().get(_owner.getSummon()) != null) && !((L2Attackable) ownerTarget).isDead())
+						if ((attackable.getAggroList().get(_owner.getSummon()) != null) && !attackable.isDead())
 						{
 							_target = (L2Character) ownerTarget;
 							return;
@@ -472,21 +472,21 @@ public final class L2CubicInstance implements IIdentifiable
 			
 			if (skill.isBad())
 			{
-				byte shld = Formulas.calcShldUse(getOwner(), target, skill);
+				byte shld = Formulas.calcShldUse(_owner, target, skill);
 				boolean acted = Formulas.calcCubicSkillSuccess(this, target, skill, shld);
 				if (!acted)
 				{
-					getOwner().sendPacket(SystemMessageId.ATTACK_FAILED);
+					_owner.sendPacket(SystemMessageId.ATTACK_FAILED);
 					continue;
 				}
 				
 			}
 			
 			// Apply effects
-			skill.applyEffects(getOwner(), this, target, false, false, true, 0);
+			skill.applyEffects(_owner, target, false, false, true, 0);
 			
 			// If this is a bad skill notify the duel manager, so it can be removed after the duel (player & target must be in the same duel).
-			if (target.isPlayer() && target.getActingPlayer().isInDuel() && skill.isBad() && (getOwner().getDuelId() == target.getActingPlayer().getDuelId()))
+			if (target.isPlayer() && target.getActingPlayer().isInDuel() && skill.isBad() && (_owner.getDuelId() == target.getActingPlayer().getDuelId()))
 			{
 				DuelManager.getInstance().onBuff(target.getActingPlayer(), skill);
 			}
@@ -494,11 +494,10 @@ public final class L2CubicInstance implements IIdentifiable
 	}
 	
 	/**
-	 * @param activeCubic
 	 * @param skill
 	 * @param targets
 	 */
-	public void useCubicMdam(L2CubicInstance activeCubic, Skill skill, L2Object[] targets)
+	public void useCubicMdam(Skill skill, L2Object[] targets)
 	{
 		for (L2Character target : (L2Character[]) targets)
 		{
@@ -519,9 +518,9 @@ public final class L2CubicInstance implements IIdentifiable
 				}
 			}
 			
-			boolean mcrit = Formulas.calcMCrit(activeCubic.getOwner().getMCriticalHit(target, skill));
-			byte shld = Formulas.calcShldUse(activeCubic.getOwner(), target, skill);
-			int damage = (int) Formulas.calcMagicDam(activeCubic, target, skill, mcrit, shld);
+			boolean mcrit = Formulas.calcMCrit(_owner.getMCriticalHit(target, skill));
+			byte shld = Formulas.calcShldUse(_owner, target, skill);
+			int damage = (int) Formulas.calcMagicDam(this, target, skill, mcrit, shld);
 			
 			if (Config.DEBUG)
 			{
@@ -544,14 +543,14 @@ public final class L2CubicInstance implements IIdentifiable
 				}
 				else
 				{
-					activeCubic.getOwner().sendDamageMessage(target, damage, mcrit, false, false);
-					target.reduceCurrentHp(damage, activeCubic.getOwner(), skill);
+					_owner.sendDamageMessage(target, damage, mcrit, false, false);
+					target.reduceCurrentHp(damage, _owner, skill);
 				}
 			}
 		}
 	}
 	
-	public void useCubicDrain(L2CubicInstance activeCubic, Skill skill, L2Object[] targets)
+	public void useCubicDrain(Skill skill, L2Object[] targets)
 	{
 		if (Config.DEBUG)
 		{
@@ -565,10 +564,10 @@ public final class L2CubicInstance implements IIdentifiable
 				continue;
 			}
 			
-			boolean mcrit = Formulas.calcMCrit(activeCubic.getOwner().getMCriticalHit(target, skill));
-			byte shld = Formulas.calcShldUse(activeCubic.getOwner(), target, skill);
+			boolean mcrit = Formulas.calcMCrit(_owner.getMCriticalHit(target, skill));
+			byte shld = Formulas.calcShldUse(_owner, target, skill);
 			
-			int damage = (int) Formulas.calcMagicDam(activeCubic, target, skill, mcrit, shld);
+			int damage = (int) Formulas.calcMagicDam(this, target, skill, mcrit, shld);
 			if (Config.DEBUG)
 			{
 				_log.info("L2SkillDrain: useCubicSkill() -> damage = " + damage);
@@ -576,7 +575,7 @@ public final class L2CubicInstance implements IIdentifiable
 			
 			// TODO: Unhardcode fixed value
 			double hpAdd = (0.4 * damage);
-			L2PcInstance owner = activeCubic.getOwner();
+			L2PcInstance owner = _owner;
 			double hp = ((owner.getCurrentHp() + hpAdd) > owner.getMaxHp() ? owner.getMaxHp() : (owner.getCurrentHp() + hpAdd));
 			
 			owner.setCurrentHp(hp);
@@ -584,7 +583,7 @@ public final class L2CubicInstance implements IIdentifiable
 			// Check to see if we should damage the target
 			if ((damage > 0) && !target.isDead())
 			{
-				target.reduceCurrentHp(damage, activeCubic.getOwner(), skill);
+				target.reduceCurrentHp(damage, _owner, skill);
 				
 				// Manage attack or cast break of the target (calculating rate, sending message...)
 				if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
@@ -611,17 +610,17 @@ public final class L2CubicInstance implements IIdentifiable
 				continue;
 			}
 			
-			byte shld = Formulas.calcShldUse(getOwner(), target, skill);
+			byte shld = Formulas.calcShldUse(_owner, target, skill);
 			
 			if (skill.hasEffectType(L2EffectType.STUN, L2EffectType.PARALYZE, L2EffectType.ROOT))
 			{
 				if (Formulas.calcCubicSkillSuccess(this, target, skill, shld))
 				{
 					// Apply effects
-					skill.applyEffects(getOwner(), this, target, false, false, true, 0);
+					skill.applyEffects(_owner, target, false, false, true, 0);
 					
 					// If this is a bad skill notify the duel manager, so it can be removed after the duel (player & target must be in the same duel).
-					if (target.isPlayer() && target.getActingPlayer().isInDuel() && skill.isBad() && (getOwner().getDuelId() == target.getActingPlayer().getDuelId()))
+					if (target.isPlayer() && target.getActingPlayer().isInDuel() && skill.isBad() && (_owner.getDuelId() == target.getActingPlayer().getDuelId()))
 					{
 						DuelManager.getInstance().onBuff(target.getActingPlayer(), skill);
 					}
@@ -646,11 +645,11 @@ public final class L2CubicInstance implements IIdentifiable
 				{
 					if (target.isAttackable())
 					{
-						target.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, getOwner(), (int) ((150 * skill.getPower()) / (target.getLevel() + 7)));
+						target.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, _owner, (int) ((150 * skill.getPower()) / (target.getLevel() + 7)));
 					}
 					
 					// Apply effects
-					skill.applyEffects(getOwner(), this, target, false, false, true, 0);
+					skill.applyEffects(_owner, target, false, false, true, 0);
 					
 					if (Config.DEBUG)
 					{

+ 74 - 72
L2J_Server/java/com/l2jserver/gameserver/model/actor/tasks/cubics/CubicAction.java

@@ -117,100 +117,102 @@ public final class CubicAction implements Runnable
 			}
 			else if (Rnd.get(1, 100) < _chance)
 			{
-				Skill skill = _cubic.getSkills().get(Rnd.get(_cubic.getSkills().size()));
-				if (skill != null)
+				final Skill skill = _cubic.getSkills().get(Rnd.get(_cubic.getSkills().size()));
+				if (skill == null)
 				{
-					if (skill.getId() == L2CubicInstance.SKILL_CUBIC_HEAL)
+					return;
+				}
+				
+				if (skill.getId() == L2CubicInstance.SKILL_CUBIC_HEAL)
+				{
+					// friendly skill, so we look a target in owner's party
+					_cubic.cubicTargetForHeal();
+				}
+				else
+				{
+					// offensive skill, we look for an enemy target
+					_cubic.getCubicTarget();
+					if (!L2CubicInstance.isInCubicRange(_cubic.getOwner(), _cubic.getTarget()))
 					{
-						// friendly skill, so we look a target in owner's party
-						_cubic.cubicTargetForHeal();
+						_cubic.setTarget(null);
 					}
-					else
+				}
+				L2Character target = _cubic.getTarget();
+				if ((target != null) && !target.isDead())
+				{
+					if (Config.DEBUG)
 					{
-						// offensive skill, we look for an enemy target
-						_cubic.getCubicTarget();
-						if (!L2CubicInstance.isInCubicRange(_cubic.getOwner(), _cubic.getTarget()))
-						{
-							_cubic.setTarget(null);
-						}
+						_log.info("L2CubicInstance: Action.run();");
+						_log.info("Cubic ID: " + _cubic.getId() + " Target: " + target.getName() + " distance: " + target.calculateDistance(_cubic.getOwner(), true, false));
 					}
-					L2Character target = _cubic.getTarget();
-					if ((target != null) && !target.isDead())
+					
+					_cubic.getOwner().broadcastPacket(new MagicSkillUse(_cubic.getOwner(), target, skill.getId(), skill.getLevel(), 0, 0));
+					
+					L2Character[] targets =
+					{
+						target
+					};
+					
+					if (skill.isContinuous())
 					{
 						if (Config.DEBUG)
 						{
-							_log.info("L2CubicInstance: Action.run();");
-							_log.info("Cubic ID: " + _cubic.getId() + " Target: " + target.getName() + " distance: " + target.calculateDistance(_cubic.getOwner(), true, false));
+							_log.info("L2CubicInstance: Action.run() skill " + skill);
 						}
-						
-						_cubic.getOwner().broadcastPacket(new MagicSkillUse(_cubic.getOwner(), target, skill.getId(), skill.getLevel(), 0, 0));
-						
-						L2Character[] targets =
-						{
-							target
-						};
-						
-						if (skill.isContinuous())
-						{
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run() skill " + skill);
-							}
-							_cubic.useCubicContinuous(skill, targets);
-						}
-						else
+						_cubic.useCubicContinuous(skill, targets);
+					}
+					else
+					{
+						skill.activateSkill(_cubic, targets);
+						if (Config.DEBUG)
 						{
-							skill.activateSkill(_cubic.getOwner(), targets);
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run(); other handler");
-							}
+							_log.info("L2CubicInstance: Action.run(); other handler");
 						}
-						
-						if (skill.hasEffectType(L2EffectType.MAGICAL_ATTACK))
+					}
+					
+					if (skill.hasEffectType(L2EffectType.MAGICAL_ATTACK))
+					{
+						if (Config.DEBUG)
 						{
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run() skill " + skill);
-							}
-							_cubic.useCubicMdam(_cubic, skill, targets);
+							_log.info("L2CubicInstance: Action.run() skill " + skill);
 						}
-						else if (skill.hasEffectType(L2EffectType.HP_DRAIN))
+						_cubic.useCubicMdam(skill, targets);
+					}
+					else if (skill.hasEffectType(L2EffectType.HP_DRAIN))
+					{
+						if (Config.DEBUG)
 						{
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run() skill " + skill);
-							}
-							_cubic.useCubicDrain(_cubic, skill, targets);
+							_log.info("L2CubicInstance: Action.run() skill " + skill);
 						}
-						else if (skill.hasEffectType(L2EffectType.STUN, L2EffectType.ROOT, L2EffectType.PARALYZE))
+						_cubic.useCubicDrain(skill, targets);
+					}
+					else if (skill.hasEffectType(L2EffectType.STUN, L2EffectType.ROOT, L2EffectType.PARALYZE))
+					{
+						if (Config.DEBUG)
 						{
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run() skill " + skill);
-							}
-							_cubic.useCubicDisabler(skill, targets);
+							_log.info("L2CubicInstance: Action.run() skill " + skill);
 						}
-						else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT))
+						_cubic.useCubicDisabler(skill, targets);
+					}
+					else if (skill.hasEffectType(L2EffectType.DMG_OVER_TIME, L2EffectType.DMG_OVER_TIME_PERCENT))
+					{
+						if (Config.DEBUG)
 						{
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run() skill " + skill);
-							}
-							_cubic.useCubicContinuous(skill, targets);
+							_log.info("L2CubicInstance: Action.run() skill " + skill);
 						}
-						else if (skill.hasEffectType(L2EffectType.AGGRESSION))
+						_cubic.useCubicContinuous(skill, targets);
+					}
+					else if (skill.hasEffectType(L2EffectType.AGGRESSION))
+					{
+						if (Config.DEBUG)
 						{
-							if (Config.DEBUG)
-							{
-								_log.info("L2CubicInstance: Action.run() skill " + skill);
-							}
-							_cubic.useCubicDisabler(skill, targets);
+							_log.info("L2CubicInstance: Action.run() skill " + skill);
 						}
-						
-						// The cubic has done an action, increase the current count
-						_currentCount.incrementAndGet();
+						_cubic.useCubicDisabler(skill, targets);
 					}
+					
+					// The cubic has done an action, increase the current count
+					_currentCount.incrementAndGet();
 				}
 			}
 		}

+ 11 - 22
L2J_Server/java/com/l2jserver/gameserver/model/actor/tasks/cubics/CubicHeal.java

@@ -56,35 +56,24 @@ public class CubicHeal implements Runnable
 			_cubic.cancelDisappear();
 			return;
 		}
+		
 		try
 		{
-			Skill skill = null;
-			for (Skill sk : _cubic.getSkills())
+			final Skill skill = _cubic.getSkills().stream().filter(s -> s.getId() == L2CubicInstance.SKILL_CUBIC_HEAL).findFirst().orElse(null);
+			if (skill == null)
 			{
-				if (sk.getId() == L2CubicInstance.SKILL_CUBIC_HEAL)
-				{
-					skill = sk;
-					break;
-				}
+				return;
 			}
 			
-			if (skill != null)
+			_cubic.cubicTargetForHeal();
+			final L2Character target = _cubic.getTarget();
+			if ((target != null) && !target.isDead())
 			{
-				_cubic.cubicTargetForHeal();
-				final L2Character target = _cubic.getTarget();
-				if ((target != null) && !target.isDead())
+				if ((target.getMaxHp() - target.getCurrentHp()) > skill.getPower())
 				{
-					if ((target.getMaxHp() - target.getCurrentHp()) > skill.getPower())
-					{
-						L2Character[] targets =
-						{
-							target
-						};
-						
-						skill.activateSkill(_cubic.getOwner(), targets);
-						
-						_cubic.getOwner().broadcastPacket(new MagicSkillUse(_cubic.getOwner(), target, skill.getId(), skill.getLevel(), 0, 0));
-					}
+					skill.activateSkill(_cubic, target);
+					
+					_cubic.getOwner().broadcastPacket(new MagicSkillUse(_cubic.getOwner(), target, skill.getId(), skill.getLevel(), 0, 0));
 				}
 			}
 		}

+ 1 - 6
L2J_Server/java/com/l2jserver/gameserver/model/itemcontainer/Inventory.java

@@ -373,12 +373,7 @@ public abstract class Inventory extends ItemContainer
 			Skill unequipSkill = it.getUnequipSkill();
 			if (unequipSkill != null)
 			{
-				L2PcInstance[] targets =
-				{
-					player
-				};
-				
-				unequipSkill.activateSkill(player, targets);
+				unequipSkill.activateSkill(player, player);
 			}
 			
 			if (update)

+ 7 - 13
L2J_Server/java/com/l2jserver/gameserver/model/items/L2Weapon.java

@@ -364,13 +364,7 @@ public final class L2Weapon extends L2Item
 			// Skill condition not met
 			return;
 		}
-		
-		L2Character[] targets =
-		{
-			target
-		};
-		
-		onCritSkill.activateSkill(caster, targets);
+		onCritSkill.activateSkill(caster, target);
 	}
 	
 	/**
@@ -429,18 +423,18 @@ public final class L2Weapon extends L2Item
 			return;
 		}
 		
-		L2Character[] targets =
-		{
-			target
-		};
-		
 		// Launch the magic skill and calculate its effects
 		// Get the skill handler corresponding to the skill type
-		onMagicSkill.activateSkill(caster, targets);
+		onMagicSkill.activateSkill(caster, target);
 		
 		// notify quests of a skill use
 		if (caster instanceof L2PcInstance)
 		{
+			L2Character[] targets =
+			{
+				target
+			};
+			
 			//@formatter:off
 			caster.getKnownList().getKnownObjects().values().stream()
 				.filter(Objects::nonNull)

+ 38 - 15
L2J_Server/java/com/l2jserver/gameserver/model/skills/Skill.java

@@ -909,7 +909,7 @@ public final class Skill implements IIdentifiable
 	
 	public boolean useSoulShot()
 	{
-		return (hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK));
+		return hasEffectType(L2EffectType.PHYSICAL_ATTACK, L2EffectType.PHYSICAL_ATTACK_HP_LINK);
 	}
 	
 	public boolean useSpiritShot()
@@ -1329,18 +1329,18 @@ public final class Skill implements IIdentifiable
 	}
 	
 	/**
-	 * Method overload for {@link Skill#applyEffects(L2Character, L2CubicInstance, L2Character, boolean, boolean, boolean, int)}.<br>
+	 * Method overload for {@link Skill#applyEffects(L2Character, L2Character, boolean, boolean, boolean, int)}.<br>
 	 * Simplify the calls.
 	 * @param effector the caster of the skill
 	 * @param effected the target of the effect
 	 */
 	public void applyEffects(L2Character effector, L2Character effected)
 	{
-		applyEffects(effector, null, effected, false, false, true, 0);
+		applyEffects(effector, effected, false, false, true, 0);
 	}
 	
 	/**
-	 * Method overload for {@link Skill#applyEffects(L2Character, L2CubicInstance, L2Character, boolean, boolean, boolean, int)}.<br>
+	 * Method overload for {@link Skill#applyEffects(L2Character, L2Character, boolean, boolean, boolean, int)}.<br>
 	 * Simplify the calls, allowing abnormal time time customization.
 	 * @param effector the caster of the skill
 	 * @param effected the target of the effect
@@ -1349,20 +1349,19 @@ public final class Skill implements IIdentifiable
 	 */
 	public void applyEffects(L2Character effector, L2Character effected, boolean instant, int abnormalTime)
 	{
-		applyEffects(effector, null, effected, false, false, instant, abnormalTime);
+		applyEffects(effector, effected, false, false, instant, abnormalTime);
 	}
 	
 	/**
 	 * Applies the effects from this skill to the target.
 	 * @param effector the caster of the skill
-	 * @param cubic the cubic that cast the skill, can be {@code null}
 	 * @param effected the target of the effect
 	 * @param self if {@code true} self-effects will be casted on the caster
 	 * @param passive if {@code true} passive effects will be applied to the effector
 	 * @param instant if {@code true} instant effects will be applied to the effected
 	 * @param abnormalTime custom abnormal time, if equal or lesser than zero will be ignored
 	 */
-	public void applyEffects(L2Character effector, L2CubicInstance cubic, L2Character effected, boolean self, boolean passive, boolean instant, int abnormalTime)
+	public void applyEffects(L2Character effector, L2Character effected, boolean self, boolean passive, boolean instant, int abnormalTime)
 	{
 		// null targets cannot receive any effects.
 		if (effected == null)
@@ -1447,12 +1446,33 @@ public final class Skill implements IIdentifiable
 		}
 	}
 	
+	/**
+	 * Activates a skill for the given creature and targets.
+	 * @param caster the caster
+	 * @param targets the targets
+	 */
+	public void activateSkill(L2Character caster, L2Object... targets)
+	{
+		activateSkill(caster, null, targets);
+	}
+	
+	/**
+	 * Activates a skill for the given cubic and targets.
+	 * @param cubic the cubic
+	 * @param targets the targets
+	 */
+	public void activateSkill(L2CubicInstance cubic, L2Object... targets)
+	{
+		activateSkill(cubic.getOwner(), cubic, targets);
+	}
+	
 	/**
 	 * Activates the skill to the targets.
 	 * @param caster the caster
+	 * @param cubic the cubic, can be {@code null}
 	 * @param targets the targets
 	 */
-	public void activateSkill(L2Character caster, L2Object[] targets)
+	private void activateSkill(L2Character caster, L2CubicInstance cubic, L2Object... targets)
 	{
 		switch (getId())
 		{
@@ -1524,16 +1544,19 @@ public final class Skill implements IIdentifiable
 			{
 				caster.stopSkillEffects(true, getId());
 			}
-			applyEffects(caster, null, caster, true, false, true, 0);
+			applyEffects(caster, caster, true, false, true, 0);
 		}
 		
-		if (useSpiritShot())
-		{
-			caster.setChargedShot(caster.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false);
-		}
-		else if (useSoulShot())
+		if (cubic == null)
 		{
-			caster.setChargedShot(ShotType.SOULSHOTS, false);
+			if (useSpiritShot())
+			{
+				caster.setChargedShot(caster.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false);
+			}
+			else if (useSoulShot())
+			{
+				caster.setChargedShot(ShotType.SOULSHOTS, false);
+			}
 		}
 	}