- 0
This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
Howl3r
Well i am trying to make an action Shift to get stats from Characters for non Gm Char.
What i mean a normal char press shift and click on other or himself
but is not working (with gm is working).
This is my Code:
/** * */ package handlers.actionhandlers; import com.l2jserver.gameserver.handler.IActionHandler; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2Object.InstanceType; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.serverpackets.MyTargetSelected; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.StatusUpdate; import com.l2jserver.gameserver.skills.BaseStats; import com.l2jserver.gameserver.skills.Stats; import com.l2jserver.util.StringUtil; /** * @author Howler * */ public class L2FactionActionShift implements IActionHandler { @Override public boolean action(L2PcInstance activeChar, L2Object target, boolean interact) { // Set the target of the L2PcInstance activeChar activeChar.setTarget(target); // Send a Server->Client packet MyTargetSelected to the L2PcInstance activeChar // The activeChar.getLevel() - getLevel() permit to display the correct color in the select window MyTargetSelected my = new MyTargetSelected(target.getObjectId(), 0); activeChar.sendPacket(my); L2PcInstance target = (L2PcInstance) activeChar.getTarget(); String htmFile = "data/html/mods/Faction/userinfo.htm"; String htmContent = HtmCache.getInstance().getHtm(htmFile); if (htmContent != null) { NpcHtmlMessage showHtml = new NpcHtmlMessage(1); showHtml.setHtml(htmContent); showHtml.replace("%name%", target.getName()); if (target.isTeam1Member()) showHtml.replace("%faction%", "<font color=\""+Config.FACTION_TEAM1_NAME_COLOR+"\">"+Config.FACTION_TEAM1_NAME+"</font>"); else if (target.isTeam2Member()) showHtml.replace("%faction%", "<font color=\""+Config.FACTION_TEAM2_NAME_COLOR+"\">"+Config.FACTION_TEAM2_NAME+"</font>"); else showHtml.replace("%faction%", "None"); showHtml.replace("%spree%", Integer.toString(target.getTopKillRow())); showHtml.replace("%facpot%", Integer.toString(target.getFactionPoints())); showHtml.replace("%pvp%", Integer.toString(target.getPvpKills())); activeChar.sendPacket(showHtml); } return true; } /* (non-Javadoc) * @see com.l2jserver.gameserver.handler.IActionHandler#getInstanceType() */ @Override public InstanceType getInstanceType() { return InstanceType.L2Playable; } }7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now