Script not working on Freya

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Script not working on Freya

Post by r0x »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 4423
L2JDP Revision Number: 7669

this is a script for Teleport. worked in the epilogue but does not work on freya.
if anyone can help, thank you immensely!

ERROR:
Loading Server Scripts
----------
1. ERROR in \MasterHandler.java (at line 527)
VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VIPT
eleport());
^^^^
^^^^^^^
VIPTeleport cannot be resolved to a type
----------
1 problem (1 error)VIPTeleport cannot be resolved to a type
Failed executing script: C:\Users\Administrator\Desktop\L2Ouro Servers\L2Ouro Se
rver 4.0\gameserver\data\scripts\handlers\MasterHandler.java. See MasterHandler.
java.error.log for details.
ERROR LOG
Error on: C:\Users\Administrator\Desktop\L2Ouro Servers\L2Ouro Server 4.0\gameserver\data\scripts\handlers\MasterHandler.java.error.log
Line: -1 - Column: -1

compilation failed
SCRIPT:

Code: Select all

/* * 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.voicedcommandhandlers; import java.util.NoSuchElementException;import java.util.StringTokenizer; import com.l2jserver.gameserver.ai.CtrlIntention;import com.l2jserver.gameserver.handler.IVoicedCommandHandler;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;  public class VIPTeleport implements IVoicedCommandHandler{    private static final String[] _voicedCommands =    {        "teleport"    };        public boolean useVoicedCommand(String command, L2PcInstance activeChar, String tlp)    {        if (command.equalsIgnoreCase("teleport"))        {            if (activeChar == null)            {                return false;            }            else if(activeChar.atEvent)            {                activeChar.sendMessage("You are an Event.");                return false;            }            else if(activeChar.isInDuel())            {                activeChar.sendMessage("You are on Duel.");                return false;            }            else if(activeChar.isInOlympiadMode())            {                activeChar.sendMessage("You are in Olympiad.");                return false;            }            else if(activeChar.isInCombat())            {                activeChar.sendMessage("You can't teleport in Combat Mod.");                return false;            }            else if (activeChar.isFestivalParticipant())            {                activeChar.sendMessage("You are in a festival.");                return false;            }            else if (activeChar.isInJail())            {                activeChar.sendMessage("You are in Jail.");                return false;            }            else if (activeChar.inObserverMode())            {                activeChar.sendMessage("You are in Observ Mode.");                return false;            }            else if (activeChar.isDead())            {                activeChar.sendMessage("You Dead. Can't Teleport.");                return false;            }            else if (activeChar.isFakeDeath())            {                activeChar.sendMessage("You are Dead? week up :D");                return false;            }            else if (activeChar.getKarma() > 0)            {                activeChar.sendMessage("You can't use teleport command when you have karma.");                return false;            }            else if (activeChar.getAccessLevel().getLevel() == 0)            {                activeChar.sendMessage("You Need Account VIP To Use This.");                return false;            }            if(tlp != null)            {                teleportTo(activeChar, tlp);            }            else            {                activeChar.sendMessage("Wrong or no Coordinates given. Usage: /loc to display the coordinates.");                activeChar.sendMessage("Ex: .teleport <x> <y> <z>");                return false;            }        }        return true;    }        private void teleportTo(L2PcInstance activeChar, String Cords)    {        try        {            StringTokenizer st = new StringTokenizer(Cords);            String x1 = st.nextToken();            int x = Integer.parseInt(x1);            String y1 = st.nextToken();            int y = Integer.parseInt(y1);            String z1 = st.nextToken();            int z = Integer.parseInt(z1);                        activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);            activeChar.teleToLocation(x, y, z, false);                        activeChar.sendMessage("You have been teleported to " + Cords);        }        catch (NoSuchElementException nsee)        {            activeChar.sendMessage("Wrong or no Coordinates given. Usage: /loc to display the coordinates.");            activeChar.sendMessage("Ex: .teleport <x> <y> <z>");        }    }        public String[] getVoicedCommandList()    {        return _voicedCommands;    }}
Last edited by r0x on Fri Nov 19, 2010 2:49 pm, edited 1 time in total.
User avatar
qwerty13
Posts: 640
Joined: Mon Feb 02, 2009 9:57 am
Location: Europe
Contact:

Re: Script not working on Freya

Post by qwerty13 »

Use code tags for posting code in forums.
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Script not working on Freya

Post by _DS_ »

You forget to import it in MasterHandler.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Script not working on Freya

Post by Zoey76 »

r0x wrote:L2J Revision Number: 4423
L2JDP Revision Number: 7669

this is a script for Teleport. worked in the epilogue but does not work on freya.
if anyone can help, thank you immensely!
Hello r0x!

If you can manage to apply a patch inside the attachment there is a patch for 4423/7669. :twisted:
If you have troubles the file VIPTeleport.java is also included.
If you don't apply the patch don't forget to add it to MasterHandler.java!
import handlers.voicedcommandhandlers.VIPTeleport;
and
VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VIPTeleport());
on
private static void loadVoicedHandlers()

Version 1.1
  • Little rework.
  • Now teleports pets.
  • Code cleanup.
  • Updated messages(typos and syntaxis).
Version 2.0b
Now you cannot teleport while:
  • in an instance.
  • in Craft mode.
  • in Store mode.
  • paralyzed.
  • asleep.
  • in siege.
  • in TVT.
  • flying.
Test TVT and Siege please & have fun! :P
You do not have the required permissions to view the files attached to this post.
Last edited by Zoey76 on Sat Nov 20, 2010 1:27 pm, edited 2 times in total.
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Script not working on Freya

Post by _DS_ »

btw, very bad idea to allow players teleport to any coords.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Re: Script not working on Freya

Post by r0x »

great job Zoey76!
thanks so much, I made this script with some difficulty, i do not program in java.

is possible prevent the players teleport to the boss area and siege?

again thanks!
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Re: Script not working on Freya

Post by r0x »

working perfectly!
now just need to stop the teleport for boss area and siege area.. :D
User avatar
qwerty13
Posts: 640
Joined: Mon Feb 02, 2009 9:57 am
Location: Europe
Contact:

Re: Script not working on Freya

Post by qwerty13 »

Make a checks to avoid teleportation to boss\siege zones etc.
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Re: Script not working on Freya

Post by r0x »

qwerty13 wrote:Make a checks to avoid teleportation to boss\siege zones etc.
I believe that if prevent the teleport in time of siege would solve a problem.
and create a way to verify that the coordinate does not go to the area of "boss" would solve another problem.

but I do not know how to do it ..
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Re: Script not working on Freya

Post by r0x »

TVT participants are able to use the teleport.
can someone help me block it?
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: Script not working on Freya

Post by SolidSnake »

Add this to checkConditions

Code: Select all

        else if (TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(player.getObjectId()))        {            player.sendMessage("You cannot teleport while you are participating in the TvT event!");            return false;        }
Remember to write the TvTEvent.java import
Image
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Re: Script not working on Freya

Post by r0x »

thanks!
and you know tell me how can I block within the area of boss? :roll:
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: Script not working on Freya

Post by SolidSnake »

If they teleport to a grandboss' area, they should be teleported away automatically :|
Image
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Script not working on Freya

Post by Zoey76 »

New version attached to my previous post. :P
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
User avatar
r0x
Posts: 168
Joined: Sun Jul 26, 2009 10:13 pm
Location: Brazil

Re: Script not working on Freya

Post by r0x »

Zoey76 wrote:New version attached to my previous post. :P
was very good :D
Post Reply