Added latest commits for todays sync.

This commit is contained in:
mobius
2015-02-03 22:02:10 +00:00
parent fe25f74122
commit 094651541b
36 changed files with 216 additions and 67 deletions

View File

@ -26,6 +26,7 @@ import java.util.logging.Logger;
import com.l2jserver.Config;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.enums.ItemGrade;
import com.l2jserver.gameserver.model.Elementals;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.PcCondOverride;
@ -388,6 +389,14 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
return (_crystalType != CrystalType.NONE) && (_crystalCount > 0);
}
/**
* @return return General item grade (No S80, S84, R95, R99)
*/
public ItemGrade getItemGrade()
{
return ItemGrade.valueOf(_crystalType);
}
/**
* Return the type of crystal if item is crystallizable
* @return CrystalType
@ -407,30 +416,21 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
}
/**
* Returns the grade of the item.<BR>
* <BR>
* <U><I>Concept :</I></U><BR>
* In fact, this function returns the type of crystal of the item.
* @return CrystalType
*/
public final CrystalType getItemGrade()
{
return getCrystalType();
}
/**
* For grades S80 and S84 return S
* For grades S80 and S84 return S, R95, and R99 return R
* @return the grade of the item.
*/
public final CrystalType getItemGradeSPlus()
public final CrystalType getCrystalTypePlus()
{
switch (getItemGrade())
switch (_crystalType)
{
case S80:
case S84:
return CrystalType.S;
case R95:
case R99:
return CrystalType.R;
default:
return getItemGrade();
return _crystalType;
}
}

View File

@ -77,7 +77,7 @@ public class L2WarehouseItem
_enchant = item.getEnchantLevel();
_customType1 = item.getCustomType1();
_customType2 = item.getCustomType2();
_grade = item.getItem().getItemGrade();
_grade = item.getItem().getCrystalType();
if (item.isAugmented())
{
_isAugmented = true;

View File

@ -137,7 +137,7 @@ public abstract class AbstractEnchantItem
{
return false;
}
else if (_grade != itemToEnchant.getItem().getItemGradeSPlus())
else if (_grade != itemToEnchant.getItem().getCrystalTypePlus())
{
return false;
}