Addition of configurable drops for bosses.
Contributed by MrNiceGuy.
This commit is contained in:
		| @@ -204,3 +204,19 @@ KarmaRateDropEquipWeapon = 10 | ||||
| PetXpRate = 1 | ||||
| PetFoodRate = 1 | ||||
| SinEaterXpRate = 1 | ||||
|  | ||||
|  | ||||
| # --------------------------------------------------------------------------- | ||||
| # Additional drops from raid bosses (except GrandBoss) | ||||
| # --------------------------------------------------------------------------- | ||||
|  | ||||
| BossDropEnable = False | ||||
| BossDropMinLevel = 40 | ||||
| BossDropMaxLevel = 999 | ||||
|  | ||||
| # The following configures the items you want to add to the drop | ||||
| # Usage: itemId1,minAmount1;maxAmount1,chance1;itemId2... | ||||
| # Default: Gold Einhasad, min: 1x, max: 2x, 100% chance of drop | ||||
| # PLEASE NOTE: Chance of drop also increases from VIP level/runes/etc. | ||||
| BossDropList = 4356,1,2,100; | ||||
|  | ||||
|   | ||||
| @@ -61,8 +61,10 @@ import org.l2jmobius.commons.util.PropertiesParser; | ||||
| import org.l2jmobius.commons.util.StringUtil; | ||||
| import org.l2jmobius.gameserver.enums.ChatType; | ||||
| import org.l2jmobius.gameserver.enums.ClassId; | ||||
| import org.l2jmobius.gameserver.enums.DropType; | ||||
| import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; | ||||
| import org.l2jmobius.gameserver.model.Location; | ||||
| import org.l2jmobius.gameserver.model.holders.DropHolder; | ||||
| import org.l2jmobius.gameserver.model.holders.ItemHolder; | ||||
| import org.l2jmobius.gameserver.model.item.type.CrystalType; | ||||
| import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect; | ||||
| @@ -753,6 +755,10 @@ public class Config | ||||
| 	public static int DROP_ITEM_MAX_LEVEL_DIFFERENCE; | ||||
| 	public static double DROP_ITEM_MIN_LEVEL_GAP_CHANCE; | ||||
| 	public static int EVENT_ITEM_MAX_LEVEL_DIFFERENCE; | ||||
| 	public static boolean BOSS_DROP_ENABLED; | ||||
| 	public static int BOSS_DROP_MIN_LEVEL; | ||||
| 	public static int BOSS_DROP_MAX_LEVEL; | ||||
| 	public static List<DropHolder> BOSS_DROP_LIST = new ArrayList<>(); | ||||
| 	public static float RATE_KARMA_LOST; | ||||
| 	public static float RATE_KARMA_EXP_LOST; | ||||
| 	public static float RATE_SIEGE_GUARDS_PRICE; | ||||
| @@ -2284,6 +2290,18 @@ public class Config | ||||
| 			DROP_ITEM_MAX_LEVEL_DIFFERENCE = ratesConfig.getInt("DropItemMaxLevelDifference", 10); | ||||
| 			DROP_ITEM_MIN_LEVEL_GAP_CHANCE = ratesConfig.getDouble("DropItemMinLevelGapChance", 10); | ||||
| 			EVENT_ITEM_MAX_LEVEL_DIFFERENCE = ratesConfig.getInt("EventItemMaxLevelDifference", 9); | ||||
| 			BOSS_DROP_ENABLED = ratesConfig.getBoolean("BossDropEnable", false); | ||||
| 			BOSS_DROP_MIN_LEVEL = ratesConfig.getInt("BossDropMinLevel", 40); | ||||
| 			BOSS_DROP_MAX_LEVEL = ratesConfig.getInt("BossDropMaxLevel", 999); | ||||
| 			BOSS_DROP_LIST.clear(); | ||||
| 			for (String s : ratesConfig.getString("BossDropList", "").trim().split(";")) | ||||
| 			{ | ||||
| 				if (s.isEmpty()) | ||||
| 				{ | ||||
| 					continue; | ||||
| 				} | ||||
| 				BOSS_DROP_LIST.add(new DropHolder(DropType.DROP, Integer.parseInt(s.split(",")[0]), Integer.parseInt(s.split(",")[1]), Integer.parseInt(s.split(",")[2]), (Double.parseDouble(s.split(",")[3])))); | ||||
| 			} | ||||
| 			 | ||||
| 			// Load PvP config file (if exists) | ||||
| 			final PropertiesParser pvpConfig = new PropertiesParser(PVP_CONFIG_FILE); | ||||
|   | ||||
| @@ -98,6 +98,8 @@ 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", 85); | ||||
| 						final String type = parseString(attrs, "type", "Folk"); | ||||
| 						Map<String, Object> parameters = null; | ||||
| 						Map<Integer, Skill> skills = null; | ||||
| 						Set<Integer> clans = null; | ||||
| @@ -106,8 +108,8 @@ public class NpcData implements IXmlReader | ||||
| 						List<DropGroupHolder> dropGroups = null; | ||||
| 						set.set("id", npcId); | ||||
| 						set.set("displayId", parseInteger(attrs, "displayId")); | ||||
| 						set.set("level", parseByte(attrs, "level")); | ||||
| 						set.set("type", parseString(attrs, "type", "Folk")); | ||||
| 						set.set("level", level); | ||||
| 						set.set("type", type); | ||||
| 						set.set("name", parseString(attrs, "name")); | ||||
| 						set.set("usingServerSideName", parseBoolean(attrs, "usingServerSideName")); | ||||
| 						set.set("title", parseString(attrs, "title")); | ||||
| @@ -674,6 +676,16 @@ public class NpcData implements IXmlReader | ||||
| 						// Clean old drop lists. | ||||
| 						template.removeDrops(); | ||||
| 						 | ||||
| 						// Add configurable item drop for bosses. | ||||
| 						if ((Config.BOSS_DROP_ENABLED) && (type.contains("RaidBoss") && (level >= Config.BOSS_DROP_MIN_LEVEL) && (level <= Config.BOSS_DROP_MAX_LEVEL))) | ||||
| 						{ | ||||
| 							if (dropLists == null) | ||||
| 							{ | ||||
| 								dropLists = new ArrayList<>(); | ||||
| 							} | ||||
| 							dropLists.addAll(Config.BOSS_DROP_LIST); | ||||
| 						} | ||||
| 						 | ||||
| 						// Set new drop lists. | ||||
| 						if (dropLists != null) | ||||
| 						{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment