*
* 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-market
https://campsite.bio/utchihaamkt
areadata 파일은 없지만 PVP zone 스크립트 폴더는 있습니다.
PVP 존 폴더의 arena zone 명령어로 arena 모드를 활성화 할 수 있습니다.
하지만 ID를 자동으로 보라색으로 바꾸는 명령이 무엇인지 알고 싶습니다.
The areadata file is not in my server pack
I can activate arena mode with the arena zone command in the PVP zone folder,
but I would like to know which command to use to automatically change the ID to purple.
The registration panel does not come with the VIP download, or is it paid separately, I would be interested in purchasing it, thank you How do I get in touch or how much it costs, I'll stay tuned.
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.