Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java b/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java
- index 13a90a5..e6e37f3 100644
- --- a/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java
- +++ b/L2JHellasC/java/com/l2jhellas/gameserver/controllers/RecipeController.java
- @@ -1,8 +1,6 @@
- package com.l2jhellas.gameserver.controllers;
- import java.util.ArrayList;
- -import java.util.Arrays;
- -import java.util.Collection;
- import java.util.Collections;
- import java.util.List;
- import java.util.Map;
- @@ -77,15 +75,10 @@
- if (recipeList == null)
- return;
- -
- - List<Collection<L2RecipeList>> dwarfRecipes = Arrays.asList(manufacturer.getDwarvenRecipeBook());
- - List<Collection<L2RecipeList>> commonRecipes = Arrays.asList(manufacturer.getCommonRecipeBook());
- -
- - if (!dwarfRecipes.contains(recipeList) && !commonRecipes.contains(recipeList))
- - {
- - Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false recipe id.", Config.DEFAULT_PUNISH);
- - commonRecipes = null;
- - dwarfRecipes = null;
- +
- + if(!manufacturer.hasRecipeList(recipeListId,recipeList.isDwarvenRecipe()))
- + {
- + Util.handleIllegalPlayerAction(player, "Warning!! Player " + player.getName() + " of account " + player.getAccountName() + " tried to set recipe which he dont have.", Config.DEFAULT_PUNISH);
- return;
- }
- @@ -125,18 +118,11 @@
- L2RecipeList recipeList = getValidRecipeList(player, recipeListId);
- if (recipeList == null)
- - {
- return;
- - }
- - List<Collection<L2RecipeList>> dwarfRecipes = Arrays.asList(player.getDwarvenRecipeBook());
- - List<Collection<L2RecipeList>> commonRecipes = Arrays.asList(player.getCommonRecipeBook());
- -
- - if (!dwarfRecipes.contains(recipeList) && !commonRecipes.contains(recipeList))
- - {
- - Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " of account " + player.getAccountName() + " sent a false recipe id.", Config.DEFAULT_PUNISH);
- - dwarfRecipes = null;
- - commonRecipes = null;
- + if(!player.hasRecipeList(recipeListId,recipeList.isDwarvenRecipe()))
- + {
- + Util.handleIllegalPlayerAction(player, "Warning!! Player " + player.getName() + " of account " + player.getAccountName() + " tried to set recipe which he dont have.", Config.DEFAULT_PUNISH);
- return;
- }
- @@ -420,11 +406,13 @@
- }
- else
- {
- - _player.sendMessage("Item(s) failed to create");
- if (_target != _player)
- {
- - _target.sendMessage("Item(s) failed to create");
- + _player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CREATION_OF_S2_FOR_S1_AT_S3_ADENA_FAILED).addCharName(_target).addItemName(_recipeList.getItemId()).addItemNumber(_price));
- + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_FAILED_TO_CREATE_S2_FOR_S3_ADENA).addCharName(_player).addItemName(_recipeList.getItemId()).addItemNumber(_price));
- }
- + else
- + _target.sendPacket(SystemMessageId.ITEM_MIXING_FAILED);
- updateMakeInfo(false);
- }
- @@ -621,27 +609,22 @@
- L2ItemInstance createdItem = _target.getInventory().addItem("Manufacture", itemId, itemCount, _target, _player);
- if (itemCount > 1)
- - {
- - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S);
- - sm.addItemName(itemId);
- - sm.addNumber(itemCount);
- - _player.sendPacket(sm);
- - sm = null;
- - }
- + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(itemId).addNumber(itemCount));
- else
- - {
- - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1);
- - sm.addItemName(itemId);
- - _player.sendPacket(sm);
- - sm = null;
- - }
- -
- + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1).addItemName(itemId));
- +
- if (_target != _player)
- {
- - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_S1_ADENA);
- - sm.addNumber(_price);
- - _player.sendPacket(sm);
- - sm = null;
- + if (itemCount == 1)
- + {
- + _player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S2_CREATED_FOR_S1_FOR_S3_ADENA).addString(_target.getName()).addItemName(itemId).addItemNumber(_price));
- + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_CREATED_S2_FOR_S3_ADENA).addString(_player.getName()).addItemName(itemId).addItemNumber(_price));
- + }
- + else
- + {
- + _player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S2_S3_S_CREATED_FOR_S1_FOR_S4_ADENA).addString(_target.getName()).addNumber(itemCount).addItemName(itemId).addItemNumber(_price));
- + _target.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_CREATED_S2_S3_S_FOR_S4_ADENA).addString(_player.getName()).addNumber(itemCount).addItemName(itemId).addItemNumber(_price));
- + }
- }
- if (Config.ALT_GAME_CREATION)
- diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java
- index 16754fb..e2d3246 100644
- --- a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java
- +++ b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopListSet.java
- @@ -1,12 +1,7 @@
- package com.l2jhellas.gameserver.network.clientpackets;
- -import java.util.Arrays;
- -import java.util.Collection;
- -import java.util.List;
- -
- import com.l2jhellas.Config;
- import com.l2jhellas.gameserver.datatables.xml.RecipeData;
- -import com.l2jhellas.gameserver.enums.ZoneId;
- import com.l2jhellas.gameserver.enums.player.StoreType;
- import com.l2jhellas.gameserver.model.L2ManufactureItem;
- import com.l2jhellas.gameserver.model.L2ManufactureList;
- @@ -14,7 +9,6 @@
- import com.l2jhellas.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jhellas.gameserver.network.SystemMessageId;
- import com.l2jhellas.gameserver.network.serverpackets.RecipeShopMsg;
- -import com.l2jhellas.gameserver.taskmanager.AttackStanceTaskManager;
- import com.l2jhellas.util.Util;
- public final class RequestRecipeShopListSet extends L2GameClientPacket
- @@ -56,27 +50,9 @@
- return;
- }
- - if (player.isInsideZone(ZoneId.NO_STORE))
- - {
- - player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
- + if (!player.canOpenPrivateStore())
- return;
- - }
- -
- - if (player.isSitting() && !player.isInStoreMode())
- - return;
- -
- - if (player.isAlikeDead() || player.isMounted() || player.isProcessingRequest())
- - return;
- - if (player.isInDuel() || player.isCastingNow() || AttackStanceTaskManager.getInstance().isInAttackStance(player) || player.isInOlympiadMode())
- - {
- - player.sendPacket(SystemMessageId.CANT_OPERATE_PRIVATE_STORE_DURING_COMBAT);
- - return;
- - }
- -
- - final List<Collection<L2RecipeList>> dwarfRecipes = Arrays.asList(player.getDwarvenRecipeBook());
- - final List<Collection<L2RecipeList>> commonRecipes = Arrays.asList(player.getCommonRecipeBook());
- -
- L2ManufactureList createList = new L2ManufactureList();
- createList.clear();
- @@ -94,12 +70,12 @@
- return;
- }
- - if (!dwarfRecipes.contains(list) && !commonRecipes.contains(list))
- - {
- + if(!player.hasRecipeList(recipeID,list.isDwarvenRecipe()))
- + {
- Util.handleIllegalPlayerAction(player, "Warning!! Player " + player.getName() + " of account " + player.getAccountName() + " tried to set recipe which he dont have.", Config.DEFAULT_PUNISH);
- return;
- }
- -
- +
- if (cost > 2000000000)
- return;
- diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
- index 8a5c9fc..a1e457f 100644
- --- a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
- +++ b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeInfo.java
- @@ -26,8 +26,8 @@
- if (player == null)
- return;
- - final L2PcInstance shop = L2World.getInstance().getPlayer(player.getName());
- -
- + final L2PcInstance shop = L2World.getInstance().getPlayer(_playerObjectId);
- +
- if (shop == null || _playerObjectId != shop.getObjectId() || shop.getPrivateStoreType() != StoreType.MANUFACTURE)
- return;
- diff --git a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
- index 4a1e272..0021ed7 100644
- --- a/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
- +++ b/L2JHellasC/java/com/l2jhellas/gameserver/network/clientpackets/RequestRecipeShopMakeItem.java
- @@ -47,18 +47,16 @@
- activeChar.sendMessage("Cannot make items while trading");
- return;
- }
- +
- if (manufacturer.getPrivateStoreType() != StoreType.MANUFACTURE)
- - {
- - // activeChar.sendMessage("Cannot make items while trading");
- return;
- - }
- if (activeChar.isInCraftMode() || manufacturer.isInCraftMode())
- {
- activeChar.sendMessage("Currently in Craft Mode");
- return;
- }
- - if (manufacturer.isInDuel() || activeChar.isInDuel())
- + if (manufacturer.isInDuel() || activeChar.isInDuel() || manufacturer.isInCombat() || activeChar.isInCombat())
- {
- activeChar.sendPacket(SystemMessageId.CANT_OPERATE_PRIVATE_STORE_DURING_COMBAT);
- return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement