**This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU GeneralPublicLicenseas published by* the FreeSoftwareFoundation; 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 GeneralPublicLicensefor more details.**You should have received a copy of the GNU GeneralPublicLicense* along withthis program;ifnot, write to the FreeSoftware*Foundation,Inc.,59TemplePlace-Suite330,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
*/publicfinalclass L2BufferInstance extends L2NpcInstance
{public L2BufferInstance(int objectId, L2NpcTemplate template){super(objectId,template);}@Overridepublicvoid onBypassFeedback(L2PcInstance player,String command){StringTokenizer st =newStringTokenizer(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();}elseif(st.countTokens()==1)
buffid =Integer.valueOf(st.nextToken());if(actualCommand.equalsIgnoreCase("getbuff")){if(buffid !=0){MagicSkillUse mgc =newMagicSkillUse(this, player, buffid, bufflevel,5,0);SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
showMessageWindow(player);
player.broadcastPacket(mgc);
showChatWindow(player, nextWindow);}}elseif(actualCommand.equalsIgnoreCase("restore")){
player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
player.setCurrentCp(player.getMaxCp());
showMessageWindow(player);}elseif(actualCommand.equalsIgnoreCase("cancel")){
player.stopAllEffects();
showMessageWindow(player);}elsesuper.onBypassFeedback(player, command);}@Overridepublicvoid onAction(L2PcInstance player){if(this!= player.getTarget()){
player.setTarget(this);
player.sendPacket(newMyTargetSelected(getObjectId(), player.getLevel()- getLevel()));
player.sendPacket(newValidateLocation(this));}elseif(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);}}privatevoid showMessageWindow(L2PcInstance player){String filename ="data/html/buffer/"+ getNpcId()+".htm";
filename = getHtmlPath(getNpcId(),0);NpcHtmlMessage html =newNpcHtmlMessage(getObjectId());
html.setFile(filename);
html.replace("%objectId%",String.valueOf(getObjectId()));
html.replace("%npcname%", getName());
player.sendPacket(html);}@OverridepublicString 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.
OPENING ON MARCH 21 AT 18:00 GMT+1
Airin Server — a journey from the classic Chronicle 1 to the epic Chronicle 5, followed by a world merge with the Teon server.
We are creating a unique gaming experience where each era unfolds gradually. From your first steps to battles with epic bosses, from the importance of every equipment grade to the significance of every location.
Progressive Chronicles — your journey through history.
Limits:
1 client per person
Rates:
Epic drop chance: x1
Quest drop chance: x1
Raid drop chance: x2
Adena (dynamic): x3~ (x1 for high-level)
EXP\SP: x2-x3
Drop chance: x2-x3
Spoil chance: x2-x3
Quests A-grade: x1-x3
Quests S-grade: x1-x2
Welcome to Elmorelab.com!
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.