Configs for augmented item trade and destroy actions.

This commit is contained in:
MobiusDev
2019-02-06 04:55:20 +00:00
parent c2905c5851
commit 35e51e1fb4
54 changed files with 347 additions and 167 deletions

View File

@ -957,6 +957,8 @@ public final class Config
public static boolean RETAIL_LIKE_AUGMENTATION_ACCESSORY;
public static int[] AUGMENTATION_BLACKLIST;
public static boolean ALT_ALLOW_AUGMENT_PVP_ITEMS;
public static boolean ALT_ALLOW_AUGMENT_TRADE;
public static boolean ALT_ALLOW_AUGMENT_DESTROY;
public static double HP_REGEN_MULTIPLIER;
public static double MP_REGEN_MULTIPLIER;
public static double CP_REGEN_MULTIPLIER;
@ -1846,6 +1848,8 @@ public final class Config
Arrays.sort(AUGMENTATION_BLACKLIST);
ALT_ALLOW_AUGMENT_PVP_ITEMS = Character.getBoolean("AltAllowAugmentPvPItems", false);
ALT_ALLOW_AUGMENT_TRADE = Character.getBoolean("AltAllowAugmentTrade", false);
ALT_ALLOW_AUGMENT_DESTROY = Character.getBoolean("AltAllowAugmentDestroy", true);
ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Character.getBoolean("AltKarmaPlayerCanBeKilledInPeaceZone", false);
ALT_GAME_KARMA_PLAYER_CAN_SHOP = Character.getBoolean("AltKarmaPlayerCanShop", true);
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Character.getBoolean("AltKarmaPlayerCanTeleport", true);

View File

@ -744,6 +744,10 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isDropable()
{
if (Config.ALT_ALLOW_AUGMENT_TRADE && isAugmented())
{
return true;
}
return !isAugmented() && _item.isDropable();
}
@ -753,6 +757,10 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isDestroyable()
{
if (!Config.ALT_ALLOW_AUGMENT_DESTROY && isAugmented())
{
return false;
}
return _item.isDestroyable();
}
@ -762,6 +770,10 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isTradeable()
{
if (Config.ALT_ALLOW_AUGMENT_TRADE && isAugmented())
{
return true;
}
return !isAugmented() && _item.isTradeable();
}
@ -771,6 +783,10 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isSellable()
{
if (Config.ALT_ALLOW_AUGMENT_TRADE && isAugmented())
{
return true;
}
return !isAugmented() && _item.isSellable();
}

View File

@ -95,17 +95,12 @@ public final class RequestCrystallizeItem implements IClientIncomingPacket
if (inventory != null)
{
final L2ItemInstance item = inventory.getItemByObjectId(_objectId);
if (item == null)
if ((item == null) || item.isHeroItem() || (!Config.ALT_ALLOW_AUGMENT_DESTROY && item.isAugmented()))
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
if (item.isHeroItem())
{
return;
}
if (_count > item.getCount())
{
_count = activeChar.getInventory().getItemByObjectId(_objectId).getCount();