Jump to content
  • 0

How To Add ; In Html For The Buffer.


Question

Posted (edited)

Hello guys .

 

 

 

I want to do this in in my Buffer npc who know how?

 

 

 

Default :

 

<a action="bypass -h npc_%objectId%_getbuff 1204 130">

 

 

To work like This :

 

<a action="bypass -h npc_%objectId%_getbuff 1204 130;1003 130;1004 130">

if (actualCommand.equalsIgnoreCase("getbuff"))
    	{
    		if (buffid != 0 && !player.isDead())
    		{
    			SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
    			broadcastPacket(new MagicSkillUse(this, player, buffid, bufflevel, 500, 0));
    			showChatWindow(player);
    		}
    	}

I try some methods but i failed ... :|

 

Project aCis.

Edited by Styx

5 answers to this question

Recommended Posts

  • 0
Posted

I think it should be something like that:

    @Override
    public void onBypassFeedback(L2PcInstance player, String command)
    {
    	StringTokenizer st = new StringTokenizer(command, " ");
    	String actualCommand = st.nextToken();
    	
    	if (actualCommand.equalsIgnoreCase("getbuff"))
    	{
		String[] buffsArray = command.substring(actualCommand.length).trim().split(";");
		for(String buffString : buffsArray)
		{
			String[] idLevelString = buffString.split(" ");
			int buffid = Integer.parseInt(idLevelString[0]);
			int bufflevel = idLevelString.length > 1 ? Integer.parseInt(idLevelString[1]) : 1;
			
			if (buffid != 0 && !player.isDead())
			{
				SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
				broadcastPacket(new MagicSkillUse(this, player, buffid, bufflevel, 500, 0));
			}
		}
			
		showChatWindow(player);
    	}
    	else if (actualCommand.equalsIgnoreCase("restore"))
    	{
    		if (!player.isDead())
    		{
    			player.setCurrentHp(player.getMaxHp());
    			broadcastPacket(new MagicSkillUse(this, player, 1258, 4, 500, 0));
        		showChatWindow(player);
    		}
    	}
    	else if (actualCommand.equalsIgnoreCase("cancel"))
    	{
    		if (!player.isDead())
    		{
    			player.stopAllEffects();
    			broadcastPacket(new MagicSkillUse(this, player, 1056, 12, 500, 0));
        		showChatWindow(player);
    		}
    	}
    	else
    		super.onBypassFeedback(player, command);
    }
  • 0
Posted

Hi

 

Could you show me whats before the code you have pasted? I would like to see how buffid and bufflevel is taken from String, so i can find out best changes in code without guessing :)

  • 0
Posted (edited)

Hi

 

Could you show me whats before the code you have pasted? I would like to see how buffid and bufflevel is taken from String, so i can find out best changes in code without guessing :)

 

