Advertisement
Guest User

craftr

a guest
Jun 29th, 2020
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java b/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java
  2. index 13a90a5..e6e37f3 100644
  3. --- a/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java
  4. +++ b/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java
  5. @@ -1,8 +1,6 @@
  6. package com.l2jhellas.gameserver.controllers;
  7.  
  8. import java.util.ArrayList;
  9. -import java.util.Arrays;
  10. -import java.util.Collection;
  11. import java.util.Collections;
  12. import java.util.List;
  13. import java.util.Map;
  14. @@ -77,15 +75,10 @@
  15.  
  16. if (recipeList == null)
  17. return;
  18. -
  19. - List<Collection<L2RecipeList>> dwarfRecipes = Arrays.asList(manufacturer.getDwarvenRecipeBook());
  20. - List<Collection<L2RecipeList>> commonRecipes = Arrays.asList(manufacturer.getCommonRecipeBook());
  21. -
  22. - if (!dwarfRecipes.contains(recipeList) && !commonRecipes.contains(recipeList))
  23. - {
  24. - Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false recipe id.", Config.DEFAULT_PUNISH);
  25. - commonRecipes = null;
  26. - dwarfRecipes = null;
  27. +
  28. + if(!manufacturer.hasRecipeList(recipeListId,recipeList.isDwarvenRecipe()))
  29. + {
  30. + Util.handleIllegalPlayerAction(player, "Warning!! Player " + player.getName() + " of account " + player.getAccountName() + " tried to set recipe which he dont have.", Config.DEFAULT_PUNISH);
  31. return;
  32. }
  33.  
  34. @@ -125,18 +118,11 @@
  35. L2RecipeList recipeList = getValidRecipeList(player, recipeListId);
  36.  
  37. if (recipeList == null)
  38. - {
  39. return;
  40. - }
  41.  
  42. - List<Collection<L2RecipeList>> dwarfRecipes = Arrays.asList(player.getDwarvenRecipeBook());
  43. - List<Collection<L2RecipeList>> commonRecipes = Arrays.asList(player.getCommonRecipeBook());
  44. -
  45. - if (!dwarfRecipes.contains(recipeList) && !commonRecipes.contains(recipeList))
  46. - {
  47. - Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false recipe id.", Config.DEFAULT_PUNISH);
  48. - dwarfRecipes = null;
  49. - commonRecipes = null;
  50. + if(!player.hasRecipeList(recipeListId,recipeList.isDwarvenRecipe()))
  51. + {
  52. + Util.handleIllegalPlayerAction(player, "Warning!! Player " + player.getName() + " of account " + player.getAccountName() + " tried to set recipe which he dont have.", Config.DEFAULT_PUNISH);
  53. return;
  54. }
  55.  
  56. @@ -420,11 +406,13 @@
  57. }
  58. else
  59. {
  60. - _player.sendMessage("Item(s) failed to create");
  61. if (_target != _player)
  62. {
  63. - _target.sendMessage("Item(s) failed to create");
  64. + _player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CREATION_OF_S2_FOR_S1_AT_S3_ADENA_FAILED).addCharName(_target).addItemName(_recipeList.getItemId()).addItemNumber(_price));
  65. + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_FAILED_TO_CREATE_S2_FOR_S3_ADENA).addCharName(_player).addItemName(_recipeList.getItemId()).addItemNumber(_price));
  66. }
  67. + else
  68. + _target.sendPacket(SystemMessageId.ITEM_MIXING_FAILED);
  69.  
  70. updateMakeInfo(false);
  71. }
  72. @@ -621,27 +609,22 @@
  73. L2ItemInstance createdItem = _target.getInventory().addItem("Manufacture", itemId, itemCount, _target, _player);
  74.  
  75. if (itemCount > 1)
  76. - {
  77. - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S);
  78. - sm.addItemName(itemId);
  79. - sm.addNumber(itemCount);
  80. - _player.sendPacket(sm);
  81. - sm = null;
  82. - }
  83. + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(itemId).addNumber(itemCount));
  84. else
  85. - {
  86. - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1);
  87. - sm.addItemName(itemId);
  88. - _player.sendPacket(sm);
  89. - sm = null;
  90. - }
  91. -
  92. + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1).addItemName(itemId));
  93. +
  94. if (_target != _player)
  95. {
  96. - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S1_ADENA);
  97. - sm.addNumber(_price);
  98. - _player.sendPacket(sm);
  99. - sm = null;
  100. + if (itemCount == 1)
  101. + {
  102. + _player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S2_CREATED_FOR_S1_FOR_S3_ADENA).addString(_target.getName()).addItemName(itemId).addItemNumber(_price));
  103. + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_CREATED_S2_FOR_S3_ADENA).addString(_player.getName()).addItemName(itemId).addItemNumber(_price));
  104. + }
  105. + else
  106. + {
  107. + _player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S2_S3_S_CREATED_FOR_S1_FOR_S4_ADENA).addString(_target.getName()).addNumber(itemCount).addItemName(itemId).addItemNumber(_price));
  108. + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_CREATED_S2_S3_S_FOR_S4_ADENA).addString(_player.getName()).addNumber(itemCount).addItemName(itemId).addItemNumber(_price));
  109. + }
  110. }
  111.  
  112. if (Config.ALT_GAME_CREATION)
  113. diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java
  114. index 16754fb..e2d3246 100644
  115. --- a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java
  116. +++ b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java
  117. @@ -1,12 +1,7 @@
  118. package com.l2jhellas.gameserver.network.clientpackets;
  119.  
  120. -import java.util.Arrays;
  121. -import java.util.Collection;
  122. -import java.util.List;
  123. -
  124. import com.l2jhellas.Config;
  125. import com.l2jhellas.gameserver.datatables.xml.RecipeData;
  126. -import com.l2jhellas.gameserver.enums.ZoneId;
  127. import com.l2jhellas.gameserver.enums.player.StoreType;
  128. import com.l2jhellas.gameserver.model.L2ManufactureItem;
  129. import com.l2jhellas.gameserver.model.L2ManufactureList;
  130. @@ -14,7 +9,6 @@
  131. import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
  132. import com.l2jhellas.gameserver.network.SystemMessageId;
  133. import com.l2jhellas.gameserver.network.serverpackets.RecipeShopMsg;
  134. -import com.l2jhellas.gameserver.taskmanager.AttackStanceTaskManager;
  135. import com.l2jhellas.util.Util;
  136.  
  137. public final class RequestRecipeShopListSet extends L2GameClientPacket
  138. @@ -56,27 +50,9 @@
  139. return;
  140. }
  141.  
  142. - if (player.isInsideZone(ZoneId.NO_STORE))
  143. - {
  144. - player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
  145. + if (!player.canOpenPrivateStore())
  146. return;
  147. - }
  148. -
  149. - if (player.isSitting() && !player.isInStoreMode())
  150. - return;
  151. -
  152. - if (player.isAlikeDead() || player.isMounted() || player.isProcessingRequest())
  153. - return;
  154.  
  155. - if (player.isInDuel() || player.isCastingNow() || AttackStanceTaskManager.getInstance().isInAttackStance(player) || player.isInOlympiadMode())
  156. - {
  157. - player.sendPacket(SystemMessageId.CANT_OPERATE_PRIVATE_STORE_DURING_COMBAT);
  158. - return;
  159. - }
  160. -
  161. - final List<Collection<L2RecipeList>> dwarfRecipes = Arrays.asList(player.getDwarvenRecipeBook());
  162. - final List<Collection<L2RecipeList>> commonRecipes = Arrays.asList(player.getCommonRecipeBook());
  163. -
  164. L2ManufactureList createList = new L2ManufactureList();
  165. createList.clear();
  166.  
  167. @@ -94,12 +70,12 @@
  168. return;
  169. }
  170.  
  171. - if (!dwarfRecipes.contains(list) && !commonRecipes.contains(list))
  172. - {
  173. + if(!player.hasRecipeList(recipeID,list.isDwarvenRecipe()))
  174. + {
  175. Util.handleIllegalPlayerAction(player, "Warning!! Player " + player.getName() + " of account " + player.getAccountName() + " tried to set recipe which he dont have.", Config.DEFAULT_PUNISH);
  176. return;
  177. }
  178. -
  179. +
  180. if (cost > 2000000000)
  181. return;
  182.  
  183. diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
  184. index 8a5c9fc..a1e457f 100644
  185. --- a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
  186. +++ b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
  187. @@ -26,8 +26,8 @@
  188. if (player == null)
  189. return;
  190.  
  191. - final L2PcInstance shop = L2World.getInstance().getPlayer(player.getName());
  192. -
  193. + final L2PcInstance shop = L2World.getInstance().getPlayer(_playerObjectId);
  194. +
  195. if (shop == null || _playerObjectId != shop.getObjectId() || shop.getPrivateStoreType() != StoreType.MANUFACTURE)
  196. return;
  197.  
  198. diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
  199. index 4a1e272..0021ed7 100644
  200. --- a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
  201. +++ b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
  202. @@ -47,18 +47,16 @@
  203. activeChar.sendMessage("Cannot make items while trading");
  204. return;
  205. }
  206. +
  207. if (manufacturer.getPrivateStoreType() != StoreType.MANUFACTURE)
  208. - {
  209. - // activeChar.sendMessage("Cannot make items while trading");
  210. return;
  211. - }
  212.  
  213. if (activeChar.isInCraftMode() || manufacturer.isInCraftMode())
  214. {
  215. activeChar.sendMessage("Currently in Craft Mode");
  216. return;
  217. }
  218. - if (manufacturer.isInDuel() || activeChar.isInDuel())
  219. + if (manufacturer.isInDuel() || activeChar.isInDuel() || manufacturer.isInCombat() || activeChar.isInCombat())
  220. {
  221. activeChar.sendPacket(SystemMessageId.CANT_OPERATE_PRIVATE_STORE_DURING_COMBAT);
  222. return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement