Jump to content

[Guide]How To Create your own Teleport command!


Emrys
 Share

Recommended Posts

First Of all :

Put this code on handlers/voicecommandhandlers

package handlers.voicedcommandhandlers;

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

/**
*
*@author TheEnd
*
*/
public class Giran implements IVoicedCommandHandler
{
    private static final String[] VOICED_COMMANDS = { "giran" };

    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
    {   
       
        if (command.equalsIgnoreCase("giran"))
        {          
             if(activeChar.isInJail())
            {
                activeChar.sendMessage("Sorry,you are in Jail!");
                return false;
            }
            else if(activeChar.isInOlympiadMode())
            {
                activeChar.sendMessage("Sorry,you are in the Olympiad now.");
                return false;
            }
                    
            else if(activeChar.atEvent)
            {
                activeChar.sendMessage("Sorry,you are in an event.");
                return false;
            }
            else  if (activeChar.isInDuel())
            {
                activeChar.sendMessage("Sorry,you are in a duel!");
                return false;
            }
            else if (activeChar.inObserverMode())
            {
               activeChar.sendMessage("Sorry,you are in the observation.");
            }            
            else if (activeChar.isFestivalParticipant())
            {
                activeChar.sendMessage("Sorry,you are in a festival.");
                return false;
            }         
           if(activeChar.getInventory().getItemByItemId(3470) == null)
           {
              activeChar.sendMessage("You need one or more Gold Bars to use the teleport system.");
             return false;
           }
               int placex;
               int placey;
               int placez;
               
               placex = 81304;
               placey = 14589;
               placez = -3469;
               
               activeChar.teleToLocation(placex, placey, placez);
     activeChar.sendMessage("You have been teleported to Giran!");
    activeChar.getInventory().destroyItemByItemId("Gold Bat", 3470, 1, activeChar, activeChar.getTarget());
    activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");
        }
        return true;
    }
    public String[] getVoicedCommandList()
    {
        return VOICED_COMMANDS;
    }

}

       

We will change the command, nwo it is .giran , to change it , just replace this in Red:

    private static final String[] VOICED_COMMANDS = { "giran" };

 

    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)

    { 

     

        if (command.equalsIgnoreCase("giran"))

---------------------------

Then We will change the location. Change the Red with the location you want:

 

              placex = 81304; Here u Put X

              placey = 14589; Here u Put Y

              placez = -3469; Here U Put Z

 

-----------------------------------------------

Now the last thing that we will change is the Item that will be needed. Change the Red with Id the green with amount

 

          if(activeChar.getInventory().getItemByItemId(3470) == null)

          {

              activeChar.sendMessage("You need one or more Gold Bars to use the teleport system.");

            return false;

}

              int placex;

              int placey;

              int placez;

             

              placex = 81304;

              placey = 14589;

              placez = -3469;

             

              activeChar.teleToLocation(placex, placey, placez);

    activeChar.sendMessage("You have been teleported to Giran!");

    activeChar.getInventory().destroyItemByItemId("Gold Bat", 3470, 1, activeChar, activeChar.getTarget());

    activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");

 

-------------------------------------------

Save the File.

Now we are going to register it.

Run this Patch But Change where it says Giran with your file name.

Index: data/scripts/handlers/MasterHandler.java
===================================================================
--- data/scripts/handlers/MasterHandler.java	(revision 6529)
+++ data/scripts/handlers/MasterHandler.java	(working copy)
@@ -221,6 +222,7 @@
	private static void loadVoicedHandlers()
	{
		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());
+		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Giran());
		if (Config.L2JMOD_ALLOW_WEDDING)
			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());
		if (Config.BANKING_SYSTEM_ENABLED)

 

----------------------

And now you have your own teleport command.

Simply Press : .giran (or your name)and you are ready.....

 

Credits: TheEnd

Link to comment
Share on other sites

Nice, also You could make config for alow or disalow this command and config for X/Y/Z - this is simple.

 

Good Share  ;)

Link to comment
Share on other sites

Nice, also You could make config for alow or disalow this command and config for X/Y/Z - this is simple.

 

Good Share  ;)

yeah.. This is waht I wanted to do for the next guide :D

Link to comment
Share on other sites

yeah.. This is waht I wanted to do for the next guide :D

 

awesome share , but there are some typo which need fix :P

 

whatever. as a code , its awesome , and very useful. but it can be hacked easily

Link to comment
Share on other sites

Nothing usefull, But nice idea. Good Work.

 

Yea its good ,something like .valakas command :]

GJ ,gonna use it for my next share :)

 

This cmd already exists here in the forum.. :P

Link to comment
Share on other sites

  • 1 year later...

i know this thread is old, but i was redirected here from a newer one and since this one is much complex i dont want to post in the other one the thanks :P

for me will be useful and i guess a bump will be good too :P

 

Link to comment
Share on other sites

i know this thread is old, but i was redirected here from a newer one and since this one is much complex i dont want to post in the other one the thanks :P

for me will be useful and i guess a bump will be good too :P

 

 

First of all use this little thing called fullstop ".", and this little thing called comma ",".

Secondly, did you bump a 1 year old topic just to say thanks? JESUS!

Link to comment
Share on other sites

First of all use this little thing called fullstop ".", and this little thing called comma ",".

Secondly, did you bump a 1 year old topic just to say thanks? JESUS!

http://www.maxcheaters.com/forum/index.php?topic=184194.0

http://www.maxcheaters.com/forum/index.php?topic=77872.0

 

And also the code is messed up, because you deleted one of his checks.

So not only you leeched his code, but you even did it in the wrong way.

 

. . . .

 

why to post there since this one is much complex ?

and no i didnt bump it for thanks, i bump it for ppl like me that may find it useful.

 

and btw my emoticon > ur "fullstop"

dont play smart since u cant handle it ;)

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.

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.

 Share



  • Posts

    • Promotional banners:  
    • We have added few new features for Second Edition of L2Etina. Check them out:   While streaming L2Etina, you will now receive L2Coins automatically.   Dwarves who have set private workshop, now automatically sell Crystallization to nearby players. For this service, they receive 10% of created crystals.   Before closing game, you will now see amount of earned experience, adena, total play time and acquired items.   You can now check Ranking of current and previous edition. This window can be found in Main Menu.   Party Window now have a special spot, showing if member has Noble Blessing.   Players from South America will be able to connect to the server by proxy.   Players who have supported first edition by donation, will now 2 weeks of free premium.   We have rewritten description of every buff, so they are now clear and handy. Vote rewards will be different for new edition, but exact items are not decided yet.   When spoil is successfull, you will now see special popup window. When you target monster who has been spoiled, you will see Spoil as a debuff.   Buff Store now have possibility to refuse to buff someone. Retail version of party matching was added back. Offline private stores now automatically disappear after 5 days. There are plenty more improvements and fixes, like ability to disable skill bar, multiple fixes to epic bosses, adjustments to aggro.
    • First of all thank you for fast answer. I have changed internal as you said but didn't work sir.
    • The difference isn't paying upfront or at the end of each week. The major difference is that paying clans to join, leads to leaders making random weak sides who play just for money and creates an extremely toxic fake competition in-game (i.e. l2 dex, e-global, valhalla and this kind of servers). Paying clans just to join absolutely kills the rivalry between them as there are no real losers and winners. Everyone gets paid at the end of every week so who cares right ?   Rewarding the winners with cash gives a massive motive to the leaders to create strong sides and try their best to win without giving any advantage to any clan (unlike paying people to join and basically giving them free premiums and whatnot). In this case, there will always be losers and winners and the rivalry will be kept alive.   I hope that clears up the massive difference between the 2 scenarios. Look at all those big russian servers. No1 makes fraps flaming about which side is better. Everyone cares about daily 9v9s or organized ones. There is no clan identity anymore because leaders simply don't care. They have been so detached from the clan's identity that most of the times the leader's CP holds a different name to the side's. This is a very important point to think about. 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock