|
@@ -35,9 +35,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
|
|
import com.l2jserver.gameserver.model.items.L2Item;
|
|
|
import com.l2jserver.gameserver.model.stats.BaseStats;
|
|
|
import com.l2jserver.gameserver.model.stats.Stats;
|
|
|
-import com.l2jserver.gameserver.network.serverpackets.MyTargetSelected;
|
|
|
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
|
-import com.l2jserver.gameserver.network.serverpackets.StatusUpdate;
|
|
|
import com.l2jserver.util.StringUtil;
|
|
|
|
|
|
public class L2NpcActionShift implements IActionHandler
|
|
@@ -66,21 +64,6 @@ public class L2NpcActionShift implements IActionHandler
|
|
|
// 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(), activeChar.getLevel() - ((L2Character) target).getLevel());
|
|
|
- activeChar.sendPacket(my);
|
|
|
-
|
|
|
- // Check if the activeChar is attackable (without a forced attack)
|
|
|
- if (target.isAutoAttackable(activeChar))
|
|
|
- {
|
|
|
- // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
|
|
|
- StatusUpdate su = new StatusUpdate(target);
|
|
|
- su.addAttribute(StatusUpdate.CUR_HP, (int) ((L2Character) target).getCurrentHp());
|
|
|
- su.addAttribute(StatusUpdate.MAX_HP, ((L2Character) target).getMaxHp());
|
|
|
- activeChar.sendPacket(su);
|
|
|
- }
|
|
|
-
|
|
|
NpcHtmlMessage html = new NpcHtmlMessage(0);
|
|
|
html.setFile(activeChar.getHtmlPrefix(), "data/html/admin/npcinfo.htm");
|
|
|
|
|
@@ -197,21 +180,6 @@ public class L2NpcActionShift implements IActionHandler
|
|
|
// 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(), activeChar.getLevel() - ((L2Character) target).getLevel());
|
|
|
- activeChar.sendPacket(my);
|
|
|
-
|
|
|
- // Check if the activeChar is attackable (without a forced attack)
|
|
|
- if (target.isAutoAttackable(activeChar))
|
|
|
- {
|
|
|
- // Send a Server->Client packet StatusUpdate of the L2NpcInstance to the L2PcInstance to update its HP bar
|
|
|
- StatusUpdate su = new StatusUpdate(target);
|
|
|
- su.addAttribute(StatusUpdate.CUR_HP, (int) ((L2Character) target).getCurrentHp());
|
|
|
- su.addAttribute(StatusUpdate.MAX_HP, ((L2Character) target).getMaxHp());
|
|
|
- activeChar.sendPacket(su);
|
|
|
- }
|
|
|
-
|
|
|
NpcHtmlMessage html = new NpcHtmlMessage(0);
|
|
|
int hpMul = Math.round((float) (((L2Character) target).getStat().calcStat(Stats.MAX_HP, 1, (L2Character) target, null) / BaseStats.CON.calcBonus((L2Character) target)));
|
|
|
if (hpMul == 0)
|