Removed soulshot recharge task.

This commit is contained in:
MobiusDev
2019-01-10 20:47:52 +00:00
parent 6c38b88b42
commit d875f8c4c7
4 changed files with 8 additions and 22 deletions

View File

@@ -1085,16 +1085,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
setCurrentCp(getStatus().getCurrentCp() - 10);
}
final int timeAtk = calculateTimeBetweenAttacks(target, weaponItem);
// Recharge any active auto soulshot tasks for player (or player's summon if one exists).
if (this instanceof L2PcInstance)
{
((L2PcInstance) this).rechargeAutoSoulShot(true, false, false, timeAtk);
((L2PcInstance) this).rechargeAutoSoulShot(true, false, false);
}
else if (this instanceof L2Summon)
{
((L2Summon) this).getOwner().rechargeAutoSoulShot(true, false, true, timeAtk);
((L2Summon) this).getOwner().rechargeAutoSoulShot(true, false, true);
}
// Verify if soulshots are charged.
@@ -1111,6 +1109,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// Get the Attack Speed of the L2Character (delay (in milliseconds) before next attack)
// the hit is calculated to happen halfway to the animation - might need further tuning e.g. in bow case
final int timeAtk = calculateTimeBetweenAttacks(target, weaponItem);
final int timeToHit = timeAtk / 2;
_attackEndTime = GameTimeController.getGameTicks();
_attackEndTime += (timeAtk / GameTimeController.MILLIS_IN_TICK);
@@ -1646,16 +1645,15 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Recharge AutoSoulShot
final int atkTime = Formulas.getInstance().calcMAtkSpd(activeChar, skill, skill.getHitTime());
if (skill.useSoulShot())
{
if (activeChar instanceof L2PcInstance)
{
((L2PcInstance) activeChar).rechargeAutoSoulShot(true, false, false, atkTime);
((L2PcInstance) activeChar).rechargeAutoSoulShot(true, false, false);
}
else if (this instanceof L2Summon)
{
((L2Summon) activeChar).getOwner().rechargeAutoSoulShot(true, false, true, atkTime);
((L2Summon) activeChar).getOwner().rechargeAutoSoulShot(true, false, true);
}
}

View File

@@ -12331,18 +12331,6 @@ public final class L2PcInstance extends L2Playable
}
}
/**
* Recharge auto soul shot.
* @param physical the physical
* @param magic the magic
* @param summon the summon
* @param atkTime TODO
*/
public void rechargeAutoSoulShot(boolean physical, boolean magic, boolean summon, int atkTime)
{
ThreadPool.schedule(() -> rechargeAutoSoulShot(physical, magic, summon), atkTime);
}
class WarnUserTakeBreak implements Runnable
{
@Override

View File

@@ -116,7 +116,7 @@ public final class RequestAutoSoulShot extends L2GameClientPacket
sm.addString(item.getItemName());
activeChar.sendPacket(sm);
activeChar.rechargeAutoSoulShot(true, true, true, 0);
activeChar.rechargeAutoSoulShot(true, true, true);
}
else
{
@@ -155,7 +155,7 @@ public final class RequestAutoSoulShot extends L2GameClientPacket
activeChar.sendPacket(SystemMessageId.SOULSHOTS_GRADE_MISMATCH);
}
activeChar.rechargeAutoSoulShot(true, true, false, 0);
activeChar.rechargeAutoSoulShot(true, true, false);
}
}
}

View File

@@ -632,7 +632,7 @@ public final class UseItem extends L2GameClientPacket
if (item.getItem() instanceof L2Weapon)
{
// charge Soulshot/Spiritshot like L2OFF
activeChar.rechargeAutoSoulShot(true, true, false, 0);
activeChar.rechargeAutoSoulShot(true, true, false);
item.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);
item.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
}