Jump to content

Recommended Posts

Posted

New command for admins.

Teleport char to desirable place.

 

aden|delf|dion|dwarven|elf|floran|giran|gludin|gludio|goddard

heine|hunters|kamael|orc|oren|rune|schuttgart|talkingisland

 

Index: trunk/L2jLive_DataPack/data/scripts/handlers/MasterHandler.java
===================================================================
--- /tmp/svn_fs20100723-29614-a94dpf-0	Fri Jul 23 14:49:29 2010
+++ /tmp/svn_fs20100723-29614-1htti98-0	Fri Jul 23 14:49:29 2010
@@ -136,6 +136,7 @@
		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminSummon());
		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminTarget());
		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminTeleport());
+		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminTeleportChar());
		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminTerritoryWar());
		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminTest());
		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminTownWar());
Index: trunk/L2jLive_DataPack/sql/admin_command_access_rights.sql
===================================================================
--- /tmp/svn_fs20100723-29614-jpfq5z-0	Fri Jul 23 14:49:29 2010
+++ /tmp/svn_fs20100723-29614-ppccs1-0	Fri Jul 23 14:49:29 2010
@@ -420,6 +420,7 @@
('admin_summon_setlvl','1'),
('admin_target','1'),
('admin_tele','1'),
+('admin_teleportchar','1'),
('admin_teleportto','1'),
('admin_teleport_character','1'),
('admin_teleport_character_to_menu','1'),

 

AdminTeleportChar.java

/*
* 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 handlers.admincommandhandlers;

import java.util.StringTokenizer;
import java.util.logging.Logger;

import com.l2jserver.Config;
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

public class AdminTeleportChar implements IAdminCommandHandler
{
        private static Logger _log = Logger.getLogger(AdminTeleportChar.class.getName());
        
        private static final String[] ADMIN_COMMANDS =
        {
                "admin_teleportchar"
        };
        
        private static final int[][] Teleport_Coords =
        {
                {147450, 27064, -2203},
                {12428, 16551, -4588},
                {18748, 145437, -3132},
                {116551, -182493, -1525},
                {45873, 49288, -3064},
                {17144, 170156, -3502},
                {83346, 148096, -3405},
                {-83063, 150791, -3133},
                {-14225, 123540, -3121},
                {147711, -55339, -2735},
                {111125, 219029, -3543},
                {116589, 76268, -2734},
                {-117016, 46555, 367},
                {-44133, -113911, -239},
                {82321, 55139, -1529},
                {44070, -50243, -796},
                {87359, -143377, -1293},
                {-83910, 243341, -3730}
        };
        
        public boolean useAdminCommand(String command, L2PcInstance activeChar, String target)
        {
                if (Config.ENABLE_SAFE_ADMIN_PROTECTION)
                {
                        if (!activeChar.isSafeAdmin())
                        {
                                activeChar.logout();
                                _log.warning("Character " + activeChar.getName() + "(" + activeChar.getObjectId() + ") tryed to use an admin command.");
                                return false;
                        }
                }
                
                if (command.startsWith("admin_teleportchar"))
                {
                        L2PcInstance targetp = (L2PcInstance)activeChar.getTarget();
                        
                        StringTokenizer st = new StringTokenizer(command);
                        st.nextToken();
                        String type = "";
                        try
                        {
                                type = st.nextToken();
                                if (type.equals ("aden"))
                                {
                                        teleportChar(targetp, 0, "Aden");
                                }
                                else if (type.startsWith ("delf"))
                                {
                                        teleportChar(targetp, 1, "D.Elf Village");
                                }
                                else if (type.startsWith ("dion"))
                                {
                                        teleportChar(targetp, 2, "Dion");
                                }
                                else if (type.startsWith ("dwarven"))
                                {
                                        teleportChar(targetp, 3, "Dwarven Village");
                                }
                                else if (type.startsWith ("elf"))
                                {
                                        teleportChar(targetp, 4, "Elven Village");
                                }
                                else if (type.startsWith ("floran"))
                                {
                                        teleportChar(targetp, 5, "Floran");
                                }
                                else if (type.startsWith ("giran"))
                                {
                                        teleportChar(targetp, 6, "Giran");
                                }
                                else if (type.startsWith ("gludin"))
                                {
                                        teleportChar(targetp, 7, "Gludin");
                                }
                                else if (type.startsWith ("gludio"))
                                {
                                        teleportChar(targetp, 8, "Gludio");
                                }
                                else if (type.startsWith ("goddard"))
                                {
                                        teleportChar(targetp, 9, "Goddard");
                                }
                                else if (type.startsWith ("heine"))
                                {
                                        teleportChar(targetp, 10, "Heine");
                                }
                                else if (type.startsWith ("hunters"))
                                {
                                        teleportChar(targetp, 11, "Hunters Village");
                                }
                                else if (type.startsWith ("kamael"))
                                {
                                        teleportChar(targetp, 12, "Kamael Village");
                                }
                                else if (type.startsWith ("orc"))
                                {
                                        teleportChar(targetp, 13, "Orc Village");
                                }
                                else if (type.startsWith ("oren"))
                                {
                                        teleportChar(targetp, 14, "Oren");
                                }
                                else if (type.startsWith ("rune"))
                                {
                                        teleportChar(targetp, 15, "Rune");
                                }
                                else if (type.startsWith ("schuttgart"))
                                {
                                        teleportChar(targetp, 16, "Schuttgart");
                                }
                                else if (type.startsWith ("talkingisland"))
                                {
                                        teleportChar(targetp, 17, "Talking Island Village");
                                }
            else 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.isDead())
            {
               activeChar.sendMessage("Sorry,you are dead.");  
            return false;
            }        
            else if (activeChar.getKarma() > 0 || activeChar.getPvpFlag() > 0)
            {
               activeChar.sendMessage("Sorry,you are in combat.");
            return false;
            }              
            else if (activeChar.inObserverMode())
            {
               activeChar.sendMessage("Sorry,you are in the observation mode.");
            }         
            else if (activeChar.isInCombat())
            {
               activeChar.sendMessage("You are in combat!");
            }      
            else if (activeChar.isFestivalParticipant())
            {
                activeChar.sendMessage("Sorry,you are in a festival.");
                return false;
            }
                              else
                                {
                                        activeChar.sendMessage("Invalid place: " + type + ".");
                                        activeChar.sendMessage("Usage: //teleportchar Place");
                                        acticeChar.sendMessage("Places: aden|delf|dion|dwarven|elf|floran|giran|gludin|gludio|goddard");
                                        acticeChar.sendMessage("heine|hunters|kamael|orc|oren|rune|schuttgart|talkingisland");
                                }
                        }
                        return true;
                }
        }
        
        private boolean teleportChar(L2PcInstance target, int town, String name)
        {
                L2PcInstance targetp = (L2PcInstance)activeChar.getTarget();
                
                int[] loc = Teleport_Coords[town];
                
                targetp.teleToLocation(loc[0], loc[1], loc[2]);
                activeChar.sendMessage("Teleporting: " + targetp.getName() + " To: " + name + ".");
                targetp.sendMessage("You have been teleported to: " + name + ".");
                
                return true;
        }
        
        public String[] getAdminCommandList()
        {
                return ADMIN_COMMANDS;
        }
}

 

Credits to L2jLive

Posted

Fixed!

add this

 

            else 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.isDead())
            {
               activeChar.sendMessage("Sorry,you are dead.");  
            return false;
            }        
            else if (activeChar.getKarma() > 0 || activeChar.getPvpFlag() > 0)
            {
               activeChar.sendMessage("Sorry,you are in combat.");
            return false;
            }              
            else if (activeChar.inObserverMode())
            {
               activeChar.sendMessage("Sorry,you are in the observation mode.");
            }         
            else if (activeChar.isInCombat())
            {
               activeChar.sendMessage("You are in combat!");
            }      
            else if (activeChar.isFestivalParticipant())
            {
                activeChar.sendMessage("Sorry,you are in a festival.");
                return false;
            }    

 

After:

                                else if (type.startsWith ("talkingisland"))
                                {
                                        teleportChar(targetp, 17, "Talking Island Village");
                                }

 

Posted

LOOOOOOL

This already exists and it's not limited.

You can set the name of a char and teleport him wherever you want.

Seriously, wtf is this shitty project?

Stop c/ping these stupid codes here >.<

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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 Disabled AdBlock