*
* 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.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.MyTargetSelected;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
/**
*
* @author Leki
*/
public final class L2BufferInstance extends L2NpcInstance
{
public L2BufferInstance(int objectId, L2NpcTemplate template)
{
super(objectId, template);
}
@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
StringTokenizer st = new StringTokenizer(command, " ");
String actualCommand = st.nextToken();
int buffid = 0;
int bufflevel = 1;
String nextWindow = null;
if (st.countTokens() == 3) {
buffid = Integer.valueOf(st.nextToken());
bufflevel = Integer.valueOf(st.nextToken());
nextWindow = st.nextToken();
}
else if (st.countTokens() == 1)
buffid = Integer.valueOf(st.nextToken());
if (actualCommand.equalsIgnoreCase("getbuff"))
{
if (buffid != 0)
{
MagicSkillUse mgc = new MagicSkillUse(this, player, buffid, bufflevel, 5, 0);
SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
showMessageWindow(player);
player.broadcastPacket(mgc);
showChatWindow(player, nextWindow);
}
}
else if (actualCommand.equalsIgnoreCase("restore")) {
player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
player.setCurrentCp(player.getMaxCp());
showMessageWindow(player);
}
else if (actualCommand.equalsIgnoreCase("cancel")) {
player.stopAllEffects();
showMessageWindow(player);
}
else
super.onBypassFeedback(player, command);
}
@Override
public void onAction(L2PcInstance player)
{
if (this != player.getTarget()) {
player.setTarget(this);
player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
player.sendPacket(new ValidateLocation(this));
}
else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false)) {
player.setCurrentFolkNPC(this);
showMessageWindow(player);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
else {
player.getAI().setIntention(CtrlIntention.INTERACT, this);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
}
private void showMessageWindow(L2PcInstance player)
{
String filename = "data/html/buffer/" + getNpcId() + ".htm";
filename = getHtmlPath(getNpcId(), 0);
NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
html.setFile(filename);
html.replace("%objectId%", String.valueOf(getObjectId()));
html.replace("%npcname%", getName());
player.sendPacket(html);
}
@Override
public String getHtmlPath(int npcId, int val)
{
String pom = "";
if (val == 0)
pom = "" + npcId;
else
pom = npcId + "-" + val;
return "data/html/buffer/" + pom + ".htm";
}
}
Ρε μαγκες μου εδωσαν αυτον τον κωδικα σε ενα L2BufferInstance πως θα το βαλω μεσο του eclipse ωστε στην συνεχεια να κανω compile...
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.
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
cheap discord account full access (that's mean you have access to email and discord to change everything)
those account are good for everything
best prices on the market
price start at : 0.55$ bulk= discount
link store :
afgstore.mysellauth.com
telegram to contact me or buy : t.me/AFGDiscord
discord : revo_gg
⭐⭐⭐⭐⭐L2Lusty 50x [Essence - High Five] Start 08 February⭐⭐⭐⭐⭐
L2Lusty Essence - High Five 50x
Website: https://l2lusty.online/
Starts on 08/02/2025 16:00 London Time
Rates: XP 50X, Adena 20X, Spoil 20X, Drop 20X,
Max enchant +16 with 50% normal and 60% blessed,
Chaos Event whit 3x Lcoins Drop 24h
Website: https://l2lusty.online/
Question
mikemaster
Ρε μαγκες μου εδωσαν αυτον τον κωδικα σε ενα L2BufferInstance πως θα το βαλω μεσο του eclipse ωστε στην συνεχεια να κανω compile...
3 answers to this question
Recommended Posts
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.