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

@@ -127,7 +127,7 @@ public class EnchantItemHPBonusData implements IXmlReader
*/
public final int getHPBonus(L2ItemInstance item)
{
final List<Integer> values = _armorHPBonuses.get(item.getItem().getItemGradeSPlus());
final List<Integer> values = _armorHPBonuses.get(item.getItem().getCrystalTypePlus());
if ((values == null) || values.isEmpty() || (item.getOlyEnchantLevel() <= 0))
{
return 0;

View File

@@ -0,0 +1,61 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.enums;
import com.l2jserver.gameserver.model.items.type.CrystalType;
/**
* @author UnAfraid
*/
public enum ItemGrade
{
NONE,
D,
C,
B,
A,
S,
R;
public static ItemGrade valueOf(CrystalType type)
{
switch (type)
{
case NONE:
return NONE;
case D:
return D;
case C:
return C;
case B:
return B;
case A:
return A;
case S:
case S80:
case S84:
return S;
case R:
case R95:
case R99:
return R;
}
return null;
}
}

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)

View File

@@ -227,7 +227,7 @@ public abstract class AbstractRefinePacket extends L2GameClientPacket
return false;
}
final CrystalType grade = item.getItem().getItemGrade();
final CrystalType grade = item.getItem().getCrystalType();
final LifeStone ls = _lifeStones.get(refinerItem.getId());
// Check for item id

View File

@@ -141,7 +141,7 @@ public final class RequestAutoSoulShot extends L2GameClientPacket
{
final boolean isSoulshot = (item.getEtcItem().getDefaultAction() == ActionType.SOULSHOT) || (item.getEtcItem().getDefaultAction() == ActionType.FISHINGSHOT);
final boolean isSpiritshot = item.getEtcItem().getDefaultAction() == ActionType.SPIRITSHOT;
if ((activeChar.getActiveWeaponItem() == activeChar.getFistsWeaponItem()) || (item.getItem().getCrystalType() != activeChar.getActiveWeaponItem().getItemGradeSPlus()))
if ((activeChar.getActiveWeaponItem() == activeChar.getFistsWeaponItem()) || (item.getItem().getCrystalType() != activeChar.getActiveWeaponItem().getCrystalTypePlus()))
{
activeChar.sendPacket(isSoulshot ? SystemMessageId.THE_SOULSHOT_YOU_ARE_ATTEMPTING_TO_USE_DOES_NOT_MATCH_THE_GRADE_OF_YOUR_EQUIPPED_WEAPON : SystemMessageId.YOUR_SPIRITSHOT_DOES_NOT_MATCH_THE_WEAPON_S_GRADE);
return;

View File

@@ -82,7 +82,7 @@ public final class RequestConfirmGemStone extends AbstractRefinePacket
return;
}
if (_gemStoneCount != getGemStoneCount(targetItem.getItem().getItemGrade(), ls.getGrade()))
if (_gemStoneCount != getGemStoneCount(targetItem.getItem().getCrystalType(), ls.getGrade()))
{
activeChar.sendPacket(SystemMessageId.GEMSTONE_QUANTITY_IS_INCORRECT);
return;

View File

@@ -70,7 +70,7 @@ public class RequestConfirmRefinerItem extends AbstractRefinePacket
}
final int refinerItemId = refinerItem.getItem().getId();
final CrystalType grade = targetItem.getItem().getItemGrade();
final CrystalType grade = targetItem.getItem().getCrystalType();
final LifeStone ls = getLifeStone(refinerItemId);
final int gemStoneId = getGemStoneId(grade);
final int gemStoneCount = getGemStoneCount(grade, ls.getGrade());

View File

@@ -141,7 +141,7 @@ public final class RequestCrystallizeItem extends L2GameClientPacket
// Check if the char can crystallize items and return if false;
boolean canCrystallize = true;
switch (itemToRemove.getItem().getItemGradeSPlus())
switch (itemToRemove.getItem().getCrystalTypePlus())
{
case D:
{

View File

@@ -87,7 +87,7 @@ public final class RequestRefine extends AbstractRefinePacket
final int lifeStoneLevel = ls.getLevel();
final int lifeStoneGrade = ls.getGrade();
if (_gemStoneCount != getGemStoneCount(targetItem.getItem().getItemGrade(), lifeStoneGrade))
if (_gemStoneCount != getGemStoneCount(targetItem.getItem().getCrystalType(), lifeStoneGrade))
{
activeChar.sendPacket(new ExVariationResult(0, 0, 0));
activeChar.sendPacket(SystemMessageId.AUGMENTATION_FAILED_DUE_TO_INAPPROPRIATE_CONDITIONS);

View File

@@ -120,7 +120,7 @@ public class RequestCrystallizeEstimate extends L2GameClientPacket
// Check if the char can crystallize items and return if false;
boolean canCrystallize = true;
switch (item.getItem().getItemGradeSPlus())
switch (item.getItem().getCrystalTypePlus())
{
case D:
{

View File

@@ -61,7 +61,7 @@ public class ExQuestNpcLogList extends L2GameServerPacket
writeC(_npcLogList.size());
for (NpcLogListHolder holder : _npcLogList)
{
writeD((holder.getId()));
writeD(holder.getId());
writeC(holder.isNpcString() ? 0x01 : 0x00);
writeD(holder.getCount());
}

View File

@@ -324,7 +324,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
writeC(_activeChar.getInventory().getTalismanSlots()); // Confirmed
writeC(_activeChar.getInventory().getBroochJewelSlots()); // Confirmed
writeC(_activeChar.getTeam().getId()); // Confirmed
writeC(0x00); // Red dotted ring on the floor
writeC(0x00); // (1 = Red, 2 = White, 3 = White Pink) dotted ring on the floor
writeC(0x00);
writeC(0x00);
writeC(0x00);