Siga-nos em...
Follow us on Twitter Follow us on Facebook Watch us on YouTube
Registro

Alpha Servers
Resultados 1 a 3 de 3
  1. #1

    Avatar de Inspector
    Data de Ingresso
    May 2010
    Localização
    Na Frente do PC
    Idade
    44
    Posts
    84
    Agradecido
    4
    Agradeceu
    3
    Peso da Avaliação
    14

    Post Offline Trade Shopping

    MOD Utilizado para deixar Char logado vendendo ou comprando depois de deslogar

    Código:
    Index: data/scripts/handlers/chathandlers/ChatTell.java
    ===================================================================
    --- data/scripts/handlers/chathandlers/ChatTell.java	(revision 5944)
    +++ data/scripts/handlers/chathandlers/ChatTell.java	(working copy)
    @@ -76,6 +76,11 @@
     				activeChar.sendMessage("Player is chat banned.");
     				return;
     			}
    +			if (receiver.getClient().isDetached())
    +			{
    +				activeChar.sendMessage("Player is in offline mode.");
    +				return;
    +			}
     			
     			if (!receiver.getMessageRefusal())
     			{
    Index: java/config/l2jmods.properties
    ===================================================================
    --- java/config/l2jmods.properties	(revision 2917)
    +++ java/config/l2jmods.properties	(working copy)
    @@ -197,6 +197,24 @@
     
     
     # ---------------------------------------------------------------------------
    +# Offline trade/craft
    +# ---------------------------------------------------------------------------
    +# Option to enable or disable offline trade feature.
    +# Enable -> true, Disable -> false
    +OfflineTradeEnable = False
    +
    +# Option to enable or disable offline craft feature.
    +# Enable -> true, Disable -> false
    +OfflineCraftEnable = False
    +
    +# If set to True, name color will be changed then entering offline mode
    +OfflineSetNameColor = False
    +
    +# Color of the name in offline mode (if OfflineSetNameColor = True)
    +OfflineNameColor = 808080
    +
    +
    +# ---------------------------------------------------------------------------
     # Mana Drugs/Potions
     # ---------------------------------------------------------------------------
     # This option will enable core support for:
    Index: java/net/sf/l2j/Config.java
    ===================================================================
    --- java/net/sf/l2j/Config.java	(revision 2917)
    +++ java/net/sf/l2j/Config.java	(working copy)
    @@ -538,6 +538,10 @@
     	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
     	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
     	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
    +	public static boolean OFFLINE_TRADE_ENABLE;
    +	public static boolean OFFLINE_CRAFT_ENABLE;
    +	public static boolean OFFLINE_SET_NAME_COLOR;
    +	public static int OFFLINE_NAME_COLOR;
     	public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
     
     
    @@ -1716,6 +1720,11 @@
     					BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
     					BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
     
    +					OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
    +					OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
    +					OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
    +					OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
    +
     					L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
     				}
     				catch (Exception e)
    Index: java/net/sf/l2j/gameserver/network/L2GameClient.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/network/L2GameClient.java	(revision 2917)
    +++ java/net/sf/l2j/gameserver/network/L2GameClient.java	(working copy)
    @@ -39,6 +39,7 @@
     import net.sf.l2j.gameserver.model.L2World;
     import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
     import net.sf.l2j.gameserver.model.entity.L2Event;
    +import net.sf.l2j.gameserver.model.entity.TvTEvent;
     import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket;
     import net.sf.l2j.util.EventData;
     
    @@ -580,9 +581,25 @@
     			{
     				isDetached(true);
     				L2PcInstance player = L2GameClient.this.getActiveChar();
    -				if (player != null && player.isInCombat())
    +				if (player != null)
     				{
    -					fast = false;
    +					if (!player.isInOlympiadMode() && !player.isFestivalParticipant() && !TvTEvent.isPlayerParticipant(player.getObjectId()) && !player.isInJail())
    +					{
    +						if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
    +						{
    +							player.leaveParty();
    +							if (Config.OFFLINE_SET_NAME_COLOR)
    +							{
    +								player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
    +								player.broadcastUserInfo();
    +							}
    +							return;
    +						}
    +					}
    +					if (player.isInCombat())
    +					{
    +						fast = false;
    +					}
     				}
     				cleanMe(fast);
     			}
    Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java	(revision 2917)
    +++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java	(working copy)
    @@ -103,6 +103,13 @@
     		}
     
     		TvTEvent.onLogout(player);
    +		
    +		if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
    +		{
    +			player.closeNetConnection();
    +			return;
    +		}
    +
     		RegionBBSManager.getInstance().changeCommunityBoard();
     
     		player.deleteMe();
    Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java	(revision 2917)
    +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java	(working copy)
    @@ -105,6 +105,12 @@
     			requestor.sendMessage("Player is in Jail");
     			return;
     		}
    +		
    +		if (target.getClient().isDetached())
    +		{
    +			requestor.sendMessage("Player is in offline mode.");
    +			return;
    +		}
     
             if (target.isInOlympiadMode() || requestor.isInOlympiadMode())
                 return;
    Index: java/net/sf/l2j/gameserver/model/L2ClanMember.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/L2ClanMember.java	(revision 2917)
    +++ java/net/sf/l2j/gameserver/model/L2ClanMember.java	(working copy)
    @@ -143,7 +143,14 @@
     
     	public boolean isOnline()
     	{
    -		return _player != null;
    +		if (_player == null)
    +			return false;
    +		if (_player.getClient() == null)
    +			return false;
    +		if (_player.getClient().isDetached())
    +			return false;
    +
    +		return true;
     	}
     
     	/**
    Creditos: _DS_

  2. #2


    Avatar de daldegam
    Data de Ingresso
    Sep 2009
    Localização
    NULL
    Posts
    66
    Agradecido
    124
    Agradeceu
    29
    Peso da Avaliação
    17

    Padrão

    Cara.. não mexo com java.. mais acho que o princiopio é o mesmo...

    Isso não esta errado?
    public boolean isOnline()
    {
    - return _player != null;

    + if (_player == null)
    + return false;
    + if (_player.getClient() == null)
    + return false;
    + if (_player.getClient().isDetached())
    + return false;
    +
    + return true;
    }
    Abraços!

  3. #3

    Avatar de SerialKiller
    Data de Ingresso
    Jun 2011
    Localização
    Parana
    Posts
    54
    Agradecido
    0
    Agradeceu
    0
    Peso da Avaliação
    13

    Padrão

    Creio que não, este mod já foi testado...

 

 

Informações de Tópico

Usuários Navegando neste Tópico

Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)

Tópicos Similares

  1. |Release| Trade Relong /nao pode relogar iguanto tiver na trade
    Por UnderZone no fórum L2J -Mods
    Respostas: 0
    Último Post: 13-03-2012, 11:30 PM
  2. |Source| Fix Bug Trade Hacker
    Por Chris7yan no fórum Sources
    Respostas: 19
    Último Post: 14-04-2011, 07:38 PM
  3. |Tutorial| Evitando trade bug's ou como dizem o famoso trade hacker!
    Por Cøłєridgє no fórum Tutoriais, dicas e macetes
    Respostas: 1
    Último Post: 23-08-2010, 12:01 AM
  4. |Source| Trade On | Trade Off Por Mapa
    Por Mr.TwoHam no fórum Sources
    Respostas: 3
    Último Post: 08-04-2010, 12:18 PM

Marcadores

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •