Jump to content

Recommended Posts

Posted

Hello i've created a full working AIO buff system and i want to share it. It works , I tested it with a friend in our local server.I fixed as many possible bugs I thought.

Aio buffer is only available to teleport in PEACE ZONES. To make someone AIO you have to press //setaio and to remove someone from AIO //removeaio.

An AIO can't change subclass , can't leave from towns , etc. Also his normal skills are beeing removed and he has only the AIO skills that you can add in the AioBuffHandler.java file. Aio buffers take also a prefix in front of their name ( [AIO] ) and full recs.

0 errors in Gameserver Console.

### Eclipse Workspace Patch 1.0
#P aVa Tester
Index: java/net/sf/l2j/gameserver/Olympiad.java
===================================================================
--- java/net/sf/l2j/gameserver/Olympiad.java	(revision 9)
+++ java/net/sf/l2j/gameserver/Olympiad.java	(working copy)
@@ -392,6 +392,12 @@
     public boolean registerNoble(L2PcInstance noble, boolean classBased)
     {
         SystemMessage sm;
+        
+        if(noble.isAio())
+        {
+        	noble.sendMessage("AIO players can't register in Olympiad");
+        	return false;
+        }

         if (_compStarted)
         {
Index: java/net/sf/l2j/gameserver/model/AioBuffHandler.java
===================================================================
--- java/net/sf/l2j/gameserver/model/AioBuffHandler.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/AioBuffHandler.java	(revision 0)
@@ -0,0 +1,190 @@
+
+package net.sf.l2j.gameserver.model;
+
+import java.util.logging.Logger;
+
+import net.sf.l2j.gameserver.clientpackets.Say2;
+import net.sf.l2j.gameserver.datatables.SkillTable;
+import net.sf.l2j.gameserver.datatables.SkillTreeTable;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
+import net.sf.l2j.gameserver.util.Broadcast;
+
+/**
+ * This class handles AIO buffers
+ *@author irat
+ */
+
+public class AioBuffHandler
+{
+	private static final Logger _log = Logger.getLogger((AioBuffHandler.class.getName()));
+	
+	private final static int SKILL_IDS_LEVELS[][] =
+	{
+		{264,1},  
+		{265,1},
+		{266,1},
+		{267,1},
+		{268,1},
+		{269,1}
+	};
+	
+	public static void setAio(L2PcInstance player , L2PcInstance target)
+	{
+		if(player == null || target == null)
+			return;
+		
+		if(target.isAio())
+		{
+			player.sendMessage("Player "+target.getName()+" is already an AIO");
+			return;
+		}
+		
+		else if(target.isSubClassActive())
+		{
+			player.sendMessage("Player must be at main class in order to become an AIO");
+			return;
+		}
+		
+		else if(target.isTeleporting() || target.isInOlympiadMode() || target.isDead() || target.isAlikeDead())
+		{
+			player.sendMessage("Action failed , nothing happened");
+			return;
+		}
+		
+			target.setAio(true);
+			Broadcast.toAllOnlinePlayers(new CreatureSay(0,15,"Server","Attention: Player "+target.getName()+" has been granted with AIO status."));
+			player.sendMessage("Player "+target.getName()+" is now an AIO!");
+			target.sendPacket(new CreatureSay(0,Say2.TELL,"Aio System","Dear player, you have AIO status now with special abilities , congratulations."));
+
+	} 
+	
+	public static void changeName(String beforeName,L2PcInstance target)
+	{
+		if(beforeName == null || beforeName == "" || target == null)
+			return;
+		
+		String currentName = target.getName();
+		String newName = beforeName + currentName;
+		
+		target.setName(newName);
+		target.setRecomHave(255);
+		target.broadcastUserInfo();
+	}
+	
+	public static void removeCurrentSkills(L2PcInstance player,L2PcInstance target)
+	{
+		if(player == null || target == null)
+			return;
+		
+		L2Skill[] playerCurrentSkills = target.getAllSkills();
+		
+		//loop into skills to remove one by one
+		for(L2Skill skill : playerCurrentSkills)
+		{
+			if(skill == null)
+			{
+				player.sendMessage("Warning:Error occured in skill "+ skill.getName() +".");
+				continue;
+			}
+			target.removeSkill(skill);
+			
+		}
+        target.sendSkillList();
+	}
+	
+	public static void giveAioSkills(L2PcInstance player,L2PcInstance target)
+	{
+		for(int[] skillIdLevel : SKILL_IDS_LEVELS)
+		{
+			int id = skillIdLevel[0];
+			int level = skillIdLevel[1];
+			
+			if(id == 0 || level == 0)
+				continue;
+			
+			L2Skill skillToAdd = SkillTable.getInstance().getInfo(id,level);
+			
+			if(skillToAdd == null){
+				player.sendMessage("An error occured to give skills to "+target.getName()+",check your skill infos please and try again.");
+			    return;
+			}
+			
+			target.addSkill(skillToAdd, true);
+		}
+        target.sendSkillList();
+	}
+	
+	public static void removeAio(L2PcInstance player,L2PcInstance target)
+	{
+		if(target == null || player == null)
+			return;
+		
+		if(!target.isAio())
+		{
+			player.sendMessage("This character is not AIO at the moment!");
+			return;
+		}
+		
+		if(target.isTeleporting())
+		{
+			player.sendMessage("An error occured, nothing happened");
+			return;
+		}
+		
+		target.setAio(false);
+
+			L2Skill[] aioBuffs = target.getAllSkills();
+			
+			for(L2Skill skill : aioBuffs)
+			{
+				if(skill == null)
+					continue;
+				
+				target.removeSkill(skill);
+			}
+			
+			boolean countUnlearnable = true;
+			int unLearnable = 0;
+			int skillCounter = 0;
+			L2SkillLearn[] skills = SkillTreeTable.getInstance().getAvailableSkills(target, target.getClassId());
+			while(skills.length > unLearnable)
+			{
+				for (L2SkillLearn s : skills)
+				{
+					L2Skill sk = SkillTable.getInstance().getInfo(s.getId(), s.getLevel());
+					if (sk == null || !sk.getCanLearn(target.getClassId()))
+					{
+						if(countUnlearnable)
+							unLearnable++;
+						continue;
+					}
+					if(target.getSkillLevel(sk.getId()) == -1)
+						skillCounter++;
+					target.addSkill(sk, true);
+				}
+				countUnlearnable = false;
+				skills = SkillTreeTable.getInstance().getAvailableSkills(target, target.getClassId());
+			}
+			
+			String aioName = target.getName();
+			String name = null;
+			
+			if(aioName.startsWith("[AIO]"))
+				name = aioName.substring(5);
+		
+			
+			if(name != null)
+				target.setName(name);
+			
+			target.broadcastUserInfo();
+			target.sendSkillList();
+			target.setRecomHave(0);
+			target.sendPacket(new CreatureSay(0,Say2.TELL,"Aio System","You are no longer an AIO , you rewarded with your normal skills."));
+			player.sendMessage("Player "+target.getName()+" successfully removed from AIO");
+			Broadcast.toAllOnlinePlayers(new CreatureSay(0,15,"Server","Attention: Player "+target.getName()+" is no more a server AIO"));
+			
+		
+	}
+	
+}
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 9)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -72,6 +72,7 @@
import net.sf.l2j.gameserver.handler.UserCommandHandler;
import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAdmin;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAio;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAnnouncements;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminBBS;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminBan;
@@ -516,6 +517,7 @@

		_adminCommandHandler = AdminCommandHandler.getInstance();
		_adminCommandHandler.registerAdminCommandHandler(new AdminAdmin());
+		_adminCommandHandler.registerAdminCommandHandler(new AdminAio());
		_adminCommandHandler.registerAdminCommandHandler(new AdminInvul());
		_adminCommandHandler.registerAdminCommandHandler(new AdminDelete());
		_adminCommandHandler.registerAdminCommandHandler(new AdminKill());
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 9)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -211,8 +211,8 @@
	private static final String ADD_SKILL_SAVE = "INSERT INTO character_skills_save (char_obj_id,skill_id,skill_level,effect_count,effect_cur_time,reuse_delay,restore_type,class_index,buff_index) VALUES (?,?,?,?,?,?,?,?,?)";
	private static final String RESTORE_SKILL_SAVE = "SELECT skill_id,skill_level,effect_count,effect_cur_time, reuse_delay FROM character_skills_save WHERE char_obj_id=? AND class_index=? AND restore_type=? ORDER BY buff_index ASC";
	private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
