Augmentation improvements/fixes.

This commit is contained in:
MobiusDev
2016-06-13 18:08:19 +00:00
parent 24b3b00918
commit 68c58fd88e
100 changed files with 40881 additions and 171 deletions

View File

@ -41,10 +41,33 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
public static final int GRADE_HIGH = 2;
public static final int GRADE_TOP = 3;
public static final int GRADE_ACC = 4; // Accessory LS
public static final int GRADE_FORGOTTEN = 5; // Forgotten
protected static final int GEMSTONE_D = 2130;
protected static final int GEMSTONE_C = 2131;
protected static final int GEMSTONE_B = 2132;
protected static final int[] GEMSTONE_D = new int[]
{
2130
};
protected static final int[] GEMSTONE_C = new int[]
{
2131,
36719
};
protected static final int[] GEMSTONE_B = new int[]
{
2132
};
protected static final int[] GEMSTONE_A = new int[]
{
2133
};
protected static final int[] GEMSTONE_S = new int[]
{
2134
};
protected static final int[] GEMSTONE_R = new int[]
{
19440
};
private static final Map<Integer, LifeStone> _lifeStones = new HashMap<>();
@ -66,7 +89,9 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
80,
82,
84,
85
85,
95,
99
};
private final int _grade;
private final int _level;
@ -96,6 +121,8 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
static
{
// itemId, (LS grade, LS level)
_lifeStones.put(36718, new LifeStone(GRADE_NONE, 0));
_lifeStones.put(8723, new LifeStone(GRADE_NONE, 0));
_lifeStones.put(8724, new LifeStone(GRADE_NONE, 1));
_lifeStones.put(8725, new LifeStone(GRADE_NONE, 2));
@ -195,6 +222,39 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
_lifeStones.put(16166, new LifeStone(GRADE_HIGH, 13));
_lifeStones.put(16167, new LifeStone(GRADE_TOP, 13));
_lifeStones.put(16178, new LifeStone(GRADE_ACC, 13));
_lifeStones.put(18563, new LifeStone(GRADE_NONE, 13));
_lifeStones.put(18564, new LifeStone(GRADE_MID, 13));
_lifeStones.put(18565, new LifeStone(GRADE_HIGH, 13));
_lifeStones.put(18566, new LifeStone(GRADE_TOP, 13));
_lifeStones.put(18567, new LifeStone(GRADE_FORGOTTEN, 13));
_lifeStones.put(19166, new LifeStone(GRADE_ACC, 13));
_lifeStones.put(18568, new LifeStone(GRADE_NONE, 14));
_lifeStones.put(18569, new LifeStone(GRADE_MID, 14));
_lifeStones.put(18570, new LifeStone(GRADE_HIGH, 14));
_lifeStones.put(18571, new LifeStone(GRADE_TOP, 14));
_lifeStones.put(18572, new LifeStone(GRADE_FORGOTTEN, 14));
_lifeStones.put(19167, new LifeStone(GRADE_ACC, 14));
_lifeStones.put(18573, new LifeStone(GRADE_NONE, 15));
_lifeStones.put(18574, new LifeStone(GRADE_MID, 15));
_lifeStones.put(18575, new LifeStone(GRADE_HIGH, 15));
_lifeStones.put(18576, new LifeStone(GRADE_TOP, 15));
_lifeStones.put(18577, new LifeStone(GRADE_FORGOTTEN, 15));
_lifeStones.put(19168, new LifeStone(GRADE_ACC, 15));
_lifeStones.put(36731, new LifeStone(GRADE_NONE, 13));
_lifeStones.put(45929, new LifeStone(GRADE_NONE, 0));
_lifeStones.put(45930, new LifeStone(GRADE_MID, 13));
_lifeStones.put(45931, new LifeStone(GRADE_HIGH, 14));
_lifeStones.put(45932, new LifeStone(GRADE_TOP, 15));
_lifeStones.put(45933, new LifeStone(GRADE_ACC, 0));
_lifeStones.put(45934, new LifeStone(GRADE_ACC, 13));
_lifeStones.put(45935, new LifeStone(GRADE_ACC, 14));
_lifeStones.put(45936, new LifeStone(GRADE_ACC, 15));
}
protected static LifeStone getLifeStone(int itemId)
@ -232,10 +292,19 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
final LifeStone ls = _lifeStones.get(refinerItem.getId());
// Check for item id
if (getGemStoneId(grade) != gemStones.getId())
boolean gemIdFinded = false;
for (int id : getGemStoneId(grade))
{
if (gemStones.getId() == id)
{
gemIdFinded = true;
}
}
if (!gemIdFinded)
{
return false;
}
// Count must be greater or equal of required number
if (getGemStoneCount(grade, ls.getGrade()) > gemStones.getCount())
{
@ -350,9 +419,13 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
{
case INVENTORY:
case PAPERDOLL:
{
break;
}
default:
{
return false;
}
}
if (item.getItem() instanceof L2Weapon)
@ -361,9 +434,13 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
{
case NONE:
case FISHINGROD:
{
return false;
}
default:
{
break;
}
}
}
else if (item.getItem() instanceof L2Armor)
@ -374,9 +451,13 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
case L2Item.SLOT_LR_FINGER:
case L2Item.SLOT_LR_EAR:
case L2Item.SLOT_NECK:
{
break;
}
default:
{
return false;
}
}
}
else
@ -446,21 +527,35 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
* @param itemGrade
* @return GemStone itemId based on item grade
*/
protected static int getGemStoneId(CrystalType itemGrade)
protected static int[] getGemStoneId(CrystalType itemGrade)
{
switch (itemGrade)
{
case C:
case B:
return GEMSTONE_D;
case A:
case S:
return GEMSTONE_C;
case S80:
case S84:
{
return GEMSTONE_B;
}
case R:
{
return GEMSTONE_A;
}
case R95:
{
return GEMSTONE_S;
}
case R99:
{
return GEMSTONE_R;
}
default:
return 0;
{
return null;
}
}
}
@ -475,40 +570,67 @@ public abstract class AbstractRefinePacket implements IClientIncomingPacket
switch (lifeStoneGrade)
{
case GRADE_ACC:
{
switch (itemGrade)
{
case C:
return 200;
case B:
return 300;
case A:
return 200;
case S:
return 250;
case S80:
return 360;
case S84:
return 480;
default:
return 0;
}
default:
switch (itemGrade)
{
case C:
return 20;
case B:
{
return 125;
}
case R:
{
return 30;
}
case R95:
{
return 18;
}
case R99:
{
return 8;
}
default:
{
return 0;
}
}
}
default:
{
switch (itemGrade)
{
case C:
case B:
case A:
return 20;
case S:
return 25;
case S80:
case S84:
return 36;
{
return 25;
}
case R:
{
return 20;
}
case R95:
{
return 12;
}
case R99:
{
return 5;
}
default:
{
return 0;
}
}
}
}
}
}

