Advertisement
Sarada-L2

Anuncie Create Item Craft Adpt Acis 372

Oct 12th, 2021
840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. diff --git a/config/players.properties b/config/players.properties
  2. index e52d795..822111c 100644
  3. --- a/config/players.properties
  4. +++ b/config/players.properties
  5. @@ -260,4 +260,8 @@
  6. MaxBuffsAmount = 20
  7.  
  8. # Store buffs/debuffs on user logout. Default: True
  9. StoreSkillCooltime = True
  10. +
  11. +# Announce Recipe success. Use the variables %name% for Name players and %item% for items
  12. +AnnounceCrafts = HOOOOLLY!! %name% CREATED AN %item% in the region
  13. +
  14. diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
  15. index 91fc0f1..3fffd86 100644
  16. --- a/java/net/sf/l2j/Config.java
  17. +++ b/java/net/sf/l2j/Config.java
  18. @@ -366,6 +366,7 @@
  19. public static boolean DEEPBLUE_DROP_RULES;
  20. public static boolean ALT_GAME_DELEVEL;
  21. public static int DEATH_PENALTY_CHANCE;
  22. + public static String ANNOUNCE_CRAFTS;
  23.  
  24. /** Inventory & WH */
  25. public static int INVENTORY_MAXIMUM_NO_DWARF;
  26. @@ -1068,6 +1069,7 @@
  27. private static final void loadPlayers()
  28. {
  29. final ExProperties players = initProperties(PLAYERS_FILE);
  30. + ANNOUNCE_CRAFTS = players.getProperty("AnnounceCrafts", "HOOOOLLY!! %name% CREATED AN %item% in the region ");
  31. EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
  32. HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
  33. MP_REGEN_MULTIPLIER = players.getProperty("MpRegenMultiplier", 1.);
  34. diff --git a/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java b/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java
  35. index 32355de..5171740 100644
  36. --- a/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java
  37. +++ b/java/net/sf/l2j/gameserver/model/craft/RecipeItemMaker.java
  38. @@ -5,7 +5,9 @@
  39. import net.sf.l2j.commons.random.Rnd;
  40.  
  41. import net.sf.l2j.Config;
  42. +import net.sf.l2j.gameserver.data.ItemTable;
  43. import net.sf.l2j.gameserver.model.L2Skill;
  44. +import net.sf.l2j.gameserver.model.World;
  45. import net.sf.l2j.gameserver.model.actor.instance.Player;
  46. import net.sf.l2j.gameserver.model.holder.IntIntHolder;
  47. import net.sf.l2j.gameserver.model.item.Recipe;
  48. @@ -270,6 +272,14 @@
  49.  
  50. _target.getInventory().addItem("Manufacture", itemId, itemCount, _target, _player);
  51.  
  52. + if (!Config.ANNOUNCE_CRAFTS.isEmpty())
  53. + {
  54. + World.getInstance().getPlayers().forEach(players ->
  55. + {
  56. + 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()));
  57. + });
  58. + }
  59. +
  60. // inform customer of earned item
  61. if (_target != _player)
  62. {
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement