Jump to content

Recommended Posts

Posted (edited)

Hello, I bring you the l2jdev dungeon event adapted to l2jfrozen for me

 

video test

 

Update Code: https://pastebin.com/Kc61EPNc

 

sql,html: https://www.mediafire.com/file/7z5v60myf9tf1vn/Dungeon.rar/file

 

 

I don't know exactly all the credits but I leave the names of the codes I use, sorry if any are missing

 

Credits: Anarchy, Juvenil Walker, Baggos, mkizub, G1ta0, Forsaiken

Help:melron

 

 

Edited by tensador27
Update code
  • Thanks 1
Posted
2 minutes ago, tensador27 said:

any advice or basic guide to improve it thank you very much in the same way

Simply check if the player is on dungeon before the item creation 

Posted
1 hour ago, melron said:

Simply check if the player is on dungeon before the item creation 

hello add this do you think it would work?

 

	                            if(DungeonManager.getInstance().getDungeonParticipants().contains(activeChar.getObjectId()))
                               {                         	  
   								L2ItemInstance item = activeChar.addItemDungeon("dungeon reward", itemId, count, null, true);
   								item.setEnchantLevel(25);
   								activeChar.getInventory().equipItemAndRecord(item);
   				                PlayerMemo.setVar(activeChar, "delete_temp_item_" + item.getObjectId(), item.getObjectId(), System.currentTimeMillis() + (1000 *60 *60 *5)); 
   								InstanceManager.getInstance().getInstance(0);
   								activeChar.setDungeon(null);						
   								activeChar.teleToLocation(Config.DUNGEON_SPAWN_X, Config.DUNGEON_SPAWN_Y, Config.DUNGEON_SPAWN_Z, Config.DUNGEON_SPAWN_RND);	                  	                            	   
                               }
	                            else 
                               {
                            	 activeChar.sendMessage("No puedes recibir el premio");  
                               }

 

I also put this

 

	                               if(Dungeon.isRegistered(activeChar)) 
                               {                         	  
   								L2ItemInstance item = activeChar.addItemDungeon("dungeon reward", itemId, count, null, true);
   								item.setEnchantLevel(25);
   								activeChar.getInventory().equipItemAndRecord(item);
   				                PlayerMemo.setVar(activeChar, "delete_temp_item_" + item.getObjectId(), item.getObjectId(), System.currentTimeMillis() + (1000 *60 *60 *5)); 
   								InstanceManager.getInstance().getInstance(0);
   								activeChar.setDungeon(null);						
   								activeChar.teleToLocation(Config.DUNGEON_SPAWN_X, Config.DUNGEON_SPAWN_Y, Config.DUNGEON_SPAWN_Z, Config.DUNGEON_SPAWN_RND);	                  	                            	   
                               }




and in the dungeon part I put this
  
	public static boolean isRegistered(L2PcInstance player)
	{
		return DungeonManager.getInstance().getDungeonParticipants().contains(player.getObjectId());
	}  

 

Posted
1 minute ago, Kara said:

Like your ex. 

Are you vulnerable? I divorced you because you were a bitch

11 minutes ago, tensador27 said:

hello add this do you think it would work?

 

 

activeChar.getDungeon() != null

Posted (edited)

@tensador27 with this ThreadPool.java player will not teleported ..you need to use ThreadPoolManager options to work perfectly..i got stacked many times .. What i did :

replace all : ThreadPool.schedule(
with :ThreadPoolManager.getInstance().scheduleGeneral(

 

and all :  ThreadPool.scheduleAtFixedRate(()

with : ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(()

 

also you need to add this :
 

com/l2jfrozen/gameserver/model/actor/knownlist/ObjectKnownList.java
===========================================

        @Override
        public void run()
        {
            if (_obj != null)
            {
                _obj.getKnownList().updateKnownObjects();
            }
        }
    }


+    @SuppressWarnings("unchecked")
+    public final <A> Collection<A> getKnownType(Class<A> type)
+    {
+        List<A> result = new ArrayList<>();
+        
+        for (L2Object obj : _knownObjects.values())
+        {
+            if (type.isAssignableFrom(obj.getClass()))
+                result.add((A) obj);
+        }
+        return result;
+    }
+    
+    @SuppressWarnings("unchecked")
+    public final <A> Collection<A> getKnownTypeInRadius(Class<A> type, int radius)
+    {
+        List<A> result = new ArrayList<>();
+        
+        for (L2Object obj : _knownObjects.values())
+        {
+            if (type.isAssignableFrom(obj.getClass()) && Util.checkIfInRange(radius, getActiveObject(), obj, true))
+                result.add((A) obj);
+        }
+        return result;
+    }
}

 

 

also consuming of items on party dungeon needs fix, it first take the itemid and then it tell u ,u need party.https://ibb.co/zb5wbW5

Edited by Irrelevant
  • 3 months later...
Posted (edited)

This code is old and there's a few bugs (like the bypass vulnerability). This was taken from L2Eola files but not the latest files obviously, so you have to find and fix any bugs.

 

The person who tried to adapt this clearly did not bother to read the code or was unable to, therefore whole systems such as player memo have been copied from aCis for a single use (dungeon). Or even ThreadPool class when frozen already has a thread pool implementation.

Instances code is incomplete too and there will be issues for sure.

 

Some other parts of the code are changed too, I suppose it's because you gave credits to 5 other people besides me so some of them must have made the changes.

 

-

 

If you need a proper adaptation don't use this, ask a person that knows what they're doing to adapt this for you.

 

 

 

ALSO this made me physically sick:

  

+           if (_command.startsWith("bp_reward"))
+           {
+               int type = Integer.parseInt(_command.substring(10));
+               int itemId = 0;
+               int count = 1;
+               
+               switch (type)
+               {
+                   case 0:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL0;
+                       
+                       break;
+                   }
+                   case 1:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL1;
+                       
+                       break;
+                   }
+                   case 2:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL2;
+                       
+                       break;
+                   }
+                   case 3:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL3;
+                       
+                       break;
+                   }
+                   case 4:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL4;
+                       
+                       break;
+                   }
+                   case 5:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL5;
+                       
+                       break;
+                   }
+                   case 6:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL6;
+                       
+                       break;
+                   }
+                   case 7:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL7;
+                       
+                       break;
+                   }
+                   case 8:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL8;
+                       
+                       break;
+                   }
+                   case 9:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL9;
+                       
+                       break;
+                   }
+                   case 10:
+                   {
+                       itemId = Config.DUNGEON_ITEM_RENEWAL10;
+                       
+                       break;
+                   }
+               }
+               
+               if (itemId == 0)
+               {
+                   System.out.println(activeChar.getName() + " tried to send custom id on dungeon solo rewards.");
+                   return;
+               }
+                               if(activeChar.getDungeon() != null)
+                               {                             
+                                   L2ItemInstance item = activeChar.addItemDungeon("dungeon reward", itemId, count, null, true);
+                                   item.setEnchantLevel(25);
+                                   activeChar.getInventory().equipItemAndRecord(item);
+                                   PlayerMemo.setVar(activeChar, "delete_temp_item_" + item.getObjectId(), item.getObjectId(), System.currentTimeMillis() + (1000 *60 *60 *5)); 
+                                   InstanceManager.getInstance().getInstance(0);
+                                   activeChar.setDungeon(null);                        
+                                   activeChar.teleToLocation(Config.DUNGEON_SPAWN_X, Config.DUNGEON_SPAWN_Y, Config.DUNGEON_SPAWN_Z, Config.DUNGEON_SPAWN_RND);                                                           
+                               }
+                               else 
+                               {
+                                activeChar.sendMessage("No puedes recibir el premio");  
+                               }
+           }

 

 