-	private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?";
-	private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?";
+	private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,aio=? WHERE obj_id=?";
+	private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,aio FROM characters WHERE obj_id=?";
	private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
	private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
	private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,level=?,class_id=? WHERE char_obj_id=? AND class_index =?";
@@ -314,6 +314,12 @@
		@Override
		public void doCast(L2Skill skill)
		{
+			if(isAio() && !isInsideZone(ZONE_PEACE))
+			{
+				sendMessage("An AIO buffer can use his abilities only in PEACE ZONE");
+				return;
+			}
+					
			super.doCast(skill);

			// cancel the recent fake-death protection instantly if the player attacks or casts spells
@@ -548,6 +554,9 @@
	/** The _noble. */
	private boolean _noble = false;

+	/** Aio system */
+	private boolean _aio = false;
+	
	/** The _hero. */
	private boolean _hero = false;

@@ -6864,6 +6873,7 @@
				player.setOnlineTime(rset.getLong("onlinetime"));
				player.setNewbie(rset.getInt("newbie") == 1);
				player.setNoble(rset.getInt("nobless") == 1);
+				player.setAio(rset.getInt("aio") == 1);

				player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
				if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
@@ -7412,7 +7422,8 @@
			statement.setLong(54, getClanCreateExpiryTime());
			statement.setString(55, getName());
			statement.setLong(56, getDeathPenaltyBuffLevel());
-			statement.setInt(57, getObjectId());
+			statement.setInt(57, isAio() ? 1 : 0);
+			statement.setInt(58, getObjectId());

			statement.execute();
			statement.close();
@@ -10077,6 +10088,16 @@
		return true;
	}

