Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 84)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -1281,6 +1281,10 @@
- + public static boolean GLOBAL_DROP;
- + public static Map<Integer, List<Integer>> DROP_LIST = new HashMap<>();
- + GLOBAL_DROP = server.getProperty("DropSystem", false);
- + String[] temp = server.getProperty("DropList", "").split(";");
- + for (String s : temp)
- + {
- + List<Integer> list = new ArrayList<>();
- + String[] t = s.split(",");
- + list.add(Integer.parseInt(t[1]));
- + list.add(Integer.parseInt(t[2]));
- + list.add(Integer.parseInt(t[3]));
- + DROP_LIST.put(Integer.parseInt(t[0]), list);
- + }
- Index: gameserver/config/server.properties
- ===================================================================
- --- gameserver/config/server.properties (revision 84)
- +++ gameserver/config/server.properties (working copy)
- @@ -1281,6 +1281,10 @@
- +# =================================================================
- +# Global Drop
- +# =================================================================
- + # Specified drop items.
- + DropSystem = True
- + # itemId,chance,min,max;itemId2,chance2,min2,max2;...
- + DropList = 3470,10,1,2
- Index: net.sf.l2j.gameserver.model.actor.instance/Monster.java
- ===================================================================
- --- net.sf.l2j.gameserver.model.actor.instance/Monster.java (revision 84)
- +++ net.sf.l2j.gameserver.model.actor.instance/Monster.java (working copy)
- @@ -1281,6 +1281,10 @@
- public void doItemDrop(NpcTemplate npcTemplate, Creature mainDamageDealer)
- {
- if (mainDamageDealer == null)
- return;
- // Don't drop anything if the last attacker or owner isn't Player
- final Player player = mainDamageDealer.getActingPlayer();
- if (player == null)
- return;
- // level modifier in %'s (will be subtracted from drop chance)
- final int levelModifier = calculateLevelModifierForDrop(player);
- CursedWeaponManager.getInstance().checkDrop(this, player);
- // now throw all categorized drops and handle spoil.
- for (DropCategory cat : npcTemplate.getDropData())
- {
- IntIntHolder item = null;
- if (cat.isSweep())
- {
- if (getSpoilState().isSpoiled())
- {
- for (DropData drop : cat.getAllDrops())
- {
- item = calculateRewardItem(drop, levelModifier, true, player);
- if (item == null)
- continue;
- getSpoilState().getSweepItems().add(item);
- }
- }
- }
- else
- {
- if (getSeedState().isSeeded())
- {
- DropData drop = cat.dropSeedAllowedDropsOnly();
- if (drop == null)
- continue;
- item = calculateRewardItem(drop, levelModifier, false, player);
- }
- else
- item = calculateCategorizedRewardItem(cat, levelModifier, player);
- if (item != null)
- {
- // Check if the autoLoot mode is active
- if ((isRaidBoss() && Config.AUTO_LOOT_RAID) || (!isRaidBoss() && Config.AUTO_LOOT))
- player.doAutoLoot(this, item);
- else
- dropItem(player, item);
- // Broadcast message if RaidBoss was defeated
- if (isRaidBoss())
- broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_DIED_DROPPED_S3_S2).addCharName(this).addItemName(item.getId()).addNumber(item.getValue()));
- }
- }
- }
- + if (Config.GLOBAL_DROP)
- + {
- + for (Entry<Integer, List<Integer>> entry : Config.DROP_LIST.entrySet())
- + {
- + int rewardItem = Rnd.get(entry.getValue().get(1), entry.getValue().get(2));
- + int dropChance = entry.getValue().get(0);
- +
- +
- + // Apply level modifier, if any/wanted.
- + if (Config.DEEPBLUE_DROP_RULES)
- + {
- + int deepBlueDrop = (levelModifier > 0) ? 3 : 1;
- +
- + // Check if we should apply our maths so deep blue mobs will not drop that easy.
- + dropChance = ((entry.getValue().get(0) - ((entry.getValue().get(0) * levelModifier) / 100)) / deepBlueDrop);
- + }
- +
- + if (Rnd.get(100) < dropChance)
- + {
- + final IntIntHolder item = new IntIntHolder(entry.getKey(), rewardItem);
- + if (Config.AUTO_LOOT)
- + player.addItem("dropCustom", item.getId(), item.getValue(), this, true);
- + else
- + dropItem(player, item);
- + }
- + }
- + }
- // Apply special item drop for champions.
- if (isChampion() && Config.CHAMPION_REWARD > 0)
- {
- int dropChance = Config.CHAMPION_REWARD;
- // Apply level modifier, if any/wanted.
- if (Config.DEEPBLUE_DROP_RULES)
- {
- int deepBlueDrop = (levelModifier > 0) ? 3 : 1;
- // Check if we should apply our maths so deep blue mobs will not drop that easy.
- dropChance = ((Config.CHAMPION_REWARD - ((Config.CHAMPION_REWARD * levelModifier) / 100)) / deepBlueDrop);
- }
- if (Rnd.get(100) < dropChance)
- {
- final IntIntHolder item = new IntIntHolder(Config.CHAMPION_REWARD_ID, Math.max(1, Rnd.get(1, Config.CHAMPION_REWARD_QTY)));
- if (Config.AUTO_LOOT)
- player.addItem("ChampionLoot", item.getId(), item.getValue(), this, true);
- else
- dropItem(player, item);
- }
- }
- // Herbs.
- if (getTemplate().getDropHerbGroup() > 0)
- {
- for (DropCategory cat : HerbDropData.getInstance().getHerbDroplist(getTemplate().getDropHerbGroup()))
- {
- final IntIntHolder item = calculateCategorizedHerbItem(cat, levelModifier);
- if (item != null)
- {
- if (Config.AUTO_LOOT_HERBS)
- player.addItem("Loot", item.getId(), 1, this, true);
- else
- {
- // If multiple similar herbs drop, split them and make a unique drop per item.
- final int count = item.getValue();
- if (count > 1)
- {
- item.setValue(1);
- for (int i = 0; i < count; i++)
- dropItem(player, item);
- }
- else
- dropItem(player, item);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement