Ombladon Administrator, Head DEV


Data inscrierii: 30/Aug/2007 Mesaje: 8
|
Trimis: 02/09/2007 12:52 Titlul subiectului: Interlude Buffer Instance |
|
|
acest cod este facut de mine in scopul de a crea in buffer in interlude, fara sa folosim quest ptr a bufa
Codul:
| Cod: |
package net.sf.l2j.gameserver.model.actor.instance;
import java.util.StringTokenizer;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.L2Skill.SkillType;
import net.sf.l2j.gameserver.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.templates.L2NpcTemplate;
/**
* Interlude Buffer Instance
*
* @author Ombladon
*/
public class L2GmBufferInstance extends L2FolkInstance
{
public L2GmBufferInstance(int objectId, L2NpcTemplate template)
{
super(objectId, template);
}
public void onBypassFeedback(L2PcInstance player, String command)
{
player.sendPacket(new ActionFailed());
StringTokenizer st = new StringTokenizer(command, " ");
String actualCommand = st.nextToken(); // Get actual command
if (actualCommand.equalsIgnoreCase("gmbuff"))
{
try
{
int skillId = Integer.parseInt(st.nextToken());
int skillLevel = Integer.parseInt(st.nextToken());
int adena = Integer.parseInt(st.nextToken());
this.setTarget(player);
L2Skill skill;
try
{
try
{
skill = SkillTable.getInstance().getInfo(skillId,skillLevel);
player.destroyItemByItemId("L2GmBufferInstance", 57, adena, null, true);
if (skill.getSkillType() == SkillType.SUMMON)
player.doCast(skill);
else
this.doCast(skill);
}
catch (Exception e)
{
player.sendMessage("L2GmBufferInstance: Invalid skill level!");
}
}
catch (Exception e)
{
player.sendMessage("L2GmBufferInstance: Invalid skill!");
}
return;
}
catch (Exception e)
{
_log.warning("L2GmBufferInstance: Error while parsing bypass value");
e.printStackTrace();
}
}
super.onBypassFeedback(player, command);
}
public String getHtmlPath(int npcId, int val)
{
String pom = "";
if (val == 0)
{
pom = "" + npcId;
}
else
{
pom = npcId + "-" + val;
}
return "data/html/gmbuffer/" + pom + ".htm";
}
}
|
salavti aceasta fila cu numele: L2GmBufferInstance.Java
dak nu folositi eclipse va voi da si un server prebuild cu classul in el :P
dak folositi eclipse:java\net\sf\l2j\gameserver\model\actor\instance _________________ L2J:
---------------------------------------------
Core DEV
Datapack DEV
Database Dev
Client modder |
|