Thanks for help.

 /*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package net.sf.l2j.gameserver.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;


public final class L2BufferInstance extends L2NpcInstance
{
    public L2BufferInstance(int objectId, L2NpcTemplate template)
    {
        super(objectId, template);
    }
    
    @Override
	public void onAction(L2PcInstance player)
	{
		// Set the target of the L2PcInstance player
		if (player.getTarget() != this)
			player.setTarget(this);
		else
		{
			// Check if the player is attackable (without a forced attack) and isn't dead
			if (isAutoAttackable(player) && !isAlikeDead())
			{
				// Check the height difference, this max heigth difference might need some tweaking
				if (Math.abs(player.getZ() - getZ()) < 400)
				{
					// Set the L2PcInstance Intention to ATTACK
					player.getAI().setIntention(CtrlIntention.ATTACK, this);
				}
				else
				{
					// Send ActionFailed (target is out of attack range) to the L2PcInstance player
					player.sendPacket(ActionFailed.STATIC_PACKET);
				}
			}
			else if (!isAutoAttackable(player))
			{
				// Calculate the distance between the L2PcInstance and the L2NpcInstance
				if (!canInteract(player))
				{
					// Notify the L2PcInstance AI with INTERACT
					player.getAI().setIntention(CtrlIntention.INTERACT, this);
				}
				else
				{
					// Rotate the player to face the instance
					player.sendPacket(new MoveToPawn(player, this, L2Npc.INTERACTION_DISTANCE));
					
					// Send ActionFailed to the player in order to avoid he stucks
					player.sendPacket(ActionFailed.STATIC_PACKET);
					
					// Send the freaking chat window
					showChatWindow(player);
				}
			}
			// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
			player.sendPacket(ActionFailed.STATIC_PACKET);
		}
	}
    
    @Override
    public void onBypassFeedback(L2PcInstance player, String command)
    {
    	StringTokenizer st = new StringTokenizer(command, " ");
    	String actualCommand = st.nextToken();
    	
    	int buffid = 0, bufflevel = 1;
    	if (st.countTokens() == 2)
    	{
    		buffid = Integer.valueOf(st.nextToken());
    		bufflevel = Integer.valueOf(st.nextToken());
    	}
    	else if (st.countTokens() == 1)
    		buffid = Integer.valueOf(st.nextToken());
    	
    	if (actualCommand.equalsIgnoreCase("getbuff"))
    	{
    		if (buffid != 0 && !player.isDead())
    		{
    			SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
    			broadcastPacket(new MagicSkillUse(this, player, buffid, bufflevel, 500, 0));
    			showChatWindow(player);
    		}
    	}
    	else if (actualCommand.equalsIgnoreCase("restore"))
    	{
    		if (!player.isDead())
    		{
    			player.setCurrentHp(player.getMaxHp());
    			broadcastPacket(new MagicSkillUse(this, player, 1258, 4, 500, 0));
        		showChatWindow(player);
    		}
    	}
    	else if (actualCommand.equalsIgnoreCase("cancel"))
    	{
    		if (!player.isDead())
    		{
    			player.stopAllEffects();
    			broadcastPacket(new MagicSkillUse(this, player, 1056, 12, 500, 0));
        		showChatWindow(player);
    		}
    	}
    	else
    		super.onBypassFeedback(player, command);
    }
    
    @Override
    public void showChatWindow(L2PcInstance player)
    {
    	// Send a Server->Client NpcHtmlMessage containing the text of the L2Npc to the L2PcInstance
    	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
		html.setFile("data/html/gold/buffer.htm");
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
		
		// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
		player.sendPacket(ActionFailed.STATIC_PACKET);
    }
}
Edited by Styx
  • 0
Posted

 

I think it should be something like that:

    @Override
    public void onBypassFeedback(L2PcInstance player, String command)
    {
    	StringTokenizer st = new StringTokenizer(command, " ");
    	String actualCommand = st.nextToken();
    	
    	if (actualCommand.equalsIgnoreCase("getbuff"))
    	{
		String[] buffsArray = command.substring(actualCommand.length).trim().split(";");
		for(String buffString : buffsArray)
		{
			String[] idLevelString = buffString.split(" ");
			int buffid = Integer.parseInt(idLevelString[0]);
			int bufflevel = idLevelString.length > 1 ? Integer.parseInt(idLevelString[1]) : 1;
			
			if (buffid != 0 && !player.isDead())
			{
				SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
				broadcastPacket(new MagicSkillUse(this, player, buffid, bufflevel, 500, 0));
			}
		}
			
		showChatWindow(player);
    	}
    	else if (actualCommand.equalsIgnoreCase("restore"))
    	{
    		if (!player.isDead())
    		{
    			player.setCurrentHp(player.getMaxHp());
    			broadcastPacket(new MagicSkillUse(this, player, 1258, 4, 500, 0));
        		showChatWindow(player);
    		}
    	}
    	else if (actualCommand.equalsIgnoreCase("cancel"))
    	{
    		if (!player.isDead())
    		{
    			player.stopAllEffects();
    			broadcastPacket(new MagicSkillUse(this, player, 1056, 12, 500, 0));
        		showChatWindow(player);
    		}
    	}
    	else
    		super.onBypassFeedback(player, command);
    }

 

I will check it now thanks for your time..

Guest
This topic is now closed to further replies.


  • Posts

    • Dear clients, we strongly advise against holding funds in USDT due to an increase in mass freezes by the issuer. Any wallet can be locked without explanation if your coins happen to be in the wrong place at the wrong time. If you hold savings in USDT, swap them for something safer, such as XMR, BTC, ETH, or similar. When working with crypto, opt for decentralized coins that are technically impossible to freeze. Alternatively, after handling USDT, move your funds into safe assets. To protect your funds, we recommend using XMR, BTC, ETH.
    • Hello everyone, I am looking for a C4 Scions of Destiny (P656) Retail x1 L2OFF Server Pack + Source. My goal is not to launch a server immediately. I want to learn L2OFF server development in C++, understand the original C4 architecture, and eventually build my own project in the future. I have already tried to reach an agreement with a few members who offer C4 projects, but communication has been quite slow, so I decided to ask the community here as well. I'm specifically looking for a Retail x1 version, not a heavily customized x45 or PvP pack. Ideally, the package should include: Complete LoginServer Complete GameServer Source code SQL database AI / NPC scripts Geodata Visual Studio solution/project Everything required to compile, study, and run the server If anyone knows a trusted seller or can recommend a reliable P656 Retail x1 package, I would really appreciate your advice. I would also appreciate hearing from anyone who has purchased a Retail x1 package before and can share their experience. Thank you very much!
    • NEW SEASON OPENING - TODAY ! GRAND OPENING FROM - 10/07/2026, FRIDAY, 20:00 +3 GMT !
    • Elite Lineage II Development | Websites • Master Accounts • Custom Systems • Server Solutions Turn Your Lineage II Project Into a Professional Experience Hello everyone, My name is Frank, and for years I've been developing custom solutions for Lineage II private servers. My focus isn't simply creating attractive websites—it's building complete ecosystems that improve both the player experience and server management. Unlike generic web designers, I understand how Lineage II servers actually work. Every page and system is designed with real gameplay, server administration, and player retention in mind. Whether you're launching your first project or upgrading an established server, I can help you create something that looks and feels like a premium MMORPG. What I Can Build Modern Landing Pages Your landing page is the first impression players have of your server. I create high-end landing pages featuring: • Cinematic hero sections • Animated backgrounds • Countdown timers • Feature showcases • Grand Opening events • Server roadmap • Responsive mobile design • Fast loading and SEO-friendly structure No generic templates. Every landing page is built specifically for your project. Complete Master Account Systems One of my specialties is developing advanced account management panels that integrate naturally with your Lineage II server. Examples include: • Account Dashboard • Character Selection • Character Information • Character Statistics • Combat Power System • Achievement System • Character Mastery • Collections • Daily Rewards • Vote Rewards • Referral Systems • Lucky Wheel • Premium Account Management • Donation Store • Coin Wallet • VIP Services • PIN Protection • Password Management • Inventory Viewer • Warehouse Viewer • Rankings • Online Players • Server Statistics • Event Pages Everything is designed with both usability and visual quality in mind. Custom Web Systems Need something unique? I also develop completely custom features tailored to your server. Examples: • World Boss Event Pages • Raid Boss Tracker • Olympiad Rankings • Castle Siege Overview • Grand Boss Status • Event Management Panels • Daily Hunt Interfaces • Progression Systems • Collection Systems • Custom Shops • Clan Pages • Marketplace • Admin Panels If you have an idea, we can build it. Full Website Development I can create your complete server website, including: • Home • Downloads • News • Patch Notes • Server Information • Wiki • Rankings • Community Pages • Support Center • Knowledge Base • FAQ • Voting Pages • Donation Pages Designed to match your server's identity. Forum Integration Professional integration with community platforms. Examples: • XenForo • phpBB • Discord Integration • Custom Forum Themes • User Synchronization Server Experience Because I actively work with Lineage II servers, I understand much more than web development. Experience includes designing and implementing systems around: • Character progression • Achievement tracking • Collection systems • Daily Hunt mechanics • Lucky Wheel events • Premium services • Server economy • Custom reward systems • World Boss events • Event scheduling • Player dashboards • Administrative tools This allows me to design websites and panels that feel like a natural extension of your server instead of just another website. Technologies • PHP 8 • MySQL / MariaDB • HTML5 • CSS3 • JavaScript • AJAX • Responsive Design • API Integration • Linux Server Environment Why Choose Me? ✔ Years of Lineage II development experience ✔ I understand both the website and the game server ✔ Custom development—not copy-paste templates ✔ Modern UI & UX ✔ Mobile responsive ✔ Clean and optimized code ✔ Long-term support ✔ Fast communication ✔ Flexible solutions for every budget Portfolio Below you'll find examples of projects I've created, including custom landing pages, master account systems, dashboards, progression systems, and unique interfaces developed for real Lineage II servers.     Need Something Unique? Some of the most successful servers stand out because they offer features players haven't seen before. If you have an idea—even if it's only a rough concept—I can help transform it into a polished, fully functional system.     Contact Interested in working together? Feel free to send me a private message with your project details. I'll be happy to discuss your ideas and provide a free estimate. Let's build something your players will remember.     Discord:  https://discord.gg/qnmNkY6D3n
  • 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..