Jump to content

Recommended Posts

Posted

Hey all.

 

This is the super duper flash i made. Those that play LoL will know what i'm talking about, but i have to say it works somehow different that LoL flash(since L2 has camera rotation, 3d stuff, it has to be slower or players would ragequit).

 

Video:

 

Sorry if it's laggy.

 

Here:

Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TestFlash.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TestFlash.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/TestFlash.java	(revision 0)
@@ -0,0 +1,104 @@
+/*
+ * 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.ai.CtrlIntention;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
+import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
+import net.sf.l2j.gameserver.skills.AbnormalEffect;
+
+/**
+ * @author Anarchy
+ *
+ */
+public class TestFlash implements IVoicedCommandHandler
+{
+	private static final String[] VOICED_COMMANDS = { "flash" };
+	
+	@Override
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar)
+	{
+		if (command.equals("flash"))
+		{
+			if (activeChar.flashing)
+			{
+				activeChar.sendMessage("You have already requested for a flash on next click.");
+				return false;
+			}
+			activeChar.flashing = true;
+			activeChar.sendMessage("Your next click will flash you to your location.");
+		}
+		
+		return true;
+	}
+
+	@Override
+	public String[] getVoicedCommandList()
+	{
+		return VOICED_COMMANDS;
+	}
+	
+	public static void flash(L2PcInstance p, int x, int y, int z)
+	{
+		if (p.isInsideRadius(x, y, 350, false))
+		{
+			p.stopMove(null);
+			p.startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
+			p.flashing = false;
+			p.sendPacket(ActionFailed.STATIC_PACKET);
+			ThreadPoolManager.getInstance().scheduleGeneral(new DoIt(p, x, y, z), 3500);
+		}
+		else
+		{
+			p.sendMessage("Too far.");
+			p.sendPacket(ActionFailed.STATIC_PACKET);
+		}
+	}
+	
+	private static class DoIt implements Runnable
+	{
+		private L2PcInstance p = null;
+		private int x = 0, y = 0, z = 0;
+		
+		public DoIt(L2PcInstance p, int x, int y, int z)
+		{
+			this.p = p;
+			this.x = x;
+			this.y = y;
+			this.z = z;
+		}
+		
+		@Override
+		public void run()
+		{
+			p.abortAttack();
+			p.abortCast();
+			p.setIsTeleporting(true);
+			p.setTarget(null);
+			p.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
+			p.decayMe();
+			p.getPosition().setXYZ(x, y, z);
+			p.onTeleported();
+			p.broadcastUserInfo();
+			p.sendPacket(new ValidateLocation(p));
+			p.sendPacket(ActionFailed.STATIC_PACKET);
+			p.revalidateZone(true);
+			p.stopAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
+		}
+	}
+}
Index: java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java	(revision 3)
+++ java/net/sf/l2j/gameserver/network/clientpackets/MoveBackwardToLocation.java	(working copy)
@@ -18,6 +18,7 @@

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ai.CtrlIntention;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TestFlash;
import net.sf.l2j.gameserver.model.L2CharPosition;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
@@ -95,6 +96,12 @@
			return;
		}

+		if (activeChar.flashing)
+		{
+			TestFlash.flash(activeChar, _targetX, _targetY, _targetZ);
+			return;
+		}
+		
		if (_moveMovement == 0 && Config.GEODATA < 1) // cursor movement without geodata is disabled
			activeChar.sendPacket(ActionFailed.STATIC_PACKET);
		else
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 20)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -234,6 +234,8 @@
  */
public final class L2PcInstance extends L2Playable
{
+	public boolean flashing = false;
+	
	private boolean _isTopKiller = false;

	public boolean isTopKiller()
Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java	(revision 14)
+++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java	(working copy)
@@ -22,6 +22,7 @@
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Kills;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.KinoChoose;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Leave;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TestFlash;

public class VoicedCommandHandler
{
@@ -43,6 +44,7 @@
		{
			registerVoicedCommandHandler(new KinoChoose());
		}
+		registerVoicedCommandHandler(new TestFlash());
	}

