- Implemented Appearance Stones with engine.

- Fixed Private Stores, not showing items enchant level, attributes, appearance.
 - Fixed RelationChange packet, with reputation, for green name for normal players on login.
This commit is contained in:
erlandys56
2015-01-26 21:09:25 +00:00
parent 095d3bb620
commit eb8567590a
37 changed files with 1142 additions and 42 deletions

View File

@@ -19,6 +19,7 @@
package com.l2jserver.gameserver.model.items;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.items.type.ArmorType;
import com.l2jserver.gameserver.model.skills.Skill;
@@ -117,4 +118,10 @@ public final class L2Armor extends L2Item
}
return _enchant4Skill.getSkill();
}
@Override
public AppearanceStone getAppearanceStone()
{
return null;
}
}

View File

@@ -21,8 +21,10 @@ package com.l2jserver.gameserver.model.items;
import java.util.ArrayList;
import java.util.List;
import com.l2jserver.gameserver.data.xml.impl.AppearanceStonesData;
import com.l2jserver.gameserver.model.L2ExtractableProduct;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
import com.l2jserver.gameserver.model.items.type.EtcItemType;
import com.l2jserver.util.StringUtil;
@@ -37,6 +39,7 @@ public final class L2EtcItem extends L2Item
private final boolean _isBlessed;
private final List<L2ExtractableProduct> _extractableItems;
private final boolean _isInfinite;
private final AppearanceStone _appearanceStone;
/**
* Constructor for EtcItem.
@@ -120,6 +123,7 @@ public final class L2EtcItem extends L2Item
}
_isInfinite = set.getBoolean("is_infinite", false);
_appearanceStone = (_handler != null) && _handler.equalsIgnoreCase("ItemAppearance") ? AppearanceStonesData.getInstance().getStone(getId()) : null;
}
/**
@@ -171,4 +175,10 @@ public final class L2EtcItem extends L2Item
{
return _isInfinite;
}
@Override
public AppearanceStone getAppearanceStone()
{
return _appearanceStone;
}
}

View File

@@ -34,6 +34,7 @@ import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.model.events.ListenersContainer;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.interfaces.IIdentifiable;
@@ -963,4 +964,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
{
return null;
}
public abstract AppearanceStone getAppearanceStone();
}

View File

@@ -64,6 +64,9 @@ public class L2WarehouseItem
private final int _time;
private final int _appearanceId;
private final long _appearanceTime;
public L2WarehouseItem(L2ItemInstance item)
{
_item = item.getItem();
@@ -94,6 +97,8 @@ public class L2WarehouseItem
_elemDefAttr[i] = item.getElementDefAttr(i);
}
_enchantOptions = item.getEnchantOptions();
_appearanceId = item.getAppearanceId();
_appearanceTime = item.getAppearanceTime();
}
/**
@@ -296,4 +301,14 @@ public class L2WarehouseItem
{
return _item.toString();
}
public int getAppearanceId()
{
return _appearanceId;
}
public long getAppearanceTime()
{
return _appearanceTime;
}
}

View File

@@ -26,6 +26,7 @@ import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.conditions.ConditionGameChance;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.model.events.EventDispatcher;
import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcSkillSee;
import com.l2jserver.gameserver.model.holders.SkillHolder;
@@ -449,4 +450,10 @@ public final class L2Weapon extends L2Item
caster.sendPacket(sm);
}
}
@Override
public AppearanceStone getAppearanceStone()
{
return null;
}
}

View File

@@ -170,6 +170,9 @@ public final class L2ItemInstance extends L2Object
private final List<Options> _enchantOptions = new ArrayList<>();
private int _appearanceId = 0;
private long _appearanceTime = -1;
/**
* Constructor of the L2ItemInstance from the objectId and the itemId.
* @param objectId : int designating the ID of the object in the world
@@ -1499,8 +1502,8 @@ public final class L2ItemInstance extends L2Object
public static L2ItemInstance restoreFromDb(int ownerId, ResultSet rs)
{
L2ItemInstance inst = null;
int objectId, item_id, loc_data, enchant_level, custom_type1, custom_type2, manaLeft;
long time, count;
int objectId, item_id, loc_data, enchant_level, custom_type1, custom_type2, manaLeft, appearance_id;
long time, count, appearance_time;
ItemLocation loc;
try
{
@@ -1514,6 +1517,8 @@ public final class L2ItemInstance extends L2Object
custom_type2 = rs.getInt("custom_type2");
manaLeft = rs.getInt("mana_left");
time = rs.getLong("time");
appearance_id = rs.getInt("appearance_id");
appearance_time = rs.getLong("appearance_time");
}
catch (Exception e)
{
@@ -1540,6 +1545,8 @@ public final class L2ItemInstance extends L2Object
// Setup life time for shadow weapons
inst._mana = manaLeft;
inst._time = time;
inst._appearanceId = appearance_id;
inst._appearanceTime = appearance_time;
// load augmentation and elemental enchant
if (inst.isEquipable())
@@ -1658,7 +1665,7 @@ public final class L2ItemInstance extends L2Object
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE items SET owner_id=?,count=?,loc=?,loc_data=?,enchant_level=?,custom_type1=?,custom_type2=?,mana_left=?,time=? " + "WHERE object_id = ?"))
PreparedStatement ps = con.prepareStatement("UPDATE items SET owner_id=?,count=?,loc=?,loc_data=?,enchant_level=?,custom_type1=?,custom_type2=?,mana_left=?,time=?,appearance_id=?,appearance_time=? " + "WHERE object_id = ?"))
{
ps.setInt(1, _ownerId);
ps.setLong(2, getCount());
@@ -1669,7 +1676,9 @@ public final class L2ItemInstance extends L2Object
ps.setInt(7, getCustomType2());
ps.setInt(8, getMana());
ps.setLong(9, getTime());
ps.setInt(10, getObjectId());
ps.setInt(10, getAppearanceId());
ps.setLong(11, getAppearanceTime());
ps.setInt(12, getObjectId());
ps.executeUpdate();
_existsInDb = true;
_storedInDb = true;
@@ -2252,4 +2261,26 @@ public final class L2ItemInstance extends L2Object
_lifeTimeTask = null;
}
}
public int getAppearanceId()
{
return _appearanceId;
}
public void setAppearanceId(int appearanceId)
{
_storedInDb = false;
_appearanceId = appearanceId;
}
public long getAppearanceTime()
{
_storedInDb = false;
return _appearanceTime;
}
public void setAppearanceTime(long appearanceTime)
{
_appearanceTime = appearanceTime;
}
}