Jump to content
  • 0

Java Buffer


vladislav4k

Question

Recommended Posts

  • 0

Instance:

/*
* 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.L2Summon;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;

/**
* @author Ventic
*
*/
public class L2BuffInstance extends L2Npc
{	
public L2BuffInstance(int objectId, L2NpcTemplate template)
{
	super(objectId, template);
}

@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
	if (command.equals("buff"))
	{
		String val = command.substring(5);
		StringTokenizer st = new StringTokenizer(val);

		if (st.countTokens() != 3)
		{
			System.out.println("At least 3 tokens needed.");
			return;
		}

		int skillId = Integer.parseInt(st.nextToken());
		int skillLevel = Integer.parseInt(st.nextToken());

		L2Skill s = SkillTable.getInstance().getInfo(skillId, skillLevel);
		if (s == null)
		{
			System.out.println(" Wrong skill id "+skillId+".");
			return;
		}
		s.getEffects(player, player);
	}
	else if (command.equals("buffPet"))
	{
		String val = command.substring(8);
		StringTokenizer st = new StringTokenizer(val);
		int skillid = Integer.parseInt(st.nextToken());
		int level = Integer.parseInt(st.nextToken());

		if (st.countTokens() != 3)
		{
			System.out.println("At least 3 tokens needed.");
			return;
		}

		L2Skill s = SkillTable.getInstance().getInfo(skillid, level);
		if (s == null)
		{
			System.out.println(" Wrong skill id "+skillid+".");
			return;
		}
		s.getEffects(player.getPet(), player.getPet());
	}
	else
	{
		super.onBypassFeedback(player, command);
	}
}

@Override
public String getHtmlPath(int npcId, int val)
{
	String pom = "";
	if (val == 0)
		pom = "" + npcId;
	else
		pom = npcId + "-" + val;

	return "data/html/mods/buffer/" + pom + ".htm";
}	
}

 

Html:

<html>
<body>
Hi there,<br>

Please choose the buff that you want to get effected with it:<br>
<a action="bypass -h npc_%objectId%_buff 1085 3">Acumen</a></br>
<a action="bypass -h npc_%objectId%_buff 1085 3">Acumen</a></br>
<a action="bypass -h npc_%objectId%_buff 1085 3">Acumen</a></br>
<a action="bypass -h npc_%objectId%_buffPet 1085 3">Acumen</a></br>
</html>
</body>

 

Hope it works

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • The download link is down.   I know a guy who can sell it super cheap (files+source) Discord: darktechx or DarkTech#0041    
    • Back in the days we had l2robot. It was specially designed to spam F1-F12 only over the l2 game window, so you could minimize the game and still keep the so called bot running.  After the new anti - boting services came up i  couldn't inject it to the l2.exe process anymore. You never know... give it a try:   Screenshot:     Download Link (tested and working, without password on the rar): https://www.4shared.com/s/f4WXcQIwGge YouTuBe Video with instructions how to use it: https://www.youtube.com/watch?v=ypVN3pucmvM Good luck!  
    • of course , add me on discord banshee1019
    • Thanks for the feedback @Tryskell , really appreciate it.  Well to be honest, i want to learn Developing not just for fun. I mean, i like that the thing that has to do with games, and coding. For me everything that has to do with coding and lineage, setting up all the things you have to, is like a game, but with serious purpose.   A lot of information is running in the internet i agree with you, but as you mention from where i should start and what to look up, cost you 5 minutes of your time helping me out, otherwise i would spend 1 week or maybe more, to search random information.   About the time and dedication - I agree also. Why i love this, is because like a mentioned earlier, is a game the coding part, but with serious purpose. And by the way, about bad and lame Developers, those are the people that doing this without a serious purpose, and zero understanding, just low knowledged ass dumps want to learn money on a 1/2 months server, but that's not about me 😃    So about practicing, what you would suggest to me ? Any random L2J files, and just practice on them on the first steps?
    • Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)Explore 99G's digital store (mysellix.io)
  • Topics

×
×
  • Create New...