*
* 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.
ADENA
500 K = 40e
1kk = 70e
3kk = 190e
ITEMS
staff of life = 150e
karmian set = 90e
elven jewls top D = 30e
Orcish Poleaxe+1 best C pole = 680e
any D grade armor on demand
discord
wiz0642_81242
❖Items that are sent by physical delivery are sent using someone else's data. That is, if you are not able to accept the parcel, we will not be able to return it. Please keep this in mind.
READY IN STOCK
PAYMENT SYSTEMS
4x4 io, Weststein, Paysafecard, Paysend, Genome, Conotoxia, Mybrocard, Payz Silver, Pockit UK, NagaPay, Volet com, SpectroCoin, SwissMoney, Yuh, Lydia / Sumeria, Ka.App, Wittix, Western Union, MyGuava, Xapo Bank, Bunq on emulator (DE, NL, FR, ES, IE ibans), Revolut on emulator (UK/EU), ICard, BlackCatCard, Vivid DE, Bankera, Bitsa, Wise EU/UK, N26 DE/ES on emulator, Skrill, Neteller, Trasta, Wirex, Lama, Paysera, Moneyjar
CRYPTOEXCHANGE
BINGX com, Bybit LVL 2, KuCoin, Binance LVL 2, Mexc, Latoken, Poloniex, Bitmart, Kraken, WhiteBit, Quppy, Nexo, Gate, OKX, Paybis, Paxful, Huobi (HTX), xcoins com, Bit2Me
BUSINESS ACCOUNTS
Stripe, Payoneer EU, Wise Business UK/EU, Revolut Business EU/UK, N26 Business DE, Wallester Business EU, Kraken Business Pro, Monzo Business, Vivid Business, Zen Business EU, Millennium Business PL, AirWallex EU/UK, Finom business, PayPal business, Payset business
NATIONAL BANKS / BANKS
BBVA, CommerzBank, ING, Santander, Kaspi Bank, Sberbank, AlfaBank, Tbank, Raiffeisen, mBank, Paribas, Bereke Bank, Kapital Bank
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.