It's not seem little nonsense on frozen this functions?
public static final int ZONE_PVP = 1;
/** The Constant ZONE_PEACE. */
public static final int ZONE_PEACE = 2;
/** The Constant ZONE_SIEGE. */
public static final int ZONE_SIEGE = 4;
/** The Constant ZONE_MOTHERTREE. */
public static final int ZONE_MOTHERTREE = 8;
/** The Constant ZONE_CLANHALL. */
public static final int ZONE_CLANHALL = 16;
/** The Constant ZONE_UNUSED. */
public static final int ZONE_UNUSED = 32;
/** The Constant ZONE_NOLANDING. */
public static final int ZONE_NOLANDING = 64;
/** The Constant ZONE_WATER. */
public static final int ZONE_WATER = 128;
/** The Constant ZONE_JAIL. */
public static final int ZONE_JAIL = 256;
public static final int ZONE_EVENT = 257;
/** The Constant ZONE_MONSTERTRACK. */
public static final int ZONE_MONSTERTRACK = 512;
/** The Constant ZONE_SWAMP. */
public static final int ZONE_SWAMP = 1024;
/** The Constant ZONE_NOSUMMONFRIEND. */
public static final int ZONE_NOSUMMONFRIEND = 2048;
/** The Constant ZONE_OLY. */
public static final int ZONE_OLY = 4096;
/** The Constant ZONE_NOHQ. */
public static final int ZONE_NOHQ = 8192;
/** The Constant ZONE_DANGERAREA. */
public static final int ZONE_DANGERAREA = 16384;
/** The Constant ZONE_NOSTORE. */
public static final int ZONE_NOSTORE = 32768;
/** The Constant ZONE_MULTIFUNCTION. */
public static final int ZONE_MULTIFUNCTION = 67229;
public static final int ZONE_GRAND = 134458;
/** The _current zones. */
private int _currentZones = 0;
/**
* Checks if is inside zone.
* @param zone the zone
* @return true, if is inside zone
*/
public boolean isInsideZone(final int zone)
{
return (_currentZones & zone) != 0;
}
/**
* Sets the inside zone.
* @param zone the zone
* @param state the state
*/
public void setInsideZone(final int zone, final boolean state)
{
if (state)
{
_currentZones |= zone;
}
else if (isInsideZone(zone))
{
_currentZones ^= zone;
}
}
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/hoodservices
https://campsite.bio/utchihaamkt
UPDATE 1:
My bad! I didn't notice that this is published in the L2OFF section. The statement below is only relevant for L2J.
(Yes, there is another, very simple, efficient, and quite elegant, way to do this.
What you need is:
- create one Config of type Boolean, lets call it MOB_DROP_ONLY_ADENA, which will act as the trigger point for this feature.
- locate the method which is responsible for parsing the drops of the monsters from XML.
- in this method, there should be a loop for each of the parsed items and there we add a simple check:
if (Config.MOB_DROP_ONLY_ADENA && item.getItemId() != 57)
{
continue;
}
And we are done.
Now, every time the server tries to parse a drop item, it will check if the ID of the item is 57 (adena) and skip it if it isnt.
You should add a further check to make sure that the NPC you are parsing the drop for is of type Monster and not of type RaidBoss or GrandBoss (or any other custom type you might have).
The easiest way is with with a lookup into the NPC/Monster Template, if there is one on your assembly of choice. What these templates do, usually, is to provide some lookup options for certain features of theirs, such as level, type, etc.)
Question
wongerlt
It's not seem little nonsense on frozen this functions?
public static final int ZONE_PVP = 1; /** The Constant ZONE_PEACE. */ public static final int ZONE_PEACE = 2; /** The Constant ZONE_SIEGE. */ public static final int ZONE_SIEGE = 4; /** The Constant ZONE_MOTHERTREE. */ public static final int ZONE_MOTHERTREE = 8; /** The Constant ZONE_CLANHALL. */ public static final int ZONE_CLANHALL = 16; /** The Constant ZONE_UNUSED. */ public static final int ZONE_UNUSED = 32; /** The Constant ZONE_NOLANDING. */ public static final int ZONE_NOLANDING = 64; /** The Constant ZONE_WATER. */ public static final int ZONE_WATER = 128; /** The Constant ZONE_JAIL. */ public static final int ZONE_JAIL = 256; public static final int ZONE_EVENT = 257; /** The Constant ZONE_MONSTERTRACK. */ public static final int ZONE_MONSTERTRACK = 512; /** The Constant ZONE_SWAMP. */ public static final int ZONE_SWAMP = 1024; /** The Constant ZONE_NOSUMMONFRIEND. */ public static final int ZONE_NOSUMMONFRIEND = 2048; /** The Constant ZONE_OLY. */ public static final int ZONE_OLY = 4096; /** The Constant ZONE_NOHQ. */ public static final int ZONE_NOHQ = 8192; /** The Constant ZONE_DANGERAREA. */ public static final int ZONE_DANGERAREA = 16384; /** The Constant ZONE_NOSTORE. */ public static final int ZONE_NOSTORE = 32768; /** The Constant ZONE_MULTIFUNCTION. */ public static final int ZONE_MULTIFUNCTION = 67229; public static final int ZONE_GRAND = 134458; /** The _current zones. */ private int _currentZones = 0; /** * Checks if is inside zone. * @param zone the zone * @return true, if is inside zone */ public boolean isInsideZone(final int zone) { return (_currentZones & zone) != 0; } /** * Sets the inside zone. * @param zone the zone * @param state the state */ public void setInsideZone(final int zone, final boolean state) { if (state) { _currentZones |= zone; } else if (isInsideZone(zone)) { _currentZones ^= zone; } }
Link to comment
Share on other sites
10 answers to this question
Recommended Posts