Jump to content

Recommended Posts

Posted

Well, I decided to share this little guide, cause I see many people that have problem with their buffers.

The most common is 'You don't meet the criteria...', with this guide you can fix that.

Anyway let's start :

 

As an example, I took a random L2jfree buffer. We are gonna 'adapt' it for our pack, I chose L2Emu.

First, we open the __init__.py of our buffer , which is usually located here, in the folder 9999_NPCBuffer.

 

...\gameserver\data\scripts\custom\9999_NPCBuffer

 

 

We open the init, and we see the first lines. These are the imports, which the buffer uses, so it can be loaded by the gameserver.

 

import sys
from com.l2jfree.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfree.gameserver.datatables import SkillTable
from com.l2jfree			       import L2DatabaseFactory
from com.l2jfree.gameserver.model.quest import State
from com.l2jfree.gameserver.model.quest import QuestState
from com.l2jfree.gameserver.model.quest.jython import QuestJython as JQuest

 

 

We want to make them compatible with L2Emu. (or w/e pack you use)

Now, we open our pack, and we go in this path :

 

...\gameserver\data\scripts\custom

 

There we find these default quests (8003_Search,6050_KetraOrcSupport)

I chose them cause they have all the imports that we are gonna need.

Open their __init__.py , see at the top of the file the emu imports :

 

8003_Search

import sys

from com.l2emu.gameserver.model.quest   import State

from com.l2emu.gameserver.model.quest   import QuestState  

from com.l2emu.gameserver.datatables   import NpcTable

from com.l2emu.gameserver.templates.chars   import L2NpcTemplate

from com.l2emu.gameserver.model.actor.instance   import L2PcInstance

from com.l2emu.gameserver.datatables         import SpawnTable

from com.l2emu.gameserver.datatables   import ItemTable

from com.l2emu.gameserver.network.serverpackets   import RadarControl

from com.l2emu                   import L2DatabaseFactory

from com.l2emu.gameserver.model.quest.jython   import QuestJython as JQuest

 

from java.util                           import Iterator

from com.l2emu                                 import Config

 

 

6050_KetraOrcSupport

import sys

from com.l2emu.gameserver.model.quest import State

from com.l2emu.gameserver.model.quest import QuestState

from com.l2emu.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2emu.gameserver.datatables import SkillTable

from com.l2emu.gameserver.network.serverpackets import WareHouseWithdrawalList

from com.l2emu.gameserver.network.serverpackets import ActionFailed

 

I highlighted the needed imports.

 

 

Ok, now we go at our L2jfree buffer __init__.py, we open it , and then we replace the l2jfree imports, with our emu.

(in this case <> means replacing the 1st one with the 2nd one. :P)

 

 

import sys 
from com.l2jfree.gameserver.model.actor.instance import L2PcInstance <> from com.l2emu.gameserver.model.actor.instance      import L2PcInstance
from java.util import Iterator 
from com.l2jfree.gameserver.datatables import SkillTable <> from com.l2emu.gameserver.datatables import SkillTable 
from com.l2jfree import L2DatabaseFactory <> from com.l2emu import L2DatabaseFactory 
from com.l2jfree.gameserver.model.quest import State <> from com.l2emu.gameserver.model.quest import State 
from com.l2jfree.gameserver.model.quest import QuestState <> from com.l2emu.gameserver.model.quest import QuestState
from com.l2jfree.gameserver.model.quest.jython import QuestJython as JQuest <> from com.l2emu.gameserver.model.quest.jython import QuestJython as JQuest 

 

 

Our buffer imports should look now like this one :

 

 

import sys 
from com.l2emu.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator 
from com.l2emu.gameserver.datatables import SkillTable 
from com.l2emu import L2DatabaseFactory 
from com.l2emu.gameserver.model.quest import State 
from com.l2emu.gameserver.model.quest import QuestState
from com.l2emu.gameserver.model.quest.jython import QuestJython as JQuest

 

 

You are done! Now your buffer is compatible with the pack/project that you use.Simple , wasn't it? ;)

Hope I helped, cause it took me some time to write down these info.

 

p.s : Well, in some cases you can just replace the l2jfree with the l2emu word, but on the other hand, in some projects these imports are quite different. So, with this way you can be sure that you didn't make any mistakes.

p.s (2) : Something I noticed , some emu packs don't support this line, so if you wanna use a buffer in emu, you should remove it. Otherwise, you will be getting an error in your buffer.

 

st.getPlayer().restoreHPMP()

 

  • 10 months later...

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