Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/players.properties b/config/players.properties
- index e52d795..822111c 100644
- --- a/config/players.properties
- +++ b/config/players.properties
- @@ -260,4 +260,8 @@
- MaxBuffsAmount = 20
- # Store buffs/debuffs on user logout. Default: True
- StoreSkillCooltime = True
- +
- +# Announce Recipe success. Use the variables %name% for Name players and %item% for items
- +AnnounceCrafts = HOOOOLLY!! %name% CREATED AN %item% in the region
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index 91fc0f1..3fffd86 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -366,6 +366,7 @@
- public static boolean DEEPBLUE_DROP_RULES;
- public static boolean ALT_GAME_DELEVEL;
- public static int DEATH_PENALTY_CHANCE;
- + public static String ANNOUNCE_CRAFTS;
- /** Inventory & WH */
- public static int INVENTORY_MAXIMUM_NO_DWARF;
- @@ -1068,6 +1069,7 @@
- private static final void loadPlayers()
- {
- final ExProperties players = initProperties(PLAYERS_FILE);
- + ANNOUNCE_CRAFTS = players.getProperty("AnnounceCrafts", "HOOOOLLY!! %name% CREATED AN %item% in the region ");
- EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
- HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
- MP_REGEN_MULTIPLIER = players.getProperty("MpRegenMultiplier", 1.);
- diff --git a/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java b/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java
- index 32355de..5171740 100644
- --- a/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java
- +++ b/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java
- @@ -5,7 +5,9 @@
- import net.sf.l2j.commons.random.Rnd;
- import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.data.ItemTable;
- import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.actor.instance.Player;
- import net.sf.l2j.gameserver.model.holder.IntIntHolder;
- import net.sf.l2j.gameserver.model.item.Recipe;
- @@ -270,6 +272,14 @@
- _target.getInventory().addItem("Manufacture", itemId, itemCount, _target, _player);
- + if (!Config.ANNOUNCE_CRAFTS.isEmpty())
- + {
- + World.getInstance().getPlayers().forEach(players ->
- + {
- + players.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_S2).addString(Config.ANNOUNCE_CRAFTS.replace("%name%", players.getName()).replace("%item%", ItemTable.getInstance().getTemplate(itemId).getName())).addZoneName(players.getPosition()));
- + });
- + }
- +
- // inform customer of earned item
- if (_target != _player)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement