Configurable LCoin drop rate for monsters.

Contributed by Norvox.
This commit is contained in:
MobiusDevelopment 2021-05-26 22:19:39 +00:00
parent 98aefaf394
commit 25d9c25984
8 changed files with 114 additions and 8 deletions

View File

@ -644,8 +644,8 @@ RaidLootRightsCCSize = 45
# Specific item ids for auto pickup.
# Overrides all methods above.
# Format: itemId,itemId,itemId,....
# Default: 57
AutoLootItemIds = 57
# Default: 57,91663 (Adena,LCoin)
AutoLootItemIds = 57,91663
# Enable keyboard movement.
# Retail: True

View File

@ -209,3 +209,29 @@ SinEaterXpRate = 1
# Chance of blessing weapon.
# Default: 15.0
BlessingChance = 15.0
# ---------------------------------------------------------------------------
# LCoin Drop
# ---------------------------------------------------------------------------
# LCoin drops from mobs.
# Default: false
LCoinDropEnable = false
# LCoin drop chance from normal mobs.
# Default: 15.0
LCoinDropChance = 15.0
# LCoin drop minimum monster level.
# Default: 40
LCoinMinimumMonsterLevel = 40
# LCoin drop minimum drop quantity.
# Default: 1
LCoinMinDropQuantity = 1
# LCoin drop max drop quantity.
# Default: 5
LCoinMaxDropQuantity= 5

View File

@ -63,11 +63,20 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.GeoType;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.CustomMailManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util;
import custom.DelevelManager.DelevelManager;
import custom.FactionSystem.FactionSystem;
import custom.NoblessMaster.NoblessMaster;
import handlers.bypasshandlers.FindPvP;
import handlers.voicedcommandhandlers.Banking;
/**
* This class loads all the game server related configurations from files.<br>
* The files are usually located in config folder in server root folder.<br>
@ -743,6 +752,11 @@ public class Config
public static int DROP_ITEM_MAX_LEVEL_DIFFERENCE;
public static double DROP_ITEM_MIN_LEVEL_GAP_CHANCE;
public static double BLESSING_CHANCE;
public static boolean LCOIN_DROP_ENABLED;
public static double LCOIN_DROP_CHANCE;
public static int LCOIN_MIN_MOB_LV;
public static int LCOIN_MIN_QUANTITY;
public static int LCOIN_MAX_QUANTITY;
public static float RATE_KARMA_LOST;
public static float RATE_KARMA_EXP_LOST;
public static float RATE_SIEGE_GUARDS_PRICE;
@ -2320,6 +2334,11 @@ public class Config
DROP_ITEM_MAX_LEVEL_DIFFERENCE = RatesSettings.getInt("DropItemMaxLevelDifference", 10);
DROP_ITEM_MIN_LEVEL_GAP_CHANCE = RatesSettings.getDouble("DropItemMinLevelGapChance", 10);
BLESSING_CHANCE = RatesSettings.getDouble("BlessingChance", 15.0);
LCOIN_DROP_ENABLED = RatesSettings.getBoolean("LCoinDropEnable", false);
LCOIN_DROP_CHANCE = RatesSettings.getDouble("LCoinDropChance", 15.0);
LCOIN_MIN_MOB_LV = RatesSettings.getInt("LCoinMinimumMonsterLevel", 40);
LCOIN_MIN_QUANTITY = RatesSettings.getInt("LCoinMinDropQuantity", 1);
LCOIN_MAX_QUANTITY = RatesSettings.getInt("LCoinMaxDropQuantity", 5);
// Load PvP config file (if exists)
final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);

View File

@ -48,6 +48,7 @@ import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.effects.EffectType;
import org.l2jmobius.gameserver.model.holders.DropHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
@ -96,6 +97,7 @@ public class NpcData implements IXmlReader
NamedNodeMap attrs = listNode.getAttributes();
final StatSet set = new StatSet(new HashMap<>());
final int npcId = parseInteger(attrs, "id");
final int level = parseInteger(attrs, "level");
final String type;
Map<String, Object> parameters = null;
Map<Integer, Skill> skills = null;
@ -104,7 +106,7 @@ public class NpcData implements IXmlReader
List<DropHolder> dropLists = null;
set.set("id", npcId);
set.set("displayId", parseInteger(attrs, "displayId"));
set.set("level", parseByte(attrs, "level"));
set.set("level", level);
type = parseString(attrs, "type");
set.set("type", type);
set.set("name", parseString(attrs, "name"));
@ -633,7 +635,13 @@ public class NpcData implements IXmlReader
// Add LCoin drop for bosses.
if (type.contains("boss"))
{
dropLists.add(new DropHolder(DropType.DROP, 91663, 1, 1, 100));
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, 1, 1, 100));
}
// Add configurable LCoin drop for monsters.
if ((Config.LCOIN_DROP_ENABLED) && (type.contains("Monster") && !type.contains("boss")) && (level >= Config.LCOIN_MIN_MOB_LV))
{
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, Config.LCOIN_MIN_QUANTITY, Config.LCOIN_MAX_QUANTITY, Config.LCOIN_DROP_CHANCE));
}
for (DropHolder dropHolder : dropLists)

View File

@ -644,8 +644,8 @@ RaidLootRightsCCSize = 45
# Specific item ids for auto pickup.
# Overrides all methods above.
# Format: itemId,itemId,itemId,....
# Default: 57
AutoLootItemIds = 57
# Default: 57,91663 (Adena,LCoin)
AutoLootItemIds = 57,91663
# Enable keyboard movement.
# Retail: True

View File

@ -209,3 +209,29 @@ SinEaterXpRate = 1
# Chance of blessing weapon.
# Default: 15.0
BlessingChance = 15.0
# ---------------------------------------------------------------------------
# LCoin Drop
# ---------------------------------------------------------------------------
# LCoin drops from mobs.
# Default: false
LCoinDropEnable = false
# LCoin drop chance from normal mobs.
# Default: 15.0
LCoinDropChance = 15.0
# LCoin drop minimum monster level.
# Default: 40
LCoinMinimumMonsterLevel = 40
# LCoin drop minimum drop quantity.
# Default: 1
LCoinMinDropQuantity = 1
# LCoin drop max drop quantity.
# Default: 5
LCoinMaxDropQuantity= 5

View File

@ -63,11 +63,20 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.GeoType;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.CustomMailManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util;
import custom.DelevelManager.DelevelManager;
import custom.FactionSystem.FactionSystem;
import custom.NoblessMaster.NoblessMaster;
import handlers.bypasshandlers.FindPvP;
import handlers.voicedcommandhandlers.Banking;
/**
* This class loads all the game server related configurations from files.<br>
* The files are usually located in config folder in server root folder.<br>
@ -743,6 +752,11 @@ public class Config
public static int DROP_ITEM_MAX_LEVEL_DIFFERENCE;
public static double DROP_ITEM_MIN_LEVEL_GAP_CHANCE;
public static double BLESSING_CHANCE;
public static boolean LCOIN_DROP_ENABLED;
public static double LCOIN_DROP_CHANCE;
public static int LCOIN_MIN_MOB_LV;
public static int LCOIN_MIN_QUANTITY;
public static int LCOIN_MAX_QUANTITY;
public static float RATE_KARMA_LOST;
public static float RATE_KARMA_EXP_LOST;
public static float RATE_SIEGE_GUARDS_PRICE;
@ -2322,6 +2336,11 @@ public class Config
DROP_ITEM_MAX_LEVEL_DIFFERENCE = RatesSettings.getInt("DropItemMaxLevelDifference", 10);
DROP_ITEM_MIN_LEVEL_GAP_CHANCE = RatesSettings.getDouble("DropItemMinLevelGapChance", 10);
BLESSING_CHANCE = RatesSettings.getDouble("BlessingChance", 15.0);
LCOIN_DROP_ENABLED = RatesSettings.getBoolean("LCoinDropEnable", false);
LCOIN_DROP_CHANCE = RatesSettings.getDouble("LCoinDropChance", 15.0);
LCOIN_MIN_MOB_LV = RatesSettings.getInt("LCoinMinimumMonsterLevel", 40);
LCOIN_MIN_QUANTITY = RatesSettings.getInt("LCoinMinDropQuantity", 1);
LCOIN_MAX_QUANTITY = RatesSettings.getInt("LCoinMaxDropQuantity", 5);
// Load PvP config file (if exists)
final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);

View File

@ -48,6 +48,7 @@ import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.effects.EffectType;
import org.l2jmobius.gameserver.model.holders.DropHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.skills.Skill;
/**
@ -96,6 +97,7 @@ public class NpcData implements IXmlReader
NamedNodeMap attrs = listNode.getAttributes();
final StatSet set = new StatSet(new HashMap<>());
final int npcId = parseInteger(attrs, "id");
final int level = parseInteger(attrs, "level");
final String type;
Map<String, Object> parameters = null;
Map<Integer, Skill> skills = null;
@ -104,7 +106,7 @@ public class NpcData implements IXmlReader
List<DropHolder> dropLists = null;
set.set("id", npcId);
set.set("displayId", parseInteger(attrs, "displayId"));
set.set("level", parseByte(attrs, "level"));
set.set("level", level);
type = parseString(attrs, "type");
set.set("type", type);
set.set("name", parseString(attrs, "name"));
@ -633,7 +635,13 @@ public class NpcData implements IXmlReader
// Add LCoin drop for bosses.
if (type.contains("boss"))
{
dropLists.add(new DropHolder(DropType.DROP, 91663, 1, 1, 100));
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, 1, 1, 100));
}
// Add configurable LCoin drop for monsters.
if ((Config.LCOIN_DROP_ENABLED) && (type.contains("Monster") && !type.contains("boss")) && (level >= Config.LCOIN_MIN_MOB_LV))
{
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, Config.LCOIN_MIN_QUANTITY, Config.LCOIN_MAX_QUANTITY, Config.LCOIN_DROP_CHANCE));
}
for (DropHolder dropHolder : dropLists)