Infinite Odyssey life stones.
This commit is contained in:
@ -40,11 +40,33 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
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_A = 2133;
|
||||
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<>();
|
||||
|
||||
@ -98,6 +120,8 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
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));
|
||||
@ -202,19 +226,34 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
_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 final LifeStone getLifeStone(int itemId)
|
||||
@ -252,10 +291,19 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
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())
|
||||
{
|
||||
@ -478,34 +526,34 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
* @param itemGrade
|
||||
* @return GemStone itemId based on item grade
|
||||
*/
|
||||
protected static final int getGemStoneId(CrystalType itemGrade)
|
||||
protected static final 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:
|
||||
case R95:
|
||||
case R99:
|
||||
{
|
||||
return GEMSTONE_A;
|
||||
}
|
||||
case R95:
|
||||
{
|
||||
return GEMSTONE_S;
|
||||
}
|
||||
case R99:
|
||||
{
|
||||
return GEMSTONE_R;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 0;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -525,40 +573,25 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
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;
|
||||
return 125;
|
||||
}
|
||||
case R:
|
||||
{
|
||||
return 540;
|
||||
return 30;
|
||||
}
|
||||
case R95:
|
||||
{
|
||||
return 620;
|
||||
return 18;
|
||||
}
|
||||
case R99:
|
||||
{
|
||||
return 700;
|
||||
return 8;
|
||||
}
|
||||
default:
|
||||
{
|
||||
@ -571,37 +604,25 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
|
||||
switch (itemGrade)
|
||||
{
|
||||
case C:
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
case B:
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
case A:
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
case S:
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
case S80:
|
||||
case S84:
|
||||
{
|
||||
return 36;
|
||||
return 25;
|
||||
}
|
||||
case R:
|
||||
{
|
||||
return 55;
|
||||
return 20;
|
||||
}
|
||||
case R95:
|
||||
{
|
||||
return 70;
|
||||
return 12;
|
||||
}
|
||||
case R99:
|
||||
{
|
||||
return 95;
|
||||
return 5;
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
@ -119,28 +119,50 @@ public final class RequestConfirmCancelItem extends L2GameClientPacket
|
||||
}
|
||||
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;
|
||||
}
|
||||
case R:
|
||||
{
|
||||
price = 1840000;
|
||||
price = 3492800;
|
||||
break;
|
||||
}
|
||||
case R95:
|
||||
{
|
||||
price = 3680000;
|
||||
price = 2943200;
|
||||
break;
|
||||
}
|
||||
case R99:
|
||||
{
|
||||
price = 7360000;
|
||||
price = 6485800;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -70,10 +70,19 @@ 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())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user