+	public void setAio(boolean becomeAio)
+	{
+		_aio = becomeAio;
+	}
+	
+	public boolean isAio()
+	{
+		return _aio;
+	}
+	
	/**
	 * Checks if is noble.
	 * @return true, if is noble
@@ -11099,6 +11120,10 @@
		// Force a revalidation
		revalidateZone(true);

+		if(isAio() && !isInsideZone(ZONE_PEACE))
+			teleToLocation(MapRegionTable.TeleportWhereType.Town);
+			
+		
		if (Config.PLAYER_SPAWN_PROTECTION > 0)
		{
			setProtection(true);
Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(revision 9)
+++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(working copy)
@@ -277,6 +277,13 @@
			// no broadcast needed since the player will already spawn dead to others
			sendPacket(new Die(activeChar));
		}
+		
+		//Check AIO
+		if(activeChar.isAio())
+			if(!activeChar.isInsideZone(L2Character.ZONE_PEACE))
+				activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+			
+		

		if (Config.ALLOW_WATER)
		    activeChar.checkWaterState();
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAio.java	(revision 0)
@@ -0,0 +1,58 @@
+
+package net.sf.l2j.gameserver.handler.admincommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.model.AioBuffHandler;
+import net.sf.l2j.gameserver.model.L2Object;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *This class handles the admin commands for AIO system
+ * @author irat
+ */
+
+public class AdminAio implements IAdminCommandHandler
+{
+
+	private final String[] AIO_COMMANDS = {"admin_setaio","admin_removeaio"};
+
+	@Override
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		L2Object target = activeChar.getTarget();
+		L2PcInstance targ = null;
+		if(target == null)
+		{
+			activeChar.sendMessage("Using this command in the air?");
+			return false;
+		}
+		if(!(target instanceof L2PcInstance))
+		{
+			activeChar.sendMessage("This command can be used only in players.");
+			return false;
+		}
+		targ = (L2PcInstance) target;	
+		
+		if(command.equalsIgnoreCase("admin_setaio"))
+		{
+			AioBuffHandler.setAio(activeChar, targ);
+			AioBuffHandler.removeCurrentSkills(activeChar, targ);
+			AioBuffHandler.giveAioSkills(activeChar, targ);
+			AioBuffHandler.changeName("[AIO]", targ);
+		}
+		else if(command.equalsIgnoreCase("admin_removeaio"))
+		{
+			AioBuffHandler.removeAio(activeChar, targ);
+		}
+		
+		return true;
+	}
+
+
+	@Override
+	public String[] getAdminCommandList()
+	{
+		return AIO_COMMANDS;
+	}
+	
+}
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java	(revision 9)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java	(working copy)
@@ -168,7 +168,14 @@
                 player.sendPacket(new SystemMessage(SystemMessageId.SUBCLASS_NO_CHANGE_OR_CREATE_WHILE_SKILL_IN_USE));
                 return;
             }
-
+            
+            // Subclasses may not be changed if player is AIO
+            if(player.isAio())
+            {
+            	player.sendMessage("An AIO has not the ability to change or add subclasses");
+            	return;
+            }
+            
             TextBuilder content = new TextBuilder("<html><body>");
             NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
             Set<PlayerClass> subsAvailable;
Index: java/net/sf/l2j/gameserver/model/zone/type/L2TownZone.java
===================================================================
--- java/net/sf/l2j/gameserver/model/zone/type/L2TownZone.java	(revision 9)
+++ java/net/sf/l2j/gameserver/model/zone/type/L2TownZone.java	(working copy)
@@ -18,6 +18,8 @@
package net.sf.l2j.gameserver.model.zone.type;

import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.datatables.MapRegionTable;
import net.sf.l2j.gameserver.model.L2Character;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.zone.L2ZoneType;
@@ -111,12 +113,36 @@
	protected void onExit(L2Character character)
	{
		if (!_noPeace) character.setInsideZone(L2Character.ZONE_PEACE, false);
+		
+		if(((L2PcInstance) character).isAio())
+		{
+			if(!character.isTeleporting())
+			{
+			((L2PcInstance) character).sendMessage("Escaping from town? You will be teleport back automatically in some seconds");
+			ThreadPoolManager.getInstance().scheduleGeneral(new teleportBack(character), 4000);
+			}
+		}

		// if (character instanceof L2PcInstance)
			//((L2PcInstance)character).sendMessage("You left "+_townName);

	}
+	
+	class teleportBack implements Runnable
+	{
+		L2Character chara;

+		private teleportBack(L2Character character)
+		{
+			chara = character;
+		}
+		public void run()
+		{
+			chara.teleToLocation(MapRegionTable.TeleportWhereType.Town);
+		}
+		
+	}
+
	@Override
	protected void onDieInside(L2Character character) {}
Index: sql/characters.sql
===================================================================
--- sql/characters.sql	(revision 8)
+++ sql/characters.sql	(working copy)
@@ -79,6 +79,7 @@
   clan_join_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
   clan_create_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
   death_penalty_level int(2) NOT NULL DEFAULT 0,
+  aio decimal(1,0) NOT NULL DEFAULT 0,
   PRIMARY KEY  (obj_Id),
   KEY `clanid` (`clanid`)
) ;

 

If you have any bugs contact me at iracundusgr@live.com (MSN)

Posted

nc code :)

 

someone give him a cookie :P

 

edit: a soz karma..

thank you.

 

PS: i have seen an another AIO in the forum but this one is quit better with more checks, etc.

Posted

target.sendSkillList();

This should be after the for loop in removeCurrentSkills method.

In giveAioSkills method too.

 

+			if(isAio() && (isInOlympiadMode() || isOlympiadStart() || inObserverMode()))
+			{
+				sendMessage("An AIO buffer can't use his abilities in olympiad.");
+				return;
+			}

But an AIO can't join olympiad :/

 

+        if(activeChar.isAio())
+        {
+        	activeChar.sendMessage("AIO can't use unstuck command.");
+        	return false;
+        }

Not needed, since unstuck teleports you in town...

 

The connections for setting aio column in characters table to 1 or 0 in AioBuffHandler aren't needed, since it is automatically updated through the storeCharBase method.

 

Last thing, the methods in AioBuffHandler could have been static; there's no need of creating useless objects.

Posted

target.sendSkillList();

This should be after the for loop in removeCurrentSkills method.

In giveAioSkills method too.

 

+			if(isAio() && (isInOlympiadMode() || isOlympiadStart() || inObserverMode()))
+			{
+				sendMessage("An AIO buffer can't use his abilities in olympiad.");
+				return;
+			}

But an AIO can't join olympiad :/

 

+        if(activeChar.isAio())
+        {
+        	activeChar.sendMessage("AIO can't use unstuck command.");
+        	return false;
+        }

Not needed, since unstuck teleports you in town...

 

The connections for setting aio column in characters table to 1 or 0 in AioBuffHandler aren't needed, since it is automatically updated through the storeCharBase method.

 

Last thing, the methods in AioBuffHandler could have been static; there's no need of creating useless objects.

 

UPDATED

  • 1 month later...
  • 2 weeks later...
Posted

I've ported this to H5 partially and it works quite well. Especially the guards and checks, however I have this now. Not sure where I went wrong because I can't pinpoint it as the error says this was part of my edit of L2TownZone.java.

 

Anyone help? - not sure what this means, especially since I dont see how this ClassCast exception.

 

java.lang.ClassCastException: com.l2jserver.gameserver.model.actor.instance.L2Np
cWalkerInstance cannot be cast to com.l2jserver.gameserver.model.actor.instance.
L2PcInstance
        at com.l2jserver.gameserver.model.zone.type.L2TownZone.onExit(L2TownZone
.java:89)
        at com.l2jserver.gameserver.model.zone.L2ZoneType.revalidateInZone(L2Zon
eType.java:418)
        at com.l2jserver.gameserver.model.L2WorldRegion.revalidateZones(L2WorldR
egion.java:97)
        at com.l2jserver.gameserver.model.actor.L2Character.revalidateZone(L2Cha
racter.java:4576)
        at com.l2jserver.gameserver.model.actor.L2Character.updatePosition(L2Cha
racter.java:4551)
        at com.l2jhidden.game.GameTimeController$MoveObjects.execute(GameTimeCon
troller.java:141)
        at com.l2jhidden.game.GameTimeController$MoveObjects.execute(GameTimeCon
troller.java:1)
        at gnu.trove.map.hash.TIntObjectHashMap.forEachValue(TIntObjectHashMap.j
ava:402)
        at com.l2jhidden.game.GameTimeController.moveObjects(GameTimeController.
java:128)
        at com.l2jhidden.game.GameTimeController$TimerThread.run(GameTimeControl
ler.java:184)

 

and this is my take on this older code, ported to work on h5.

 

		
	character.setInsideZone(L2Character.ZONE_TOWN, false);

	if(((L2PcInstance) character).isAio())
	{
		if(!character.isTeleporting())
		{
		activeChar.teleToLocation(MapRegionManager.TeleportWhereType.Town);
		activeChar.sendMessage("Escaping from town? You will be teleport back automatically in some seconds");
		}
	}

 		// if (character instanceof L2PcInstance)
 			//((L2PcInstance)character).sendMessage("You left "+_townName);

 	}

class teleportBack implements Runnable
{
	L2Character chara;

