Jump to content

[Share] Teleport to clan leader [H5]


nery

Recommended Posts

Hello this is a voice that typing. Leader you are teleported to where your clan leader is.

 

Testing and running at 100% H5

 

### Eclipse Workspace Patch 1.0
#P KingServer
Index: dist/game/config/KingServer.properties
===================================================================
--- dist/game/config/KingServer.properties (revision 20)
+++ dist/game/config/KingServer.properties (working copy)
@@ -207,4 +207,8 @@

# Comando .pmoff para bloquear mensagens e .pmon para permitir o recebimento de pms
# Padrao (Default): False
-CommandPmOff = False
\ No newline at end of file
+CommandPmOff = False
+
+# Comando .lider para teleportar para o seu lider online
+# Padrao (Default): False
+CommandLider = False
\ No newline at end of file
Index: java/king/server/KingServer.java
===================================================================
--- java/king/server/KingServer.java (revision 20)
+++ java/king/server/KingServer.java (working copy)
@@ -126,7 +126,9 @@
         public static boolean COMMAND_TRADE_OFF;
//.online
         public static boolean ALLOW_GET_ONLINE;
-
+ // .lider
+ public static boolean COMMAND_LIDER;
+
  // --------------------------------------------------
  //              OPCOES RELACIOANDAS A LOJAS             //
// --------------------------------------------------
@@ -233,7 +235,9 @@
                                 COMMAND_TRADE_OFF = Boolean.parseBoolean (KingSettings.getProperty("CommandTradeOff", "false"));
//.online
                                 ALLOW_GET_ONLINE = Boolean.parseBoolean(KingSettings.getProperty("AllowGetOnline", "False"));
-
+ //.lider
+                        COMMAND_LIDER = Boolean.parseBoolean(KingSettings.getProperty("CommandLider", "False"));
+                       
//############################### OPCOES RELACIONADAS A LOJAS ##############################//
                                 //Distancia entre player/npc para montar loja
SHOP_MIN_RANGE_ENABLE = Boolean.parseBoolean(KingSettings.getProperty("ShopMinRangeEnable", "false"));                  
#P DataPack
Index: dist/game/data/scripts/handlers/voicedcommandhandlers/Lider.java
===================================================================
--- dist/game/data/scripts/handlers/voicedcommandhandlers/Lider.java (revision 0)
+++ dist/game/data/scripts/handlers/voicedcommandhandlers/Lider.java (working copy)
@@ -0,0 +1,154 @@
package handlers.voicedcommandhandlers;

import king.server.KingServer;
import king.server.gameserver.handler.IVoicedCommandHandler;
import king.server.gameserver.instancemanager.CastleManager;
import king.server.gameserver.model.L2World;
import king.server.gameserver.model.actor.instance.L2PcInstance;

public class Lider implements IVoicedCommandHandler
{
        private static final String[] VOICED_COMMANDS = { "lider"};
        