View File

@ -76,6 +76,7 @@ public final class RequestConfirmCancelItem implements IClientIncomingPacket
switch (item.getItem().getCrystalType())
{
case C:
{
if (item.getCrystalCount() < 1720)
{
price = 95000;
@ -89,7 +90,9 @@ public final class RequestConfirmCancelItem implements IClientIncomingPacket
price = 210000;
}
break;
}
case B:
{
if (item.getCrystalCount() < 1746)
{
price = 240000;
@ -99,7 +102,9 @@ public final class RequestConfirmCancelItem implements IClientIncomingPacket
price = 270000;
}
break;
}
case A:
{
if (item.getCrystalCount() < 2160)
{
price = 330000;
@ -113,17 +118,59 @@ public final class RequestConfirmCancelItem implements IClientIncomingPacket
price = 420000;
}
break;
}
case S:
price = 480000;
{
if (item.getCrystalCount() <= 2052)
{
price = 480000;
}
else
{
price = 920000;
}
break;
}
case S80:
case S84:
price = 920000;
{
if (item.getCrystalCount() <= 4965)
{
price = 920000;
}
else if (item.getCrystalCount() <= 7050)
{
price = 2800000;
}
else if (item.getCrystalCount() <= 8233)
{
price = 2800000;
}
else
{
price = 3200000;
}
break;
// TODO: S84 TOP price 3.2M
// any other item type is not augmentable
}
case R:
{
price = 3492800;
break;
}
case R95:
{
price = 2943200;
break;
}
case R99:
{
price = 6485800;
break;
}
default:
{
return;
}
}
activeChar.sendPacket(new ExPutItemResultForVariationCancel(item, price));