	private teleportBack(L2Character character)
	{
		chara = character;
	}
	public void run()
	{
		chara.teleToLocation(MapRegionManager.TeleportWhereType.Town);
	}

}

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


  • Posts

    • Hi, I'm selling Interface sources. I was working with one of bigger Essence projects (for ±1 year) delivering them Interface source KR. Per this period gathered knowledge about UE, UE Scripting, saw a lot of tools and their progression. So finally I decided that I can open up my own sales topic. I'm selling source for any protocol - If I don't have source, I will need you to provide whole system folder or for Essence/main - provide me protocol number. Sources are acquired by my OWN decompiler - written in Java, so we're not using popular UEExplorer upgraded by anyone. Decompiler extracts already compile ready sources. It outputs clean code, however constants are mapped 60-70%. Why only 60-70%? Well tl;dr when you compile any sources, they take at that time constant value and place it instead of = CONST_NAME to = THAT_CONST_NAME_VALUE, so it's not possible to have const name instead of value. Example of output: https://pastebin.com/cjyXcJvT for bigger .uc class (557p). p.s pastebin messed up encoding, but KR symbols are preserved - you won't see "?" symbols, rather you will see proper original korean text. I will give you guide as well, how not to mess it up with your editor VS Code/Notepad++ or what you use it to make them preserve it. You will get source + my compiler wrapper (written in java) - works on Windows/Mac/Linux - it has small GUI but supports CLI. Small notice, who thinks 'this is decompiled source' - basically all sources that are on sale are made by decompiling .u and applying changes. I think powerhouse few years ago was ArtToKill/kick (kick added support for INT64 to the publicly available compiler sources) etc. So no - there are no straight from 'creator' sources anywhere, all sellers offer the same - just the quality is different. UEExplorer upgraded was a big step, however, it introduces still a lot of nesting, if statements wrapping incorrectly which could lead to bugs. There are many things how to identify poor quality sources, as if the seller tries to sell 'out-of-box' when they see it compiles - sad news, some bugs are in the logic due to seller focusing only on 'it compiles' rather than issues that their decompiler is not capable so solve. On request I can restore ±100% const mapping.   Later I can attach compiled .u to try. Price is 400EUR. Payment methods USDT (Crypto). I'm still in debate with myself, wether to start selling XDat Editor with structures and ClientDat with 100% all files openings (no unk namings) and improved experience (such as comments support in .dat files, mass sync, improved performance and so on). P.s. If you ask me to give you some project's custom interface - the price may vary - there are couple things per project that need to be hand checked and adjusted (for example Innadril completely changes tokens which then I need to adjust my program to their token Ids). So it might take more time = more money. P.s.s. I have more things in the garage, like my own dsetup source that can allow you 'unlocking' system with your desired encrypting - you don't need to wait till 'patched' systems start appearing and so on, but I think at this time everyone who needs it make them selves it. AAC crypt removals and so on, BuildZone, everything that 'unlocks' client, however, I don't plan to make them on sale as mentioned, everyone can do them.  
    • It has been a while since I updated this thread. I am currently actively working on a full-scale port of the shader library to ensure the fast and accurate transfer of all effects. I have decompiled the original game and created a tool that fully logs the entire *Lineage 2 Interlude* particle system. This allows me to extract the original formulas hardcoded into the game, resulting in a high-fidelity port. For instance, *Lineage 2* uses an `appRnd` system that generates unique randomization patterns for different skills, giving them distinct visual characteristics; there are countless formulas and technical nuances like this. Ultimately, I will derive all the key formulas and replicate the geometry with high precision. Twelve basic geometry formulas have already been ported. The effect was created in 10 minutes using a .uc file, HLSL formulas, and SpriteEmitter particle blending formulas.   https://prnt.sc/_3UDLQVX_Y-_
    • Good luck my friend! 😃
    • try this one instead. The one he shared affects every single NPC/player character in the game, the one I posted only affects player characters  https://drive.google.com/file/d/1UtccbD9e50x3WEnQBab2PTZnBHwpcGYM/view?usp=sharing or perhaps i misunderstood; if you could please post a full explanation of the problem you're having with the files, unfortunately i think whatever you're using to translate to english is a bit bad nevermind, i got what you mean, here's the fix   https://drive.google.com/file/d/1av7OHaGSdnVQtcBgb9MhtiIkxVXy3P2y/view?usp=sharing   CanIngnoreCollision=True CanBeIngnoredCollision=True  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..