New artifact enchant system adjustments and related cleanups.
Contributed by Fakee.
This commit is contained in:
@ -31,9 +31,8 @@ import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* @author Bonux (bonuxq@gmail.com)
|
||||
* @date 09.09.2019
|
||||
**/
|
||||
* @author Bonux
|
||||
*/
|
||||
public class RequestExTryEnchantArtifact implements ClientPacket
|
||||
{
|
||||
private static final int[] ENCHANT_CHANCES =
|
||||
@ -124,21 +123,21 @@ public class RequestExTryEnchantArtifact implements ClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
int minIngridientEnchant = -1;
|
||||
int ingredientEnchant = -1;
|
||||
if (enchantLevel <= 3)
|
||||
{
|
||||
minIngridientEnchant = 0;
|
||||
ingredientEnchant = 0;
|
||||
}
|
||||
else if (enchantLevel <= 6)
|
||||
{
|
||||
minIngridientEnchant = 1;
|
||||
ingredientEnchant = 1;
|
||||
}
|
||||
else if (enchantLevel <= 9)
|
||||
{
|
||||
minIngridientEnchant = 3;
|
||||
ingredientEnchant = 3;
|
||||
}
|
||||
|
||||
if (minIngridientEnchant == -1)
|
||||
if (ingredientEnchant == -1)
|
||||
{
|
||||
player.sendPacket(ExTryEnchantArtifactResult.ERROR_PACKET);
|
||||
return;
|
||||
@ -146,13 +145,13 @@ public class RequestExTryEnchantArtifact implements ClientPacket
|
||||
|
||||
for (int objectId : _ingredients)
|
||||
{
|
||||
final Item ingridient = player.getInventory().getItemByObjectId(objectId);
|
||||
if ((ingridient == null) || (ingridient.getEnchantLevel() < minIngridientEnchant) || (ingridient.getTemplate().getArtifactSlot() != artifactSlot))
|
||||
final Item ingredient = player.getInventory().getItemByObjectId(objectId);
|
||||
if ((ingredient == null) || (ingredient.getEnchantLevel() < ingredientEnchant) || (ingredient.getEnchantLevel() > ingredientEnchant) || (ingredient.getTemplate().getArtifactSlot() != artifactSlot))
|
||||
{
|
||||
player.sendPacket(ExTryEnchantArtifactResult.ERROR_PACKET);
|
||||
return;
|
||||
}
|
||||
player.destroyItem("Artifact", ingridient, 1, player, true);
|
||||
player.destroyItem("Artifact", ingredient, 1, player, true);
|
||||
}
|
||||
|
||||
if (Rnd.get(100) < chance)
|
||||
|
@ -23,8 +23,7 @@ import org.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeMissionIn
|
||||
import org.l2jmobius.gameserver.network.serverpackets.pledgeV2.ExPledgeMissionRewardCount;
|
||||
|
||||
/**
|
||||
* @author Bonux (bonuxq@gmail.com)
|
||||
* @date 29.09.2019
|
||||
* @author Bonux
|
||||
*/
|
||||
public class RequestExPledgeMissionInfo implements ClientPacket
|
||||
{
|
||||
|
@ -19,9 +19,8 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
||||
import org.l2jmobius.gameserver.network.ServerPackets;
|
||||
|
||||
/**
|
||||
* @author Bonux (bonuxq@gmail.com)
|
||||
* @date 09.09.2019
|
||||
**/
|
||||
* @author Bonux
|
||||
*/
|
||||
public class ExTryEnchantArtifactResult extends ServerPacket
|
||||
{
|
||||
public static final int SUCCESS = 0;
|
||||
|
@ -22,9 +22,8 @@ import org.l2jmobius.gameserver.network.ServerPackets;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ServerPacket;
|
||||
|
||||
/**
|
||||
* @author Bonux (bonuxq@gmail.com), NasSeKa
|
||||
* @date 29.09.2019
|
||||
**/
|
||||
* @author Bonux, NasSeKa
|
||||
*/
|
||||
public class ExPledgeMissionRewardCount extends ServerPacket
|
||||
{
|
||||
private final int _doneMissionsCount;
|
||||
|
Reference in New Issue
Block a user