Jump to content
  • 0

Mob Drop Panel


lewnidasds

Question

Hello!

Well i want to change some things on the mob drop panel and i need your help!

Things i'd like to know so i'll try to modify:

  • Where i can find the html(i'd like to change some colors)
  • I'd like to know if its possible to show the quantity of each item(Like pride's one).And if its possible how to do it (newbie here)

Here are some pictures:

             MINE                                                                                                PRIDE(obviously)
2nuiybq.jpg     23lyz3d.png
                                                                     

Thank you very much for your time!

Edited by lewnidasds
Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

There is alot of shared customized drop panels try one of them and see where you can change them, html is hard coded inside java, small html knowledge based on table tr td you can make what ever you want :)

Link to comment
Share on other sites

  • 0

Its not rly hardcoded, npcinfo.htm from admin folder.

as far I remember it was hardcoded on hellas when I was messing with it there, maybe you talking for aCis and its changed, the truth is I don't really remember now but I think this informations are very helpfull! :)

Link to comment
Share on other sites

  • 0

Well i found the html of panel in L2NpcInstance.java.I've managed to change the colors(color idea taken from stacy doll panel cz i liked it :D )

But now how do i show the quantity?

Thank you everyone for the help! ^^

166bses.jpg

Edited by lewnidasds
Link to comment
Share on other sites

  • 0

What happens, with your current panel, if you see antharas drops ? Just wondering if your client gonna crash :troll:

Edited by Tryskell
Link to comment
Share on other sites

  • 0

What happens, with your current panel, if you see antharas drops ? Just wondering if your client gonna crash :troll:

Grand bosses haven't retail drop list.So no worries about crashing!  :D

Link to comment
Share on other sites

  • 0

but there is a protection and client is not going to crash anymore a small if statement "html is to big to display" ^^

Link to comment
Share on other sites

  • 0

Thanks for the answers everyone.

The thing i want to work now on the drop panel it the quantity(amount) of the drop list.(like the right picture i posted above)

Example:  Adena 180-250
                 Medal   1-5
And so on...

I absolutely have no idea how to code that.Thats where i need your help. ::)   :lol: 

 

Link to comment
Share on other sites

  • 0

head-src/com/l2jfrozen/gameserver/model/actor/instance/L2NpcInstance.java

 

 

TextBuilder html1 = new TextBuilder("<html><body>");
 
html1.append("<br><center><font color=\"LEVEL\">[Combat Stats]</font></center>");
html1.append("<table border=0 width=\"100%\">");
html1.append("<tr><td>Max.HP</td><td>" + (int) (getMaxHp() / getStat().calcStat(Stats.MAX_HP, 1, this, null)) + "*" + (int) getStat().calcStat(Stats.MAX_HP, 1, this, null) + "</td><td>Max.MP</td><td>" + getMaxMp() + "</td></tr>");
html1.append("<tr><td>P.Atk.</td><td>" + getPAtk(null) + "</td><td>M.Atk.</td><td>" + getMAtk(null, null) + "</td></tr>");
html1.append("<tr><td>P.Def.</td><td>" + getPDef(null) + "</td><td>M.Def.</td><td>" + getMDef(null, null) + "</td></tr>");
html1.append("<tr><td>Accuracy</td><td>" + getAccuracy() + "</td><td>Evasion</td><td>" + getEvasionRate(null) + "</td></tr>");
html1.append("<tr><td>Critical</td><td>" + getCriticalHit(null, null) + "</td><td>Speed</td><td>" + getRunSpeed() + "</td></tr>");
html1.append("<tr><td>Atk.Speed</td><td>" + getPAtkSpd() + "</td><td>Cast.Speed</td><td>" + getMAtkSpd() + "</td></tr>");
html1.append("<tr><td>Race</td><td>" + getTemplate().race + "</td><td></td><td></td></tr>");
html1.append("</table>");
 
html1.append("<br><center><font color=\"LEVEL\">[Basic Stats]</font></center>");
html1.append("<table border=0 width=\"100%\">");
html1.append("<tr><td>STR</td><td>" + getSTR() + "</td><td>DEX</td><td>" + getDEX() + "</td><td>CON</td><td>" + getCON() + "</td></tr>");
html1.append("<tr><td>INT</td><td>" + getINT() + "</td><td>WIT</td><td>" + getWIT() + "</td><td>MEN</td><td>" + getMEN() + "</td></tr>");
html1.append("</table>");
 
html1.append("<br><center><font color=\"LEVEL\">[Drop Info]</font></center>");
html1.append("Rates legend: <font color=\"ff0000\">50%+</font> <font color=\"00ff00\">30%+</font> <font color=\"0000ff\">less than 30%</font>");
html1.append("<table border=0 width=\"100%\">");
 
for (final L2DropCategory cat : getTemplate().getDropData())
{
final FastList<L2DropData> drops = cat.getAllDrops();
if (drops != null)
for (final L2DropData drop : drops)
{
if (drop == null || ItemTable.getInstance().getTemplate(drop.getItemId()) == null)
{
continue;
}
 
final String name = ItemTable.getInstance().getTemplate(drop.getItemId()).getName();
 
if (drop.getChance() >= 600000)
{
html1.append("<tr><td><font color=\"ff0000\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
}
else if (drop.getChance() >= 300000)
{
html1.append("<tr><td><font color=\"00ff00\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
}
else
{
html1.append("<tr><td><font color=\"0000ff\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
}
}
}
 
html1.append("</table>");
html1.append("</body></html>");
Edited by ~Sens
Link to comment
Share on other sites

  • 0

My post before i found the solution. :)


My thought was to set

.getMinDrop().getMaxDrop()

Right after
 

final String name = ItemTable.getInstance().getTemplate(drop.getItemId())>>>>HERE<<<<.getName();

But i got errors..So obviously i'm not doing something right there.

I'll post my l2dropdata so you can help me a bit!  ^^

 

/*
 * L2jFrozen Project - www.l2jfrozen.com 
 * 
 * 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 2, 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.model;

import java.util.Arrays;

/**
 * /* Special thanks to nuocnam Author: LittleVexy
 * @version $Revision: 1.1.4.4 $ $Date: 2005/03/29 23:15:15 $
 */
public class L2DropData
{
	public static final int MAX_CHANCE = 1000000;
	
	private int _itemId;
	private int _minDrop;
	private int _maxDrop;
	private int _chance;
	private String _questID = null;
	private String[] _stateID = null;
	
	/**
	 * Returns the ID of the item dropped
	 * @return int
	 */
	public int getItemId()
	{
		return _itemId;
	}
	
	/**
	 * Sets the ID of the item dropped
	 * @param itemId : int designating the ID of the item
	 */
	public void setItemId(final int itemId)
	{
		_itemId = itemId;
	}
	
	/**
	 * Returns the minimum quantity of items dropped
	 * @return int
	 */
	public int getMinDrop()
	{
		return _minDrop;
	}
	
	/**
	 * Returns the maximum quantity of items dropped
	 * @return int
	 */
	public int getMaxDrop()
	{
		return _maxDrop;
	}
	
	/**
	 * Returns the chance of having a drop
	 * @return int
	 */
	public int getChance()
	{
		return _chance;
	}
	
	/**
	 * Sets the value for minimal quantity of dropped items
	 * @param mindrop : int designating the quantity
	 */
	public void setMinDrop(final int mindrop)
	{
		_minDrop = mindrop;
	}
	
	/**
	 * Sets the value for maximal quantity of dopped items
	 * @param maxdrop : int designating the quantity of dropped items
	 */
	public void setMaxDrop(final int maxdrop)
	{
		_maxDrop = maxdrop;
	}
	
	/**
	 * Sets the chance of having the item for a drop
	 * @param chance : int designating the chance
	 */
	public void setChance(final int chance)
	{
		_chance = chance;
	}
	
	/**
	 * Returns the stateID.
	 * @return String[]
	 */
	public String[] getStateIDs()
	{
		return _stateID;
	}
	
	/**
	 * Adds states of the dropped item
	 * @param list : String[]
	 */
	public void addStates(final String[] list)
	{
		_stateID = list;
	}
	
	/**
	 * Returns the questID.
	 * @return String designating the ID of the quest
	 */
	public String getQuestID()
	{
		return _questID;
	}
	
	/**
	 * Sets the questID
	 * @param questID designating the questID to set.
	 */
	public void setQuestID(final String questID)
	{
		_questID = questID;
	}
	
	/**
	 * Returns if the dropped item is requested for a quest
	 * @return boolean
	 */
	public boolean isQuestDrop()
	{
		return _questID != null && _stateID != null;
	}
	
	/**
	 * Returns a report of the object
	 * @return String
	 */
	@Override
	public String toString()
	{
		String out = "ItemID: " + getItemId() + " Min: " + getMinDrop() + " Max: " + getMaxDrop() + " Chance: " + getChance() / 10000.0 + "%";
		if (isQuestDrop())
		{
			out += " QuestID: " + getQuestID() + " StateID's: " + Arrays.toString(getStateIDs());
		}
		
		return out;
	}
	
	/**
	 * Returns if parameter "o" is a L2DropData and has the same itemID that the current object
	 * @param o object to compare to the current one
	 * @return boolean
	 */
	@Override
	public boolean equals(final Object o)
	{
		if (o instanceof L2DropData)
		{
			final L2DropData drop = (L2DropData) o;
			return drop.getItemId() == getItemId();
		}
		return false;
	}
	
	@Override
	public int hashCode()
	{
		return getItemId();
	}
}

 





Solution about quantity (Leeched from PSD pack)

Now everyone who was quantity need to re-work on html.

Thanks everyone for the help!

 

{
						if (drop == null || ItemTable.getInstance().getTemplate(drop.getItemId()) == null || drop.getItemId() == 57 || drop.getItemId() == 5575)
						{
							continue;
						}
						
						String name = ItemTable.getInstance().getTemplate(drop.getItemId()).getName();
						int countmin = ItemTable.getInstance().getTemplate(drop.getMinDrop()).getItemId();
						int countmax = ItemTable.getInstance().getTemplate(drop.getMaxDrop()).getItemId();
						
						if (drop.getChance() > 700000)
						{
							html1.append("<tr><td align=\"center\"><font color=\"0066FF\">" + countmin + "-"+countmax+" "+name+"</font></td></tr>");
						}
						else if (drop.getChance() > 500000)
						{
							html1.append("<tr><td align=\"center\"><font color=\"FF99FF\">" + countmin + "-"+countmax+" "+name+"</font></td></tr>");
						}
						else if (drop.getChance() > 300000)
						{
							html1.append("<tr><td align=\"center\"><font color=\"LEVEL\">" + countmin + "-"+countmax+" "+name+"</font></td></tr>");
						}
						else if (drop.getChance() > 100000)
						{
							html1.append("<tr><td align=\"center\"><font color=\"666666\">" + countmin + "-"+countmax+" "+name+"</font></td></tr>");
						}
						else if (drop.getChance() > 10000)
						{
							html1.append("<tr><td align=\"center\"><font color=\"FF8C00\">" + countmin + "-"+countmax+" "+name+"</font></td></tr>");
						}
						else
						{
							html1.append("<tr><td align=\"center\"><font color=\"FF0000\">" + countmin + "-"+countmax+" "+name+"</font></td></tr>");
						}
Edited by lewnidasds
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock