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

@@ -41,11 +41,6 @@ public class Hit
addMask(AttackType.MISSED);
return;
}
else if (target.isInvul() || (shld > 0))
{
addMask(AttackType.BLOCKED);
return;
}
if (crit)
{
@@ -56,6 +51,11 @@ public class Hit
{
addMask(AttackType.SHOT_USED);
}
if (target.isInvul() || (shld > 0))
{
addMask(AttackType.BLOCKED);
}
}
private void addMask(AttackType type)

View File

@@ -1090,7 +1090,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// the hit is calculated to happen halfway to the animation - might need further tuning e.g. in bow case
final int timeToHit = timeAtk / 2;
_attackEndTime = System.currentTimeMillis() + timeAtk;
final int ssGrade = (weaponItem != null) ? weaponItem.getItemGradeSPlus().getId() : 0;
final int ssGrade = (weaponItem != null) ? weaponItem.getItemGrade().ordinal() : 0;
// Create a Server->Client packet Attack
Attack attack = new Attack(this, target, wasSSCharged, ssGrade);
@@ -2628,7 +2628,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
if (_ai == null)
{
_ai = initAI();
return _ai = initAI();
}
}
}

View File

@@ -1749,7 +1749,7 @@ public abstract class Inventory extends ItemContainer
for (L2ItemInstance item : getItems())
{
if (item.isEtcItem() && (item.getItem().getItemGradeSPlus() == bow.getItemGradeSPlus()) && (item.getEtcItem().getItemType() == EtcItemType.ARROW))
if (item.isEtcItem() && (item.getItem().getCrystalTypePlus() == bow.getCrystalTypePlus()) && (item.getEtcItem().getItemType() == EtcItemType.ARROW))
{
arrow = item;
break;
@@ -1771,7 +1771,7 @@ public abstract class Inventory extends ItemContainer
for (L2ItemInstance item : getItems())
{
if (item.isEtcItem() && (item.getItem().getItemGradeSPlus() == crossbow.getItemGradeSPlus()) && (item.getEtcItem().getItemType() == EtcItemType.BOLT))
if (item.isEtcItem() && (item.getItem().getCrystalTypePlus() == crossbow.getCrystalTypePlus()) && (item.getEtcItem().getItemType() == EtcItemType.BOLT))
{
bolt = item;
break;

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;
}

View File

@@ -80,7 +80,7 @@ public class FuncEnchant extends AbstractFunction
if (getStat() == Stats.MAGIC_ATTACK)
{
switch (item.getItem().getItemGradeSPlus())
switch (item.getItem().getCrystalTypePlus())
{
case S:
// M. Atk. increases by 4 for all weapons.
@@ -107,7 +107,7 @@ public class FuncEnchant extends AbstractFunction
if (item.isWeapon())
{
final WeaponType type = (WeaponType) item.getItemType();
switch (item.getItem().getItemGradeSPlus())
switch (item.getItem().getCrystalTypePlus())
{
case S:
if (item.getWeaponItem().getBodyPart() == L2Item.SLOT_LR_HAND)