View File

@ -71,9 +71,18 @@ public class RequestConfirmRefinerItem extends AbstractRefinePacket
final int refinerItemId = refinerItem.getItem().getId();
final CrystalType grade = targetItem.getItem().getCrystalType();
final LifeStone ls = getLifeStone(refinerItemId);
final int gemStoneId = getGemStoneId(grade);
final int gemStoneCount = getGemStoneCount(grade, ls.getGrade());
activeChar.sendPacket(new ExPutIntensiveResultForVariationMake(_refinerItemObjId, refinerItemId, gemStoneId, gemStoneCount));
int gemStoneId = 0;
if (getGemStoneId(grade) != null)
{
for (int id : getGemStoneId(grade))
{
if (activeChar.getInventory().getAllItemsByItemId(id) != null)
{
gemStoneId = id;
break;
}
}
}
activeChar.sendPacket(new ExPutIntensiveResultForVariationMake(_refinerItemObjId, refinerItemId, gemStoneId, getGemStoneCount(grade, ls.getGrade())));
}
}

View File

@ -131,6 +131,7 @@ public class RequestExRemoveItemAttribute implements IClientIncomingPacket
switch (item.getItem().getCrystalType())
{
case S:
{
if (item.getItem() instanceof L2Weapon)
{
_price = 50000;
@ -140,7 +141,9 @@ public class RequestExRemoveItemAttribute implements IClientIncomingPacket
_price = 40000;
}
break;
}
case S80:
{
if (item.getItem() instanceof L2Weapon)
{
_price = 100000;
@ -150,7 +153,9 @@ public class RequestExRemoveItemAttribute implements IClientIncomingPacket
_price = 80000;
}
break;
}
case S84:
{
if (item.getItem() instanceof L2Weapon)
{
_price = 200000;
@ -160,6 +165,43 @@ public class RequestExRemoveItemAttribute implements IClientIncomingPacket
_price = 160000;
}
break;
}
case R:
{
if (item.getItem() instanceof L2Weapon)
{
_price = 400000;
}
else
{
_price = 320000;
}
break;
}
case R95:
{
if (item.getItem() instanceof L2Weapon)
{
_price = 800000;
}
else
{
_price = 640000;
}
break;
}
case R99:
{
if (item.getItem() instanceof L2Weapon)
{
_price = 3200000;
}
else
{
_price = 2560000;
}
break;
}
}
return _price;

View File

@ -74,6 +74,7 @@ public final class RequestRefineCancel implements IClientIncomingPacket
switch (targetItem.getItem().getCrystalType())
{
case C:
{
if (targetItem.getCrystalCount() < 1720)
{
price = 95000;
@ -87,7 +88,9 @@ public final class RequestRefineCancel implements IClientIncomingPacket
price = 210000;
}
break;
}
case B:
{
if (targetItem.getCrystalCount() < 1746)
{
price = 240000;
@ -97,7 +100,9 @@ public final class RequestRefineCancel implements IClientIncomingPacket
price = 270000;
}
break;
}
case A:
{
if (targetItem.getCrystalCount() < 2160)
{
price = 330000;
@ -111,17 +116,39 @@ public final class RequestRefineCancel implements IClientIncomingPacket
price = 420000;
}
break;
}
case S:
{
price = 480000;
break;
}
case S80:
case S84:
{
price = 920000;
break;
}
case R:
{
price = 1560000;
break;
}
case R95:
{
price = 5400000;
break;
}
case R99:
{
price = 14160000;
break;
}
// any other item type is not augmentable
default:
{
client.sendPacket(new ExVariationCancelResult(0));
return;
}
}
// try to reduce the players adena

View File

@ -98,7 +98,8 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
packet.writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
if (containsMask(mask, ItemListType.AUGMENT_BONUS))
{
packet.writeQ(item.getAugmentationBonus());
packet.writeD(item.get1stAugmentationId());
packet.writeD(item.get2ndAugmentationId());
}
if (containsMask(mask, ItemListType.ELEMENTAL_ATTRIBUTE))
{