Removed custom away system.
This commit is contained in:
parent
c31c85e2a3
commit
f1b7de35a6
@ -1,23 +0,0 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
# Away System
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Allow players to change their status to Away.
|
||||
# Commands: .away and .back
|
||||
AllowAwayStatus = False
|
||||
|
||||
# Away only in peace zones.
|
||||
AwayOnlyInPeaceZone = True
|
||||
|
||||
# Player can take aggro from monsters while he is Away.
|
||||
AwayPlayerTakeAggro = False
|
||||
|
||||
# Away status title color.
|
||||
# Default: 0000FF (red)
|
||||
AwayTitleColor = 0000FF
|
||||
|
||||
# How many seconds until player goes in away mode.
|
||||
AwayTimer = 10
|
||||
|
||||
# How many seconds until player goes back from away mode.
|
||||
BackTimer = 10
|
@ -558,7 +558,7 @@ ClearDroppedItemTable = False
|
||||
# Default: 15
|
||||
CharacterDataStoreInterval = 15
|
||||
|
||||
# When enabled, this forces (even if using lazy item updates) the items owned by the character to be updated into DB when saving its character.
|
||||
# When enabled, this forces the items owned by the character to be updated into DB when saving its character.
|
||||
# Default: True
|
||||
UpdateItemsOnCharStore = True
|
||||
|
||||
|
@ -88,7 +88,6 @@ public class Config
|
||||
private static final String EVENT_TVT_CONFIG_FILE = "./config/events/TvT.ini";
|
||||
private static final String EVENT_TW_CONFIG_FILE = "./config/events/TW.ini";
|
||||
// custom
|
||||
private static final String AWAY_CONFIG_FILE = "./config/custom/Away.ini";
|
||||
private static final String BANK_CONFIG_FILE = "./config/custom/Bank.ini";
|
||||
private static final String CHAMPION_CONFIG_FILE = "./config/custom/Champion.ini";
|
||||
private static final String MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE = "./config/custom/MerchantZeroSellPrice.ini";
|
||||
@ -571,13 +570,6 @@ public class Config
|
||||
public static double ALT_GAME_CREATION_SP_RATE;
|
||||
public static boolean ALT_BLACKSMITH_USE_RECIPES;
|
||||
|
||||
public static boolean ALLOW_AWAY_STATUS;
|
||||
public static int AWAY_TIMER;
|
||||
public static int BACK_TIMER;
|
||||
public static int AWAY_TITLE_COLOR;
|
||||
public static boolean AWAY_PLAYER_TAKE_AGGRO;
|
||||
public static boolean AWAY_PEACE_ZONE;
|
||||
|
||||
public static boolean BANKING_SYSTEM_ENABLED;
|
||||
public static int BANKING_SYSTEM_GOLDBARS;
|
||||
public static int BANKING_SYSTEM_ADENA;
|
||||
@ -2001,7 +1993,7 @@ public class Config
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadREBIRTHConfig()
|
||||
public static void loadRebirthConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -2080,31 +2072,6 @@ public class Config
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadAWAYConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
final Properties AWAYSettings = new Properties();
|
||||
final InputStream is = new FileInputStream(new File(AWAY_CONFIG_FILE));
|
||||
AWAYSettings.load(is);
|
||||
is.close();
|
||||
|
||||
/** Away System **/
|
||||
ALLOW_AWAY_STATUS = Boolean.parseBoolean(AWAYSettings.getProperty("AllowAwayStatus", "false"));
|
||||
AWAY_PLAYER_TAKE_AGGRO = Boolean.parseBoolean(AWAYSettings.getProperty("AwayPlayerTakeAggro", "false"));
|
||||
AWAY_TITLE_COLOR = Integer.decode("0x" + AWAYSettings.getProperty("AwayTitleColor", "0000FF"));
|
||||
AWAY_TIMER = Integer.parseInt(AWAYSettings.getProperty("AwayTimer", "30"));
|
||||
BACK_TIMER = Integer.parseInt(AWAYSettings.getProperty("BackTimer", "30"));
|
||||
AWAY_PEACE_ZONE = Boolean.parseBoolean(AWAYSettings.getProperty("AwayOnlyInPeaceZone", "false"));
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
throw new Error("Failed to Load " + AWAY_CONFIG_FILE + " File.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadBankingConfig()
|
||||
{
|
||||
try
|
||||
@ -3844,15 +3811,14 @@ public class Config
|
||||
loadFloodConfig();
|
||||
loadPOtherConfig();
|
||||
|
||||
// Geo&path
|
||||
// Geoengine
|
||||
loadgeodataConfig();
|
||||
|
||||
// Custom
|
||||
loadChampionConfig();
|
||||
loadMerchantZeroPriceConfig();
|
||||
loadWeddingConfig();
|
||||
loadREBIRTHConfig();
|
||||
loadAWAYConfig();
|
||||
loadRebirthConfig();
|
||||
loadBankingConfig();
|
||||
loadBufferConfig();
|
||||
loadPCBPointConfig();
|
||||
|
@ -85,7 +85,6 @@ import org.l2jmobius.gameserver.handler.UserCommandHandler;
|
||||
import org.l2jmobius.gameserver.handler.VoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import org.l2jmobius.gameserver.instancemanager.AuctionManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.AwayManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManorManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||
@ -420,28 +419,14 @@ public class GameServer
|
||||
|
||||
LOGGER.info("IdFactory: Free ObjectID's remaining: " + IdFactory.getInstance().size());
|
||||
|
||||
Util.printSection("Custom Mods");
|
||||
|
||||
if (Config.L2JMOD_ALLOW_WEDDING || Config.ALLOW_AWAY_STATUS || Config.PCB_ENABLE)
|
||||
if (Config.L2JMOD_ALLOW_WEDDING)
|
||||
{
|
||||
if (Config.L2JMOD_ALLOW_WEDDING)
|
||||
{
|
||||
CoupleManager.getInstance();
|
||||
}
|
||||
|
||||
if (Config.ALLOW_AWAY_STATUS)
|
||||
{
|
||||
AwayManager.getInstance();
|
||||
}
|
||||
|
||||
if (Config.PCB_ENABLE)
|
||||
{
|
||||
ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
|
||||
}
|
||||
CoupleManager.getInstance();
|
||||
}
|
||||
else
|
||||
|
||||
if (Config.PCB_ENABLE)
|
||||
{
|
||||
LOGGER.info("All custom mods are Disabled.");
|
||||
ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
|
||||
}
|
||||
|
||||
Util.printSection("EventManager");
|
||||
|
@ -202,12 +202,6 @@ public class AttackableAI extends CreatureAI
|
||||
return false;
|
||||
}
|
||||
|
||||
// check player is in away mod
|
||||
if (((PlayerInstance) target).isAway() && !Config.AWAY_PLAYER_TAKE_AGGRO)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.isInParty() && target.getParty().isInDimensionalRift())
|
||||
{
|
||||
final byte riftType = target.getParty().getDimensionalRift().getType();
|
||||
|
@ -21,7 +21,6 @@ import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.AwayCmd;
|
||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.BankingCmd;
|
||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.CTFCmd;
|
||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.DMCmd;
|
||||
@ -72,11 +71,6 @@ public class VoicedCommandHandler
|
||||
|
||||
registerVoicedCommandHandler(new StatsCmd());
|
||||
|
||||
if (Config.ALLOW_AWAY_STATUS)
|
||||
{
|
||||
registerVoicedCommandHandler(new AwayCmd());
|
||||
}
|
||||
|
||||
if (Config.ALLOW_FARM1_COMMAND || Config.ALLOW_FARM2_COMMAND || Config.ALLOW_PVP1_COMMAND || Config.ALLOW_PVP2_COMMAND)
|
||||
{
|
||||
registerVoicedCommandHandler(new FarmPvpCmd());
|
||||
|
@ -94,7 +94,7 @@ public class CustomPotions implements IItemHandler
|
||||
if (skill != null)
|
||||
{
|
||||
player.doCast(skill);
|
||||
if (((!player.isSitting() && !player.isParalyzed() && !player.isAway() && !player.isFakeDeath()) || skill.isPotion()))
|
||||
if (((!player.isSitting() && !player.isParalyzed() && !player.isFakeDeath()) || skill.isPotion()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -79,12 +79,6 @@ public class Firework implements IItemHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isConfused())
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -117,7 +117,7 @@ public class Escape implements IUserCommandHandler
|
||||
}
|
||||
|
||||
// Check player status.
|
||||
if (player.isCastingNow() || player.isMovementDisabled() || player.isMuted() || player.isAlikeDead() || player.isInOlympiadMode() || player.isAwaying())
|
||||
if (player.isCastingNow() || player.isMovementDisabled() || player.isMuted() || player.isAlikeDead() || player.isInOlympiadMode())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -80,12 +80,6 @@ public class OfflineShop implements IUserCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
player.sendMessage("You can't restart in Away mode.");
|
||||
return false;
|
||||
}
|
||||
|
||||
player.getInventory().updateDatabase();
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||
|
@ -1,176 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.voicedcommandhandlers;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.AwayManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.Siege;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
* @author Michiru
|
||||
*/
|
||||
public class AwayCmd implements IVoicedCommandHandler
|
||||
{
|
||||
private static final String[] VOICED_COMMANDS =
|
||||
{
|
||||
"away",
|
||||
"back"
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String text)
|
||||
{
|
||||
if (command.startsWith("away"))
|
||||
{
|
||||
return away(activeChar, text);
|
||||
}
|
||||
else if (command.startsWith("back"))
|
||||
{
|
||||
return back(activeChar);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final int ZONE_PEACE = 2;
|
||||
|
||||
private boolean away(PlayerInstance activeChar, String text)
|
||||
{
|
||||
final Siege siege = SiegeManager.getInstance().getSiege(activeChar);
|
||||
|
||||
// check char is all ready in away mode
|
||||
if (activeChar.isAway() || activeChar.isAwaying())
|
||||
{
|
||||
activeChar.sendMessage("You are already Away.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!activeChar.isInsideZone(ZoneId.PEACE) && Config.AWAY_PEACE_ZONE)
|
||||
{
|
||||
activeChar.sendMessage("You can only Away in peace zone.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check player is death/fake death and movement disable
|
||||
if (activeChar.isMovementDisabled() || activeChar.isAlikeDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if player is in Siege
|
||||
if ((siege != null) && siege.isInProgress())
|
||||
{
|
||||
activeChar.sendMessage("You are in siege, you can't go Afk.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if player is a Cursed Weapon owner
|
||||
if (activeChar.isCursedWeaponEquiped())
|
||||
{
|
||||
activeChar.sendMessage("You can't go Afk! You are currently holding a cursed weapon.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if player is in Duel
|
||||
if (activeChar.isInDuel())
|
||||
{
|
||||
activeChar.sendMessage("You can't go Afk! You are in a duel!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check is in DimensionsRift
|
||||
if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift())
|
||||
{
|
||||
activeChar.sendMessage("You can't go Afk! You are in the dimensional rift.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check to see if the player is in an event
|
||||
if (activeChar.isInFunEvent())
|
||||
{
|
||||
activeChar.sendMessage("You can't go Afk! You are in event now.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check player is in Olympiade
|
||||
if (activeChar.isInOlympiadMode() || (activeChar.getOlympiadGameId() != -1))
|
||||
{
|
||||
activeChar.sendMessage("You can't go Afk! Your are fighting in Olympiad!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check player is in observer mode
|
||||
if (activeChar.inObserverMode())
|
||||
{
|
||||
activeChar.sendMessage("You can't go Afk in Observer mode!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check player have karma/pk/pvp status
|
||||
if ((activeChar.getKarma() > 0) || (activeChar.getPvpFlag() > 0))
|
||||
{
|
||||
activeChar.sendMessage("Player in PVP or with Karma can't use the Away command!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (text == null)
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
// check away text have not more then 10 letter
|
||||
if (text.length() > 10)
|
||||
{
|
||||
activeChar.sendMessage("You can't set your status Away with more then 10 letters.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if player have no one in target
|
||||
if (activeChar.getTarget() == null)
|
||||
{
|
||||
// set this Player status away in AwayManager
|
||||
AwayManager.getInstance().setAway(activeChar, text);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendMessage("You can't have any one in your target.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean back(PlayerInstance activeChar)
|
||||
{
|
||||
if (!activeChar.isAway())
|
||||
{
|
||||
activeChar.sendMessage("You are not Away!");
|
||||
return false;
|
||||
}
|
||||
AwayManager.getInstance().setBack(activeChar);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getVoicedCommandList()
|
||||
{
|
||||
return VOICED_COMMANDS;
|
||||
}
|
||||
}
|
@ -81,12 +81,6 @@ public class OfflineShop implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
player.sendMessage("You can't restart in Away mode.");
|
||||
return false;
|
||||
}
|
||||
|
||||
player.getInventory().updateDatabase();
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||
|
@ -1,215 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.instancemanager;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
|
||||
/**
|
||||
* @author Michiru
|
||||
*/
|
||||
public class AwayManager
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(AwayManager.class.getName());
|
||||
|
||||
protected Map<PlayerInstance, RestoreData> _awayPlayers;
|
||||
|
||||
private AwayManager()
|
||||
{
|
||||
_awayPlayers = Collections.synchronizedMap(new WeakHashMap<PlayerInstance, RestoreData>());
|
||||
}
|
||||
|
||||
private final class RestoreData
|
||||
{
|
||||
private final String _originalTitle;
|
||||
private final int _originalTitleColor;
|
||||
private final boolean _sitForced;
|
||||
|
||||
public RestoreData(PlayerInstance player)
|
||||
{
|
||||
_originalTitle = player.getTitle();
|
||||
_originalTitleColor = player.getAppearance().getTitleColor();
|
||||
_sitForced = !player.isSitting();
|
||||
}
|
||||
|
||||
public boolean isSitForced()
|
||||
{
|
||||
return _sitForced;
|
||||
}
|
||||
|
||||
public void restore(PlayerInstance player)
|
||||
{
|
||||
player.getAppearance().setTitleColor(_originalTitleColor);
|
||||
player.setTitle(_originalTitle);
|
||||
}
|
||||
}
|
||||
|
||||
public void setAway(PlayerInstance player, String text)
|
||||
{
|
||||
player.setAwaying(true);
|
||||
player.broadcastPacket(new SocialAction(player.getObjectId(), 9));
|
||||
player.sendMessage("Your status is Away in " + Config.AWAY_TIMER + " Sec.");
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
final SetupGauge sg = new SetupGauge(SetupGauge.BLUE, Config.AWAY_TIMER * 1000);
|
||||
player.sendPacket(sg);
|
||||
player.setImmobilized(true);
|
||||
ThreadPool.schedule(new setPlayerAwayTask(player, text), Config.AWAY_TIMER * 1000);
|
||||
}
|
||||
|
||||
public void setBack(PlayerInstance player)
|
||||
{
|
||||
player.sendMessage("You are back from Away Status in " + Config.BACK_TIMER + " Sec.");
|
||||
final SetupGauge sg = new SetupGauge(SetupGauge.BLUE, Config.BACK_TIMER * 1000);
|
||||
player.sendPacket(sg);
|
||||
ThreadPool.schedule(new setPlayerBackTask(player), Config.BACK_TIMER * 1000);
|
||||
}
|
||||
|
||||
public void extraBack(PlayerInstance player)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final RestoreData rd = _awayPlayers.get(player);
|
||||
if (rd == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rd.restore(player);
|
||||
_awayPlayers.remove(player);
|
||||
}
|
||||
|
||||
class setPlayerAwayTask implements Runnable
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
private final String _awayText;
|
||||
|
||||
setPlayerAwayTask(PlayerInstance player, String awayText)
|
||||
{
|
||||
_player = player;
|
||||
_awayText = awayText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (_player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_player.isAttackingNow() || _player.isCastingNow())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_awayPlayers.put(_player, new RestoreData(_player));
|
||||
|
||||
_player.disableAllSkills();
|
||||
_player.abortAttack();
|
||||
_player.abortCast();
|
||||
_player.setTarget(null);
|
||||
_player.setImmobilized(false);
|
||||
if (!_player.isSitting())
|
||||
{
|
||||
_player.sitDown();
|
||||
}
|
||||
if (_awayText.length() <= 1)
|
||||
{
|
||||
_player.sendMessage("You are now *Away*");
|
||||
}
|
||||
else
|
||||
{
|
||||
_player.sendMessage("You are now Away *" + _awayText + "*");
|
||||
}
|
||||
|
||||
_player.getAppearance().setTitleColor(Config.AWAY_TITLE_COLOR);
|
||||
|
||||
if (_awayText.length() <= 1)
|
||||
{
|
||||
_player.setTitle("*Away*");
|
||||
}
|
||||
else
|
||||
{
|
||||
_player.setTitle("Away*" + _awayText + "*");
|
||||
}
|
||||
|
||||
_player.broadcastUserInfo();
|
||||
_player.setParalyzed(true);
|
||||
_player.setAway(true);
|
||||
_player.setAwaying(false);
|
||||
}
|
||||
}
|
||||
|
||||
class setPlayerBackTask implements Runnable
|
||||
{
|
||||
private final PlayerInstance _player;
|
||||
|
||||
setPlayerBackTask(PlayerInstance player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (_player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final RestoreData rd = _awayPlayers.get(_player);
|
||||
|
||||
if (rd == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_player.setParalyzed(false);
|
||||
_player.enableAllSkills();
|
||||
_player.setAway(false);
|
||||
|
||||
if (rd.isSitForced())
|
||||
{
|
||||
_player.standUp();
|
||||
}
|
||||
|
||||
rd.restore(_player);
|
||||
_awayPlayers.remove(_player);
|
||||
_player.broadcastUserInfo();
|
||||
_player.sendMessage("You are Back now!");
|
||||
}
|
||||
}
|
||||
|
||||
public static AwayManager getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final AwayManager INSTANCE = new AwayManager();
|
||||
}
|
||||
}
|
@ -313,8 +313,6 @@ public class PlayerInstance extends Playable
|
||||
private boolean _isIn7sDungeon = false;
|
||||
private int _heroConsecutiveKillCount = 0;
|
||||
private boolean _isPvpHero = false;
|
||||
private boolean _awaying = false;
|
||||
private boolean _isAway = false;
|
||||
public int _originalTitleColorAway;
|
||||
public String _originalTitleAway;
|
||||
private boolean _isAio = false;
|
||||
@ -3482,10 +3480,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
|
||||
}
|
||||
else if (isAway())
|
||||
{
|
||||
sendMessage("You can't stand up if your Status is Away.");
|
||||
}
|
||||
else if (_waitTypeSitting && !isInStoreMode() && !isAlikeDead())
|
||||
{
|
||||
if (_relax)
|
||||
@ -12328,24 +12322,6 @@ public class PlayerInstance extends Playable
|
||||
return _donator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is away.
|
||||
* @return true, if is away
|
||||
*/
|
||||
public boolean isAway()
|
||||
{
|
||||
return _isAway;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the checks if is away.
|
||||
* @param value the new checks if is away
|
||||
*/
|
||||
public void setAway(boolean value)
|
||||
{
|
||||
_isAway = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the checks if is in olympiad mode.
|
||||
* @param value the new checks if is in olympiad mode
|
||||
@ -16704,24 +16680,6 @@ public class PlayerInstance extends Playable
|
||||
return (int) Math.sqrt((dx * dx) + (dy * dy) + (dz * dz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is awaying.
|
||||
* @return the _awaying
|
||||
*/
|
||||
public boolean isAwaying()
|
||||
{
|
||||
return _awaying;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the _awaying.
|
||||
* @param awaying the _awaying to set
|
||||
*/
|
||||
public void setAwaying(boolean awaying)
|
||||
{
|
||||
_awaying = awaying;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is locked.
|
||||
* @return true, if is locked
|
||||
|
@ -43,7 +43,6 @@ import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
|
||||
import org.l2jmobius.gameserver.datatables.OfflineTradeTable;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.ClanTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.AwayManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@ -687,11 +686,6 @@ public class GameClient extends MMOClient<MMOConnection<GameClient>> implements
|
||||
player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
AwayManager.getInstance().extraBack(player);
|
||||
}
|
||||
|
||||
if (Olympiad.getInstance().isRegistered(player))
|
||||
{
|
||||
Olympiad.getInstance().unRegisterNoble(player);
|
||||
@ -772,11 +766,6 @@ public class GameClient extends MMOClient<MMOConnection<GameClient>> implements
|
||||
player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
AwayManager.getInstance().extraBack(player);
|
||||
}
|
||||
|
||||
if (Olympiad.getInstance().isRegistered(player))
|
||||
{
|
||||
Olympiad.getInstance().unRegisterNoble(player);
|
||||
|
@ -48,17 +48,11 @@ public class Logout extends GameClientPacket
|
||||
|
||||
if (player.isInFunEvent() && !player.isGM())
|
||||
{
|
||||
player.sendMessage("You cannot Logout while in registered in an Event.");
|
||||
player.sendMessage("You cannot logout while in registered in an event.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
player.sendMessage("You can't restart in Away mode.");
|
||||
return;
|
||||
}
|
||||
|
||||
player.getInventory().updateDatabase();
|
||||
|
||||
if (AttackStanceTaskManager.getInstance().getAttackStanceTask(player) && (!player.isGM() || !Config.GM_RESTART_FIGHTING))
|
||||
@ -71,7 +65,7 @@ public class Logout extends GameClientPacket
|
||||
// Dont allow leaving if player is in combat
|
||||
if (player.isInCombat() && !player.isGM())
|
||||
{
|
||||
player.sendMessage("You cannot Logout while is in Combat mode.");
|
||||
player.sendMessage("You cannot logout while in combat mode.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
@ -79,7 +73,7 @@ public class Logout extends GameClientPacket
|
||||
// Dont allow leaving if player is teleporting
|
||||
if (player.isTeleporting() && !player.isGM())
|
||||
{
|
||||
player.sendMessage("You cannot Logout while is Teleporting.");
|
||||
player.sendMessage("You cannot logout while teleporting.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
@ -102,14 +96,14 @@ public class Logout extends GameClientPacket
|
||||
{
|
||||
if (SevenSignsFestival.getInstance().isFestivalInitialized())
|
||||
{
|
||||
player.sendMessage("You cannot Logout while you are a participant in a Festival.");
|
||||
player.sendMessage("You cannot logout while you are a participant in a festival.");
|
||||
return;
|
||||
}
|
||||
|
||||
final Party playerParty = player.getParty();
|
||||
if (playerParty != null)
|
||||
{
|
||||
player.getParty().broadcastToPartyMembers(SystemMessage.sendString(player.getName() + " has been removed from the upcoming Festival."));
|
||||
player.getParty().broadcastToPartyMembers(SystemMessage.sendString(player.getName() + " has been removed from the upcoming festival."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,14 +98,6 @@ public class RequestRestart extends GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if player is in away mode
|
||||
if (player.isAway())
|
||||
{
|
||||
player.sendMessage("You can't restart in Away mode.");
|
||||
sendPacket(RestartResponse.valueOf(false));
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent player from restarting if they are a festival participant
|
||||
// and it is in progress, otherwise notify party members that the player
|
||||
// is not longer a participant.
|
||||
|
@ -68,13 +68,13 @@ public class RequestUnEquipItem extends GameClientPacket
|
||||
}
|
||||
|
||||
// Prevent player from unequipping items in special conditions
|
||||
if (player.isStunned() || player.isConfused() || player.isAway() || player.isParalyzed() || player.isSleeping() || player.isAlikeDead())
|
||||
if (player.isStunned() || player.isConfused() || player.isParalyzed() || player.isSleeping() || player.isAlikeDead())
|
||||
{
|
||||
player.sendMessage("Your status does not allow you to do that.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (/* activeChar.isAttackingNow() || */player.isCastingNow() || player.isCastingPotionNow())
|
||||
if (player.isCastingNow() || player.isCastingPotionNow())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -238,10 +238,6 @@ public class Say2 extends GameClientPacket
|
||||
}
|
||||
if (!receiver.getBlockList().isInBlockList(player) || player.isGM())
|
||||
{
|
||||
if (receiver.isAway())
|
||||
{
|
||||
player.sendMessage("Player is Away try again later.");
|
||||
}
|
||||
if (Config.JAIL_DISABLE_CHAT && receiver.isInJail())
|
||||
{
|
||||
player.sendMessage("Player is in jail.");
|
||||
|
@ -47,7 +47,7 @@ public class TradeRequest extends GameClientPacket
|
||||
|
||||
if (!player.getAccessLevel().allowTransaction())
|
||||
{
|
||||
player.sendMessage("Transactions are disable for your Access Level");
|
||||
player.sendMessage("Transactions are disable for your access level.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
@ -64,154 +64,140 @@ public class TradeRequest extends GameClientPacket
|
||||
|
||||
if (partner.isInOlympiadMode() || player.isInOlympiadMode())
|
||||
{
|
||||
player.sendMessage("You or your target can't request trade in Olympiad mode");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isAway())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner is Away");
|
||||
player.sendMessage("You or your target can't request trade in Olympiad mode.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isStunned())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner Stunned");
|
||||
player.sendMessage("You can't request a trade when partner is stunned.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isConfused())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner Confused");
|
||||
player.sendMessage("You can't request a trade when partner is confused.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isCastingNow() || partner.isCastingPotionNow())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner Casting Now");
|
||||
player.sendMessage("You can't request a trade when partner is casting.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isInDuel())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner in Duel");
|
||||
player.sendMessage("You can't request a trade when partner is in duel.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isImmobilized())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner is Immobilized");
|
||||
player.sendMessage("You can't request a trade when partner is immobilized.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isInFunEvent())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner in Event");
|
||||
player.sendMessage("You can't request a trade when partner in event.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.getActiveEnchantItem() != null)
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner Enchanting");
|
||||
player.sendMessage("You can't request a trade when partner is enchanting.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isParalyzed())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner is Paralyzed");
|
||||
player.sendMessage("You can't request a trade when partner is paralyzed.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.inObserverMode())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner in Observation Mode");
|
||||
player.sendMessage("You can't request a trade when partner is in observation mode.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (partner.isAttackingNow())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when partner Attacking Now");
|
||||
player.sendMessage("You can't request a trade when partner is attacking.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isStunned())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you Stunned");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isAway())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you Away");
|
||||
player.sendMessage("You can't request a trade when you are stunned.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isConfused())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you Confused");
|
||||
player.sendMessage("You can't request a trade when you are confused.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isCastingNow() || player.isCastingPotionNow())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you Casting");
|
||||
player.sendMessage("You can't request a trade when you are casting.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isInDuel())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you in Duel");
|
||||
player.sendMessage("You can't request a trade when you are in duel.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isImmobilized())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you are Immobilized");
|
||||
player.sendMessage("You can't request a trade when you are immobilized.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isInFunEvent())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you are in Event");
|
||||
player.sendMessage("You can't request a trade when you are in event.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getActiveEnchantItem() != null)
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you Enchanting");
|
||||
player.sendMessage("You can't request a trade when you enchanting.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.isParalyzed())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you are Paralyzed");
|
||||
player.sendMessage("You can't request a trade when you are paralyzed.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.inObserverMode())
|
||||
{
|
||||
player.sendMessage("You can't Request a Trade when you in Observation Mode");
|
||||
player.sendMessage("You can't request a trade when you in observation mode.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
@ -226,7 +212,7 @@ public class TradeRequest extends GameClientPacket
|
||||
// Alt game - Karma punishment
|
||||
if (!Config.ALT_GAME_KARMA_PLAYER_CAN_TRADE && ((player.getKarma() > 0) || (partner.getKarma() > 0)))
|
||||
{
|
||||
player.sendMessage("Chaotic players can't use Trade.");
|
||||
player.sendMessage("Chaotic players can't use trade.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
@ -240,7 +226,7 @@ public class TradeRequest extends GameClientPacket
|
||||
|
||||
if (!Config.ALLOW_LOW_LEVEL_TRADE && (((player.getLevel() < 76) && (partner.getLevel() >= 76)) || (partner.getLevel() < 76) || (player.getLevel() >= 76)))
|
||||
{
|
||||
player.sendMessage("You Cannot Trade a Lower Level Character");
|
||||
player.sendMessage("You cannot trade a lower level character.");
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public class UseItem extends GameClientPacket
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (player.isStunned() || player.isConfused() || player.isAway() || player.isParalyzed() || player.isSleeping())
|
||||
if (player.isStunned() || player.isConfused() || player.isParalyzed() || player.isSleeping())
|
||||
{
|
||||
player.sendMessage("You cannot use items right now.");
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user