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

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