diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/usercommandhandlers/Escape.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/usercommandhandlers/Escape.java index 4d5e70929d87454f262ada5ab7b27021c1ef2bf5..0075382034057f1f97314ea736ef67d46d15fb82 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/usercommandhandlers/Escape.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/usercommandhandlers/Escape.java @@ -22,9 +22,7 @@ import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.handler.IUserCommandHandler; -import com.l2jserver.gameserver.instancemanager.GrandBossManager; import com.l2jserver.gameserver.instancemanager.MapRegionManager; -import com.l2jserver.gameserver.model.PcCondOverride; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.model.skills.L2Skill; @@ -53,34 +51,13 @@ public class Escape implements IUserCommandHandler return false; } - int unstuckTimer = (activeChar.getAccessLevel().isGm() ? 1000 : Config.UNSTUCK_INTERVAL * 1000); - // Check to see if the player is in a festival. - if (activeChar.isFestivalParticipant()) - { - activeChar.sendMessage("You may not use an escape command in a festival."); - return false; - } - - // Check to see if player is in jail - if (activeChar.isInJail()) - { - activeChar.sendMessage("You can not escape from jail."); - return false; - } - - if (GrandBossManager.getInstance().getZone(activeChar) != null && !activeChar.canOverrideCond(PcCondOverride.ZONE_CONDITIONS)) + if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted() || activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped()) { - activeChar.sendMessage("You may not use an escape command in a Boss Zone."); return false; } - - if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted() - || activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped()) - return false; - activeChar.forceIsCasting(GameTimeController.getGameTicks() + unstuckTimer / GameTimeController.MILLIS_IN_TICK); - + activeChar.forceIsCasting(GameTimeController.getGameTicks() + (unstuckTimer / GameTimeController.MILLIS_IN_TICK)); L2Skill escape = SkillTable.getInstance().getInfo(2099, 1); // 5 minutes escape L2Skill GM_escape = SkillTable.getInstance().getInfo(2100, 1); // 1 second escape @@ -93,7 +70,7 @@ public class Escape implements IUserCommandHandler } activeChar.sendMessage("You use Escape: 1 second."); } - else if (Config.UNSTUCK_INTERVAL == 300 && escape != null) + else if ((Config.UNSTUCK_INTERVAL == 300) && (escape != null)) { activeChar.doCast(escape); return true; @@ -102,13 +79,15 @@ public class Escape implements IUserCommandHandler { if (Config.UNSTUCK_INTERVAL > 100) { - activeChar.sendMessage("You use Escape: " + unstuckTimer / 60000 + " minutes."); + activeChar.sendMessage("You use Escape: " + (unstuckTimer / 60000) + " minutes."); } else - activeChar.sendMessage("You use Escape: " + unstuckTimer / 1000 + " seconds."); + { + activeChar.sendMessage("You use Escape: " + (unstuckTimer / 1000) + " seconds."); + } } activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - //SoE Animation section + // SoE Animation section activeChar.setTarget(activeChar); activeChar.disableAllSkills(); @@ -116,7 +95,7 @@ public class Escape implements IUserCommandHandler Broadcast.toSelfAndKnownPlayersInRadius(activeChar, msk, 900); SetupGauge sg = new SetupGauge(0, unstuckTimer); activeChar.sendPacket(sg); - //End SoE Animation section + // End SoE Animation section EscapeFinalizer ef = new EscapeFinalizer(activeChar); // continue execution later @@ -127,7 +106,7 @@ public class Escape implements IUserCommandHandler static class EscapeFinalizer implements Runnable { - private L2PcInstance _activeChar; + private final L2PcInstance _activeChar; EscapeFinalizer(L2PcInstance activeChar) { @@ -138,7 +117,9 @@ public class Escape implements IUserCommandHandler public void run() { if (_activeChar.isDead()) + { return; + } _activeChar.setIsIn7sDungeon(false); _activeChar.enableAllSkills();