Drop Panel

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
slycosty
Posts: 8
Joined: Mon Feb 17, 2014 6:18 am

Drop Panel

Post by slycosty »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:6408
L2JDP Revision Number:10190

Hi I found this interesting drop panel but I'm a total noob I have the files . Can anyone help with install?

Code: Select all

/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, 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 General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */package handlers.actionhandlers; import com.l2jserver.Config;import com.l2jserver.gameserver.handler.IActionHandler;import com.l2jserver.gameserver.model.Elementals;import com.l2jserver.gameserver.model.L2Object;import com.l2jserver.gameserver.model.L2Object.InstanceType;import com.l2jserver.gameserver.model.actor.L2Attackable;import com.l2jserver.gameserver.model.actor.L2Character;import com.l2jserver.gameserver.model.actor.L2Npc;import com.l2jserver.gameserver.model.actor.instance.L2MerchantInstance;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; public class L2NpcActionShift implements IActionHandler{    /**     * Manage and Display the GM console to modify the L2NpcInstance (GM only).<BR><BR>     *     * <B><U> Actions (If the L2PcInstance is a GM only)</U> :</B><BR><BR>     * <li>Set the L2NpcInstance as target of the L2PcInstance player (if necessary)</li>     * <li>Send a Server->Client packet MyTargetSelected to the L2PcInstance player (display the select window)</li>     * <li>If L2NpcInstance is autoAttackable, send a Server->Client packet StatusUpdate to the L2PcInstance in order to update L2NpcInstance HP bar </li>     * <li>Send a Server->Client NpcHtmlMessage() containing the GM console about this L2NpcInstance </li><BR><BR>     *     * <FONT COLOR=#FF0000><B> <U>Caution</U> : Each group of Server->Client packet must be terminated by a ActionFailed packet in order to avoid     * that client wait an other packet</B></FONT><BR><BR>     *     * <B><U> Example of use </U> :</B><BR><BR>     * <li> Client packet : Action</li><BR><BR>     */    @Override    public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)    {        // Check if the L2PcInstance is a GM        if (activeChar.getAccessLevel().isGm())        {            // 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");                        html.replace("%objid%", String.valueOf(target.getObjectId()));            html.replace("%class%", target.getClass().getSimpleName());            html.replace("%id%",    String.valueOf(((L2Npc)target).getTemplate().getNpcId()));            html.replace("%lvl%",   String.valueOf(((L2Npc)target).getTemplate().getLevel()));            html.replace("%name%",  String.valueOf(((L2Npc)target).getTemplate().getName()));            html.replace("%tmplid%",String.valueOf(((L2Npc)target).getTemplate().getNpcId()));            html.replace("%aggro%", String.valueOf((target instanceof L2Attackable) ? ((L2Attackable) target).getAggroRange() : 0));            html.replace("%hp%",    String.valueOf((int)((L2Character)target).getCurrentHp()));            html.replace("%hpmax%", String.valueOf(((L2Character)target).getMaxHp()));            html.replace("%mp%",    String.valueOf((int)((L2Character)target).getCurrentMp()));            html.replace("%mpmax%", String.valueOf(((L2Character)target).getMaxMp()));                        html.replace("%patk%", String.valueOf(((L2Character)target).getPAtk(null)));            html.replace("%matk%", String.valueOf(((L2Character)target).getMAtk(null, null)));            html.replace("%pdef%", String.valueOf(((L2Character)target).getPDef(null)));            html.replace("%mdef%", String.valueOf(((L2Character)target).getMDef(null, null)));            html.replace("%accu%", String.valueOf(((L2Character)target).getAccuracy()));            html.replace("%evas%", String.valueOf(((L2Character)target).getEvasionRate(null)));            html.replace("%crit%", String.valueOf(((L2Character)target).getCriticalHit(null, null)));            html.replace("%rspd%", String.valueOf(((L2Character)target).getRunSpeed()));            html.replace("%aspd%", String.valueOf(((L2Character)target).getPAtkSpd()));            html.replace("%cspd%", String.valueOf(((L2Character)target).getMAtkSpd()));            html.replace("%str%",  String.valueOf(((L2Character)target).getSTR()));            html.replace("%dex%",  String.valueOf(((L2Character)target).getDEX()));            html.replace("%con%",  String.valueOf(((L2Character)target).getCON()));            html.replace("%int%",  String.valueOf(((L2Character)target).getINT()));            html.replace("%wit%",  String.valueOf(((L2Character)target).getWIT()));            html.replace("%men%",  String.valueOf(((L2Character)target).getMEN()));            html.replace("%loc%",  String.valueOf(target.getX()+" "+target.getY()+" "+target.getZ()));            html.replace("%dist%", String.valueOf((int)Math.sqrt(activeChar.getDistanceSq(target))));                        byte attackAttribute = ((L2Character)target).getAttackElement();            html.replace("%ele_atk%", Elementals.getElementName(attackAttribute));            html.replace("%ele_atk_value%", String.valueOf(((L2Character)target).getAttackElementValue(attackAttribute)));            html.replace("%ele_dfire%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.FIRE)));            html.replace("%ele_dwater%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.WATER)));            html.replace("%ele_dwind%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.WIND)));            html.replace("%ele_dearth%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.EARTH)));            html.replace("%ele_dholy%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.HOLY)));            html.replace("%ele_ddark%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.DARK)));                        if (((L2Npc)target).getSpawn() != null)            {                html.replace("%spawn%", ((L2Npc)target).getSpawn().getLocx()+" "+((L2Npc)target).getSpawn().getLocy()+" "+((L2Npc)target).getSpawn().getLocz());                html.replace("%loc2d%", String.valueOf((int)Math.sqrt(((L2Character)target).getPlanDistanceSq(((L2Npc)target).getSpawn().getLocx(), ((L2Npc)target).getSpawn().getLocy()))));                html.replace("%loc3d%", String.valueOf((int)Math.sqrt(((L2Character)target).getDistanceSq(((L2Npc)target).getSpawn().getLocx(), ((L2Npc)target).getSpawn().getLocy(), ((L2Npc)target).getSpawn().getLocz()))));                html.replace("%resp%",  String.valueOf(((L2Npc)target).getSpawn().getRespawnDelay() / 1000));            }            else            {                html.replace("%spawn%", "<font color=FF0000>null</font>");                html.replace("%loc2d%", "<font color=FF0000>--</font>");                html.replace("%loc3d%", "<font color=FF0000>--</font>");                html.replace("%resp%",  "<font color=FF0000>--</font>");            }                        if (((L2Npc)target).hasAI())            {                html.replace("%ai_intention%",  "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getAI().getIntention().name())+"</td></tr></table></td></tr>");                html.replace("%ai%",            "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>"+((L2Npc)target).getAI().getClass().getSimpleName()+"</td></tr></table></td></tr>");                html.replace("%ai_type%",       "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>AIType</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getAiType())+"</td></tr></table></td></tr>");                html.replace("%ai_clan%",       "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Clan & Range:</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getClan())+" "+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getClanRange())+"</td></tr></table></td></tr>");                html.replace("%ai_enemy_clan%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Enemy & Range:</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getEnemyClan())+" "+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getEnemyRange())+"</td></tr></table></td></tr>");            }            else            {                html.replace("%ai_intention%",  "");                html.replace("%ai%",            "");                html.replace("%ai_type%",       "");                html.replace("%ai_clan%",       "");                html.replace("%ai_enemy_clan%", "");            }                        if (target instanceof L2MerchantInstance)            {                html.replace("%butt%","<button value=\"Shop\" action=\"bypass -h admin_showShop "+String.valueOf(((L2Npc)target).getTemplate().getNpcId())+"\" width=60 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");            }            else            {                html.replace("%butt%","");            }                        activeChar.sendPacket(html);        }        else if (Config.ALT_GAME_VIEWNPC)        {            // 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/custom/mobinfo.htm");                        html.replace("%objid%", String.valueOf(target.getObjectId()));            html.replace("%class%", target.getClass().getSimpleName());            html.replace("%id%",    String.valueOf(((L2Npc)target).getTemplate().getNpcId()));            html.replace("%lvl%",   String.valueOf(((L2Npc)target).getTemplate().getLevel()));            html.replace("%name%",  String.valueOf(((L2Npc)target).getTemplate().getName()));            html.replace("%tmplid%",String.valueOf(((L2Npc)target).getTemplate().getNpcId()));            html.replace("%aggro%", String.valueOf((target instanceof L2Attackable) ? ((L2Attackable) target).getAggroRange() : 0));            html.replace("%hp%",    String.valueOf((int)((L2Character)target).getCurrentHp()));            html.replace("%hpmax%", String.valueOf(((L2Character)target).getMaxHp()));            html.replace("%mp%",    String.valueOf((int)((L2Character)target).getCurrentMp()));            html.replace("%mpmax%", String.valueOf(((L2Character)target).getMaxMp()));                        html.replace("%patk%", String.valueOf(((L2Character)target).getPAtk(null)));            html.replace("%matk%", String.valueOf(((L2Character)target).getMAtk(null, null)));            html.replace("%pdef%", String.valueOf(((L2Character)target).getPDef(null)));            html.replace("%mdef%", String.valueOf(((L2Character)target).getMDef(null, null)));            html.replace("%accu%", String.valueOf(((L2Character)target).getAccuracy()));            html.replace("%evas%", String.valueOf(((L2Character)target).getEvasionRate(null)));            html.replace("%crit%", String.valueOf(((L2Character)target).getCriticalHit(null, null)));            html.replace("%rspd%", String.valueOf(((L2Character)target).getRunSpeed()));            html.replace("%aspd%", String.valueOf(((L2Character)target).getPAtkSpd()));            html.replace("%cspd%", String.valueOf(((L2Character)target).getMAtkSpd()));            html.replace("%str%",  String.valueOf(((L2Character)target).getSTR()));            html.replace("%dex%",  String.valueOf(((L2Character)target).getDEX()));            html.replace("%con%",  String.valueOf(((L2Character)target).getCON()));            html.replace("%int%",  String.valueOf(((L2Character)target).getINT()));            html.replace("%wit%",  String.valueOf(((L2Character)target).getWIT()));            html.replace("%men%",  String.valueOf(((L2Character)target).getMEN()));            html.replace("%loc%",  String.valueOf(target.getX()+" "+target.getY()+" "+target.getZ()));            html.replace("%dist%", String.valueOf((int)Math.sqrt(activeChar.getDistanceSq(target))));                        byte attackAttribute = ((L2Character)target).getAttackElement();            html.replace("%ele_atk%", Elementals.getElementName(attackAttribute));            html.replace("%ele_atk_value%", String.valueOf(((L2Character)target).getAttackElementValue(attackAttribute)));            html.replace("%ele_dfire%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.FIRE)));            html.replace("%ele_dwater%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.WATER)));            html.replace("%ele_dwind%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.WIND)));            html.replace("%ele_dearth%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.EARTH)));            html.replace("%ele_dholy%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.HOLY)));            html.replace("%ele_ddark%", String.valueOf(((L2Character)target).getDefenseElementValue(Elementals.DARK)));                        if (((L2Npc)target).getSpawn() != null)            {                html.replace("%spawn%", ((L2Npc)target).getSpawn().getLocx()+" "+((L2Npc)target).getSpawn().getLocy()+" "+((L2Npc)target).getSpawn().getLocz());                html.replace("%loc2d%", String.valueOf((int)Math.sqrt(((L2Character)target).getPlanDistanceSq(((L2Npc)target).getSpawn().getLocx(), ((L2Npc)target).getSpawn().getLocy()))));                html.replace("%loc3d%", String.valueOf((int)Math.sqrt(((L2Character)target).getDistanceSq(((L2Npc)target).getSpawn().getLocx(), ((L2Npc)target).getSpawn().getLocy(), ((L2Npc)target).getSpawn().getLocz()))));                html.replace("%resp%",  String.valueOf(((L2Npc)target).getSpawn().getRespawnDelay() / 1000));            }            else            {                html.replace("%spawn%", "<font color=FF0000>null</font>");                html.replace("%loc2d%", "<font color=FF0000>--</font>");                html.replace("%loc3d%", "<font color=FF0000>--</font>");                html.replace("%resp%",  "<font color=FF0000>--</font>");            }                        if (((L2Npc)target).hasAI())            {                html.replace("%ai_intention%",  "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getAI().getIntention().name())+"</td></tr></table></td></tr>");                html.replace("%ai%",            "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>"+((L2Npc)target).getAI().getClass().getSimpleName()+"</td></tr></table></td></tr>");                html.replace("%ai_type%",       "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>AIType</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getAiType())+"</td></tr></table></td></tr>");                html.replace("%ai_clan%",       "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Clan & Range:</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getClan())+" "+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getClanRange())+"</td></tr></table></td></tr>");                html.replace("%ai_enemy_clan%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Enemy & Range:</font></td><td align=right width=170>"+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getEnemyClan())+" "+String.valueOf(((L2Npc)target).getTemplate().getAIDataStatic().getEnemyRange())+"</td></tr></table></td></tr>");            }            else            {                html.replace("%ai_intention%",  "");                html.replace("%ai%",            "");                html.replace("%ai_type%",       "");                html.replace("%ai_clan%",       "");                html.replace("%ai_enemy_clan%", "");            }                        activeChar.sendPacket(html);        }                return true;    }        @Override    public InstanceType getInstanceType()    {        return InstanceType.L2Npc;    }}

Code: Select all

/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, 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 General Public License for more * details. *  * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */package handlers.bypasshandlers; import java.text.DecimalFormat; import com.l2jserver.gameserver.datatables.ItemTable;import com.l2jserver.gameserver.handler.IBypassHandler;import com.l2jserver.gameserver.model.L2DropCategory;import com.l2jserver.gameserver.model.L2DropData;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.L2Npc;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;import com.l2jserver.gameserver.model.items.L2Item;import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;import com.l2jserver.util.StringUtil; public class DropInfo implements IBypassHandler{    private static final String[] COMMANDS =    {        "drop",        "spoil",        "info",        "quest"    };        @Override    public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)    {        try        {            final NpcHtmlMessage html = new NpcHtmlMessage(0);            L2Object targetmob = activeChar.getTarget();            L2Npc npc = (L2Npc) targetmob;            String droptext = "";                        if (command.startsWith("drop"))            {                try                {                    html.setFile(activeChar.getHtmlPrefix(), "data/html/custom/mobdrop.htm");                                        if (!(npc.isChampion() || npc.isMinion() || npc.getInstanceType() == InstanceType.L2GrandBossInstance || npc.isRaid() || npc.isRaidMinion() || npc.isMob()))                        return false;                       if (npc.getTemplate().getDropData().isEmpty())                    {                        droptext = "WARNING: This Npc has no Drops!";                        html.replace("%drops%", droptext);                        activeChar.sendPacket(html);                        return false;                    }                    String champ = "";                    String imgsg = "<img src=\"l2ui.squaregray\" width=\"274\" height=\"1\">";                    String ta_op = "<table bgcolor=333333 cellspacing=2 cellpadding=1><tr><td height=38 fixwidth=36><img src=\"";                    String ta_op2 = "\" height=32 width=32></td><td fixwidth=234><table VALIGN=top valing = top width=234 cellpadding=0 cellspacing=0><tr>";                     final StringBuilder droptext1 = StringUtil.startAppend(9000, champ + "<br>" + imgsg);                    for (L2DropCategory cat : npc.getTemplate().getDropData())                    {                        for (L2DropData drop : cat.getAllDrops())                        {                            final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());                            if (item == null)                                continue;                            if (cat.isSweep())                                continue;                            if (drop.isQuestDrop())                                continue;                                                  String smind = null, drops = null;                            String name = item.getName();                            double chance = (drop.getChance()/10000);                                                         if (item.getCrystalType() == 0)                            {                                smind = "<img src=\"L2UI_CH3.joypad_shortcut\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 1)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_D\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 2)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_C\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 3)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_B\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 4)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_A\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 5)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_S\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 6)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_80\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 7)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_84\" width=16 height=16>";                            }                                    if (chance <= 0.001)                            {                                DecimalFormat df = new DecimalFormat("#.####");                                drops = df.format(chance);                            }                            else if (chance <= 0.01)                            {                                DecimalFormat df = new DecimalFormat("#.###");                                drops = df.format(chance);                            }                            else                            {                                DecimalFormat df = new DecimalFormat("##.##");                                drops = df.format(chance);                            }                               if (name.startsWith("Recipe - Sealed"))                                name = "<font color=00FF00>(Re)</font><font color=FF00FF>(Sl)</font>" + name.substring(16);                            if (name.startsWith("Sealed "))                                name = "<font color=FF00FF>(Sl)</font>" + name.substring(7);                            if (name.startsWith("Common Item - "))                                name = "<font color=00FFFF>(Ci)</font>" + name.substring(14);                            if (name.startsWith("Recipe: "))                                name = "<font color=00FF00>(Re)</font>" + name.substring(8);                            if (name.startsWith("Recipe -"))                                name = "<font color=00FF00>(Re)</font>" + name.substring(8);                            if (name.startsWith("Mid-Grade Life Stone"))                                name = "<font color=fff600>Mid-Grade LS</font>" + name.substring(20);                            if (name.startsWith("High-Grade Life Stone"))                                name = "<font color=fff600>High-Grade LS</font>" + name.substring(21);                            if (name.startsWith("Top-Grade Life Stone"))                                name = "<font color=fff600>Top-Grade LS</font>" + name.substring(20);                            if (name.startsWith("Forgotten Scroll - "))                                name = "<font color=fff600>FS - </font>" + name.substring(19);                            if (name.startsWith("Greater Dye of "))                                name = "<font color=fff600>G Dye of </font>" + name.substring(15);                             droptext1.append(ta_op + item.getIcon()+ta_op2+"<td align=left width=16>" +smind+ "</td><td align=left width=260><font color=fff600>" +name+ "</font></td></tr><tr><td align=left width=16><img src=\"L2UI_CH3.QuestWndToolTipBtn\" width=16 height=16></td><td align=left width=55><font color=E15656>" +drops+ "%</font></td></tr></table></td></tr></table>" + imgsg);                        }                    }                    droptext = droptext1.toString();                    html.replace("%drops%", droptext);                    activeChar.sendPacket(html);                }                catch (Exception e)                {                    activeChar.sendMessage("Something went wrong with the drop preview.");                }            }            if (command.startsWith("spoil"))            {                try                {                    html.setFile(activeChar.getHtmlPrefix(), "data/html/custom/mobspoil.htm");                                        if (!(npc.isChampion() || npc.isMinion() || npc.isRaid() || npc.isRaidMinion() || npc.isMob()))                        return false;                    if (npc.getTemplate().getDropData().isEmpty())                    {                        droptext = "WARNING: This Npc has no Drops!";                        html.replace("%drops%", droptext);                        activeChar.sendPacket(html);                        return false;                    }                    String champ = "";                    String imgsg = "<img src=\"l2ui.squaregray\" width=\"274\" height=\"1\">";                    String ta_op = "<table bgcolor=333333 cellspacing=2 cellpadding=1><tr><td height=38 fixwidth=36><img src=\"";                    String ta_op2 = "\" height=32 width=32></td><td fixwidth=234><table VALIGN=top valing = top width=234 cellpadding=0 cellspacing=1><tr>";                    final StringBuilder droptext1 = StringUtil.startAppend(1000, champ + "<br>" + imgsg);                    for (L2DropCategory cat : npc.getTemplate().getDropData())                    {                        for (L2DropData drop : cat.getAllDrops())                        {                            final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());                            if (item == null)                                continue;                            if (!(cat.isSweep()))                                continue;                                                          String smind = null, drops = null;                            String name = item.getName();                            double chance = (drop.getChance()/10000);                                                         if (item.getCrystalType() == 0)                            {                                smind = "<img src=\"L2UI_CH3.joypad_shortcut\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 1)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_D\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 2)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_C\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 3)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_B\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 4)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_A\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 5)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_S\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 6)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_80\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 7)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_84\" width=16 height=16>";                            }                                    if (chance <= 0.001)                            {                                DecimalFormat df = new DecimalFormat("#.####");                                drops = df.format(chance);                            }                            else if (chance <= 0.01)                            {                                DecimalFormat df = new DecimalFormat("#.###");                                drops = df.format(chance);                            }                            else                            {                                DecimalFormat df = new DecimalFormat("##.##");                                drops = df.format(chance);                            }                               if (name.startsWith("Recipe - Sealed"))                                name = "<font color=00FF00>(Re)</font><font color=FF00FF>(Sl)</font>" + name.substring(16);                            if (name.startsWith("Sealed "))                                name = "<font color=FF00FF>(Sl)</font>" + name.substring(7);                            if (name.startsWith("Common Item - "))                                name = "<font color=00FFFF>(Ci)</font>" + name.substring(14);                            if (name.startsWith("Recipe: "))                                name = "<font color=00FF00>(Re)</font>" + name.substring(8);                            if (name.startsWith("Recipe -"))                                name = "<font color=00FF00>(Re)</font>" + name.substring(8);                            if (name.startsWith("Mid-Grade Life Stone"))                                name = "<font color=fff600>Mid-Grade LS</font>" + name.substring(20);                            if (name.startsWith("High-Grade Life Stone"))                                name = "<font color=fff600>High-Grade LS</font>" + name.substring(21);                            if (name.startsWith("Top-Grade Life Stone"))                                name = "<font color=fff600>Top-Grade LS</font>" + name.substring(20);                            if (name.startsWith("Forgotten Scroll - "))                                name = "<font color=fff600>FS - </font>" + name.substring(19);                            if (name.startsWith("Greater Dye of "))                                name = "<font color=fff600>G Dye of </font>" + name.substring(15);                             droptext1.append(ta_op + item.getIcon()+ta_op2+"<td align=left width=16>" +smind+ "</td><td align=left width=260><font color=fff600>" +name+ "</font></td></tr><tr><td align=left width=16><img src=\"L2UI_CH3.QuestWndToolTipBtn\" width=16 height=16></td><td align=left width=55><font color=E15656>" +drops+ "%</font></td></tr></table></td></tr></table>" + imgsg);                        }                    }                    droptext = droptext1.toString();                    html.replace("%drops%", droptext);                    activeChar.sendPacket(html);                }                catch (Exception e)                {                    activeChar.sendMessage("Something went wrong with the drop preview.");                }            }            if (command.startsWith("quest"))            {                try                {                    html.setFile(activeChar.getHtmlPrefix(), "data/html/custom/mobquest.htm");                                        if (!(npc.isChampion() || npc.isMinion() || npc.isRaid() || npc.isRaidMinion() || npc.isMob()))                        return false;                    if (npc.getTemplate().getDropData().isEmpty())                    {                        droptext = "WARNING: This Npc has no Drops!";                        html.replace("%drops%", droptext);                        activeChar.sendPacket(html);                        return false;                    }                    String champ = "";                    String imgsg = "<img src=\"l2ui.squaregray\" width=\"274\" height=\"1\">";                    String ta_op = "<table bgcolor=333333 cellspacing=2 cellpadding=1><tr><td height=38 fixwidth=36><img src=\"";                    String ta_op2 = "\" height=32 width=32></td><td fixwidth=234><table VALIGN=top valing = top width=234 cellpadding=0 cellspacing=1><tr>";                    final StringBuilder droptext1 = StringUtil.startAppend(1000, champ + "<br>" + imgsg);                    for (L2DropCategory cat : npc.getTemplate().getDropData())                    {                        for (L2DropData drop : cat.getAllDrops())                        {                            final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());                            if (item == null)                                continue;                            if (!(drop.isQuestDrop()))                                continue;                                                          String smind = null, drops = null;                            String name = item.getName();                            double chance = (drop.getChance()/10000);                                                         if (item.getCrystalType() == 0)                            {                                smind = "<img src=\"L2UI_CH3.joypad_shortcut\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 1)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_D\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 2)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_C\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 3)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_B\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 4)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_A\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 5)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_S\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 6)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_80\" width=16 height=16>";                            }                            else if (item.getCrystalType() == 7)                            {                                smind = "<img src=\"L2UI_CT1.Icon_DF_ItemGrade_84\" width=16 height=16>";                            }                                    if (chance <= 0.001)                            {                                DecimalFormat df = new DecimalFormat("#.####");                                drops = df.format(chance);                            }                            else if (chance <= 0.01)                            {                                DecimalFormat df = new DecimalFormat("#.###");                                drops = df.format(chance);                            }                            else                            {                                DecimalFormat df = new DecimalFormat("##.##");                                drops = df.format(chance);                            }                               if (name.startsWith("Recipe - Sealed"))                                name = "<font color=00FF00>(Re)</font><font color=FF00FF>(Sl)</font>" + name.substring(16);                            if (name.startsWith("Sealed "))                                name = "<font color=FF00FF>(Sl)</font>" + name.substring(7);                            if (name.startsWith("Common Item - "))                                name = "<font color=00FFFF>(Ci)</font>" + name.substring(14);                            if (name.startsWith("Recipe: "))                                name = "<font color=00FF00>(Re)</font>" + name.substring(8);                            if (name.startsWith("Recipe -"))                                name = "<font color=00FF00>(Re)</font>" + name.substring(8);                            if (name.startsWith("Mid-Grade Life Stone"))                                name = "<font color=fff600>Mid-Grade LS</font>" + name.substring(20);                            if (name.startsWith("High-Grade Life Stone"))                                name = "<font color=fff600>High-Grade LS</font>" + name.substring(21);                            if (name.startsWith("Top-Grade Life Stone"))                                name = "<font color=fff600>Top-Grade LS</font>" + name.substring(20);                            if (name.startsWith("Forgotten Scroll - "))                                name = "<font color=fff600>FS - </font>" + name.substring(19);                            if (name.startsWith("Greater Dye of "))                                name = "<font color=fff600>G Dye of </font>" + name.substring(15);                             droptext1.append(ta_op + item.getIcon()+ta_op2+"<td align=left width=16>" +smind+ "</td><td align=left width=260><font color=fff600>" +name+ "</font></td></tr><tr><td align=left width=16><img src=\"L2UI_CH3.QuestWndToolTipBtn\" width=16 height=16></td><td align=left width=55><font color=E15656>" +drops+ "%</font></td></tr></table></td></tr></table>" + imgsg);                        }                    }                    droptext = droptext1.toString();                    html.replace("%drops%", droptext);                    activeChar.sendPacket(html);                }                catch (Exception e)                {                    activeChar.sendMessage("Something went wrong with the drop preview.");                }            }        }        catch (Exception e)        {            activeChar.sendMessage("You cant use this option with this target.");        }        return false;    }        @Override    public String[] getBypassList()    {        return COMMANDS;    }} 
Files: actionhandlers/L2NpcActionShift.java
bypasshandlers/DropInfo.java
html/custom/ mobdrop.html
mobinfo.html
mobquest.html
mobquest.html
Any help would be good...
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Drop Panel

Post by jurchiks »

Seriously? Ctrl+F inside datapack folder...
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
slycosty
Posts: 8
Joined: Mon Feb 17, 2014 6:18 am

Re: Drop Panel

Post by slycosty »

jurchiks wrote:Seriously? Ctrl+F inside datapack folder...
Seriously I tried for 2 days now.this is what I figured so far:

Code: Select all

import com.l2jserver.gameserver.datatables.ItemTable;import com.l2jserver.gameserver.handler.IBypassHandler;[color=#FF0000]import com.l2jserver.gameserver.model.L2DropCategory;import com.l2jserver.gameserver.model.L2DropData;[/color]import com.l2jserver.gameserver.model.L2Object;[color=#FF0000]import com.l2jserver.gameserver.model.L2Object.InstanceType;[/color]import com.l2jserver.gameserver.model.actor.L2Character;import com.l2jserver.gameserver.model.actor.L2Npc;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;[color=#FF0000]import com.l2jserver.gameserver.templates.item.L2Item;[/color]import com.l2jserver.util.StringUtil;
The imports do not exist because of the revision diff I tried to add them but the result was ...
I started with 62 errors now i have 20 so is progress but I cant remake the hole gameserver
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Drop Panel

Post by jurchiks »

Ah, so you put the code you got in the right place, but the imports are the problem?
Should have said that in the first place.
Are you using Eclipse when working with l2j?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
slycosty
Posts: 8
Joined: Mon Feb 17, 2014 6:18 am

Re: Drop Panel

Post by slycosty »

jurchiks wrote:Ah, so you put the code you got in the right place, but the imports are the problem?
Should have said that in the first place.
Are you using Eclipse when working with l2j?
Yes I am using eclipse.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Drop Panel

Post by jurchiks »

Then just delete the whole import block and save the file; L2J Eclipse preferences make it automatically add all missing imports, so it should all of those that have simply changed location.
As for classes whose names have changed, you can search for the methods that are used from those classes in core.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
slycosty
Posts: 8
Joined: Mon Feb 17, 2014 6:18 am

Re: Drop Panel

Post by slycosty »

jurchiks wrote:Then just delete the whole import block and save the file; L2J Eclipse preferences make it automatically add all missing imports, so it should all of those that have simply changed location.
As for classes whose names have changed, you can search for the methods that are used from those classes in core.
]
Thx I'll try.
Hyrelius
Posts: 257
Joined: Thu Dec 16, 2010 5:16 am

Re: Drop Panel

Post by Hyrelius »

If it does not organize imports on save action automatically, do CTRL+SHIFT+O while in the class, which you removed the imports from.
Image
I don't mind helping - however: I only do so if I want to.
No support for other server packs than L2J.
Post Reply