Jump to content
  • 0

Adena auto-loot


Question

Posted

Hey guys, I wan the only-adena autoloot option for l2j

I tried ripping the l2jfree once but I get too many unknown symbols and stupid errors....

 

This is the part of l2jfree at gameserver/datatables/ItemTable.java

		// Create and Init the L2ItemInstance corresponding to the Item Identifier
	L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId, itemId);

	if (process.equalsIgnoreCase("loot") && ((!Config.AUTO_LOOT && itemId != 57 && itemId != 5575 && itemId < 6360 && itemId > 6362) || (!Config.AUTO_LOOT_ADENA && (itemId == 57 || itemId == 5575 || itemId >= 6360 && itemId <= 6362))))
	{
		ScheduledFuture<?> itemLootShedule;
		long delay = 0;
		// if in CommandChannel and was killing a World/RaidBoss
		if (reference instanceof L2Boss)
		{
			if (((L2Attackable) reference).getFirstCommandChannelAttacked() != null
					&& ((L2Attackable) reference).getFirstCommandChannelAttacked().meetRaidWarCondition(reference))
			{
				item.setOwnerId(((L2Attackable) reference).getFirstCommandChannelAttacked().getChannelLeader().getObjectId());
				delay = 300000;
			}
			else
			{
				delay = 15000;
				item.setOwnerId(actor.getObjectId());
			}
		}
		else
		{
			item.setOwnerId(actor.getObjectId());
			delay = 15000;
		}
		itemLootShedule = ThreadPoolManager.getInstance().scheduleGeneral(new ResetOwner(item), delay);
		item.setItemLootShedule(itemLootShedule);
	}

	if (_log.isDebugEnabled())
		_log.debug("ItemTable: Item created  oid:" + item.getObjectId() + " itemid:" + itemId);

 

 

And these are the errors I get...

   
     [javac] *\L2_GameServer\java\net\sf\l2j\gameserver\datatables\ItemTable.java:767: cannot find symbol
    [javac] symbol  : constructor L2ItemInstance(int,int,int)
    [javac] location: class net.sf.l2j.gameserver.model.L2ItemInstance
    [javac] 		L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId, itemId);
    [javac] 		                      ^
    [javac] *\L2_GameServer\java\net\sf\l2j\gameserver\datatables\ItemTable.java:774: cannot find symbol
    [javac] symbol  : class L2Boss
    [javac] location: class net.sf.l2j.gameserver.datatables.ItemTable
    [javac] 			if (reference instanceof L2Boss)
    [javac] 			                         ^
    [javac] *\L2_GameServer\java\net\sf\l2j\gameserver\datatables\ItemTable.java:793: cannot find symbol
    [javac] symbol  : class ResetOwner
    [javac] location: class net.sf.l2j.gameserver.datatables.ItemTable
    [javac] 			itemLootShedule = ThreadPoolManager.getInstance().scheduleGeneral(new ResetOwner(item), delay);
    [javac] 			                                                                      ^
    [javac] *\java\net\sf\l2j\gameserver\datatables\ItemTable.java:797: cannot find symbol
    [javac] symbol  : method isDebugEnabled()
    [javac] location: class java.util.logging.Logger
    [javac] 		if (_log.isDebugEnabled())
    [javac] 		        ^
    [javac] *\L2_GameServer\java\net\sf\l2j\gameserver\datatables\ItemTable.java:798: cannot find symbol
    [javac] symbol  : method debug(java.lang.String)
    [javac] location: class java.util.logging.Logger
    [javac] 			_log.debug("ItemTable: Item created  oid:" + item.getObjectId() + " itemid:" + itemId);
    [javac] 			    ^

 

Can someone please adjust this code to L2J for me? :)

 

Thanks in advance...

1 answer to this question

Recommended Posts

  • 0
Posted

		// Create and Init the L2ItemInstance corresponding to the Item Identifier
	L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId, itemId);

	if (process.equalsIgnoreCase("loot") && ((!Config.AUTO_LOOT && itemId != 57 && itemId != 5575 && itemId < 6360 && itemId > 6362) || (!Config.AUTO_LOOT_ADENA && (itemId == 57 || itemId == 5575 || itemId >= 6360 && itemId <= 6362))))
	{
		ScheduledFuture<?> itemLootShedule;
		long delay = 0;
		// if in CommandChannel and was killing a World/RaidBoss
		if (reference instanceof L2BossInstance)
		{
			if (((L2Attackable) reference).getFirstCommandChannelAttacked() != null
					&& ((L2Attackable) reference).getFirstCommandChannelAttacked().meetRaidWarCondition(reference))
			{
				item.setOwnerId(((L2Attackable) reference).getFirstCommandChannelAttacked().getChannelLeader().getObjectId());
				delay = 300000;
			}
			else
			{
				delay = 15000;
				item.setOwnerId(actor.getObjectId());
			}
		}
		else
		{
			item.setOwnerId(actor.getObjectId());
			delay = 15000;
		}
		itemLootShedule = ThreadPoolManager.getInstance().scheduleGeneral(new ResetOwner(item), delay);
		item.setItemLootShedule(itemLootShedule);
	}

	if (Config.DEBUG)
		_log.warning("ItemTable: Item created  oid:" + item.getObjectId() + " itemid:" + itemId);

 

Should correct 3 errors (L2Boss => L2BossInstance, and the debug message).

 

For the 2 last, one is simple : you forget to add a internal class named ResetOwner.

 

The ItemInstance bad constructor is surely simple, but I let you search else it's not funny. Open L2ItemInstance and see how the constructor is made. The number/types of arguments you ask (3 integers) don't fit with L2J. So perhaps there are 2 arguements only, perhaps it's not 3 integers but 2 integers and one strong, blablabla :).

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
Answer this question...

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