Edited by An4rchy
Posted
5 hours ago, joseinacio said:

help acis 401

image.png.4ea06f15f401d7555cd0e9883a661c48.png

 

 

ConectionPool.java

add this

 

	private static final CLogger LOGGER = new CLogger(ConnectionPool.class.getName());
+	private static ConnectionPool _instance;	




	public static Connection getConnection() throws SQLException
	{
		return _source.getConnection();
	}

+	public static ConnectionPool getInstance()
+	{
+		if (_instance == null)
+		{
+			_instance = new ConnectionPool();
+		}
+		
+		return _instance;
+	}

 

  • Like 1
  • 4 weeks later...
Posted (edited)
On 6/23/2022 at 3:27 PM, tensador27 said:

 

 

ConectionPool.java

add this

 

	private static final CLogger LOGGER = new CLogger(ConnectionPool.class.getName());
+	private static ConnectionPool _instance;	




	public static Connection getConnection() throws SQLException
	{
		return _source.getConnection();
	}

+	public static ConnectionPool getInstance()
+	{
+		if (_instance == null)
+		{
+			_instance = new ConnectionPool();
+		}
+		
+		return _instance;
+	}

 

help

image.png.88ee713e60a06bb326551add8d728321.png

only on linux this error windows is okimage.png.1d274413ebb8f85f1b8a6a7ea079a73e.png

Edited by joseinacio

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

    • Which file is responsible for the text in the footer on the login screen? The text at the very bottom... I've been searching for two days and I can't figure out how to edit it. Could someone help? I think I've checked almost all the files in the system and still can't find it.
    • I can see that the admins arent taking any action, yet they still seem willing to share information about various other people names and IP addresses. But when it comes to scams, no one reacts.      
    • Server Info Chronicle:  Interlude                                                                                                                                    XP: 100x | SP: 100x | Drop: 50x | Adena: 75x Enchant: Safe +3 |  Max +21 Website: Website Link Discord: Discord Link   WHY? When I was a teenager I had this idea. Build my own Lineage 2 server. My own rules. My own world. I wasn't a programmer. I had no idea how any of it worked. I tried, hit a wall, and quit. But the idea never left. I came back years later. Got further. Quit again. Watched friends try similar things. The idea stayed stuck in my head for fifteen years. I'm a developer now. I finally finished it. Not because I suddenly had more time - I have a full-time job and real responsibilities. An hour before bed if I'm lucky. That's actually exactly why I finished it.   The problem I kept running into I still love this game. But every server I tried as an adult made that one hour feel worthless. Log in, kill a few mobs, make no real progress, log out frustrated. The game was designed for someone with unlimited time. That person doesn't exist in my life anymore. I looked around. Everyone I used to play with has the same problem. Same love for the game. Same lack of time. Jobs, families, maybe an hour late at night. So I stopped waiting for someone else to build it.           WHAT? Custom starting zone in Gludin (up until 2nd profession start) Talent system - rebirth at level 80 and choose your talents Bounty hunter system - daily tasks to kill random monsters to receive great reward! Potion crafting system - custom HP/MP potions and recipes Custom 1st & 2nd class quests (shorter) Scheme buffer Shop until C grade   Visit our website to get more info: Website Link   The philosophy 95% of the game is completely soloable. No clan required. No raid schedules. No guilt when you have to log off. You are the solo director of your own session. Log in, pursue your goal for an hour, log out on your own terms. When you've conquered what you wanted - you stop naturally. A new season drops with fresh Talent Tree changes and you come back to build something completely different. No endless stretched grind. No pay-to-win. No shady admin decisions. No surprise wipes. I'm one developer who built this because I love it.                                          This is the server I needed fifteen years ago. Glad I finally had the skills to build it. Come see what I made. [Forever Lineage]
  • 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..