Jump to content

Recommended Posts

Posted
Hello everyone, I'm sharing the version I was working on recently.

And a more original server-focused package following the missions of the original game.
The entire calling package was restructured, making it lighter and easier to execute.
It is good for people who want to start a package, without customizing equipment and skills.

* I put together 4 bases: "RusaCis3.5" "Lucera" "aCis" "Dev"

It has a Modern UI template.

 

JDK 14: https://mega.nz/file/rg5QwDJA#FwHrPbt8bw8prD3WLJz7dFOv1HAoYakNLTbVhLdgQTY
Client: https://www.mediafire.com/file/rg6twikao7zugd2/L2_CLIENT_INTERLUDE.zip
MariaDB: https://mega.nz/file/YBIXXSgY#9xqdkVMXAXY3VPNkBs6R05rnzJ9bH6aU47y2WNLfri4
L2FileEdit: https://mega.nz/file/xdQTTaKJ#poqzJDE-gItyQo0EOEWCHsC_r4HPXaCmLAZ_InUmOjE
Soucer: https://mega.nz/file/cv1BnCpY#F6UDroejOid2i4F9ipMZTt8d0u_ww10o9e0zAjlHMSA
Compilado: https://mega.nz/file/M3FxCaaR#FW6k4SFZJhajRygJSxDJwDfWc04kaC6HVUc5rktT2SE

 

 

Quote

# Extra
* Dualbox
*AntiFeed
* Premium
* Bots prevention Bots prevention
* Premium Buffs Category
* DropList info Shift + Click
* Skill Duration
* Olympiad Custom Period
* InfinitySS
* InfinityArrows
* AutoFarm

 * EVENTS
 capturetheflag, deathmatch, lastman, soloboss, teamvsteam

 * Commands Custom voiced
.menu
.offline
.online
.premium
.
ctfinfo
.ctfjoin
.ctfleave
.dminfo
.dmjoin
.dmleave
.lminfo
.lmjoin
.lmleave
.tvtinfo
.tvtjoin
.tvtleave

 

Author post: IFox

  • Like 3
Posted

how to config gameserver/loginserver java path ? any explain?

 

' Get Java path.
Dim path
Set shell = WScript.CreateObject("WScript.Shell")
path = shell.Environment.Item("JAVA_HOME")
If path = "" Then
    MsgBox "Could not find JAVA_HOME environment variable!", vbOKOnly, "Game Server"
Else
    If InStr(path, "\bin") = 0 Then
        path = path + "\bin\"
    Else
        path = path + "\"
    End If
    path = Replace(path, "\\", "\")
    path = Replace(path, "Program Files", "Progra~1")
End If



' Generate command.
Dim command
command = path & "java -Xmx2280m -cp ../libs/*; l2j.luceraV3.gameserver.GameServer"

' Run the server.
Dim exitcode
exitcode = 0
Do
    ' Run the command and keep the console open.
    exitcode = shell.Run("cmd /c " & command & " & exit", 0, True)

    ' Handle the exit code
    If exitcode = 2 Then
        ' Restart
        exitcode = 2
    ElseIf exitcode <> 0 Then
        ' Error
       exitcode = 0
        Exit Do
    End If
Loop While exitcode = 2

 

Posted
2 hours ago, kHa said:

how to config gameserver/loginserver java path ? any explain?

 

' Get Java path.
Dim path
Set shell = WScript.CreateObject("WScript.Shell")
path = shell.Environment.Item("JAVA_HOME")
If path = "" Then
    MsgBox "Could not find JAVA_HOME environment variable!", vbOKOnly, "Game Server"
Else
    If InStr(path, "\bin") = 0 Then
        path = path + "\bin\"
    Else
        path = path + "\"
    End If
    path = Replace(path, "\\", "\")
    path = Replace(path, "Program Files", "Progra~1")
End If



' Generate command.
Dim command
command = path & "java -Xmx2280m -cp ../libs/*; l2j.luceraV3.gameserver.GameServer"

' Run the server.
Dim exitcode
exitcode = 0
Do
    ' Run the command and keep the console open.
    exitcode = shell.Run("cmd /c " & command & " & exit", 0, True)

    ' Handle the exit code
    If exitcode = 2 Then
        ' Restart
        exitcode = 2
    ElseIf exitcode <> 0 Then
        ' Error
       exitcode = 0
        Exit Do
    End If
Loop While exitcode = 2

 

You don't have to tuche nothing on that section mate just install your java jdk14. Setup in your every moments area the home_java path if you dont know how use Google to guide you...

Posted
2 hours ago, optimousprime said:

You don't have to tuche nothing on that section mate just install your java jdk14. Setup in your every moments area the home_java path if you dont know how use Google to guide you...

thanks, its work

  • 2 weeks later...
Posted
1 hour ago, antada said:

.farm

The config file is missing and cannot be executed.

In order to have the auto farm system install the interface in the system that  bean provided 

Posted

You can apply a code for auto farm system . 
 

Quote
======================================================	
Index: net/sf/l2j/gameserver/model/L2AutoFarmTask.java
======================================================	
+package net.sf.l2j.gameserver.model;
+
+import java.util.concurrent.ScheduledFuture;
+
+import net.sf.l2j.commons.concurrent.ThreadPool;
+import net.sf.l2j.gameserver.geoengine.GeoEngine;
+import net.sf.l2j.gameserver.handler.usercommandhandlers.Escape;
+import net.sf.l2j.gameserver.model.actor.instance.Chest;
+import net.sf.l2j.gameserver.model.actor.instance.GrandBoss;
+import net.sf.l2j.gameserver.model.actor.instance.Monster;
+import net.sf.l2j.gameserver.model.actor.instance.Player;
+import net.sf.l2j.gameserver.model.actor.instance.RaidBoss;
+
+public class L2AutoFarmTask
+{
+	private final Player _actor;
+	private ScheduledFuture<?> _task;
+	
+	public L2AutoFarmTask(Player actor)
+	{
+		_actor = actor;
+	}
+	
+	public final Player getActor()
+	{
+		
+		return _actor;
+	}
+	
+	public void start()
+	{
+		if (_task == null)
+		{
+			_task = ThreadPool.scheduleAtFixedRate(() -> thinking(), 500, 500);
+		}
+	}
+	
+	private void thinking()
+	{
+		if (!_actor.isDead())
+		{
+			if (_actor.isMoving() || _actor.isCastingNow() || _actor.isAttackingNow() || _actor.isMovementDisabled() || _actor.isOutOfControl() || forceStopBuffer())
+				return;
+			
+			playerTarget(_actor);
+		}
+	}
+	
+	private void playerTarget(Player player)
+	{
+		Monster monster = player.getTarget() instanceof Monster ? (Monster) player.getTarget() : null;
+		if (monster != null && !GeoEngine.getInstance().canSeeTarget(player, monster))
+			monster = null;
+		
+		monster = findCreature();
+		
+		_actor.setTarget(monster);
+	}
+	
+	public Monster findCreature()
+	{
+		Monster closestMonster = null;
+		
+		double closestDistance = Double.MAX_VALUE;
+		
+		for (Monster toTest : _actor.getKnownTypeInRadius(Monster.class, 3500))
+		{
+			if (toTest == null || toTest.isDead() || !GeoEngine.getInstance().canSeeTarget(_actor, toTest))
+				continue;
+			
+			if (!_actor.isCastingNow() && !_actor.isAttackingNow())
+			{
+				if (!GeoEngine.getInstance().canMoveToTarget(_actor.getX(), _actor.getY(), _actor.getZ(), toTest.getX(), toTest.getY(), toTest.getZ()))
+					continue;
+			}
+			
+			if (toTest instanceof RaidBoss || toTest instanceof GrandBoss || toTest instanceof Chest || toTest.isRaid())
+				continue;
+			
+			double distance = calculateDistance(toTest, false);
+			
+			if (distance < closestDistance)
+			{
+				if (_actor.isFacing(toTest, 120) || _actor.isInFrontOf(toTest))
+				{
+					closestDistance = distance;
+					closestMonster = toTest;
+				}
+			}
+			
+		}
+		
+		return closestMonster;
+	}
+	
+	public double calculateDistance(WorldObject target, boolean includeZ)
+	{
+		if (target == null)
+			return Double.MAX_VALUE;
+		
+		final int x1 = _actor.getX();
+		final int y1 = _actor.getY();
+		final int z1 = _actor.getZ();
+		
+		final int x2 = target.getX();
+		final int y2 = target.getY();
+		final int z2 = target.getZ();
+		
+		double distanceSquared = Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);
+		
+		if (includeZ)
+		{
+			distanceSquared += Math.pow(z2 - z1, 2);
+		}
+		
+		return Math.sqrt(distanceSquared);
+	}
+	
+	private boolean forceStopBuffer()
+	{
+		final boolean force = running() && _actor.getAllEffects().length <= 8;
+		
+		if (force)
+		{
+			Escape unstuck = new Escape();
+			
+			unstuck.useUserCommand(52, _actor);
+			stop();
+		}
+		return force;
+	}
+	
+	public void stop()
+	{
+		if (_task != null)
+		{
+			_task.cancel(false);
+			_task = null;
+			_actor.setTarget(null);
+		}
+		
+	}
+	
+	public boolean running()
+	{
+		return _task != null;
+	}
+}

======================================================
Index: net/sf/l2j/gameserver/model/actor/Player.java
======================================================	
+	import net.sf.l2j.gameserver.model.L2AutoFarmTask;


	@Override
	public boolean doDie(Creature killer)
	{
		// Kill the Player
		if (!super.doDie(killer))
			return false;
		
		if (isMounted())
			stopFeed();
		
		_tvtkills = 0;
		_killCount = 0;
		
		synchronized (this)
		{
			if (isFakeDeath())
				stopFakeDeath(true);
			
+			if (getFarm().running())
+				getFarm().stop();
		}
		
		
		
		
		
		
		
+	private final L2AutoFarmTask _farm = new L2AutoFarmTask(this);
+	
+	public L2AutoFarmTask getFarm()
+	{
+		return _farm;
+	}


}do not copy
================================================================================
Index: net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
================================================================================
+	import net.sf.l2j.commons.lang.Tokenizer;
+	import net.sf.l2j.gameserver.model.L2AutoFarmTask;

do not copy
			ach.useAdminCommand(_command, activeChar);
			}
			
