Jump to content
  • 0

Making Buffer That Wont Buff or Heal in PVP/Karma


Question

15 answers to this question

Recommended Posts

  • 0
Posted

then you should add a check to

 

L2NpcBufferInstance.java

sorry i am not sure what you mean, do i have to make a Script of my own then ? because if so i am screwed lol

  • 0
Posted

If you use buffer from htmls:

data/html/mods/NpcBuffer.htm

Then in com.l2jserver.gameserver.model.actor.instance.L2NpcBufferInstance

class after those lines:

	@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
	// BypassValidation Exploit plug.
	if (player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != this.getObjectId())
		return;

put this code:

		if (player.isInCombat) {
		player.sendMessage("You can't use buffer while you are in combat mode!");
		return;
	}
	if (player.getPvpFlag() != 0) {
		player.sendMessage("You can't use buffer while you have PvP Flag!");
		return;
	}
	if (player.getKarma() > 0) {
		player.sendMessage("You can't use buffer while you have karma!");
		return;
	}

  • 0
Posted

sorry i am not sure what you mean, do i have to make a Script of my own then ? because if so i am screwed lol

If you use buffer from htmls:

data/html/mods/NpcBuffer.htm

Then in com.l2jserver.gameserver.model.actor.instance.L2NpcBufferInstance

class after those lines:

	@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
	// BypassValidation Exploit plug.
	if (player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != this.getObjectId())
		return;

put this code:

		if (player.isInCombat) {
		player.sendMessage("You can't use buffer while you are in combat mode!");
		return;
	}
	if (player.getPvpFlag() != 0) {
		player.sendMessage("You can't use buffer while you have PvP Flag!");
		return;
	}
	if (player.getKarma() > 0) {
		player.sendMessage("You can't use buffer while you have karma!");
		return;
	}

thats what i was talking about ;)
  • 0
Posted

I am using L2J High Five, I didnt compile it, Its Server 5550 and DataPack 9049 i looked for com.l2jserver.gameserver.model.actor.instance.L2NpcBufferInstance but could not find any thing that looked like that, do you have to compile it first in order do do that

  • 0
Posted

ok so i found this com.l2jserver.gameserver.model.actor.instance.L2NpcBufferInstance

http://trac.l2jserver.com/browser/trunk/L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2NpcBufferInstance.java#

 

 

/*

* 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 com.l2jserver.gameserver.model.actor.instance;

 

import gnu.trove.map.hash.TIntIntHashMap;

 

import java.util.logging.Logger;

 

import com.l2jserver.gameserver.cache.HtmCache;

import com.l2jserver.gameserver.datatables.NpcBufferTable;

import com.l2jserver.gameserver.datatables.SkillTable;

import com.l2jserver.gameserver.model.actor.L2Character;

import com.l2jserver.gameserver.model.actor.L2Npc;

import com.l2jserver.gameserver.model.actor.L2Summon;

import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;

import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;

import com.l2jserver.gameserver.model.skills.L2Skill;

import com.l2jserver.gameserver.network.SystemMessageId;

import com.l2jserver.gameserver.network.serverpackets.ActionFailed;

import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;

import com.l2jserver.gameserver.network.serverpackets.SystemMessage;

import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager;

 

/**

* The Class L2NpcBufferInstance.

*/

public class L2NpcBufferInstance extends L2Npc

{

static final Logger _log = Logger.getLogger(L2NpcBufferInstance.class.getName());

 

private static TIntIntHashMap pageVal = new TIntIntHashMap();

 

/**

* Instantiates a new l2 npc buffer instance.

*

* @param objectId the object id

* @param template the template

*/

public L2NpcBufferInstance(int objectId, L2NpcTemplate template)

{

super(objectId, template);

setInstanceType(InstanceType.L2NpcBufferInstance);

}

 

@Override

public void showChatWindow(L2PcInstance playerInstance, int val)

{

if (playerInstance == null)

return;

                if (player.isInCombat) {

                        player.sendMessage("You can't use buffer while you are in combat mode!");

                        return;

                }

if (player.getPvpFlag() != 0) {

                        player.sendMessage("You can't use buffer while you have PvP Flag!");

                        return;

                }

                if (player.getKarma() > 0) {

                        player.sendMessage("You can't use buffer while you have karma!");

                        return;

                }

String htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), "data/html/mods/NpcBuffer.htm");

 

if (val > 0)

htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), "data/html/mods/NpcBuffer-" + val + ".htm");

 

if (htmContent != null)

{

NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());

 

npcHtmlMessage.setHtml(htmContent);

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

playerInstance.sendPacket(npcHtmlMessage);

}

 

playerInstance.sendPacket(ActionFailed.STATIC_PACKET);

}

 

@Override

public void onBypassFeedback(L2PcInstance player, String command)

{

// BypassValidation Exploit plug.

if (player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != this.getObjectId())

return;

 

L2Character target = player;

 

if (command.startsWith("Pet"))

{

L2Summon pet = player.getPet();

if (pet == null)

{

player.sendMessage("You do not have your pet summoned.");

showChatWindow(player, 0); // 0 = main window

return;

}

target = pet;

}

 

int npcId = getNpcId();

 

if (command.startsWith("Chat"))

{

int val = Integer.parseInt(command.substring(5));

 

pageVal.put(player.getObjectId(), val);

 

showChatWindow(player, val);

}

else if (command.startsWith("Buff") || command.startsWith("PetBuff"))

{

String[] buffGroupArray = command.substring(command.indexOf("Buff") + 5).split(" ");

 

for (String buffGroupList : buffGroupArray)

{

if (buffGroupList == null)

{

_log.warning("NPC Buffer Warning: npcId = " + npcId + " has no buffGroup set in the bypass for the buff selected.");

return;

}

 

int buffGroup = Integer.parseInt(buffGroupList);

 

int[] npcBuffGroupInfo = NpcBufferTable.getInstance().getSkillInfo(npcId, buffGroup);

 

if (npcBuffGroupInfo == null)

{

_log.warning("NPC Buffer Warning: npcId = " + npcId + " Location: " + getX() + ", " + getY() + ", " + getZ() + " Player: " + player.getName() + " has tried to use skill group (" + buffGroup + ") not assigned to the NPC Buffer!");

return;

}

 

int skillId = npcBuffGroupInfo[0];

int skillLevel = npcBuffGroupInfo[1];

int skillFeeId = npcBuffGroupInfo[2];

int skillFeeAmount = npcBuffGroupInfo[3];

 

if (skillFeeId != 0)

{

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

 

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

{

SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_NOT_ENOUGH_NECESSARY_ITEMS_TO_USE_THE_SKILL);

player.sendPacket(sm);

continue;

}

 

if (itemInstance.isStackable())

{

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

{

SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_NOT_ENOUGH_NECESSARY_ITEMS_TO_USE_THE_SKILL);

player.sendPacket(sm);

continue;

}

}

else

{

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

{

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

}

}

}

 

L2Skill skill;

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

 

if (skill != null)

skill.getEffects(player, target);

}

 

showChatWindow(player, pageVal.get(player.getObjectId()));

}

else if (command.startsWith("Heal") || command.startsWith("PetHeal"))

{

if (!target.isInCombat() && !AttackStanceTaskManager.getInstance().getAttackStanceTask(target))

{

String[] healArray = command.substring(command.indexOf("Heal") + 5).split(" ");

 

for (String healType : healArray)

{

if (healType.equalsIgnoreCase("HP"))

{

target.setCurrentHp(target.getMaxHp());

}

else if (healType.equalsIgnoreCase("MP"))

{

target.setCurrentMp(target.getMaxMp());

}

else if (healType.equalsIgnoreCase("CP"))

{

target.setCurrentCp(target.getMaxCp());

}

}

}

showChatWindow(player, pageVal.get(player.getObjectId()));

}

else if (command.startsWith("RemoveBuffs") || command.startsWith("PetRemoveBuffs"))

{

target.stopAllEffectsExceptThoseThatLastThroughDeath();

showChatWindow(player, pageVal.get(player.getObjectId()));

}

else

{

super.onBypassFeedback(player, command);

}

}

}

 

 

i put it in C:\server\game\data\scripts\custom\L2NpcBufferInstance.java

then i add it to my scripts.config

 

# Custom

custom/L2NpcBufferInstance.java

 

i get this in gave server console:

1. ERROR in \L2NpcBufferInstance.java (at line 62)

        if (player.isInCombat) {

            ^^^^^^

player cannot be resolved to a variable

----------

2. ERROR in \L2NpcBufferInstance.java (at line 63)

        player.sendMessage("You can't use buffer while you are in combat mode!")

;

        ^^^^^^

player cannot be resolved

----------

3. ERROR in \L2NpcBufferInstance.java (at line 66)

        if (player.getPvpFlag() != 0) {

            ^^^^^^

player cannot be resolved

----------

4. ERROR in \L2NpcBufferInstance.java (at line 67)

        player.sendMessage("You can't use buffer while you have PvP Flag!");

        ^^^^^^

player cannot be resolved

----------

5. ERROR in \L2NpcBufferInstance.java (at line 70)

        if (player.getKarma() > 0) {

            ^^^^^^

player cannot be resolved

----------

6. ERROR in \L2NpcBufferInstance.java (at line 71)

        player.sendMessage("You can't use buffer while you have karma!");

        ^^^^^^

player cannot be resolved

----------

6 problems (6 errors)player cannot be resolved to a variable

player cannot be resolved

player cannot be resolved

player cannot be resolved

player cannot be resolved

player cannot be resolved

Failed executing script: C:\server\game\data\scripts\custom\L2NpcBufferInstance.

java. See L2NpcBufferInstance.java.error.log for details.

 

 

and the log says:

Error on: C:\server\game\data\scripts\custom\L2NpcBufferInstance.java.error.log

Line: -1 - Column: -1

 

compilation failed

  • 0
Posted

It should not be in scripts/custom/ folder

it should be inAnywhy in interlude it should be there

 

But i dont have that location package com.l2jserver.gameserver.model.actor.instance

 

is it because i downloaded a compiled server and didnt compile it myself ?

 

Guest
This topic is now closed to further replies.


  • Posts

    • 寒冷的冬天 — 火热的折扣。使用促销代码 WINTER 即可在我们商店的所有购买中获得 10% 折扣! 有效链接: 数字商品商店(网站): 前往 其他服务和产品: 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 ,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销代码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣——只需在我们的网站注册后按以下模板填写您的用户名:"SEND ME BONUS, MY USERNAME IS..." ——您需要在我们的论坛主题中发布! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人中每周都会赠送 Telegram Stars! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Cold winter — hot discounts. Use promo code WINTER and get 10% off on all purchases in our store! Active links: Digital goods store (Website): Go to Other services and products: Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Cold winter — hot discounts. Use promo code WINTER and get 10% off on all purchases in our store! Active links: Digital goods store (Website): Go to Other services and products: Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Telegram Stars — a new digital currency inside Telegram. And right now, the best opportunities are opening for profitable purchases and participation in exclusive events. And you can purchase Telegram Stars safely and at the best price in our bot. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Telegram Stars — a new digital currency inside Telegram. And right now, the best opportunities are opening for profitable purchases and participation in exclusive events. And you can purchase Telegram Stars safely and at the best price in our bot. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock