Jump to content
  • 0
Kallisto

[JAVA Adaptação] .status .inventory .skills

Question

Alguém poderia adaptar esse mod para jfrozen?
troquei os imports porem é preciso alterar alguns caminhos que não sei.

 
gameserver/handler/VoicedCommandHandler.java

		registerHandler(new Status());
		registerHandler(new Inventory());
		registerHandler(new Skills());
gameserver/handler/voicedcommandhandlers/Status.java

package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.Creature;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.GMViewCharacterInfo;
import net.sf.l2j.gameserver.network.serverpackets.GMViewHennaInfo;

public class Status implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"status"
	
	};
	
	@Override
	public boolean useVoicedCommand(String command, Player activeChar, String target)
	{
		if (command.startsWith("status") && Config.STATUS_CMD)
		{
			if (activeChar.getTarget() == null)
			{
				activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
				return false;
			}
			if (!(activeChar.getTarget() instanceof Player))
			{
				activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
				return false;
			}
			
			Creature targetCharacter = (Creature) activeChar.getTarget();
			Player targetPlayer = targetCharacter.getActingPlayer();
			
			activeChar.sendPacket(new GMViewCharacterInfo(targetPlayer));
			activeChar.sendPacket(new GMViewHennaInfo(targetPlayer));
			return true;
		}
		return false;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}

 

gameserver/handler/voicedcommandhandlers/Inventory.java

package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.Creature;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.GMViewItemList;

public class Inventory implements IVoicedCommandHandler
{

	private static final String[] VOICED_COMMANDS =
	{

		"inventory"
	
	};
	
	@Override
	public boolean useVoicedCommand(String command, Player activeChar, String target)
	{
		
		if (command.startsWith("inventory") && Config.STATUS_CMD)
		{
			if (activeChar.getTarget() == null)
			{
				activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
				return false;
			}
			if (!(activeChar.getTarget() instanceof Player))
			{
				activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
				return false;
			}
			
			Creature targetCharacter = (Creature) activeChar.getTarget();
			Player targetPlayer = targetCharacter.getActingPlayer();
			
			activeChar.sendPacket(new GMViewItemList(targetPlayer));
			return true;
		}
		return false;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}
gameserver/handler/voicedcommandhandlers/Skills.java


package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.Creature;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.GMViewSkillInfo;

public class Skills implements IVoicedCommandHandler
{
	
	private static final String[] VOICED_COMMANDS =
	{

		"skills"
	
	};
	
	@Override
	public boolean useVoicedCommand(String command, Player activeChar, String target)
	{
		
		if (command.startsWith("skills") && Config.STATUS_CMD)
		{
			if (activeChar.getTarget() == null)
			{
				activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
				return false;
			}
			if (!(activeChar.getTarget() instanceof Player))
			{
				activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
				return false;
			}
			
			Creature targetCharacter = (Creature) activeChar.getTarget();
			Player targetPlayer = targetCharacter.getActingPlayer();
			
			activeChar.sendPacket(new GMViewSkillInfo(targetPlayer));
			return true;
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}

 

 

Edited by Kallisto

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
import com.l2jfrozen.gameserver.model.actor.Creature;
import com.l2jfrozen.gameserver.model.actor.instance.Player;
import com.l2jfrozen.gameserver.network.serverpackets.GMViewHennaInfo;

esses caminhos são diferentes na jfrozen, por isso ta dando erro!

erroff2.png?1548519686

Share this post


Link to post
Share on other sites

Precisando de Dedicado ou VPS?

Conheça a L2JCenter
  • 0

Adaptação consiste em buscas, ver as mudanças, depois que você as decora, é fácil.

Player irá virar L2PCInstance, as outras não recordo, mas buscando pelos métodos da para achar facilmente.

 

  • Like 1
  • Sad 1

Share this post


Link to post
Share on other sites
  • 0
 

Adaptação consiste em buscas, ver as mudanças, depois que você as decora, é fácil.

Player irá virar L2PCInstance, as outras não recordo, mas buscando pelos métodos da para achar facilmente.

 

sou amador demais pra isso.
é por isso que criei o tópico aqui na area de pedidos , pra alguma alma boa fazer a adaptação ou passar os imports corretos..
se puder passar os outros além do L2PCInstance fico agradecido!

Share this post


Link to post
Share on other sites
  • 0
 

sou amador demais pra isso.
é por isso que criei o tópico aqui na area de pedidos , pra alguma alma boa fazer a adaptação ou passar os imports corretos..
se puder passar os outros além do L2PCInstance fico agradecido!

https://acis.i-live.eu/index.php?topic=30.255

Changeset 367 tem algumas coisas, todas as infos tem navegando pelos commits, basta usar cntr +f.

A gm view henna, abre a package e olha dentro qual nome correto, package no caso são os diretórios, é facinho brother.

Edited by Escanor

Share this post


Link to post
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...




     



  • Recently Browsing

    No registered users viewing this page.

  • Posts

×
×
  • Create New...