+			else if (_command.startsWith("farm"))
+			{
+				L2AutoFarmTask bot = activeChar.getFarm();
+				final Tokenizer tokenizer = new Tokenizer(_command);
+				final String param = tokenizer.getToken(1);
+				
+				switch (param.toLowerCase())
+				{
+					case "on":
+						if (!bot.running())
+						{
+							bot.start();
+						}
+						break;
+					
+					case "off":
+						if (bot.running())
+						{
+							bot.stop();
+						}
+						break;
+				}
+			}

do not copy
	else if (_command.startsWith("npc_"))
			{
			
======================================================			
Index: net/sf/l2j/commons/lang/Tokenizer.java
======================================================
+package net.sf.l2j.commons.lang;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Tokenizer
+{
+	private final Map<Integer, String> _tokens = new HashMap<>();
+	
+	public Tokenizer(String str)
+	{
+		this(str, " ");
+	}
+	
+	public Tokenizer(String str, String separator)
+	{
+		if (str == null || separator == null || str.isEmpty() || separator.isEmpty())
+		{
+			return;
+		}
+		
+		for (final String s : str.split(separator))
+		{
+			_tokens.put(_tokens.size(), s);
+		}
+	}
+	
+	public final String getToken(int index)
+	{
+		return _tokens.get(index);
+	}
+	
+	public final String getFirstToken()
+	{
+		return getToken(0);
+	}
+	
+	public final String getLastToken()
+	{
+		return _tokens.isEmpty() ? null : _tokens.get(_tokens.size() - 1);
+	}
+	
+	public final byte getAsByte(int index, byte defaultValue)
+	{
+		final String token = getToken(index);
+		if (token == null || !token.matches("-?\\d+"))
+		{
+			return defaultValue;
+		}
+		
+		return Byte.parseByte(token);
+	}
+	
+	public final int getAsInteger(int index, int defaultValue)
+	{
+		final String token = getToken(index);
+		if (token == null || !token.matches("-?\\d+"))
+		{
+			return defaultValue;
+		}
+		
+		return Integer.parseInt(token);
+	}
+	
+	public final float getAsFloat(int index, float defaultValue)
+	{
+		final String token = getToken(index);
+		if (token == null || !token.matches("-?\\d+(\\.\\d+)?"))
+		{
+			return defaultValue;
+		}
+		
+		return Float.parseFloat(token);
+	}
+	
+	public final double getAsDouble(int index, double defaultValue)
+	{
+		final String token = getToken(index);
+		if (token == null || !token.matches("-?\\d+(\\.\\d+)?"))
+		{
+			return defaultValue;
+		}
+		
+		return Double.parseDouble(token);
+	}
+	
+	public final long getAsLong(int index, long defaultValue)
+	{
+		final String token = getToken(index);
+		if (token == null || !token.matches("-?\\d+"))
+		{
+			return defaultValue;
+		}
+		
+		return Long.parseLong(token);
+	}
+	
+	public final boolean getAsBoolean(int index)
+	{
+		final String token = getToken(index);
+		return Boolean.parseBoolean(token);
+	}
+	
+	public <E extends Enum<E>> E getAsEnum(int index, final Class<E> enumClass, final E defaultValue)
+	{
+		final String val = getToken(index);
+		if (val != null)
+		{
+			try
+			{
+				return Enum.valueOf(enumClass, val);
+			}
+			catch (IllegalArgumentException e)
+			{
+				// Ignored
+			}
+		}
+		return defaultValue;
+	}
+	
+	public final int size()
+	{
+		return _tokens.size();
+	}
+	
+	public final boolean isEmpty()
+	{
+		return _tokens.isEmpty();
+	}
+	
+	public final String getAsString(int index)
+	{
+		return getToken(index);
+	}
+	
+	public final String getRemainingTokensFromIndex(int startIndex)
+	{
+		StringBuilder sb = new StringBuilder();
+		for (int i = startIndex; i < _tokens.size(); i++)
+		{
+			String token = getToken(i);
+			if (sb.length() > 0)
+			{
+				sb.append(" ");
+			}
+			sb.append(token);
+		}
+		return sb.toString();
+	}
+	
+	public final int countTokens()
+	{
+		return _tokens.size();
+	}
+	
+	public <E extends Enum<E>> E nextEnum(final Class<E> enumClass)
+	{
+		return getAsEnum(1, enumClass, null);
+	}
+	
+}


Download: https://mega.nz/file/RnE32I7a#U7iBDbVawz7YfPm_Q5Vcxb2ZH-SPn31PjI-cRoWIQDQ
 

 

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