        @Override
        public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
        {
                
                if (KingServer.COMMAND_LIDER)
                {
                        
                        if (command.equalsIgnoreCase("lider"))
                        {
                                
                                if (activeChar.getClan() == null)
                                {
                                        return false;
                                }
                                
                                L2PcInstance leader;
                                leader = (L2PcInstance) L2World.getInstance().findObject(activeChar.getClan().getLeaderId());
                                
                                if (leader == null)
                                {
                                        activeChar.sendMessage("Seu lider nao estar online.");
                                        return false;
                                }
                                else if (leader.isInJail())
                                {
                                        activeChar.sendMessage("Seu lider estar na Jaula.");
                                        return false;
                                }
                                else if (leader.isInOlympiadMode())
                                {
                                        activeChar.sendMessage("Seu lider estar em Olympiada.");
                                        return false;
                                }
                                else if (leader.isInDuel())
                                {
                                        activeChar.sendMessage("Seu lider estar em um Duelo.");
                                        return false;
                                }
                                else if (leader.isFestivalParticipant())
                                {
                                        activeChar.sendMessage("Seu lider estar em algum festival.");
                                        return false;
                                }
                                else if (leader.isInParty() && leader.getParty().isInDimensionalRift())
                                {
                                        activeChar.sendMessage("Seu lider estar em dimensional rift.");
                                        return false;
                                }
                                else if (leader.inObserverMode())
                                {
                                        activeChar.sendMessage("Seu lider estar em modo de Observacao.");
                                }
                                else if ((leader.getClan() != null) && (CastleManager.getInstance().getCastleByOwner(leader.getClan()) != null) && CastleManager.getInstance().getCastleByOwner(leader.getClan()).getSiege().getIsInProgress())
                                {
                                        activeChar.sendMessage("O seu lider esta em cerco, voce nao pode ir para o seu lider.");
                                        return false;
                                }
                                
                                else if (activeChar.isInJail())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando na Jaula!");
                                        return false;
                                }
                                else if (activeChar.isInOlympiadMode())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando em um Olympiada.");
                                        return false;
                                }
                                else if (activeChar.isInDuel())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando em Duelo!");
                                        return false;
                                }
                                else if (activeChar.inObserverMode())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando em modo de Observacao.");
                                }
                                else if ((activeChar.getClan() != null) && (CastleManager.getInstance().getCastleByOwner(activeChar.getClan()) != null) && CastleManager.getInstance().getCastleByOwner(activeChar.getClan()).getSiege().getIsInProgress())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando em Sierge.");
                                        return false;
                                }
                                else if (activeChar.isFestivalParticipant())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando em festival.");
                                        return false;
                                }
                                else if (activeChar.isInParty() && activeChar.getParty().isInDimensionalRift())
                                {
                                        activeChar.sendMessage("Voce nao pode ir estando em dimensional rift.");
                                        return false;
                                }
                                else if (activeChar == leader())
                                {
                                        activeChar.sendMessage("Voce nao pode se teletransportar para si mesmo.");
                                        return false;
                                }
                                if (activeChar.getInventory().getItemByItemId(57) == null)
                                {
                                        activeChar.sendMessage("Voce precisa de 1000 ou mais adenas para Teleporta ate seu lider.");
                                        return false;
                                }
                                int leaderx;
                                int leadery;
                                int leaderz;
                                
                                leaderx = leader.getX();
                                leadery = leader.getY();
                                leaderz = leader.getZ();
                                
                                activeChar.teleToLocation(leaderx, leadery, leaderz);
                                activeChar.sendMessage("Voce foi teletransportado para o seu lider!");
                                activeChar.getInventory().destroyItemByItemId("RessSystem", 57, 1000, activeChar, activeChar.getTarget());
                                activeChar.sendMessage("1000 Adenas foram usadas, Obrigado!");
                        }
                        
                        else
                        {
                                activeChar.sendMessage("Comando Desabilitado pelo Admin");
                        }
                        
                        return true;
                }
                return false;
        }
        
        public L2PcInstance leader()
        {
                return null;
        }
        
        @Override
        public String[] getVoicedCommandList()
        {
                return VOICED_COMMANDS;
        }
        
}

 

\DataPack\dist\game\data\scripts\handlers\MasterHandler.java

import handlers.voicedcommandhandlers.InfoCommand;
import handlers.voicedcommandhandlers.Lang;
+import handlers.voicedcommandhandlers.Lider;
import handlers.voicedcommandhandlers.pmoff;
import handlers.voicedcommandhandlers.Online;
import handlers.voicedcommandhandlers.Teleport;

==============================

// SetVCmd.class,
		InfoCommand.class,
		BuyRec.class,
		Online.class,
		TradeOff.class,
		pmoff.class,
		Teleport.class,
		+Lider.class,
		(Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null),
		(Config.BANKING_SYSTEM_ENABLED ? Banking.class : null),
		(Config.TVT_ALLOW_VOICED_COMMAND ? TvTVoicedInfo.class : null),
		(Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null),
		(Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null),
		(Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
		(Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
		(Config.L2JMOD_HELLBOUND_STATUS ? Hellbound.class : null),
	},
	{

 

Installed on Rev. Kingserver H5, 100% Functional

 

Crédits: BossForever e My

Link to comment
Share on other sites

use

 instead of 
[/quote ] for codes ;) Also add [share] tag at your title ;)

anyway thanks for sharing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...