Jump to content

Recommended Posts

Posted

Credits to FBIAgent from l2jserver.com and to me for some changes...

Go to java/net/sf/l2j/gameserver/datatables and make a new file called NpcBufferSkillIdsTable.java

add this code

 

package net.sf.l2j.gameserver.datatables;

 

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.util.Map;

 

import javolution.util.FastMap;

 

import net.sf.l2j.L2DatabaseFactory;

 

public class NpcBufferSkillIdsTable

{

private static NpcBufferSkillIdsTable _instance = null;

 

private Map<Integer, NpcBufferSkills> _buffers = new FastMap<Integer, NpcBufferSkills>();

 

private NpcBufferSkillIdsTable()

{

Connection con = null;

int skillCount = 0;

 

try

{

con = L2DatabaseFactory.getInstance().getConnection();

 

PreparedStatement statement = con.prepareStatement("SELECT npc_id`,`skill_id`,`skill_level`,`skill_fee_id`,`skill_fee_amount` FROM `npc_buffer_skill_ids` ORDER BY `npc_id` ASC");

ResultSet rset = statement.executeQuery();

 

int lastNpcId = 0;

NpcBufferSkills skills = null;

 

while (rset.next())

{

int npcId = rset.getInt("npc_id");

int skillId = rset.getInt("skill_id");

int skillLevel = rset.getInt("skill_level");

int skillFeeId = rset.getInt("skill_fee_id");

int skillFeeAmount = rset.getInt("skill_fee_amount");

 

if (npcId != lastNpcId)

{

if (lastNpcId != 0)

_buffers.put(lastNpcId, skills);

 

skills = new NpcBufferSkills(npcId);

skills.addSkill(skillId, skillLevel, skillFeeId, skillFeeAmount);

}

else

skills.addSkill(skillId, skillLevel, skillFeeId, skillFeeAmount);

 

lastNpcId = npcId;

skillCount++;

}

 

_buffers.put(lastNpcId, skills);

rset.close();

statement.close();

}

catch (Exception e)

{

System.out.println("NpcBufferSkillIdsTable: Error reading npc_buffer_skill_ids table: " + e);

}

finally

{

try{con.close();}catch(Exception e){}

}

 

System.out.println("NpcBufferSkillIdsTable: Loaded " + _buffers.size() + " buffers and " + skillCount + " skills.");

}

 

public static NpcBufferSkillIdsTable getInstance()

{

if (_instance == null)

_instance = new NpcBufferSkillIdsTable();

return _instance;

}

 

public int[] getSkillInfo(int npcId, int skillId)

{

NpcBufferSkills skills = _buffers.get(npcId);

 

if (skills == null)

return null;

 

return skills.getSkillInfo(skillId);

}

}

 

Go to java/net/sf/l2j/gameserver/datatables and make a new file called NpcBufferSkills.java

 

package net.sf.l2j.gameserver.datatables;

 

import java.util.Map;

 

import javolution.util.FastMap;

 

public class NpcBufferSkills

{

private int _npcId = 0;

private Map<Integer, Integer> _skillLevels = new FastMap<Integer, Integer>();

private Map<Integer, Integer> _skillFeeIds = new FastMap<Integer, Integer>();

private Map<Integer, Integer> _skillFeeAmounts = new FastMap<Integer, Integer>();

 

public NpcBufferSkills(int npcId)

{

_npcId = npcId;

}

 

public void addSkill(int skillId, int skillLevel, int skillFeeId, int skillFeeAmount)

{

_skillLevels.put(skillId, skillLevel);

_skillFeeIds.put(skillId, skillFeeId);

_skillFeeAmounts.put(skillId, skillFeeAmount);

}

 

public int[] getSkillInfo(int skillId)

{

Integer skillLevel = _skillLevels.get(skillId);

Integer skillFeeId = _skillFeeIds.get(skillId);

Integer skillFeeAmount = _skillFeeAmounts.get(skillId);

 

if (skillLevel == null || skillFeeId == null || skillFeeAmount == null)

return null;

 

return new int[] {skillLevel, skillFeeId, skillFeeAmount};

}

 

public int getNpcId()

{

return _npcId;

}

}

 

Go to java/net/sf/l2j/gameserver/model/actor/instance and make a new file called L2NpcBufferInstance.java

 

package net.sf.l2j.gameserver.model.actor.instance;

 

import java.util.Vector;

import java.util.concurrent.ScheduledFuture;

 

import net.sf.l2j.gameserver.ThreadPoolManager;

import net.sf.l2j.gameserver.cache.HtmCache;

import net.sf.l2j.gameserver.datatables.NpcBufferSkillIdsTable;

import net.sf.l2j.gameserver.datatables.SkillTable;

import net.sf.l2j.gameserver.model.L2Effect;

import net.sf.l2j.gameserver.model.L2ItemInstance;

import net.sf.l2j.gameserver.model.L2Skill;

import net.sf.l2j.gameserver.serverpackets.ActionFailed;

import net.sf.l2j.gameserver.serverpackets.MagicSkillUser;

import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;

import net.sf.l2j.gameserver.skills.Formulas;

import net.sf.l2j.gameserver.templates.L2NpcTemplate;

import net.sf.l2j.util.Rnd;

 

/**

* L2NpcBufferInstance

*

* @author FBIagent

*/

public class L2NpcBufferInstance extends L2NpcInstance

{

private class BuffTask implements Runnable

{

private Boolean _buffing = false;

private L2NpcBufferInstance _me = null;

private Vector<L2PcInstance> _playerInstances = new Vector<L2PcInstance>();

private Vector<Integer> _skillIds = new Vector<Integer>();

private Vector<Integer> _skillLevels = new Vector<Integer>();

private ScheduledFuture _task = null;

 

public BuffTask(L2NpcBufferInstance me)

{

_me = me;

_task = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(this, 100, 100);

}

 

public void addBuff(L2PcInstance playerInstance, int skillId, int skillLevel)

{

synchronized (_playerInstances)

{

/* int count = 0;

 

for (L2PcInstance playerInstance2 : _playerInstances)

{

if (playerInstance2 == playerInstance)

count++;

}

 

if (count > 4)

{

playerInstance.sendMessage("The buffer can't imagine more than 5 buffs per player.");

return;

}*/

 

_playerInstances.add(playerInstance);

_skillIds.add(skillId);

_skillLevels.add(skillLevel);

}

}

 

public void run()

{

boolean abort = false;

 

synchronized (_buffing)

{

abort = _buffing;

_buffing = true;

}

 

if (abort)

return;

 

try

{

Thread.sleep(1);

}

catch (InterruptedException ie)

{}

 

int index = -1;

L2PcInstance playerInstance = null;

int skillId = 0;

int skillLevel = 0;

 

synchronized (_playerInstances)

{

index = _skillIds.size() - 1;

 

if (index != -1)

{

index = Rnd.get(_skillIds.size());

playerInstance = _playerInstances.get(index);

skillId = _skillIds.get(index);

skillLevel = _skillLevels.get(index);

}

}

 

if (index == -1)

return;

 

L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);

 

if (playerInstance != null && skill != null)

{

//if (_me.isInsideRadius(playerInstance.getX(), playerInstance.getY(), skill.getCastRange(), true))

//continue;

 

int skillTime = Formulas.getInstance().calcMAtkSpd(_me, skill, skill.getHitTime());

 

if (skill.isDance())

_me.broadcastPacket(new MagicSkillUser(_me, _me, skillId, skillLevel, skillTime, 0));

else

_me.broadcastPacket(new MagicSkillUser(_me, playerInstance, skillId, skillLevel, skillTime, 0));

 

long continueTime = System.currentTimeMillis() + skillTime;

 

while (continueTime >= System.currentTimeMillis())

{

try

{

Thread.sleep(1);

}

catch (InterruptedException ie)

{}

}

 

L2Effect[] effects = playerInstance.getAllEffects();

 

if (effects != null)

{

for (L2Effect e : effects)

{

if (e != null && skill != null)

{

if (e.getSkill().getId() == skill.getId())

e.exit();

}

}

}

 

skill.getEffects(playerInstance, playerInstance);

}

else

System.out.println("NpcBuffer warning(" + getNpcId() + " at " + getX() + ", " + getY() + ", " + getZ() + "): Skill or Player null!");

 

synchronized (_playerInstances)

{

_playerInstances.remove(index);

_skillIds.remove(index);

_skillLevels.remove(index);

}

 

synchronized (_buffing)

{

_buffing = false;

}

}

 

protected void stopTask()

{

if (_task != null)

{

_task.cancel(true);

_task = null;

}

}

}

 

private BuffTask _buffTaskInstance = null;

 

public L2NpcBufferInstance(int objectId, L2NpcTemplate template)

{

super(objectId, template);

_buffTaskInstance = new BuffTask(this);

}

 

@Override

public void showChatWindow(L2PcInstance playerInstance, int val)

{

if (playerInstance == null)

return;

 

String htmFile = "data/html/mods/NpcBuffer.htm";

String htmContent = HtmCache.getInstance().getHtm(htmFile);

 

if (htmContent != null)

    {

    NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());

 

npcHtmlMessage.setHtml(htmContent);

    npcHtmlMessage.replace("%objectId%", String.valueOf(getObjectId()));

    playerInstance.sendPacket(npcHtmlMessage);

    }

 

playerInstance.sendPacket(new ActionFailed());

}

 

@Override

public void deleteMe()

{

_buffTaskInstance.stopTask();

_buffTaskInstance = null;

super.deleteMe();

}

 

@Override

    public void onBypassFeedback(L2PcInstance playerInstance, String command)

    {

    if (playerInstance == null)

    return;

 

    int npcId = getNpcId();

 

    if (command.startsWith("npc_buffer_buff"))

        {

    String[] params = command.split(" ");

      int skillId = Integer.parseInt(params[1]);

      int[] skillInfos = NpcBufferSkillIdsTable.getInstance().getSkillInfo(npcId, skillId);

     

      if (skillInfos == null)

      {

      System.out.println("NpcBuffer warning(" + npcId + " at " + getX() + ", " + getY() + ", " + getZ() + "): Player " + playerInstance.getName() + " tried to use skill(" + skillId + ") not assigned to npc buffer!");

      return;

      }

 

    int skillLevel = skillInfos[0];

    int skillFeeId = skillInfos[1];

    int skillFeeAmount = skillInfos[2];

 

    if (skillFeeId != 0) // take some item?

    {

    if (skillFeeAmount == 0)

    {

    System.out.println("NpcBuffer warning(" + npcId + " at " + getX() + ", " + getY() + ", " + getZ() + "): Fee amount of skill(" + skillId + ") fee id(" + skillFeeId + ") is 0!");

    return;

    }

           

    L2ItemInstance itemInstance = playerInstance.getInventory().getItemByItemId(skillFeeId);

 

    if (itemInstance == null || (!itemInstance.isStackable() && playerInstance.getInventory().getInventoryItemCount(skillFeeId, -1) < skillFeeAmount))

    {

    playerInstance.sendMessage("You do not have enought items!");

    return;

    }

 

    if (itemInstance.isStackable())

    {

    if (!playerInstance.destroyItemByItemId("Npc Buffer", skillFeeId, skillFeeAmount, playerInstance.getTarget(), true))

    {

    playerInstance.sendMessage("You do not have enought items!");

    return;

    }

    }

    else

    {

    for (int i=0;i<skillFeeAmount;i++)

    playerInstance.destroyItemByItemId("Npc Buffer", skillFeeId, 1, playerInstance.getTarget(), true);

    }

    }

L2Skill skill;

skill = SkillTable.getInstance().getInfo(skillId, skillLevel);

skill.getEffects(playerInstance, playerInstance);

        }

 

    showChatWindow(playerInstance, 0);

    }

}

 

 

Go to java/net/sf/l2j/gameserver and open file GameServer.java

 

Add the fallowing lines:

 

import net.sf.l2j.gameserver.datatables.NobleSkillTable;

+import net.sf.l2j.gameserver.datatables.NpcBufferSkillIdsTable;

import net.sf.l2j.gameserver.datatables.NpcTable;

 

HeroSkillTable.getInstance();

+ NpcBufferSkillIdsTable.getInstance();

 

        //Call to load caches

 

Run the SQL files into your database, add the NpcBuffer.Htm file into data\html\mods and voila...You got a java buffer with no posible bugs.

 

I personally prefer core buffer much more than python buffers. Python buffer can stuck if something goes wrong with a player doing a quest and you need a restart...with core buffer it wont happen ever :D

 

 

http://rapidshare.com/files/147162181/Core_Buffer.rar.html

 

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

nothing. core buffer uses java scripts more than a buffer with jscript

 

Made it because my python scripts used to lock up...Nothing python-based worked. So I decided to make a core buffer because this one can't lock up in any way...

Posted

This buffer is totally bugged.If 2 players get buffs from the same buffer,the buffer gets confused and changes html's between players.

Posted

This buffer is totally bugged.If 2 players get buffs from the same buffer,the buffer gets confused and changes html's between players.

 

OMG! Yes this is true.... ;D

 

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

    • Hello guys, I’m Morientes, owner of the servers you might know: L2Lionna / L2Pandora / L2Ramona / L2ERA / L2Zaken / L2Classic / L2Peri / L2Alice / L2EVA / L2Dragon and more. Over the years I’ve been developing Lineage II projects starting from High Five, then Classic, and later Essence. I started with High Five, which I turned into a very well-tested server with over 100 openings. My peak was around 2800 players online, and the server was stable (no crashes). With every opening there was always something to improve, fix, or optimize, and over time it became more and more stable. I still have all SVN commits from all those years, I can show everything via screen share if needed. The reason I’m selling is not because of the quality. The files are solid and ready to run any type of server (any rates). The problem was on our side;  we didn’t have a good long-term strategy for reopening servers as a team. About Classic: I started from 2.0 (Zaken version) and gradually upgraded it up to 4.7 Kamael. Each chronicle upgrade came with a lot of improvements, especially in terms of stability. About Essence: I started from the very first version and developed it up to High Elf (Protocol 464). Starting from Protocol 286 (Secrets of Empire), I worked with PTS files and extracted a lot of deep fixes. I unpacked AI.obj with full functionality, used official sniffers, and whenever something wasn’t clear, I checked directly on official servers and sniffed packets or data. For every chronicle update, I basically sniffed the entire official server, zones, monsters, events, mechanics, everything. From Chronicle 388, Reborn approached us to buy our files. The current L2Reborn Essence is based on my work! I can prove everything. I also have their updates integrated into my pack. I stopped development after High Elf mainly because my main developer was constantly looking for other opportunities. It became difficult to maintain a stable team, especially with everything going on (including the situation in Ukraine at that time). Eventually, I couldn’t find a reliable dev to continue working on Essence, so I decided to step away from this market last year. Now I’ve decided to sell everything. What I’m selling: All necessary tools (sniffing, geodata build, pack upgrade tools, game client parsers, L2Wiki parser, interfaces etc.) Full SVN repositories with all commits (Essence / Classic / High Five) All edited clients I still have All my data I can also include on sell an official character that is active daily, ranked, end up gear, and has access to end-game zones!!! useful for deep sniffing where normal players don’t have access. If someone wants to buy everything, I prefer a full deal and I will transfer full ownership. If needed, I can also sell parts separately, but honestly I’d prefer to sell everything to one team that can continue this project — this has been my work, my hobby, my baby. Important: I don’t offer further updates. The files are sold exactly as they are. I will, of course, explain everything you need to know to continue working on them. Contact: Telegram: @AlexAlexey Discord: .primsl2
    • Grand Opening: April 11, 2026 Website: https://l2strive.com Discord: https://discord.gg/SsUARZpbkG   🛡️ Server Rates Strive is a High Five Mid-PvP/Craft Server  Experience (XP): x15 Skill Points (SP): x15 Adena: x10 Drop: x15 Spoil: x3 Safe Enchant: +3 Max Enchant: +16 ⚔️ Enhanced Boss Jewelry     ⚔️ Making Bosses Useful Again Let’s be real: usually, Core, Orfen, and Baylor are just placeholder bosses that nobody cares about. We’ve overhauled their jewelry to make them legit end-game gear. We’ve turned these into high-value targets for PvP—if you want these massive percentage boosts, you’re going to have to fight for them.   ⚔️ Enhanced Boss Jewelry   💍 Improved Ring of Core Base Stats: M.Def 48 | HP +445 | MP +21 Offensive: P. Atk +12% | M. Atk +12% Critical: Physical Critical Rate +14 | Magic Critical Rate +2 Utility: Skill Reuse Delay -10% | MP Consumption -5% 🛡️ Improved Earring of Orfen Base Stats: M.Def 71 | MP +31 Defensive: P. Def +15% | M. Def +15% Recovery: Vampiric Rage +4% | Healing Received +6% Resistances: Bleed / Poison / Root / Sleep +20% (Chance & Resistance) 💎 Baylor's Earring Base Stats: M.Def 71 | MP +31 Speed: Atk. Spd +5% | Casting Spd +5% Combat: MP Regeneration +5% Resistances: Stun / Paralyze +30% (Chance & Resistance) 🚀 Core Features Full & Enchanted Buffs: Enjoy 6-hour durations on all standard and enchanted buffs. Premium Buffs: Premium users benefit from extended 9-hour buff durations. 100% Free AutoFarm: Built-in system for seamless progression while away from your PC. Custom Shop: Professional and intuitive UI for all essential equipment and consumables. NPC Buffer: Full scheme support to get you battle-ready instantly. Stability: Dedicated high-performance hardware with professional Anti-DDoS protection.  
    • Hello,   im looking for c4 client developer that can fix some issues, missing icons etc. if you are l2off developer then even better.   its easy ones, fix few skill icons, item icon, easy money if someone has time. I guess its lack of files in my patch, but might be smth other   contact with me on discord: endART_#6190 @DumanisT @SkyLord @XManton @Fr3DBr @mjst @Sighed any ideas who could help me XD
  • 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..