	public void registerVoicedCommandHandler(IVoicedCommandHandler handler)

 

If it's not easy to see in video, let me give an explanation:

 

Players can press .flash(yeah, i was just testing the effect didn't make it work with a skill but it's easy) and next click will flash them after 3,5 seconds to that location(no teleportation black screen, instant flash). There is also an effect before flash. There is a 350 radius around the char restriction where you can flash.

 

Coded on aCis.

Posted

When I was playing around on aCis pack with speed values, I did on gm speed level 3 around... 52,921 speed, did you know how it moved? Just like that but without the lags! :)

 

So when I clicked with ultimate zoomout from my point A to point B it was going instantly there but the cool part is the character wasn't even breathing or had dynamic movement it was just like paralyzed, but when I lowered down to around 20k, it looked like it drinked 2 packs of Redull and smoked 100g of meth, lol.

 

Funny facts, though.

Posted

When I was playing around on aCis pack with speed values, I did on gm speed level 3 around... 52,921 speed, did you know how it moved? Just like that but without the lags! :)

 

So when I clicked with ultimate zoomout from my point A to point B it was going instantly there but the cool part is the character wasn't even breathing or had dynamic movement it was just like paralyzed, but when I lowered down to around 20k, it looked like it drinked 2 packs of Redull and smoked 100g of meth, lol.

 

Funny facts, though.

Well, that way works but why risk getting 100 meters jump if character collides with a rock or smth ;p

 

Also there are 0 lags, it's just the video lagging.

Posted

Well, that way works but why risk getting 100 meters jump if character collides with a rock or smth ;p

 

Also there are 0 lags, it's just the video lagging.

I did some tests in colliding with objects and cliffs and most important, walking in swamp and water and colliding with other objects in these hostile environments... well what can I say, the output is kinda predictable, if you know what I mean  :good sir:

Posted

Seems something like warp.

 

better, the warp has forward or backward warp, this warps you on your cursor just like lol threw the moveToLocation packet ;)

Posted

make a skill handler for it, and dedicate a skill id :)

 

Also don't use static modifiers on a class you set private, and for stuff like this try using anonymous(since u dont need residues for a simple thing) classes like:

threadpool..blabla.scheduleGeneral(new Runnable() {
      @Override
      public void run() {
            // do shit
      }
}, 3500);

in java 8 its gonna be with lambda <3
threadpool..blabla.scheduleGeneral(() -> {
            // do shit
}, 3500);

 

Always wanted to do a mod like blink :P

Guest Elfocrash
Posted

Too many lines of code to do something way simpler.

Also you'd better check the warp spell effect from higher chronicles.

Posted

make a skill handler for it, and dedicate a skill id :)

 

Also don't use static modifiers on a class you set private, and for stuff like this try using anonymous(since u dont need residues for a simple thing) classes like:

threadpool..blabla.scheduleGeneral(new Runnable() {
      @Override
      public void run() {
            // do shit
      }
}, 3500);

in java 8 its gonna be with lambda <3
threadpool..blabla.scheduleGeneral(() -> {
            // do shit
}, 3500);

 

Always wanted to do a mod like blink :P

Yeah easy to make it work with a skill, it was just for tests ;p

Java 8 is gonna be awesome from what i've heard so far ;p

 

Too many lines of code to do something way simpler.

Also you'd better check the warp spell effect from higher chronicles.

I just c/p teleToLocation() method, removed the packet TeleportToLocation to avoid the black screen, while sending a ValidateLocation packet to actually show the new location to the player.

Just experiments :D

Guest Elfocrash
Posted

I just c/p teleToLocation() method, removed the packet TeleportToLocation to avoid the black screen, while sending a ValidateLocation packet to actually show the new location to the player.

Just experiments :D

 

 

As you can see here teh swaping could easily be just a "get distance in front" and move there. The code you see on vid is like 3 lines of code.

Obviously for front flash you need geolocation check and sin/cos usage

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...