Adapting Appearance Stone system from L2jServer.

This commit is contained in:
mobius 2015-02-25 17:57:47 +00:00
parent a3c6227823
commit 7068b969e5
41 changed files with 2830 additions and 717 deletions

View File

@ -1,52 +1,492 @@
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/AppearanceStones.xsd">
<!-- Weapon Appearance Stones -->
<!-- Normal -->
<stone id="22402" targetType="WEAPON" type="NORMAL" grades="R;R95;R99" cost="800000" /> <!-- Weapon Appearance Stone (R-grade) -->
<stone id="22403" targetType="WEAPON" type="NORMAL" grades="S;S80" cost="800000" /> <!-- Weapon Appearance Stone (S-grade) -->
<stone id="22404" targetType="WEAPON" type="NORMAL" grades="A" cost="800000" /> <!-- Weapon Appearance Stone (A-grade) -->
<stone id="22405" targetType="WEAPON" type="NORMAL" grades="B" cost="800000" /> <!-- Weapon Appearance Stone (B-grade) -->
<stone id="22406" targetType="WEAPON" type="NORMAL" grades="C" cost="800000" /> <!-- Weapon Appearance Stone (C-grade) -->
<stone id="22407" targetType="WEAPON" type="NORMAL" grades="D" cost="800000" /> <!-- Weapon Appearance Stone (D-grade) -->
<appearance_stone id="22402" targetType="WEAPON" type="NORMAL" cost="800000"><!-- Weapon Appearance Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
</appearance_stone>
<appearance_stone id="22403" targetType="WEAPON" type="NORMAL" cost="800000"> <!-- Weapon Appearance Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
</appearance_stone>
<appearance_stone id="22404" targetType="WEAPON" type="NORMAL" grade="A" cost="800000" /> <!-- Weapon Appearance Stone (A-grade) -->
<appearance_stone id="22405" targetType="WEAPON" type="NORMAL" grade="B" cost="800000" /> <!-- Weapon Appearance Stone (B-grade) -->
<appearance_stone id="22406" targetType="WEAPON" type="NORMAL" grade="C" cost="800000" /> <!-- Weapon Appearance Stone (C-grade) -->
<appearance_stone id="22407" targetType="WEAPON" type="NORMAL" grade="D" cost="800000" /> <!-- Weapon Appearance Stone (D-grade) -->
<!-- Blessed -->
<stone id="22408" targetType="WEAPON" type="BLESSED" grades="R;R95;R99" cost="800000" /> <!-- Blessed Weapon Appearance Stone (R-grade) -->
<stone id="22409" targetType="WEAPON" type="BLESSED" grades="S;S80" cost="800000" /> <!-- Blessed Weapon Appearance Stone (S-grade) -->
<stone id="22410" targetType="WEAPON" type="BLESSED" grades="A" cost="800000" /> <!-- Blessed Weapon Appearance Stone (A-grade) -->
<stone id="22411" targetType="WEAPON" type="BLESSED" grades="B" cost="800000" /> <!-- Blessed Weapon Appearance Stone (B-grade) -->
<stone id="22412" targetType="WEAPON" type="BLESSED" grades="C" cost="800000" /> <!-- Blessed Weapon Appearance Stone (C-grade) -->
<stone id="22413" targetType="WEAPON" type="BLESSED" grades="D" cost="800000" /> <!-- Blessed Weapon Appearance Stone (D-grade) -->
<!--Blessed -->
<appearance_stone id="22408" targetType="WEAPON" type="BLESSED"> <!-- Blessed Weapon Appearance Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
</appearance_stone>
<appearance_stone id="22409" targetType="WEAPON" type="BLESSED"> <!-- Blessed Weapon Appearance Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
</appearance_stone>
<appearance_stone id="22410" targetType="WEAPON" type="BLESSED" grade="A" /> <!-- Blessed Weapon Appearance Stone (A-grade) -->
<appearance_stone id="22411" targetType="WEAPON" type="BLESSED" grade="B" /> <!-- Blessed Weapon Appearance Stone (B-grade) -->
<appearance_stone id="22412" targetType="WEAPON" type="BLESSED" grade="C" /> <!-- Blessed Weapon Appearance Stone (C-grade) -->
<appearance_stone id="22413" targetType="WEAPON" type="BLESSED" grade="D" /> <!-- Blessed Weapon Appearance Stone (D-grade) -->
<!-- Restore -->
<stone id="22414" targetType="WEAPON" type="RESTORE" grades="R;R95;R99" cost="800000" /> <!-- Weapon Restoration Stone (R-grade) -->
<stone id="22415" targetType="WEAPON" type="RESTORE" grades="S;S80" cost="800000" /> <!-- Weapon Restoration Stone (S-grade) -->
<stone id="22416" targetType="WEAPON" type="RESTORE" grades="A" cost="800000" /> <!-- Weapon Restoration Stone (A-grade) -->
<stone id="22417" targetType="WEAPON" type="RESTORE" grades="B" cost="800000" /> <!-- Weapon Restoration Stone (B-grade) -->
<stone id="22418" targetType="WEAPON" type="RESTORE" grades="C" cost="800000" /> <!-- Weapon Restoration Stone (C-grade) -->
<stone id="22419" targetType="WEAPON" type="RESTORE" grades="D" cost="800000" /> <!-- Weapon Restoration Stone (D-grade) -->
<!--Restore -->
<appearance_stone id="22414" targetType="WEAPON" type="RESTORE"> <!-- Weapon Restoration Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
</appearance_stone>
<appearance_stone id="22415" targetType="WEAPON" type="RESTORE"> <!-- Weapon Restoration Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
</appearance_stone>
<appearance_stone id="22416" targetType="WEAPON" type="RESTORE" grade="A" /> <!-- Weapon Restoration Stone (A-grade) -->
<appearance_stone id="22417" targetType="WEAPON" type="RESTORE" grade="B" /> <!-- Weapon Restoration Stone (B-grade) -->
<appearance_stone id="22418" targetType="WEAPON" type="RESTORE" grade="C" /> <!-- Weapon Restoration Stone (C-grade) -->
<appearance_stone id="22419" targetType="WEAPON" type="RESTORE" grade="D" /> <!-- Weapon Restoration Stone (D-grade) -->
<!-- Armor Appearance Stones -->
<!-- Normal -->
<stone id="22682" targetType="ARMOR" type="NORMAL" grades="R;R95;R99" cost="125000" /> <!-- Armor Appearance Stone (R-grade) -->
<stone id="22683" targetType="ARMOR" type="NORMAL" grades="S;S80" cost="125000" /> <!-- Armor Appearance Stone (S-grade) -->
<stone id="22684" targetType="ARMOR" type="NORMAL" grades="A" cost="125000" /> <!-- Armor Appearance Stone (A-grade) -->
<stone id="22685" targetType="ARMOR" type="NORMAL" grades="B" cost="125000" /> <!-- Armor Appearance Stone (B-grade) -->
<stone id="22686" targetType="ARMOR" type="NORMAL" grades="C" cost="125000" /> <!-- Armor Appearance Stone (C-grade) -->
<stone id="22687" targetType="ARMOR" type="NORMAL" grades="D" cost="125000" /> <!-- Armor Appearance Stone (D-grade) -->
<!--Fixed -->
<appearance_stone id="22666" targetType="WEAPON" type="FIXED" visualId="22650" weaponType="SWORD" /> <!-- Emerald Weapon Appearance Stone: Sword -->
<appearance_stone id="22727" targetType="WEAPON" type="FIXED" visualId="22711" weaponType="SWORD" /> <!-- Japanese Sword Appearance Stone -->
<appearance_stone id="36648" targetType="WEAPON" type="FIXED" visualId="22361" weaponType="SWORD" /> <!-- Emerald One-Handed Sword Appearance Stone -->
<appearance_stone id="23929" targetType="WEAPON" type="FIXED" visualId="23913" weaponType="SWORD" lifeTime="7days" /> <!-- Tears One-Handed Sword Appearance Stone (7 days ) -->
<appearance_stone id="37833" targetType="WEAPON" type="FIXED" visualId="37689" weaponType="SWORD" lifeTime="15days" /> <!-- Valentine Appearance Stone: One-handed Sword (15 days ) -->
<appearance_stone id="37849" targetType="WEAPON" type="FIXED" visualId="37689" weaponType="SWORD" lifeTime="30days" /> <!-- Valentine Appearance Stone: One-handed Sword (30 days ) -->
<appearance_stone id="37908" targetType="WEAPON" type="FIXED" visualId="37945" weaponType="SWORD" /> <!-- Chrono Cithara Appearance Stone: One-handed Sword //TODO: Needs verification -->
<appearance_stone id="37920" targetType="WEAPON" type="FIXED" visualId="37945" weaponType="SWORD" lifeTime="15days" /> <!-- Chrono Cithara Appearance Stone: One-handed Sword (15 days ) //TODO: Needs verification -->
<appearance_stone id="37919" targetType="WEAPON" type="FIXED" visualId="10167" weaponType="SWORD" lifeTime="15days" /> <!-- Pig Lollipop Appearance Stone: One-handed Sword (15 days ) -->
<appearance_stone id="38189" targetType="WEAPON" type="FIXED" visualId="38211" weaponType="SWORD" lifeTime="30days" /> <!-- Blue Mackerel Appearance Stone: One-handed Sword (30 days ) -->
<appearance_stone id="38200" targetType="WEAPON" type="FIXED" visualId="38211" weaponType="SWORD" /> <!-- Blue Mackerel Appearance Stone: One-handed Sword -->
<!-- Blessed -->
<stone id="22688" targetType="ARMOR" type="BLESSED" grades="R;R95;R99" /> <!-- Blessed Armor Appearance Stone (R-grade) -->
<stone id="22689" targetType="ARMOR" type="BLESSED" grades="S;S80" /> <!--Blessed Armor Appearance Stone (S-grade) -->
<stone id="22690" targetType="ARMOR" type="BLESSED" grades="A" /> <!-- Blessed Armor Appearance Stone (A-grade) -->
<stone id="22691" targetType="ARMOR" type="BLESSED" grades="B" /> <!-- Blessed Armor Appearance Stone (B-grade) -->
<stone id="22692" targetType="ARMOR" type="BLESSED" grades="C" /> <!-- Blessed Armor Appearance Stone (C-grade) -->
<stone id="22693" targetType="ARMOR" type="BLESSED" grades="D" /> <!-- Blessed Armor Appearance Stone (D-grade) -->
<appearance_stone id="22668" targetType="WEAPON" type="FIXED" visualId="22652" weaponType="SWORD" handType="TWO_HANDED" /> <!-- Emerald Weapon Appearance Stone: Two-handed Sword -->
<appearance_stone id="22729" targetType="WEAPON" type="FIXED" visualId="22713" weaponType="SWORD" handType="TWO_HANDED" /> <!-- Japanese Long Sword Appearance Stone -->
<appearance_stone id="23931" targetType="WEAPON" type="FIXED" visualId="23915" weaponType="SWORD" handType="TWO_HANDED" /> <!-- Tears Two-handed Sword Appearance Stone -->
<appearance_stone id="37418" targetType="WEAPON" type="FIXED" visualId="22652" weaponType="SWORD" handType="TWO_HANDED" /> <!-- Emerald Weapon Appearance Stone: Two-handed Sword -->
<appearance_stone id="36650" targetType="WEAPON" type="FIXED" visualId="22652" weaponType="SWORD" handType="TWO_HANDED" lifeTime="7days" /> <!-- Emerald Weapon Appearance Stone: Two-handed Sword ( 7 days ) -->
<appearance_stone id="37402" targetType="WEAPON" type="FIXED" visualId="22652" weaponType="SWORD" handType="TWO_HANDED" lifeTime="15days" /> <!-- Emerald Weapon Appearance Stone: Two-handed Sword ( 15 days ) -->
<appearance_stone id="37834" targetType="WEAPON" type="FIXED" visualId="37690" weaponType="SWORD" handType="TWO_HANDED" lifeTime="15days" /> <!-- Valentine Appearance Stone: Two-handed Sword ( 15 days ) -->
<appearance_stone id="37850" targetType="WEAPON" type="FIXED" visualId="37690" weaponType="SWORD" handType="TWO_HANDED" lifeTime="30days" /> <!-- Valentine Appearance Stone: Two-handed Sword ( 30 days ) -->
<appearance_stone id="38191" targetType="WEAPON" type="FIXED" visualId="38213" weaponType="SWORD" handType="TWO_HANDED" lifeTime="30days" /> <!-- Shark Appearance Stone: Two-handed Sword ( 30 days ) -->
<appearance_stone id="38202" targetType="WEAPON" type="FIXED" visualId="38213" weaponType="SWORD" handType="TWO_HANDED" /> <!-- Shark Appearance Stone: Two-handed Sword -->
<!-- Restore -->
<stone id="22694" targetType="ARMOR" type="RESTORE" grades="R;R95;R99" /> <!-- Armor Restoration Stone (R-grade) -->
<stone id="22695" targetType="ARMOR" type="RESTORE" grades="S;S80" /> <!-- Armor Restoration Stone (S-grade) -->
<stone id="22696" targetType="ARMOR" type="RESTORE" grades="A" /> <!-- Armor Restoration Stone (A-grade) -->
<stone id="22697" targetType="ARMOR" type="RESTORE" grades="B" /> <!-- Armor Restoration Stone (B-grade) -->
<stone id="22698" targetType="ARMOR" type="RESTORE" grades="C" /> <!-- Armor Restoration Stone (C-grade) -->
<stone id="22699" targetType="ARMOR" type="RESTORE" grades="D" /> <!-- Armor Restoration Stone (D-grade) -->
</list>
<appearance_stone id="22667" targetType="WEAPON" type="FIXED" visualId="22651" weaponType="DAGGER" /> <!-- Emerald Weapon Appearance Stone: Dagger -->
<appearance_stone id="22728" targetType="WEAPON" type="FIXED" visualId="22712" weaponType="DAGGER" /> <!-- Japanese Dagger Appearance Stone -->
<appearance_stone id="23215" targetType="WEAPON" type="FIXED" visualId="22821" weaponType="DAGGER" /> <!-- Steregos' Dagger Appearance Stone -->
<appearance_stone id="23930" targetType="WEAPON" type="FIXED" visualId="23914" weaponType="DAGGER" /> <!-- Tears Dagger Appearance Stone -->
<appearance_stone id="37417" targetType="WEAPON" type="FIXED" visualId="36633" weaponType="DAGGER" /> <!-- Emerald Weapon Appearance Stone: Dagger -->
<appearance_stone id="36649" targetType="WEAPON" type="FIXED" visualId="36633" weaponType="DAGGER" lifeTime="7days" /> <!-- Emerald Weapon Appearance Stone: Dagger ( 7 days ) -->
<appearance_stone id="37401" targetType="WEAPON" type="FIXED" visualId="36633" weaponType="DAGGER" lifeTime="15days" /> <!-- Emerald Weapon Appearance Stone: Dagger ( 15 days ) -->
<appearance_stone id="37075" targetType="WEAPON" type="FIXED" visualId="37055" weaponType="DAGGER" /> <!-- Monster Weapon Appearance Stone: Drakos' Dagger -->
<appearance_stone id="37832" targetType="WEAPON" type="FIXED" visualId="37688" weaponType="DAGGER" lifeTime="15days" /> <!-- Valentine Appearance Stone: Dagger ( 15 days ) -->
<appearance_stone id="37848" targetType="WEAPON" type="FIXED" visualId="37688" weaponType="DAGGER" lifeTime="30days" /> <!-- Valentine Appearance Stone: Dagger ( 30 days ) -->
<appearance_stone id="37913" targetType="WEAPON" type="FIXED" visualId="37916" weaponType="DAGGER" /> <!-- Pumpkin Dagger Appearance Stone: Dagger -->
<appearance_stone id="38176" targetType="WEAPON" type="FIXED" visualId="14296" weaponType="DAGGER" /> <!-- Crystal Dagger Appearance Stone -->
<appearance_stone id="38190" targetType="WEAPON" type="FIXED" visualId="14296" weaponType="DAGGER" lifeTime="30days" /> <!-- Trumpetfish Appearance Stone: Dagger ( 30 days ) -->
<appearance_stone id="38201" targetType="WEAPON" type="FIXED" visualId="38212" weaponType="DAGGER" /> <!-- Trumpetfish Appearance Stone: Dagger -->
<appearance_stone id="22677" targetType="WEAPON" type="FIXED" visualId="22362" weaponType="DUAL" /> <!-- Emerald Weapon Appearance Stone: Dualsword -->
<appearance_stone id="36659" targetType="WEAPON" type="FIXED" visualId="22362" weaponType="DUAL" lifeTime="7days" /> <!-- Emerald Dualsword Appearance Stone ( 7 days ) -->
<appearance_stone id="37411" targetType="WEAPON" type="FIXED" visualId="22362" weaponType="DUAL" lifeTime="15days" /> <!-- Emerald Dualsword Appearance Stone ( 15 days ) -->
<appearance_stone id="22738" targetType="WEAPON" type="FIXED" visualId="22722" weaponType="DUAL" /> <!-- Japanese Dualsword Appearance Stone -->
<appearance_stone id="23940" targetType="WEAPON" type="FIXED" visualId="23924" weaponType="DUAL" /> <!-- Tears Dualsword Appearance Stone -->
<appearance_stone id="37070" targetType="WEAPON" type="FIXED" visualId="37050" weaponType="DUAL" /> <!-- Monster Weapon Appearance Stone: Tegaffe's Dualsword -->
<appearance_stone id="37843" targetType="WEAPON" type="FIXED" visualId="37699" weaponType="DUAL" lifeTime="15days" /> <!-- Valentine Appearance Stone: Dualsword ( 15 days ) -->
<appearance_stone id="37859" targetType="WEAPON" type="FIXED" visualId="37699" weaponType="DUAL" lifeTime="30days" /> <!-- Valentine Appearance Stone: Dualsword ( 30 days ) -->
<appearance_stone id="37924" targetType="WEAPON" type="FIXED" visualId="37949" weaponType="DUAL" lifeTime="15days" /> <!-- Chrono Maracas Appearance Stone: Dualsword ( 15 days ) //TODO: Needs verification -->
<appearance_stone id="37912" targetType="WEAPON" type="FIXED" visualId="37949" weaponType="DUAL" /> <!-- Chrono Maracas Appearance Stone: Dualsword //TODO: Needs verification -->
<appearance_stone id="38199" targetType="WEAPON" type="FIXED" visualId="38221" weaponType="DUAL" lifeTime="30days" /> <!-- Blue Mackerel Appearance Stone: Dualsword ( 30 days ) -->
<appearance_stone id="38210" targetType="WEAPON" type="FIXED" visualId="38221" weaponType="DUAL" /> <!-- Blue Mackerel Appearance Stone: Dualsword -->
<appearance_stone id="22669" targetType="WEAPON" type="FIXED" visualId="22653" weaponType="DUALFIST" /> <!-- Emerald Weapon Appearance Stone: Fist Weapon -->
<appearance_stone id="22730" targetType="WEAPON" type="FIXED" visualId="22714" weaponType="DUALFIST" /> <!-- Japanese Fist Weapon Appearance Stone -->
<appearance_stone id="23932" targetType="WEAPON" type="FIXED" visualId="23916" weaponType="DUALFIST" lifeTime="7days" /> <!-- Tears Fist Weapon Appearance Stone ( 7 days ) -->
<appearance_stone id="37419" targetType="WEAPON" type="FIXED" visualId="22653" weaponType="DUALFIST" /> <!-- Emerald Weapon Appearance Stone: Fist Weapon -->
<appearance_stone id="36651" targetType="WEAPON" type="FIXED" visualId="22653" weaponType="DUALFIST" lifeTime="7days" /> <!-- Emerald Weapon Appearance Stone: Fist Weapon ( 7 days ) -->
<appearance_stone id="37403" targetType="WEAPON" type="FIXED" visualId="22653" weaponType="DUALFIST" lifeTime="15days" /> <!-- Emerald Weapon Appearance Stone: Fist Weapon ( 15 days ) -->
<appearance_stone id="37836" targetType="WEAPON" type="FIXED" visualId="37692" weaponType="DUALFIST" lifeTime="15days" /> <!-- Valentine Appearance Stone: Fist Weapon ( 15 days ) -->
<appearance_stone id="37852" targetType="WEAPON" type="FIXED" visualId="37692" weaponType="DUALFIST" lifeTime="30days" /> <!-- Valentine Appearance Stone: Fist Weapon ( 30 days ) -->
<appearance_stone id="37909" targetType="WEAPON" type="FIXED" visualId="37946" weaponType="DUALFIST" /> <!-- Chrono Unitus Appearance Stone: Fist Weapon //TODO: Needs verification -->
<appearance_stone id="37921" targetType="WEAPON" type="FIXED" visualId="37946" weaponType="DUALFIST" lifeTime="15days" /> <!-- Chrono Unitus Appearance Stone: Fist Weapon ( 15 days ) //TODO: Needs verification -->
<appearance_stone id="38194" targetType="WEAPON" type="FIXED" visualId="38216" weaponType="DUALFIST" lifeTime="30days" /> <!-- Lobster Appearance Stone: Fist Weapon ( 30 days ) -->
<appearance_stone id="38205" targetType="WEAPON" type="FIXED" visualId="38216" weaponType="DUALFIST" /> <!-- Lobster Appearance Stone: Fist Weapon -->
<appearance_stone id="22670" targetType="WEAPON" type="FIXED" visualId="22654" weaponType="POLE" /> <!-- Emerald Weapon Appearance Stone: Spear -->
<appearance_stone id="22731" targetType="WEAPON" type="FIXED" visualId="22715" weaponType="POLE" /> <!-- Japanese Great Spear Appearance Stone -->
<appearance_stone id="23933" targetType="WEAPON" type="FIXED" visualId="23917" weaponType="POLE" lifeTime="7days" /> <!-- Tears Spear Appearance Stone ( 7 days ) -->
<appearance_stone id="37420" targetType="WEAPON" type="FIXED" visualId="22654" weaponType="POLE" /> <!-- Emerald Weapon Appearance Stone: Spear -->
<appearance_stone id="36652" targetType="WEAPON" type="FIXED" visualId="22654" weaponType="POLE" lifeTime="7days" /> <!-- Emerald Weapon Appearance Stone: Spear ( 7 days ) -->
<appearance_stone id="37404" targetType="WEAPON" type="FIXED" visualId="22654" weaponType="POLE" lifeTime="15days" /> <!-- Emerald Weapon Appearance Stone: Spear ( 15 days ) -->
<appearance_stone id="37837" targetType="WEAPON" type="FIXED" visualId="37693" weaponType="POLE" lifeTime="15days" /> <!-- Valentine Appearance Stone: Spear ( 15 days ) -->
<appearance_stone id="37853" targetType="WEAPON" type="FIXED" visualId="37693" weaponType="POLE" lifeTime="30days" /> <!-- Valentine Appearance Stone: Spear ( 30 days ) -->
<appearance_stone id="37910" targetType="WEAPON" type="FIXED" visualId="37947" weaponType="POLE" /> <!-- Chrono Campana Appearance Stone: Spear //TODO: Needs verification -->
<appearance_stone id="37922" targetType="WEAPON" type="FIXED" visualId="37947" weaponType="POLE" lifeTime="15days" /> <!-- Chrono Campana Appearance Stone: Spear ( 15 days ) //TODO: Needs verification -->
<appearance_stone id="38192" targetType="WEAPON" type="FIXED" visualId="38214" weaponType="POLE" lifeTime="30days" /> <!-- Squid Appearance Stone: Spear ( 30 days ) -->
<appearance_stone id="38203" targetType="WEAPON" type="FIXED" visualId="38214" weaponType="POLE" /> <!-- Squid Appearance Stone: Spear -->
<appearance_stone id="22671" targetType="WEAPON" type="FIXED" visualId="22655" weaponType="BOW" /> <!-- Emerald Weapon Appearance Stone: Bow -->
<appearance_stone id="22732" targetType="WEAPON" type="FIXED" visualId="22716" weaponType="BOW" /> <!-- Japanese Bow Appearance Stone -->
<appearance_stone id="23934" targetType="WEAPON" type="FIXED" visualId="23918" weaponType="BOW" lifeTime="7days" /> <!-- Tears Bow Appearance Stone ( 7 days ) -->
<appearance_stone id="22671" targetType="WEAPON" type="FIXED" visualId="22655" weaponType="BOW" /> <!-- Emerald Weapon Appearance Stone: Bow -->
<appearance_stone id="36653" targetType="WEAPON" type="FIXED" visualId="22655" weaponType="BOW" lifeTime="7days" /> <!-- Emerald Weapon Appearance Stone: Bow ( 7 days ) -->
<appearance_stone id="22671" targetType="WEAPON" type="FIXED" visualId="22655" weaponType="BOW" lifeTime="15days" /> <!-- Emerald Weapon Appearance Stone: Bow ( 15 days ) -->
<appearance_stone id="37082" targetType="WEAPON" type="FIXED" visualId="37062" weaponType="BOW" /> <!-- Monster Weapon Appearance Stone: Kanadis' Bow -->
<appearance_stone id="37083" targetType="WEAPON" type="FIXED" visualId="37063" weaponType="BOW" /> <!-- Monster Weapon Appearance Stone: Centaur's Bow -->
<appearance_stone id="37838" targetType="WEAPON" type="FIXED" visualId="37694" weaponType="BOW" lifeTime="15days" /> <!-- Valentine Appearance Stone: Bow ( 15 days ) -->
<appearance_stone id="37854" targetType="WEAPON" type="FIXED" visualId="37694" weaponType="BOW" lifeTime="30days" /> <!-- Valentine Appearance Stone: Bow ( 30 days ) -->
<appearance_stone id="38195" targetType="WEAPON" type="FIXED" visualId="38217" weaponType="BOW" lifeTime="30days" /> <!-- Giant Crab Appearance Stone: Bow ( 30 days ) -->
<appearance_stone id="38206" targetType="WEAPON" type="FIXED" visualId="38217" weaponType="BOW" /> <!-- Giant Crab Appearance Stone: Bow -->
<!-- <appearance_stone id="40297" targetType="WEAPON" type="FIXED" visualId="?" weaponType="BOW" /> --> <!-- Monster Weapon Appearance Stone: Tayga Archer's Bow //TODO: Missing VisualID -->
<appearance_stone id="22672" targetType="WEAPON" type="FIXED" visualId="22656" weaponType="CROSSBOW" /> <!-- Emerald Weapon Appearance Stone: Crossbow -->
<appearance_stone id="22733" targetType="WEAPON" type="FIXED" visualId="22717" weaponType="CROSSBOW" /> <!-- Japanese Crossbow Appearance Stone -->
<appearance_stone id="23935" targetType="WEAPON" type="FIXED" visualId="23919" weaponType="CROSSBOW" lifeTime="7days" /> <!-- Tears Crossbow Appearance Stone ( 7 days ) -->
<appearance_stone id="36654" targetType="WEAPON" type="FIXED" visualId="22656" weaponType="CROSSBOW" lifeTime="7days" /> <!-- Emerald Weapon Appearance Stone: Crossbow ( 7 days ) -->
<appearance_stone id="37406" targetType="WEAPON" type="FIXED" visualId="22656" weaponType="CROSSBOW" lifeTime="15days" /> <!-- Emerald Weapon Appearance Stone: Crossbow ( 15 days ) -->
<appearance_stone id="37422" targetType="WEAPON" type="FIXED" visualId="22656" weaponType="CROSSBOW" /> <!-- Emerald Weapon Appearance Stone: Crossbow -->
<appearance_stone id="37084" targetType="WEAPON" type="FIXED" visualId="37064" weaponType="CROSSBOW" /> <!-- Monster Weapon Appearance Stone: Spicula's Crossbow -->
<appearance_stone id="37855" targetType="WEAPON" type="FIXED" visualId="37695" weaponType="CROSSBOW" lifeTime="30days" /> <!-- Valentine Appearance Stone: Crossbow ( 30 days ) -->
<appearance_stone id="37839" targetType="WEAPON" type="FIXED" visualId="37695" weaponType="CROSSBOW" lifeTime="15days" /> <!-- Valentine Appearance Stone: Crossbow ( 15 days ) -->
<appearance_stone id="38196" targetType="WEAPON" type="FIXED" visualId="38218" weaponType="CROSSBOW" lifeTime="30days" /> <!-- Crayfish Appearance Stone: Crossbow ( 30 days ) -->
<appearance_stone id="38207" targetType="WEAPON" type="FIXED" visualId="38218" weaponType="CROSSBOW" /> <!-- Crayfish Appearance Stone: Crossbow -->
<appearance_stone id="22673" targetType="WEAPON" type="FIXED" visualId="22657" weaponType="BLUNT" /> <!-- Weapon Appearance Stone: One-handed Blunt Weapon -->
<appearance_stone id="22734" targetType="WEAPON" type="FIXED" visualId="22718" weaponType="BLUNT" /> <!-- Japanese Blunt Appearance Stone -->
<appearance_stone id="22675" targetType="WEAPON" type="FIXED" visualId="22659" weaponType="BLUNT" magicType="MAGICAL" /> <!-- Emerald Weapon Appearance Stone: One-handed Magic Blunt Weapon -->
<appearance_stone id="22736" targetType="WEAPON" type="FIXED" visualId="22720" weaponType="BLUNT" magicType="MAGICAL" /> <!-- Japanese Magic Blunt Appearance Stone -->
<appearance_stone id="22674" targetType="WEAPON" type="FIXED" visualId="22658" weaponType="BLUNT" handType="TWO_HANDED" /> <!-- Emerald Weapon Appearance Stone: Two-handed Blunt Weapon -->
<appearance_stone id="22735" targetType="WEAPON" type="FIXED" visualId="22719" weaponType="BLUNT" handType="TWO_HANDED" /> <!-- Japanese Giant Blunt Appearance Stone -->
<appearance_stone id="22676" targetType="WEAPON" type="FIXED" visualId="22660" weaponType="BLUNT" handType="TWO_HANDED" magicType="MAGICAL" /> <!-- Emerald Weapon Appearance Stone: Two-handed Magic Blunt Weapon -->
<appearance_stone id="22676" targetType="WEAPON" type="FIXED" visualId="38215" weaponType="BLUNT" handType="TWO_HANDED" magicType="MAGICAL" /> <!-- Sea Horse Two-handed Magic Blunt Appearance Stone -->
<appearance_stone id="22737" targetType="WEAPON" type="FIXED" visualId="22721" weaponType="BLUNT" handType="TWO_HANDED" magicType="MAGICAL" /> <!-- Japanese Giant Magic Blunt Appearance Stone -->
<appearance_stone id="22678" targetType="WEAPON" type="FIXED" visualId="22662" weaponType="DUALDAGGER" /> <!-- Emerald Weapon Appearance Stone: Dual Dagger -->
<appearance_stone id="22739" targetType="WEAPON" type="FIXED" visualId="22723" weaponType="DUALDAGGER" /> <!-- Japanese Double Dagger Appearance Stone -->
<appearance_stone id="22679" targetType="WEAPON" type="FIXED" visualId="22663" weaponType="DUALBLUNT" /> <!-- Emerald Weapon Appearance Stone: Dual Blunt Weapon -->
<appearance_stone id="22740" targetType="WEAPON" type="FIXED" visualId="22724" weaponType="DUALBLUNT" /> <!-- Japanese Double Blunt Appearance Stone -->
<!--Armor Appearance Stones -->
<!--Normal -->
<appearance_stone id="22682" targetType="ARMOR" type="NORMAL" cost="125000"> <!-- Armor Appearance Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
</appearance_stone>
<appearance_stone id="22683" targetType="ARMOR" type="NORMAL" cost="125000"> <!-- Armor Appearance Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
</appearance_stone>
<appearance_stone id="22684" targetType="ARMOR" type="NORMAL" grade="A" cost="125000" /> <!-- Armor Appearance Stone (A-grade) -->
<appearance_stone id="22685" targetType="ARMOR" type="NORMAL" grade="B" cost="125000" /> <!-- Armor Appearance Stone (B-grade) -->
<appearance_stone id="22686" targetType="ARMOR" type="NORMAL" grade="C" cost="125000" /> <!-- Armor Appearance Stone (C-grade) -->
<appearance_stone id="22687" targetType="ARMOR" type="NORMAL" grade="D" cost="125000" /> <!-- Armor Appearance Stone (D-grade) -->
<!--Blessed -->
<appearance_stone id="22688" targetType="ARMOR" type="BLESSED"> <!-- Blessed Armor Appearance Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
</appearance_stone>
<appearance_stone id="22689" targetType="ARMOR" type="BLESSED"> <!--Blessed Armor Appearance Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
</appearance_stone>
<appearance_stone id="22690" targetType="ARMOR" type="BLESSED" grade="A" /> <!-- Blessed Armor Appearance Stone (A-grade) -->
<appearance_stone id="22691" targetType="ARMOR" type="BLESSED" grade="B" /> <!-- Blessed Armor Appearance Stone (B-grade) -->
<appearance_stone id="22692" targetType="ARMOR" type="BLESSED" grade="C" /> <!-- Blessed Armor Appearance Stone (C-grade) -->
<appearance_stone id="22693" targetType="ARMOR" type="BLESSED" grade="D" /> <!-- Blessed Armor Appearance Stone (D-grade) -->
<!--Restore -->
<appearance_stone id="22694" targetType="ARMOR" type="RESTORE"> <!-- Armor Restoration Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
</appearance_stone>
<appearance_stone id="22695" targetType="ARMOR" type="RESTORE"> <!-- Armor Restoration Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
</appearance_stone>
<appearance_stone id="22696" targetType="ARMOR" type="RESTORE" grade="A" /> <!-- Armor Restoration Stone (A-grade) -->
<appearance_stone id="22697" targetType="ARMOR" type="RESTORE" grade="B" /> <!-- Armor Restoration Stone (B-grade) -->
<appearance_stone id="22698" targetType="ARMOR" type="RESTORE" grade="C" /> <!-- Armor Restoration Stone (C-grade) -->
<appearance_stone id="22699" targetType="ARMOR" type="RESTORE" grade="D" /> <!-- Armor Restoration Stone (D-grade) -->
<!--Restore -->
<appearance_stone id="22700" type="RESTORE"> <!-- Equipment Restoration Stone (R-grade) -->
<grade>R</grade>
<grade>R95</grade>
<grade>R99</grade>
<targetType>WEAPON</targetType>
<targetType>ARMOR</targetType>
</appearance_stone>
<appearance_stone id="22701" type="RESTORE"> <!-- Equipment Restoration Stone (S-grade) -->
<grade>S</grade>
<grade>S80</grade>
<targetType>WEAPON</targetType>
<targetType>ARMOR</targetType>
</appearance_stone>
<appearance_stone id="22702" type="RESTORE" grade="A"> <!-- Equipment Restoration Stone (A-grade) -->
<targetType>WEAPON</targetType>
<targetType>ARMOR</targetType>
</appearance_stone>
<appearance_stone id="22703" type="RESTORE" grade="B"> <!-- Equipment Restoration Stone (B-grade) -->
<targetType>WEAPON</targetType>
<targetType>ARMOR</targetType>
</appearance_stone>
<appearance_stone id="22704" type="RESTORE" grade="C"> <!-- Equipment Restoration Stone (C-grade) -->
<targetType>WEAPON</targetType>
<targetType>ARMOR</targetType>
</appearance_stone>
<appearance_stone id="22705" type="RESTORE" grade="D"> <!-- Equipment Restoration Stone (D-grade) -->
<targetType>WEAPON</targetType>
<targetType>ARMOR</targetType>
</appearance_stone>
<!--Fixed -->
<!-- Metal Suit -->
<appearance_stone id="23493" targetType="ARMOR" type="FIXED" visualId="23448"> <!-- Metal Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23494" targetType="ARMOR" type="FIXED" visualId="23449" bodyPart="legs" /> <!-- Metal Pants Appearance Stone -->
<appearance_stone id="23495" targetType="ARMOR" type="FIXED" visualId="23450" bodyPart="gloves" /> <!-- Metal Gloves Appearance Stone -->
<appearance_stone id="23496" targetType="ARMOR" type="FIXED" visualId="23451" bodyPart="feet" /> <!-- Metal Shoes Appearance Stone -->
<appearance_stone id="23497" targetType="ACCESSORY" type="FIXED" visualId="23452"> <!-- Metal Hair Accessory Appearance Stone -->
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!-- Metal Suit with skill -->
<appearance_stone id="23712" targetType="ARMOR" type="FIXED" visualId="23708"> <!-- Metal Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23713" targetType="ARMOR" type="FIXED" visualId="23709" bodyPart="legs" /> <!-- Metal Pants Appearance Stone -->
<appearance_stone id="23714" targetType="ARMOR" type="FIXED" visualId="23710" bodyPart="gloves" /> <!-- Metal Gloves Appearance Stone -->
<appearance_stone id="23715" targetType="ARMOR" type="FIXED" visualId="23711" bodyPart="feet" /> <!-- Metal Shoes Appearance Stone -->
<!-- Military Suit -->
<appearance_stone id="23503" targetType="ARMOR" type="FIXED" visualId="23453" raceNot="ERTHEIA"> <!-- Military Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23504" targetType="ARMOR" type="FIXED" visualId="23454" bodyPart="legs" raceNot="ERTHEIA" /> <!-- Military Pants Appearance Stone -->
<appearance_stone id="23505" targetType="ARMOR" type="FIXED" visualId="23455" bodyPart="gloves" raceNot="ERTHEIA" /> <!-- Military Gloves Appearance Stone -->
<appearance_stone id="23506" targetType="ARMOR" type="FIXED" visualId="23456" bodyPart="feet" raceNot="ERTHEIA" /> <!-- Military Shoes Appearance Stone -->
<appearance_stone id="23507" targetType="ACCESSORY" type="FIXED" visualId="23457" raceNot="ERTHEIA"> <!-- Military Hair Accessory Appearance Stone -->
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!-- Military Suit with skill -->
<appearance_stone id="23720" targetType="ARMOR" type="FIXED" visualId="23716" raceNot="ERTHEIA"> <!-- Military Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23721" targetType="ARMOR" type="FIXED" visualId="23717" bodyPart="legs" raceNot="ERTHEIA" /> <!-- Military Pants Appearance Stone -->
<appearance_stone id="23722" targetType="ARMOR" type="FIXED" visualId="23718" bodyPart="gloves" raceNot="ERTHEIA" /> <!-- Military Gloves Appearance Stone -->
<appearance_stone id="23723" targetType="ARMOR" type="FIXED" visualId="23719" bodyPart="feet" raceNot="ERTHEIA" /> <!-- Military Shoes Appearance Stone -->
<!-- Ninja Suit -->
<appearance_stone id="23189" targetType="ARMOR" type="FIXED" visualId="23554"> <!-- Ninja Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23190" targetType="ARMOR" type="FIXED" visualId="23555" bodyPart="legs" raceNot="ERTHEIA" /> <!-- Ninja Pants Appearance Stone -->
<appearance_stone id="23191" targetType="ARMOR" type="FIXED" visualId="23556" bodyPart="gloves" raceNot="ERTHEIA" /> <!-- Ninja Gloves Appearance Stone -->
<appearance_stone id="23192" targetType="ARMOR" type="FIXED" visualId="23557" bodyPart="feet" raceNot="ERTHEIA" /> <!-- Ninja Shoes Appearance Stone -->
<appearance_stone id="23193" targetType="ACCESSORY" type="FIXED" visualId="23558" raceNot="ERTHEIA"> <!-- Ninja Hair Accessory Appearance Stone -->
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!-- Ninja Suit with skill -->
<appearance_stone id="23564" targetType="ARMOR" type="FIXED" visualId="23554"> <!-- Ninja Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23565" targetType="ARMOR" type="FIXED" visualId="23555" bodyPart="legs" raceNot="ERTHEIA" /> <!-- Ninja Pants Appearance Stone -->
<appearance_stone id="23566" targetType="ARMOR" type="FIXED" visualId="23556" bodyPart="gloves" raceNot="ERTHEIA" /> <!-- Ninja Gloves Appearance Stone -->
<appearance_stone id="23567" targetType="ARMOR" type="FIXED" visualId="23557" bodyPart="feet" raceNot="ERTHEIA" /> <!-- Ninja Shoes Appearance Stone -->
<!-- Traditional Taiwanese Suit -->
<appearance_stone id="23194" targetType="ARMOR" type="FIXED" visualId="23184"> <!-- Traditional Taiwanese Top Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23195" targetType="ARMOR" type="FIXED" visualId="23185" bodyPart="legs" raceNot="ERTHEIA" /> <!-- Traditional Taiwanese Pants Appearance Stone -->
<appearance_stone id="23196" targetType="ARMOR" type="FIXED" visualId="23186" bodyPart="gloves" raceNot="ERTHEIA" /> <!-- Traditional Taiwanese Gloves Appearance Stone -->
<appearance_stone id="23197" targetType="ARMOR" type="FIXED" visualId="23187" bodyPart="feet" raceNot="ERTHEIA" /> <!-- Traditional Taiwanese Shoes Appearance Stone -->
<appearance_stone id="23198" targetType="ACCESSORY" type="FIXED" visualId="23188" raceNot="ERTHEIA"> <!-- Traditional Taiwanese Hair Accessory Appearance Stone -->
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!-- Onepiece -->
<appearance_stone id="23172" targetType="ARMOR" type="FIXED" visualId="23171" raceNot="ERTHEIA"> <!-- Beach Swimsuit Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23234" targetType="ARMOR" type="FIXED" visualId="23173" raceNot="ERTHEIA"> <!-- Alluring Swimsuit Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23235" targetType="ARMOR" type="FIXED" visualId="23226" raceNot="ERTHEIA"> <!-- Seductive Swimsuit Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23486" targetType="ARMOR" type="FIXED" visualId="23485"> <!-- Santa Outfit Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23487" targetType="ARMOR" type="FIXED" visualId="23485"> <!-- Santa Outfit Appearance Stone -->
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<!-- Shield and Sigils -->
<appearance_stone id="22680" targetType="ARMOR" type="FIXED" visualId="22664" armorType="SHIELD" raceNot="ERTHEIA" /> <!-- Emerald Weapon Appearance Stone: Shield -->
<appearance_stone id="22681" targetType="ARMOR" type="FIXED" visualId="22665" armorType="SIGIL" raceNot="ERTHEIA" /> <!-- Emerald Weapon Appearance Stone: Sigil -->
<appearance_stone id="22741" targetType="ARMOR" type="FIXED" visualId="22725" armorType="SHIELD" raceNot="ERTHEIA" /> <!-- Japanese Shield Appearance Stone -->
<appearance_stone id="22742" targetType="ARMOR" type="FIXED" visualId="22726" armorType="SIGIL" raceNot="ERTHEIA" /> <!-- Japanese Sigil Appearance Stone -->
<!--Accessory Appearance Stones -->
<!--Normal -->
<appearance_stone id="22708" targetType="ACCESSORY" type="NORMAL" cost="125000" /> <!-- Accessory Appearance Stone -->
<!--Blessed -->
<appearance_stone id="22709" targetType="ACCESSORY" type="BLESSED" /> <!-- Accessory Appearance Stone -->
<!--Restore -->
<appearance_stone id="22882" targetType="ACCESSORY" type="RESTORE" /> <!-- Hair Accessory Appearance Restoration Stone -->
<!--Anakim Outfit -->
<appearance_stone id="23882" targetType="ARMOR" type="FIXED" visualId="23881" raceNot="ERTHEIA">
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<!--Dark Assassion Suit -->
<appearance_stone id="24134" targetType="ARMOR" type="FIXED" visualId="24133">
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<!--Vampire Suit -->
<appearance_stone id="23888" targetType="ARMOR" type="FIXED" visualId="23883" raceNot="ERTHEIA">
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23889" targetType="ARMOR" type="FIXED" visualId="23884" bodyPart="legs" raceNot="ERTHEIA" />
<appearance_stone id="23890" targetType="ARMOR" type="FIXED" visualId="23885" bodyPart="gloves" raceNot="ERTHEIA" />
<appearance_stone id="23891" targetType="ARMOR" type="FIXED" visualId="23886" bodyPart="feet" raceNot="ERTHEIA" />
<appearance_stone id="23892" targetType="ACCESSORY" type="FIXED" visualId="23887" raceNot="ERTHEIA">
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!--Samurai Outfit -->
<appearance_stone id="23880" targetType="ARMOR" type="FIXED" visualId="23879">
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="23878" targetType="ACCESSORY" type="FIXED" visualId="23877">
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!--NC Dinos Uniform -->
<appearance_stone id="45435" targetType="ARMOR" type="FIXED" visualId="37725" lifeTime="30days">
<bodyPart>chest</bodyPart>
<bodyPart>fullarmor</bodyPart>
</appearance_stone>
<appearance_stone id="45433" targetType="ACCESSORY" type="FIXED" visualId="37726" lifeTime="30days">
<bodyPart>hair</bodyPart>
<bodyPart>hair2</bodyPart>
<bodyPart>hairall</bodyPart>
</appearance_stone>
<!-- Tears One-handed Blunt Weapon -->
<appearance_stone id="23936" targetType="WEAPON" type="FIXED" visualId="23920" weaponType="BLUNT" bodyPart="lhand" lifeTime="7days" />
<!-- Tears Magic Sword -->
<appearance_stone id="23937" targetType="WEAPON" type="FIXED" visualId="23921" weaponType="SWORD" magicType="MAGICAL" bodyPart="lhand" lifeTime="7days" />
<!-- Tears Tears One-handed Magic Blunt Weapon -->
<appearance_stone id="23938" targetType="WEAPON" type="FIXED" visualId="23922" weaponType="BLUNT" magicType="MAGICAL" lifeTime="7days" />
<!-- Tears Two-handed Magic Blunt Weapon -->
<appearance_stone id="23939" targetType="WEAPON" type="FIXED" visualId="23923" weaponType="DUALBLUNT" magicType="MAGICAL" lifeTime="7days" />
<!-- Tears Dual Dagger -->
<appearance_stone id="23941" targetType="WEAPON" type="FIXED" visualId="23945" weaponType="DUALDAGGER" lifeTime="7days" />
<!-- Tears Dual Blunt Weapon -->
<appearance_stone id="23942" targetType="WEAPON" type="FIXED" visualId="23946" weaponType="DUALBLUNT" lifeTime="7days" />
<!-- Tears Shield -->
<appearance_stone id="23943" targetType="ARMOR" type="FIXED" visualId="23927" armorType="SHIELD" lifeTime="7days" />
<!-- Tears Sigil -->
<appearance_stone id="23944" targetType="ARMOR" type="FIXED" visualId="23928" armorType="SIGIL" lifeTime="7days" />
<!-- Valentine Dagger -->
<appearance_stone id="37688" targetType="WEAPON" type="FIXED" visualId="37688" weaponType="DAGGER" lifeTime="15days" />
<!-- Valentine One-handed Sword -->
<appearance_stone id="37689" targetType="WEAPON" type="FIXED" visualId="37689" weaponType="SWORD" lifeTime="15days" />
<!-- Valentine Two-handed Sword -->
<appearance_stone id="37690" targetType="WEAPON" type="FIXED" visualId="37690" weaponType="SWORD" bodyPart="lrhand" lifeTime="15days" />
<!-- Valentine One-handed Blunt Weapon -->
<appearance_stone id="37691" targetType="WEAPON" type="FIXED" visualId="37691" weaponType="BLUNT" bodyPart="lhand" lifeTime="15days" />
<!-- Valentine Fist Weapon -->
<appearance_stone id="37692" targetType="WEAPON" type="FIXED" visualId="37692" weaponType="DUALFIST" lifeTime="15days" />
<!-- Valentine Spear -->
<appearance_stone id="37693" targetType="WEAPON" type="FIXED" visualId="37693" weaponType="POLE" lifeTime="15days" />
<!-- Valentine Bow -->
<appearance_stone id="37694" targetType="WEAPON" type="FIXED" visualId="37694" weaponType="BOW" lifeTime="15days" />
<!-- Valentine Crossbow -->
<appearance_stone id="37695" targetType="WEAPON" type="FIXED" visualId="37695" weaponType="CROSSBOW" lifeTime="15days" />
<!-- Valentine One-handed Magic Sword -->
<appearance_stone id="37696" targetType="WEAPON" type="FIXED" visualId="37696" weaponType="SWORD" lifeTime="15days" />
<!-- Valentine One-handed Magic Blunt Weapon -->
<appearance_stone id="37697" targetType="WEAPON" type="FIXED" visualId="37697" weaponType="BLUNT" magicType="MAGICAL" lifeTime="15days" />
<!-- Valentine Two-handed Magic Blunt Weapon -->
<appearance_stone id="37698" targetType="WEAPON" type="FIXED" visualId="37698" weaponType="DUALBLUNT" magicType="MAGICAL" lifeTime="15days" />
<!-- Valentine Dualsword -->
<appearance_stone id="37699" targetType="WEAPON" type="FIXED" visualId="37699" weaponType="DUAL" lifeTime="15days" />
<!-- Valentine Dual Dagger -->
<appearance_stone id="37700" targetType="WEAPON" type="FIXED" visualId="37700" weaponType="DUALDAGGER" lifeTime="15days" />
<!-- Valentine Dual Blunt Weapon -->
<appearance_stone id="37701" targetType="WEAPON" type="FIXED" visualId="37701" weaponType="DUALBLUNT" lifeTime="15days" />
<!-- Valentine Shield -->
<appearance_stone id="37702" targetType="ARMOR" type="FIXED" visualId="37702" armorType="SHIELD" lifeTime="15days" />
<!-- Valentine Sigil -->
<appearance_stone id="37703" targetType="ARMOR" type="FIXED" visualId="37703" armorType="SIGIL" lifeTime="15days" />
<!-- Pig Lollipop Appearance Stone: One-handed Sword -->
<appearance_stone id="37907" targetType="WEAPON" type="FIXED" visualId="37629" weaponType="SWORD" />
<!-- Chrono Cithara Appearance Stone: One-handed Sword -->
<appearance_stone id="37908" targetType="WEAPON" type="FIXED" visualId="37945" weaponType="SWORD" />
<!-- Chrono Unitus Appearance Stone: Fist Weapon -->
<appearance_stone id="37909" targetType="WEAPON" type="FIXED" visualId="37946" weaponType="DUALFIST" />
<!-- Chrono Campana Appearance Stone: Spear -->
<appearance_stone id="37910" targetType="WEAPON" type="FIXED" visualId="37947" weaponType="POLE" />
<!-- Chrono Darbuka Appearance Stone: Two-handed Blunt Weapon -->
<appearance_stone id="37911" targetType="WEAPON" type="FIXED" visualId="37948" weaponType="DUALBLUNT" />
<!-- Chrono Maracas Appearance Stone: Dualsword -->
<appearance_stone id="37912" targetType="WEAPON" type="FIXED" visualId="37949" weaponType="DUAL" />
<!-- Pumpkin Dagger Appearance Stone: Dagger -->
<appearance_stone id="37913" targetType="WEAPON" type="FIXED" visualId="37916" weaponType="DAGGER" />
<!-- Pumpkin Dual Dagger Appearance Stone: Dual Dagger -->
<appearance_stone id="37914" targetType="WEAPON" type="FIXED" visualId="37917" weaponType="DUALDAGGER" />
<!-- Scarecrow Sword Appearance Stone: One-handed Magic Sword -->
<appearance_stone id="37915" targetType="WEAPON" type="FIXED" visualId="37918" weaponType="SWORD" magicType="MAGICAL" />
</list>

View File

@ -18,15 +18,18 @@
*/
package handlers.itemhandlers;
import com.l2jserver.gameserver.data.xml.impl.AppearanceItemData;
import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.request.ShapeShiftingItemRequest;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.itemappearance.ExChoose_Shape_Shifting_Item;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExChooseShapeShiftingItem;
/**
* @author Erlandys
* @author UnAfraid
*/
public class Appearance implements IItemHandler
{
@ -40,21 +43,21 @@ public class Appearance implements IItemHandler
}
final L2PcInstance player = playable.getActingPlayer();
if (player.getUsingAppearanceStone() != null)
if (player.hasRequest(ShapeShiftingItemRequest.class))
{
player.sendPacket(SystemMessageId.APPEARANCE_MODIFICATION_OR_RESTORATION_IN_PROGRESS_PLEASE_TRY_AGAIN_AFTER_COMPLETING_THIS_TASK);
return false;
}
if ((item == null) || !item.isEtcItem() || (item.isEtcItem() && (item.getEtcItem().getAppearanceStone() == null)))
final AppearanceStone stone = AppearanceItemData.getInstance().getStone(item.getId());
if (stone == null)
{
player.sendMessage("This item is either not an appearance stone or is currently not handled!");
return false;
}
player.sendPacket(new ExChoose_Shape_Shifting_Item(item.getEtcItem().getAppearanceStone()));
player.setUsingAppearanceStone(item);
player.addRequest(new ShapeShiftingItemRequest(player, item));
player.sendPacket(new ExChooseShapeShiftingItem(stone));
return true;
}
}

View File

@ -1,20 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element name="stone" maxOccurs="unbounded" minOccurs="0">
<xs:complexType mixed="true">
<xs:attribute type="xs:integer" name="id" />
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="targetType" />
<xs:attribute type="xs:string" name="grades" />
<xs:attribute type="xs:integer" name="cost" />
<xs:attribute type="xs:integer" name="visualId" />
<xs:attribute type="xs:integer" name="lifeTime" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element name="appearance_stone" maxOccurs="unbounded" minOccurs="0">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="grade" maxOccurs="unbounded" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="D" />
<xs:enumeration value="C" />
<xs:enumeration value="B" />
<xs:enumeration value="A" />
<xs:enumeration value="S" />
<xs:enumeration value="S80" />
<xs:enumeration value="R" />
<xs:enumeration value="R95" />
<xs:enumeration value="R99" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="targetType" maxOccurs="unbounded" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="WEAPON" />
<xs:enumeration value="ARMOR" />
<xs:enumeration value="ACCESSORY" />
<xs:enumeration value="ALL" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bodyPart" maxOccurs="unbounded" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="none" />
<xs:enumeration value="shirt" />
<xs:enumeration value="lbracelet" />
<xs:enumeration value="rbracelet" />
<xs:enumeration value="talisman" />
<xs:enumeration value="chest" />
<xs:enumeration value="fullarmor" />
<xs:enumeration value="head" />
<xs:enumeration value="hair" />
<xs:enumeration value="hairall" />
<xs:enumeration value="underwear" />
<xs:enumeration value="back" />
<xs:enumeration value="neck" />
<xs:enumeration value="legs" />
<xs:enumeration value="feet" />
<xs:enumeration value="gloves" />
<xs:enumeration value="chest,legs" />
<xs:enumeration value="belt" />
<xs:enumeration value="rhand" />
<xs:enumeration value="lhand" />
<xs:enumeration value="lrhand" />
<xs:enumeration value="rear;lear" />
<xs:enumeration value="rfinger;lfinger" />
<xs:enumeration value="brooch" />
<xs:enumeration value="brooch_jewel" />
<xs:enumeration value="onepiece" />
<xs:enumeration value="hair2" />
<xs:enumeration value="dhair" />
<xs:enumeration value="alldress" />
<xs:enumeration value="deco1" />
<xs:enumeration value="waist" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="race" maxOccurs="unbounded" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="HUMAN" />
<xs:enumeration value="ELF" />
<xs:enumeration value="DARK_ELF" />
<xs:enumeration value="ORC" />
<xs:enumeration value="DWRAF" />
<xs:enumeration value="KAMAEL" />
<xs:enumeration value="ERTHEIA" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="raceNot" maxOccurs="unbounded" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="HUMAN" />
<xs:enumeration value="ELF" />
<xs:enumeration value="DARK_ELF" />
<xs:enumeration value="ORC" />
<xs:enumeration value="DWRAF" />
<xs:enumeration value="KAMAEL" />
<xs:enumeration value="ERTHEIA" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:integer" name="id" use="required" />
<xs:attribute name="targetType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="WEAPON" />
<xs:enumeration value="ARMOR" />
<xs:enumeration value="ACCESSORY" />
<xs:enumeration value="ALL" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NORMAL" />
<xs:enumeration value="RESTORE" />
<xs:enumeration value="FIXED" />
<xs:enumeration value="BLESSED" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:integer" name="cost" use="optional" />
<xs:attribute name="grade" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="D" />
<xs:enumeration value="C" />
<xs:enumeration value="B" />
<xs:enumeration value="A" />
<xs:enumeration value="S" />
<xs:enumeration value="S80" />
<xs:enumeration value="R" />
<xs:enumeration value="R95" />
<xs:enumeration value="R99" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:integer" name="visualId" use="optional" />
<xs:attribute name="weaponType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="SWORD" />
<xs:enumeration value="BLUNT" />
<xs:enumeration value="DAGGER" />
<xs:enumeration value="BOW" />
<xs:enumeration value="POLE" />
<xs:enumeration value="DUAL" />
<xs:enumeration value="ETC" />
<xs:enumeration value="FIST" />
<xs:enumeration value="DUALFIST" />
<xs:enumeration value="FISHINGROD" />
<xs:enumeration value="RAPIER" />
<xs:enumeration value="ANCIENTSWORD" />
<xs:enumeration value="CROSSBOW" />
<xs:enumeration value="FLAG" />
<xs:enumeration value="OWNTHING" />
<xs:enumeration value="DUALDAGGER" />
<xs:enumeration value="DUALBLUNT" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="magicType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="MAGICAL" />
<xs:enumeration value="PHYISICAL" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="handType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="NONE" />
<xs:enumeration value="ONE_HANDED" />
<xs:enumeration value="TWO_HANDED" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="armorType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="SIGIL" />
<xs:enumeration value="SHIELD" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="bodyPart" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="none" />
<xs:enumeration value="shirt" />
<xs:enumeration value="lbracelet" />
<xs:enumeration value="rbracelet" />
<xs:enumeration value="talisman" />
<xs:enumeration value="chest" />
<xs:enumeration value="fullarmor" />
<xs:enumeration value="head" />
<xs:enumeration value="hair" />
<xs:enumeration value="hairall" />
<xs:enumeration value="underwear" />
<xs:enumeration value="back" />
<xs:enumeration value="neck" />
<xs:enumeration value="legs" />
<xs:enumeration value="feet" />
<xs:enumeration value="gloves" />
<xs:enumeration value="chest,legs" />
<xs:enumeration value="belt" />
<xs:enumeration value="rhand" />
<xs:enumeration value="lhand" />
<xs:enumeration value="lrhand" />
<xs:enumeration value="rear;lear" />
<xs:enumeration value="rfinger;lfinger" />
<xs:enumeration value="brooch" />
<xs:enumeration value="brooch_jewel" />
<xs:enumeration value="onepiece" />
<xs:enumeration value="hair2" />
<xs:enumeration value="dhair" />
<xs:enumeration value="alldress" />
<xs:enumeration value="deco1" />
<xs:enumeration value="waist" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="race" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="HUMAN" />
<xs:enumeration value="ELF" />
<xs:enumeration value="DARK_ELF" />
<xs:enumeration value="ORC" />
<xs:enumeration value="DWRAF" />
<xs:enumeration value="KAMAEL" />
<xs:enumeration value="ERTHEIA" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="raceNot" use="optional">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="HUMAN" />
<xs:enumeration value="ELF" />
<xs:enumeration value="DARK_ELF" />
<xs:enumeration value="ORC" />
<xs:enumeration value="DWRAF" />
<xs:enumeration value="KAMAEL" />
<xs:enumeration value="ERTHEIA" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="lifeTime" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,6 @@
CREATE TABLE IF NOT EXISTS `item_variables` (
`id` int(10) UNSIGNED NOT NULL,
`var` varchar(255) NOT NULL,
`val` text NOT NULL,
KEY `charId` (`id`)
);

View File

@ -11,8 +11,6 @@ CREATE TABLE IF NOT EXISTS `items` (
`custom_type2` INT DEFAULT 0,
`mana_left` decimal(5,0) NOT NULL DEFAULT -1,
`time` decimal(13) NOT NULL DEFAULT 0,
`appearance_id` int(11) NOT NULL DEFAULT 0,
`appearance_time` decimal(13) NOT NULL DEFAULT -1,
PRIMARY KEY (`object_id`),
KEY `owner_id` (`owner_id`),
KEY `item_id` (`item_id`),

View File

@ -18,7 +18,6 @@
*/
package com.l2jserver.gameserver.data.xml.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
@ -28,15 +27,17 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jserver.gameserver.data.xml.IXmlReader;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.model.entity.AppearanceStone.AppearanceItemType;
import com.l2jserver.gameserver.model.entity.AppearanceStone.StoneType;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.enums.Race;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.appearance.AppearanceTargetType;
import com.l2jserver.gameserver.model.items.type.CrystalType;
/**
* @author Erlandys
* @author UnAfraid
*/
public final class AppearanceItemData implements IXmlReader
public class AppearanceItemData implements IXmlReader
{
private final Map<Integer, AppearanceStone> _stones = new HashMap<>();
@ -48,42 +49,88 @@ public final class AppearanceItemData implements IXmlReader
@Override
public void load()
{
_stones.clear();
parseDatapackFile("data/AppearanceStones.xml");
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _stones.size() + " appearance stones.");
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _stones.size() + " Stones");
//@formatter:off
/*
for (L2Item item : ItemTable.getInstance().getAllItems())
{
if ((item == null) || !item.getName().contains("Appearance Stone"))
{
continue;
}
if (item.getName().contains("Pack") || _stones.containsKey(item.getId()))
{
continue;
}
System.out.println("Unhandled appearance stone: " + item);
}
*/
//@formatter:on
}
@Override
public void parseDocument(Document doc)
{
StatsSet set;
Node att;
NamedNodeMap attrs;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
{
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if ("stone".equalsIgnoreCase(d.getNodeName()))
if ("appearance_stone".equalsIgnoreCase(d.getNodeName()))
{
final NamedNodeMap attrs = d.getAttributes();
int itemId = parseInteger(attrs, "id");
String type = parseString(attrs, "type");
String targetType = parseString(attrs, "targetType");
String grades[] = parseString(attrs, "grades", "none").split(";");
long cost = parseLong(attrs, "cost", 0l);
int visualId = parseInteger(attrs, "visualId", 0);
long lifeTime = parseLong(attrs, "lifeTime", 0l);
ArrayList<Integer> gradesIds = new ArrayList<>();
CrystalType cType;
for (String gr : grades)
attrs = d.getAttributes();
set = new StatsSet();
for (int i = 0; i < attrs.getLength(); i++)
{
cType = CrystalType.valueOf(gr.toUpperCase());
gradesIds.add(cType.getId());
att = attrs.item(i);
set.set(att.getNodeName(), att.getNodeValue());
}
type = type.toUpperCase();
targetType = targetType.toUpperCase();
StoneType sType = StoneType.valueOf(type);
AppearanceItemType iType = AppearanceItemType.valueOf(targetType);
_stones.put(itemId, new AppearanceStone(itemId, sType, iType, gradesIds, cost, visualId, lifeTime));
final AppearanceStone stone = new AppearanceStone(set);
for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
{
switch (c.getNodeName())
{
case "grade":
{
final CrystalType type = CrystalType.valueOf(c.getTextContent());
stone.addCrystalType(type);
break;
}
case "targetType":
{
final AppearanceTargetType type = AppearanceTargetType.valueOf(c.getTextContent());
stone.addTargetType(type);
break;
}
case "bodyPart":
{
final int part = ItemTable._slots.get(c.getTextContent());
stone.addBodyPart(part);
break;
}
case "race":
{
final Race race = Race.valueOf(c.getTextContent());
stone.addRace(race);
break;
}
case "raceNot":
{
final Race raceNot = Race.valueOf(c.getTextContent());
stone.addRaceNot(raceNot);
break;
}
}
}
_stones.put(stone.getId(), stone);
}
}
}

View File

@ -68,6 +68,7 @@ public final class ArmorSetsData implements IXmlReader
if ("set".equalsIgnoreCase(d.getNodeName()))
{
set = new L2ArmorSet();
set.setIsVisual(parseBoolean(d.getAttributes(), "visual", false));
set.setMinimumPieces(parseInteger(d.getAttributes(), "minimumPieces"));
for (Node a = d.getFirstChild(); a != null; a = a.getNextSibling())

View File

@ -75,7 +75,6 @@ public class ItemInfo
};
private int[] _option;
private int _visualId;
private long _visualExpiration;
@ -152,13 +151,13 @@ public class ItemInfo
}
_option = item.getEnchantOptions();
_visualId = item.getVisualId();
_visualExpiration = item.getAppearanceTime();
}
public ItemInfo(L2ItemInstance item, int change)
{
this(item);
_change = change;
_visualExpiration = item.getVisualLifeTime() > 0 ? (item.getVisualLifeTime() - System.currentTimeMillis()) / 1000 : 0;
}
public ItemInfo(TradeItem item)
@ -201,8 +200,9 @@ public class ItemInfo
_change = 0;
// Get shadow item mana
_mana = item.getMana();
_time = item.isTimeLimitedItem() ? (int) (item.getRemainingTime() / 1000) : -9999;
_mana = -1;
_time = -9999;
_location = item.getLocationSlot();
_elemAtkType = item.getAttackElementType();
@ -211,9 +211,9 @@ public class ItemInfo
{
_elemDefAttr[i] = item.getElementDefAttr(i);
}
_option = item.getEnchantOptions();
_visualId = item.getVisualId();
_visualExpiration = item.getVisualExpiration();
}
public ItemInfo(Product item)
@ -303,8 +303,6 @@ public class ItemInfo
_elemDefAttr[i] = item.getElementDefAttr(i);
}
_option = item.getEnchantOptions();
_visualId = item.getAppearanceId();
_visualExpiration = item.getAppearanceTime();
}
public int getObjectId()
@ -364,7 +362,7 @@ public class ItemInfo
public int getTime()
{
return _time;
return _time > 0 ? _time : _visualExpiration > 0 ? (int) _visualExpiration : -9999;
}
public int getLocation()

View File

@ -33,6 +33,7 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
*/
public final class L2ArmorSet
{
private boolean _isVisual;
private int _minimumPieces;
private final List<Integer> _chests;
private final List<Integer> _legs;
@ -75,6 +76,16 @@ public final class L2ArmorSet
_enchantSkills = new ArrayList<>();
}
public boolean isVisual()
{
return _isVisual;
}
public void setIsVisual(boolean val)
{
_isVisual = val;
}
/**
* @return the minimum amount of pieces equipped to form a set.
*/
@ -329,6 +340,39 @@ public final class L2ArmorSet
}
public int getVisualPiecesCount(L2PcInstance player)
{
final Inventory inv = player.getInventory();
final L2ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
final L2ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
final L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
final L2ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
int legs = 0;
int head = 0;
int gloves = 0;
int feet = 0;
if (legsItem != null)
{
legs = legsItem.getVisualId();
}
if (headItem != null)
{
head = headItem.getVisualId();
}
if (glovesItem != null)
{
gloves = glovesItem.getVisualId();
}
if (feetItem != null)
{
feet = feetItem.getVisualId();
}
return getPiecesCount(legs, head, gloves, feet);
}
public int getCON()
{
return _con;

View File

@ -77,7 +77,7 @@ public class TradeItem
_isTimeLimited = item.isTimeLimitedItem();
_time = item.isTimeLimitedItem() ? (int) (item.getRemainingTime() / 1000) : -9999;
_visualId = item.getVisualId();
_visualExpiration = item.getAppearanceTime();
_visualExpiration = item.getTime();
}
public TradeItem(L2Item item, long count, long price, int enchantLevel, int attackAttribute, int attackAttributeValue, int defenseAttributes[], int appearanceId)

View File

@ -161,6 +161,7 @@ import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.model.actor.L2Vehicle;
import com.l2jserver.gameserver.model.actor.appearance.PcAppearance;
import com.l2jserver.gameserver.model.actor.knownlist.PcKnownList;
import com.l2jserver.gameserver.model.actor.request.AbstractRequest;
import com.l2jserver.gameserver.model.actor.stat.PcStat;
import com.l2jserver.gameserver.model.actor.status.PcStatus;
import com.l2jserver.gameserver.model.actor.tasks.player.DismountTask;
@ -759,6 +760,8 @@ public final class L2PcInstance extends L2Playable
private int _expertiseWeaponPenalty = 0;
private int _expertisePenaltyBonus = 0;
private volatile Map<Class<? extends AbstractRequest>, AbstractRequest> _requests;
private boolean _isEnchanting = false;
private int _activeEnchantItemId = ID_NONE;
private int _activeEnchantSupportItemId = ID_NONE;
@ -767,9 +770,6 @@ public final class L2PcInstance extends L2Playable
private int _firstCompoundOID = -1;
private int _secondCompoundOID = -1;
private L2ItemInstance _usingAStone = null;
private L2ItemInstance _appearanceItem = null;
private L2ItemInstance _targetAppearanceItem = null;
private boolean _usingPrimeShop = false;
@ -15044,6 +15044,105 @@ public final class L2PcInstance extends L2Playable
return getServitors().values().stream().mapToInt(L2Summon::getSummonPoints).sum();
}
/**
* @param request
* @return {@code true} if the request was registered successfully, {@code false} otherwise.
*/
public boolean addRequest(AbstractRequest request)
{
if (_requests == null)
{
synchronized (this)
{
if (_requests == null)
{
_requests = new ConcurrentHashMap<>();
}
}
}
return canRequest(request) && (_requests.putIfAbsent(request.getClass(), request) == null);
}
public boolean canRequest(AbstractRequest request)
{
return (_requests != null) && _requests.values().stream().allMatch(request::canWorkWith);
}
/**
* @param clazz
* @return {@code true} if request was successfully removed, {@code false} in case processing set is not created or not containing the request.
*/
public boolean removeRequest(Class<? extends AbstractRequest> clazz)
{
return (_requests != null) && (_requests.remove(clazz) != null);
}
/**
* @param <T>
* @param requestClass
* @return object that is instance of {@code requestClass} param, {@code null} if not instance or not set.
*/
public <T extends AbstractRequest> T getRequest(Class<T> requestClass)
{
return _requests != null ? requestClass.cast(_requests.get(requestClass)) : null;
}
/**
* @return {@code true} if player has any processing request set, {@code false} otherwise.
*/
public boolean hasRequests()
{
return (_requests != null) && !_requests.isEmpty();
}
public boolean hasItemRequest()
{
return (_requests != null) && _requests.values().stream().anyMatch(AbstractRequest::isItemRequest);
}
/**
* @param requestClass
* @param classes
* @return {@code true} if player has the provided request and processing it, {@code false} otherwise.
*/
@SafeVarargs
public final boolean hasRequest(Class<? extends AbstractRequest> requestClass, Class<? extends AbstractRequest>... classes)
{
if (_requests != null)
{
for (Class<? extends AbstractRequest> clazz : classes)
{
if (_requests.containsKey(clazz))
{
return true;
}
}
return _requests.containsKey(requestClass);
}
return false;
}
/**
* @param objectId
* @return {@code true} if item object id is currently in use by some request, {@code false} otherwise.
*/
public boolean isProcessingItem(int objectId)
{
return (_requests != null) && _requests.values().stream().anyMatch(req -> req.isUsing(objectId));
}
/**
* Removing all requests associated with the item object id provided.
* @param objectId
*/
public void removeRequestsThatProcessesItem(int objectId)
{
if (_requests != null)
{
_requests.values().removeIf(req -> req.isUsing(objectId));
}
}
/*
* Return current vitality points in integer format
*/
@ -15094,36 +15193,6 @@ public final class L2PcInstance extends L2Playable
_secondCompoundOID = secondCompoundOID;
}
public L2ItemInstance getUsingAppearanceStone()
{
return _usingAStone;
}
public void setUsingAppearanceStone(L2ItemInstance stone)
{
_usingAStone = stone;
}
public L2ItemInstance getAppearanceItem()
{
return _appearanceItem;
}
public void setAppearanceItem(L2ItemInstance item)
{
_appearanceItem = item;
}
public L2ItemInstance getTargetAppearanceItem()
{
return _targetAppearanceItem;
}
public void setTargetAppearanceItem(L2ItemInstance item)
{
_targetAppearanceItem = item;
}
public void setUsingPrimeShop(boolean isUsing)
{
_usingPrimeShop = isUsing;

View File

@ -0,0 +1,94 @@
/*
* 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.model.actor.request;
import java.util.Objects;
import java.util.concurrent.ScheduledFuture;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* @author UnAfraid
*/
public abstract class AbstractRequest
{
private final L2PcInstance _activeChar;
private volatile long _timestamp = 0;
private volatile boolean _isProcessing;
private ScheduledFuture<?> _timeOutTask;
public AbstractRequest(L2PcInstance activeChar)
{
Objects.requireNonNull(activeChar);
_activeChar = activeChar;
}
public L2PcInstance getActiveChar()
{
return _activeChar;
}
public long getTimestamp()
{
return _timestamp;
}
public void setTimestamp(long timestamp)
{
_timestamp = timestamp;
}
public void scheduleTimeout(long delay)
{
_timeOutTask = ThreadPoolManager.getInstance().scheduleGeneral(this::onTimeout, delay);
}
public boolean isTimeout()
{
return (_timeOutTask != null) && !_timeOutTask.isDone();
}
public boolean isProcessing()
{
return _isProcessing;
}
public boolean setProcessing(boolean isProcessing)
{
return _isProcessing = isProcessing;
}
public boolean canWorkWith(AbstractRequest request)
{
return true;
}
public boolean isItemRequest()
{
return false;
}
public abstract boolean isUsing(int objectId);
public void onTimeout()
{
}
}

View File

@ -0,0 +1,75 @@
/*
* 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.model.actor.request;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
/**
* @author Sdw
*/
public class ShapeShiftingItemRequest extends AbstractRequest
{
private L2ItemInstance _appearanceStone;
private L2ItemInstance _appearanceExtractItem;
public ShapeShiftingItemRequest(L2PcInstance activeChar, L2ItemInstance appearanceStone)
{
super(activeChar);
_appearanceStone = appearanceStone;
}
public L2ItemInstance getAppearanceStone()
{
return _appearanceStone;
}
public void setAppearanceStone(L2ItemInstance appearanceStone)
{
_appearanceStone = appearanceStone;
}
public L2ItemInstance getAppearanceExtractItem()
{
return _appearanceExtractItem;
}
public void setAppearanceExtractItem(L2ItemInstance appearanceExtractItem)
{
_appearanceExtractItem = appearanceExtractItem;
}
@Override
public boolean isItemRequest()
{
return true;
}
@Override
public boolean canWorkWith(AbstractRequest request)
{
return !request.isItemRequest();
}
@Override
public boolean isUsing(int objectId)
{
return (objectId > 0) && ((objectId == _appearanceStone.getObjectId()) || (objectId == _appearanceExtractItem.getObjectId()));
}
}

View File

@ -1,113 +0,0 @@
/*
* 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.model.entity;
import java.util.ArrayList;
/**
* @author Erlandys
*/
public class AppearanceStone
{
public enum StoneType
{
NONE,
NORMAL,
BLESSED,
FIXED,
RESTORE
}
public enum AppearanceItemType
{
NONE,
WEAPON,
ARMOR,
ACCESSORY,
ALL
}
private final int _itemId;
private final StoneType _type;
private final AppearanceItemType _itemType;
private final ArrayList<Integer> _grades;
private final long _price;
private final int _targetItem;
private final long _timeForAppearance;
private int _maxGrade;
public AppearanceStone(int itemId, StoneType type, AppearanceItemType itemType, ArrayList<Integer> grades, long price, int targetItem, long timeForAppearance)
{
_itemId = itemId;
_type = type;
_itemType = itemType;
_grades = grades;
_maxGrade = grades.get(0);
for (int gr : _grades)
{
if (_maxGrade < gr)
{
_maxGrade = gr;
}
}
_price = price;
_targetItem = targetItem;
_timeForAppearance = timeForAppearance;
}
public int getItemId()
{
return _itemId;
}
public StoneType getType()
{
return _type;
}
public AppearanceItemType getItemType()
{
return _itemType;
}
public ArrayList<Integer> getGrades()
{
return _grades;
}
public int getMaxGrade()
{
return _maxGrade;
}
public long getPrice()
{
return _price;
}
public int getTargetItem()
{
return _targetItem;
}
public long getTimeForAppearance()
{
return _timeForAppearance;
}
}

View File

@ -358,6 +358,7 @@ public abstract class Inventory extends ItemContainer
if (itemSkill != null)
{
itemSkill.setReferenceItemId(item.getId());
player.addSkill(itemSkill, false);
if (itemSkill.isActive())
@ -454,7 +455,6 @@ public abstract class Inventory extends ItemContainer
if (itemSkill != null)
{
itemSkill.setReferenceItemId(item.getId());
player.addSkill(itemSkill, false);
if (itemSkill.isActive())
@ -644,6 +644,16 @@ public abstract class Inventory extends ItemContainer
}
}
final L2ArmorSet visualArmorSet = ArmorSetsData.getInstance().getSet(chestItem.getVisualId());
if ((visualArmorSet != null) && visualArmorSet.isVisual())
{
int pieces = visualArmorSet.getVisualPiecesCount(player);
if (pieces >= visualArmorSet.getMinimumPieces())
{
addSkills(player, item, visualArmorSet.getSkills(), visualArmorSet.getPiecesCount(player));
}
}
if (update)
{
player.sendSkillList();
@ -687,6 +697,11 @@ public abstract class Inventory extends ItemContainer
{
remove = true;
}
if (removeArmorsetBonus(player, ArmorSetsData.getInstance().getSet(item.getVisualId())))
{
remove = true;
}
}
else
{
@ -697,7 +712,7 @@ public abstract class Inventory extends ItemContainer
}
final L2ArmorSet armorSet = ArmorSetsData.getInstance().getSet(chestItem.getId());
if (armorSet != null)
if ((armorSet != null) && !armorSet.isVisual())
{
if (armorSet.containItem(slot, item.getId())) // removed part of set
{
@ -720,6 +735,25 @@ public abstract class Inventory extends ItemContainer
}
}
}
final L2ArmorSet visualArmorSet = ArmorSetsData.getInstance().getSet(chestItem.getVisualId());
if ((visualArmorSet != null) && visualArmorSet.isVisual())
{
if (visualArmorSet.containItem(slot, item.getVisualId())) // removed part of set
{
if (removeArmorsetBonus(player, visualArmorSet))
{
remove = true;
}
}
else if (visualArmorSet.containShield(item.getVisualId())) // removed shield
{
if (removeShieldSkills(player, visualArmorSet.getShieldSkills()))
{
remove = true;
}
}
}
}
if (remove)
@ -1788,7 +1822,7 @@ public abstract class Inventory extends ItemContainer
public void restore()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT object_id, item_id, count, enchant_level, loc, loc_data, custom_type1, custom_type2, mana_left, time, appearance_id, appearance_time FROM items WHERE owner_id=? AND (loc=? OR loc=?) ORDER BY loc_data"))
PreparedStatement statement = con.prepareStatement("SELECT object_id, item_id, count, enchant_level, loc, loc_data, custom_type1, custom_type2, mana_left, time FROM items WHERE owner_id=? AND (loc=? OR loc=?) ORDER BY loc_data"))
{
statement.setInt(1, getOwnerId());
statement.setString(2, getBaseLocation().name());

View File

@ -40,6 +40,7 @@ import com.l2jserver.gameserver.model.events.impl.character.player.inventory.OnP
import com.l2jserver.gameserver.model.events.impl.character.player.inventory.OnPlayerItemTransfer;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.variables.ItemVariables;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.ExAdenaInvenCount;
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoInvenWeight;
@ -880,7 +881,7 @@ public class PcInventory extends Inventory
{
int[][] paperdoll = new int[33][4];
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement2 = con.prepareStatement("SELECT object_id,item_id,loc_data,enchant_level,appearance_id FROM items WHERE owner_id=? AND loc='PAPERDOLL'"))
PreparedStatement statement2 = con.prepareStatement("SELECT object_id,item_id,loc_data,enchant_level FROM items WHERE owner_id=? AND loc='PAPERDOLL'"))
{
statement2.setInt(1, objectId);
try (ResultSet invdata = statement2.executeQuery())
@ -888,13 +889,11 @@ public class PcInventory extends Inventory
while (invdata.next())
{
int slot = invdata.getInt("loc_data");
final ItemVariables vars = new ItemVariables(invdata.getInt("object_id"));
paperdoll[slot][0] = invdata.getInt("object_id");
paperdoll[slot][1] = invdata.getInt("item_id");
paperdoll[slot][2] = invdata.getInt("enchant_level");
paperdoll[slot][3] = invdata.getInt("appearance_id");
/*
* if (slot == Inventory.PAPERDOLL_RHAND) { paperdoll[Inventory.PAPERDOLL_RHAND][0] = invdata.getInt("object_id"); paperdoll[Inventory.PAPERDOLL_RHAND][1] = invdata.getInt("item_id"); paperdoll[Inventory.PAPERDOLL_RHAND][2] = invdata.getInt("enchant_level"); }
*/
paperdoll[slot][3] = vars.getInt(ItemVariables.VISUAL_ID, 0);
}
}
}

View File

@ -19,7 +19,6 @@
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;
@ -118,10 +117,4 @@ public final class L2Armor extends L2Item
}
return _enchant4Skill.getSkill();
}
@Override
public AppearanceStone getAppearanceStone()
{
return null;
}
}

View File

@ -21,10 +21,8 @@ package com.l2jserver.gameserver.model.items;
import java.util.ArrayList;
import java.util.List;
import com.l2jserver.gameserver.data.xml.impl.AppearanceItemData;
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;
@ -39,7 +37,6 @@ 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.
@ -123,7 +120,6 @@ public final class L2EtcItem extends L2Item
}
_isInfinite = set.getBoolean("is_infinite", false);
_appearanceStone = (_handler != null) && _handler.equals("Appearance") ? AppearanceItemData.getInstance().getStone(getId()) : null;
}
/**
@ -175,10 +171,4 @@ public final class L2EtcItem extends L2Item
{
return _isInfinite;
}
@Override
public AppearanceStone getAppearanceStone()
{
return _appearanceStone;
}
}

View File

@ -35,7 +35,6 @@ 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;
@ -964,6 +963,4 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
{
return null;
}
public abstract AppearanceStone getAppearanceStone();
}

View File

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

View File

@ -26,7 +26,6 @@ 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;
@ -450,10 +449,4 @@ public final class L2Weapon extends L2Item
caster.sendPacket(sm);
}
}
@Override
public AppearanceStone getAppearanceStone()
{
return null;
}
}

View File

@ -0,0 +1,29 @@
/*
* 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.model.items.appearance;
/**
* @author UnAfraid
*/
public enum AppearanceHandType
{
NONE,
ONE_HANDED,
TWO_HANDED,
}

View File

@ -0,0 +1,29 @@
/*
* 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.model.items.appearance;
/**
* @author UnAfraid
*/
public enum AppearanceMagicType
{
NONE,
MAGICAL,
PHYISICAL,
}

View File

@ -0,0 +1,210 @@
/*
* 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.model.items.appearance;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.enums.Race;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.type.ArmorType;
import com.l2jserver.gameserver.model.items.type.CrystalType;
import com.l2jserver.gameserver.model.items.type.WeaponType;
/**
* @author UnAfraid
*/
public class AppearanceStone
{
private final int _id;
private final int _cost;
private final int _visualId;
private final long _lifeTime;
private final AppearanceType _type;
private final WeaponType _weaponType;
private final ArmorType _armorType;
private final AppearanceHandType _handType;
private final AppearanceMagicType _magicType;
private List<CrystalType> _crystalTypes;
private List<AppearanceTargetType> _targetTypes;
private List<Integer> _bodyParts;
private List<Race> _races;
private List<Race> _racesNot;
public AppearanceStone(StatsSet set)
{
_id = set.getInt("id");
_visualId = set.getInt("visualId", 0);
_cost = set.getInt("cost", 0);
_lifeTime = set.getDuration("lifeTime", Duration.ofSeconds(0)).toMillis();
_type = set.getEnum("type", AppearanceType.class, AppearanceType.NONE);
_weaponType = set.getEnum("weaponType", WeaponType.class, WeaponType.NONE);
_armorType = set.getEnum("armorType", ArmorType.class, ArmorType.NONE);
_handType = set.getEnum("handType", AppearanceHandType.class, AppearanceHandType.NONE);
_magicType = set.getEnum("magicType", AppearanceMagicType.class, AppearanceMagicType.NONE);
final CrystalType crystalType = set.getEnum("crystalType", CrystalType.class, CrystalType.NONE);
if (crystalType != CrystalType.NONE)
{
addCrystalType(crystalType);
}
final AppearanceTargetType targetType = set.getEnum("targetType", AppearanceTargetType.class, AppearanceTargetType.NONE);
if (targetType != AppearanceTargetType.NONE)
{
addTargetType(targetType);
}
final int bodyPart = ItemTable._slots.get(set.getString("bodyPart", "none"));
if (bodyPart != L2Item.SLOT_NONE)
{
addBodyPart(bodyPart);
}
final Race race = set.getEnum("race", Race.class, Race.NONE);
if (race != Race.NONE)
{
addRace(race);
}
final Race raceNot = set.getEnum("raceNot", Race.class, Race.NONE);
if (raceNot != Race.NONE)
{
addRaceNot(raceNot);
}
}
public int getId()
{
return _id;
}
public int getVisualId()
{
return _visualId;
}
public int getCost()
{
return _cost;
}
public long getLifeTime()
{
return _lifeTime;
}
public AppearanceType getType()
{
return _type;
}
public WeaponType getWeaponType()
{
return _weaponType;
}
public ArmorType getArmorType()
{
return _armorType;
}
public AppearanceHandType getHandType()
{
return _handType;
}
public AppearanceMagicType getMagicType()
{
return _magicType;
}
public void addCrystalType(CrystalType type)
{
if (_crystalTypes == null)
{
_crystalTypes = new ArrayList<>();
}
_crystalTypes.add(type);
}
public List<CrystalType> getCrystalTypes()
{
return _crystalTypes != null ? _crystalTypes : Collections.emptyList();
}
public void addTargetType(AppearanceTargetType type)
{
if (_targetTypes == null)
{
_targetTypes = new ArrayList<>();
}
_targetTypes.add(type);
}
public List<AppearanceTargetType> getTargetTypes()
{
return _targetTypes != null ? _targetTypes : Collections.emptyList();
}
public void addBodyPart(Integer part)
{
if (_bodyParts == null)
{
_bodyParts = new ArrayList<>();
}
_bodyParts.add(part);
}
public List<Integer> getBodyParts()
{
return _bodyParts != null ? _bodyParts : Collections.emptyList();
}
public void addRace(Race race)
{
if (_races == null)
{
_races = new ArrayList<>();
}
_races.add(race);
}
public List<Race> getRaces()
{
return _races != null ? _races : Collections.emptyList();
}
public void addRaceNot(Race race)
{
if (_racesNot == null)
{
_racesNot = new ArrayList<>();
}
_racesNot.add(race);
}
public List<Race> getRacesNot()
{
return _racesNot != null ? _racesNot : Collections.emptyList();
}
}

View File

@ -0,0 +1,31 @@
/*
* 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.model.items.appearance;
/**
* @author UnAfraid
*/
public enum AppearanceTargetType
{
NONE,
WEAPON,
ARMOR,
ACCESSORY,
ALL
}

View File

@ -0,0 +1,31 @@
/*
* 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.model.items.appearance;
/**
* @author UnAfraid
*/
public enum AppearanceType
{
NONE,
NORMAL,
BLESSED,
FIXED,
RESTORE;
}

View File

@ -37,12 +37,14 @@ import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.data.xml.impl.AppearanceItemData;
import com.l2jserver.gameserver.data.xml.impl.EnchantItemOptionsData;
import com.l2jserver.gameserver.data.xml.impl.OptionData;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.enums.ItemLocation;
import com.l2jserver.gameserver.enums.ShotType;
import com.l2jserver.gameserver.enums.UserInfoType;
import com.l2jserver.gameserver.idfactory.IdFactory;
import com.l2jserver.gameserver.instancemanager.ItemsOnGroundManager;
import com.l2jserver.gameserver.instancemanager.MercTicketManager;
@ -69,14 +71,17 @@ import com.l2jserver.gameserver.model.items.L2Armor;
import com.l2jserver.gameserver.model.items.L2EtcItem;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.L2Weapon;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.type.EtcItemType;
import com.l2jserver.gameserver.model.items.type.ItemType;
import com.l2jserver.gameserver.model.options.EnchantOptions;
import com.l2jserver.gameserver.model.options.Options;
import com.l2jserver.gameserver.model.stats.functions.AbstractFunction;
import com.l2jserver.gameserver.model.variables.ItemVariables;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.DropItem;
import com.l2jserver.gameserver.network.serverpackets.ExAdenaInvenCount;
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoEquipSlot;
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import com.l2jserver.gameserver.network.serverpackets.GetItem;
import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
@ -163,6 +168,7 @@ public final class L2ItemInstance extends L2Object
private ScheduledFuture<?> itemLootShedule = null;
private ScheduledFuture<?> _lifeTimeTask;
private ScheduledFuture<?> _appearanceLifeTimeTask;
private final DropProtection _dropProtection = new DropProtection();
@ -170,9 +176,6 @@ 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
@ -1502,8 +1505,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, appearance_id;
long time, count, appearance_time;
int objectId, item_id, loc_data, enchant_level, custom_type1, custom_type2, manaLeft;
long time, count;
ItemLocation loc;
try
{
@ -1517,8 +1520,6 @@ 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)
{
@ -1545,8 +1546,6 @@ 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())
@ -1665,7 +1664,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=?,appearance_id=?,appearance_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=? " + "WHERE object_id = ?"))
{
ps.setInt(1, _ownerId);
ps.setLong(2, getCount());
@ -1676,9 +1675,7 @@ public final class L2ItemInstance extends L2Object
ps.setInt(7, getCustomType2());
ps.setInt(8, getMana());
ps.setLong(9, getTime());
ps.setInt(10, getVisualId());
ps.setLong(11, getAppearanceTime());
ps.setInt(12, getObjectId());
ps.setInt(10, getObjectId());
ps.executeUpdate();
_existsInDb = true;
_storedInDb = true;
@ -2260,27 +2257,101 @@ public final class L2ItemInstance extends L2Object
_lifeTimeTask.cancel(false);
_lifeTimeTask = null;
}
if ((_appearanceLifeTimeTask != null) && !_appearanceLifeTimeTask.isDone())
{
_appearanceLifeTimeTask.cancel(false);
_appearanceLifeTimeTask = null;
}
}
public final ItemVariables getVariables()
{
final ItemVariables vars = getScript(ItemVariables.class);
return vars != null ? vars : addScript(new ItemVariables(getObjectId()));
}
public int getVisualId()
{
return _appearanceId;
final int visualId = getVariables().getInt(ItemVariables.VISUAL_ID, 0);
if (visualId > 0)
{
final int appearanceStoneId = getVariables().getInt(ItemVariables.VISUAL_APPEARANCE_STONE_ID, 0);
if (appearanceStoneId > 0)
{
final AppearanceStone stone = AppearanceItemData.getInstance().getStone(appearanceStoneId);
if (stone != null)
{
final L2PcInstance player = getActingPlayer();
if (player != null)
{
if (!stone.getRaces().isEmpty() && !stone.getRaces().contains(player.getRace()))
{
return 0;
}
if (!stone.getRacesNot().isEmpty() && stone.getRacesNot().contains(player.getRace()))
{
return 0;
}
}
}
}
}
return visualId;
}
public void setAppearanceId(int appearanceId)
public void setVisualId(int visualId)
{
_storedInDb = false;
_appearanceId = appearanceId;
getVariables().set(ItemVariables.VISUAL_ID, visualId);
}
public long getAppearanceTime()
public long getVisualLifeTime()
{
_storedInDb = false;
return _appearanceTime;
return getVariables().getLong(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, 0);
}
public void setAppearanceTime(long appearanceTime)
public void scheduleVisualLifeTime()
{
_appearanceTime = appearanceTime;
if (_appearanceLifeTimeTask != null)
{
_appearanceLifeTimeTask.cancel(false);
}
if (getVisualLifeTime() > 0)
{
final long time = getVisualLifeTime() - System.currentTimeMillis();
if (time > 0)
{
_appearanceLifeTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(this::onVisualLifeTimeEnd, time);
}
else
{
ThreadPoolManager.getInstance().executeGeneral(this::onVisualLifeTimeEnd);
}
}
}
private final void onVisualLifeTimeEnd()
{
final ItemVariables vars = getVariables();
vars.remove(ItemVariables.VISUAL_ID);
vars.remove(ItemVariables.VISUAL_APPEARANCE_STONE_ID);
vars.remove(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME);
vars.storeMe();
final L2PcInstance player = getActingPlayer();
if (player != null)
{
final InventoryUpdate iu = new InventoryUpdate();
iu.addModifiedItem(this);
player.broadcastUserInfo(UserInfoType.APPAREANCE);
player.sendPacket(new ExUserInfoEquipSlot(player));
player.sendPacket(iu);
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_BEEN_RESTORED_TO_ITS_PREVIOUS_APPEARANCE_AS_ITS_TEMPORARY_MODIFICATION_HAS_EXPIRED).addItemName(this));
}
}
public boolean isAppearanceable()
{
return isWeapon() || isArmor();
}
}

View File

@ -0,0 +1,173 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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 DataPack 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.model.variables;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jserver.L2DatabaseFactory;
/**
* @author UnAfraid
*/
public class ItemVariables extends AbstractVariables
{
private static final Logger _log = Logger.getLogger(ItemVariables.class.getName());
// SQL Queries.
private static final String SELECT_QUERY = "SELECT * FROM item_variables WHERE id = ?";
private static final String SELECT_COUNT = "SELECT COUNT(*) FROM item_variables WHERE id = ?";
private static final String DELETE_QUERY = "DELETE FROM item_variables WHERE id = ?";
private static final String INSERT_QUERY = "INSERT INTO item_variables (id, var, val) VALUES (?, ?, ?)";
private final int _objectId;
// Static Constants
public static final String VISUAL_ID = "visualId";
public static final String VISUAL_APPEARANCE_STONE_ID = "visualAppearanceStoneId";
public static final String VISUAL_APPEARANCE_LIFE_TIME = "visualAppearanceLifetime";
public ItemVariables(int objectId)
{
_objectId = objectId;
restoreMe();
}
public static boolean hasVariables(int objectId)
{
// Restore previous variables.
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement st = con.prepareStatement(SELECT_COUNT))
{
st.setInt(1, objectId);
try (ResultSet rset = st.executeQuery())
{
if (rset.next())
{
return rset.getInt(1) > 0;
}
}
}
catch (SQLException e)
{
_log.log(Level.WARNING, ItemVariables.class.getSimpleName() + ": Couldn't select variables count for: " + objectId, e);
return false;
}
return true;
}
@Override
public boolean restoreMe()
{
// Restore previous variables.
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement st = con.prepareStatement(SELECT_QUERY))
{
st.setInt(1, _objectId);
try (ResultSet rset = st.executeQuery())
{
while (rset.next())
{
set(rset.getString("var"), rset.getString("val"), false);
}
}
}
catch (SQLException e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't restore variables for: " + _objectId, e);
return false;
}
finally
{
compareAndSetChanges(true, false);
}
return true;
}
@Override
public boolean storeMe()
{
// No changes, nothing to store.
if (!hasChanges())
{
return false;
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
// Clear previous entries.
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
{
st.setInt(1, _objectId);
st.execute();
}
// Insert all variables.
try (PreparedStatement st = con.prepareStatement(INSERT_QUERY))
{
st.setInt(1, _objectId);
for (Entry<String, Object> entry : getSet().entrySet())
{
st.setString(2, entry.getKey());
st.setString(3, String.valueOf(entry.getValue()));
st.addBatch();
}
st.executeBatch();
}
}
catch (SQLException e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't update variables for: " + _objectId, e);
return false;
}
finally
{
compareAndSetChanges(true, false);
}
return true;
}
@Override
public boolean deleteMe()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
// Clear previous entries.
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
{
st.setInt(1, _objectId);
st.execute();
}
// Clear all entries
getSet().clear();
}
catch (Exception e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Couldn't delete variables for: " + _objectId, e);
return false;
}
return true;
}
}

View File

@ -33,6 +33,10 @@ import com.l2jserver.gameserver.network.clientpackets.*;
import com.l2jserver.gameserver.network.clientpackets.adenadistribution.RequestDivideAdena;
import com.l2jserver.gameserver.network.clientpackets.adenadistribution.RequestDivideAdenaCancel;
import com.l2jserver.gameserver.network.clientpackets.adenadistribution.RequestDivideAdenaStart;
import com.l2jserver.gameserver.network.clientpackets.appearance.RequestExCancelShape_Shifting_Item;
import com.l2jserver.gameserver.network.clientpackets.appearance.RequestExTryToPutShapeShiftingEnchantSupportItem;
import com.l2jserver.gameserver.network.clientpackets.appearance.RequestExTryToPutShapeShiftingTargetItem;
import com.l2jserver.gameserver.network.clientpackets.appearance.RequestShapeShiftingItem;
import com.l2jserver.gameserver.network.clientpackets.auctionhouse.RequestCommissionBuyInfo;
import com.l2jserver.gameserver.network.clientpackets.auctionhouse.RequestCommissionBuyItem;
import com.l2jserver.gameserver.network.clientpackets.auctionhouse.RequestCommissionCancel;
@ -57,10 +61,6 @@ import com.l2jserver.gameserver.network.clientpackets.friend.RequestFriendList;
import com.l2jserver.gameserver.network.clientpackets.friend.RequestSendFriendMsg;
import com.l2jserver.gameserver.network.clientpackets.friend.RequestUpdateBlockMemo;
import com.l2jserver.gameserver.network.clientpackets.friend.RequestUpdateFriendMemo;
import com.l2jserver.gameserver.network.clientpackets.itemappearance.RequestExCancelShape_Shifting_Item;
import com.l2jserver.gameserver.network.clientpackets.itemappearance.RequestExTryToPut_Shape_Shifting_EnchantSupportItem;
import com.l2jserver.gameserver.network.clientpackets.itemappearance.RequestExTryToPut_Shape_Shifting_TargetItem;
import com.l2jserver.gameserver.network.clientpackets.itemappearance.RequestShape_Shifting_Item;
import com.l2jserver.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
import com.l2jserver.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
import com.l2jserver.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
@ -1487,16 +1487,16 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
// msg = new ExSysstring(); (chdS)
break;
case 0xC4:
msg = new RequestExTryToPut_Shape_Shifting_TargetItem();
msg = new RequestExTryToPutShapeShiftingTargetItem();
break;
case 0xC5:
msg = new RequestExTryToPut_Shape_Shifting_EnchantSupportItem();
msg = new RequestExTryToPutShapeShiftingEnchantSupportItem();
break;
case 0xC6:
msg = new RequestExCancelShape_Shifting_Item();
break;
case 0xC7:
msg = new RequestShape_Shifting_Item();
msg = new RequestShapeShiftingItem();
break;
case 0xC8:
// msg = new NCGuardSendDataToServer(); // (chdb)

View File

@ -16,15 +16,18 @@
* 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.network.clientpackets.itemappearance;
package com.l2jserver.gameserver.network.clientpackets.appearance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.request.ShapeShiftingItemRequest;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExShapeShiftingResult;
public final class RequestExCancelShape_Shifting_Item extends L2GameClientPacket
/**
* @author UnAfraid
*/
public class RequestExCancelShape_Shifting_Item extends L2GameClientPacket
{
private static final String _C__D0_C6_REQUESTEXCANCELSHAPE_SHIFTING_ITEM = "[C] D0:C6 RequestExCancelShape_Shifting_Item";
@Override
protected void readImpl()
{
@ -33,19 +36,19 @@ public final class RequestExCancelShape_Shifting_Item extends L2GameClientPacket
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
final L2PcInstance player = getActiveChar();
if (player == null)
{
return;
}
player.setAppearanceItem(null);
player.setTargetAppearanceItem(null);
player.setUsingAppearanceStone(null);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(ExShapeShiftingResult.FAILED);
}
@Override
public String getType()
{
return _C__D0_C6_REQUESTEXCANCELSHAPE_SHIFTING_ITEM;
return getClass().getSimpleName();
}
}

View File

@ -0,0 +1,241 @@
/*
* 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.network.clientpackets.appearance;
import com.l2jserver.gameserver.data.xml.impl.AppearanceItemData;
import com.l2jserver.gameserver.enums.ItemLocation;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.request.ShapeShiftingItemRequest;
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.appearance.AppearanceType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.items.type.ArmorType;
import com.l2jserver.gameserver.model.items.type.WeaponType;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExPutShapeShiftingExtractionItemResult;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExShapeShiftingResult;
/**
* @author UnAfraid
*/
public class RequestExTryToPutShapeShiftingEnchantSupportItem extends L2GameClientPacket
{
private int _targetItemObjId;
private int _extracItemObjId;
@Override
protected void readImpl()
{
_targetItemObjId = readD();
_extracItemObjId = readD();
}
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
if (player == null)
{
return;
}
final ShapeShiftingItemRequest request = player.getRequest(ShapeShiftingItemRequest.class);
if (player.isInStoreMode() || player.isInCraftMode() || player.isProcessingRequest() || player.isProcessingTransaction() || (request == null))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP);
return;
}
final PcInventory inventory = player.getInventory();
final L2ItemInstance targetItem = inventory.getItemByObjectId(_targetItemObjId);
final L2ItemInstance extracItem = inventory.getItemByObjectId(_extracItemObjId);
L2ItemInstance stone = request.getAppearanceStone();
if ((targetItem == null) || (extracItem == null) || (stone == null))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!extracItem.isAppearanceable())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((extracItem.getItemLocation() != ItemLocation.INVENTORY) && (extracItem.getItemLocation() != ItemLocation.PAPERDOLL))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
final AppearanceStone appearanceStone = AppearanceItemData.getInstance().getStone(stone.getId());
if (appearanceStone == null)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((appearanceStone.getType() == AppearanceType.RESTORE) || (appearanceStone.getType() == AppearanceType.FIXED))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (extracItem.getVisualId() > 0)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.YOU_CANNOT_EXTRACT_FROM_A_MODIFIED_ITEM);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (appearanceStone.getWeaponType() != WeaponType.NONE)
{
if (!targetItem.isWeapon() || (targetItem.getItemType() != appearanceStone.getWeaponType()))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
if (appearanceStone.getWeaponType() != WeaponType.NONE)
{
if (!targetItem.isWeapon() || (targetItem.getItemType() != appearanceStone.getWeaponType()))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
switch (appearanceStone.getHandType())
{
case ONE_HANDED:
{
if ((targetItem.getItem().getBodyPart() & L2Item.SLOT_R_HAND) != L2Item.SLOT_R_HAND)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
case TWO_HANDED:
{
if ((targetItem.getItem().getBodyPart() & L2Item.SLOT_LR_HAND) != L2Item.SLOT_LR_HAND)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
}
switch (appearanceStone.getMagicType())
{
case MAGICAL:
{
if (!targetItem.getItem().isMagicWeapon())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
case PHYISICAL:
{
if (targetItem.getItem().isMagicWeapon())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
}
}
if (appearanceStone.getArmorType() != ArmorType.NONE)
{
switch (appearanceStone.getArmorType())
{
case SHIELD:
{
if (!targetItem.isArmor() || (targetItem.getItemType() != ArmorType.SHIELD))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
case SIGIL:
{
if (!targetItem.isArmor() || (targetItem.getItemType() != ArmorType.SIGIL))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
}
}
if (extracItem.getOwnerId() != player.getObjectId())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
request.setAppearanceExtractItem(extracItem);
player.sendPacket(ExPutShapeShiftingExtractionItemResult.SUCCESS);
}
@Override
public String getType()
{
return getClass().getSimpleName();
}
}

View File

@ -0,0 +1,268 @@
/*
* 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.network.clientpackets.appearance;
import com.l2jserver.gameserver.data.xml.impl.AppearanceItemData;
import com.l2jserver.gameserver.enums.ItemLocation;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.request.ShapeShiftingItemRequest;
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.appearance.AppearanceTargetType;
import com.l2jserver.gameserver.model.items.appearance.AppearanceType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.items.type.ArmorType;
import com.l2jserver.gameserver.model.items.type.WeaponType;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExPutShapeShiftingTargetItemResult;
/**
* @author UnAfraid
*/
public class RequestExTryToPutShapeShiftingTargetItem extends L2GameClientPacket
{
private int _targetItemObjId;
@Override
protected void readImpl()
{
_targetItemObjId = readD();
}
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
if (player == null)
{
return;
}
final ShapeShiftingItemRequest request = player.getRequest(ShapeShiftingItemRequest.class);
if (player.isInStoreMode() || player.isInCraftMode() || player.isProcessingRequest() || player.isProcessingTransaction() || (request == null))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP);
return;
}
final PcInventory inventory = player.getInventory();
final L2ItemInstance targetItem = inventory.getItemByObjectId(_targetItemObjId);
L2ItemInstance stone = request.getAppearanceStone();
if ((targetItem == null) || (stone == null))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!targetItem.isAppearanceable())
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((targetItem.getItemLocation() != ItemLocation.INVENTORY) && (targetItem.getItemLocation() != ItemLocation.PAPERDOLL))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null)
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
final AppearanceStone appearanceStone = AppearanceItemData.getInstance().getStone(stone.getId());
if (appearanceStone == null)
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (((appearanceStone.getType() != AppearanceType.RESTORE) && (targetItem.getVisualId() > 0)) || ((appearanceStone.getType() == AppearanceType.RESTORE) && (targetItem.getVisualId() == 0)))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
// TODO: Handle hair accessory!
// if (!targetItem.isEtcItem() && (targetItem.getItem().getCrystalType() == CrystalType.NONE))
{
// player.sendPacket(SystemMessageId.YOU_CANNOT_MODIFY_OR_RESTORE_NOGRADE_ITEMS);
// return;
}
if (!appearanceStone.getCrystalTypes().isEmpty() && !appearanceStone.getCrystalTypes().contains(targetItem.getItem().getCrystalType()))
{
player.sendPacket(SystemMessageId.ITEM_GRADES_DO_NOT_MATCH);
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (appearanceStone.getTargetTypes().isEmpty())
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!appearanceStone.getTargetTypes().contains(AppearanceTargetType.ALL))
{
if (targetItem.isWeapon() && !appearanceStone.getTargetTypes().contains(AppearanceTargetType.WEAPON))
{
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
else if (targetItem.isArmor() && !appearanceStone.getTargetTypes().contains(AppearanceTargetType.ARMOR) && !appearanceStone.getTargetTypes().contains(AppearanceTargetType.ACCESSORY))
{
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
else if (targetItem.isArmor() && !appearanceStone.getBodyParts().isEmpty() && !appearanceStone.getBodyParts().contains(targetItem.getItem().getBodyPart()))
{
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
if (appearanceStone.getWeaponType() != WeaponType.NONE)
{
if (!targetItem.isWeapon() || (targetItem.getItemType() != appearanceStone.getWeaponType()))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
switch (appearanceStone.getHandType())
{
case ONE_HANDED:
{
if ((targetItem.getItem().getBodyPart() & L2Item.SLOT_R_HAND) != L2Item.SLOT_R_HAND)
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
break;
}
case TWO_HANDED:
{
if ((targetItem.getItem().getBodyPart() & L2Item.SLOT_LR_HAND) != L2Item.SLOT_LR_HAND)
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
break;
}
}
switch (appearanceStone.getMagicType())
{
case MAGICAL:
{
if (!targetItem.getItem().isMagicWeapon())
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
break;
}
case PHYISICAL:
{
if (targetItem.getItem().isMagicWeapon())
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
}
}
}
if (appearanceStone.getArmorType() != ArmorType.NONE)
{
switch (appearanceStone.getArmorType())
{
case SHIELD:
{
if (!targetItem.isArmor() || (targetItem.getItemType() != ArmorType.SHIELD))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
break;
}
case SIGIL:
{
if (!targetItem.isArmor() || (targetItem.getItemType() != ArmorType.SIGIL))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(SystemMessageId.THIS_ITEM_DOES_NOT_MEET_REQUIREMENTS);
return;
}
}
}
}
if (targetItem.getOwnerId() != player.getObjectId())
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
player.sendPacket(new ExPutShapeShiftingTargetItemResult(ExPutShapeShiftingTargetItemResult.RESULT_SUCCESS, appearanceStone.getCost()));
}
@Override
public String getType()
{
return getClass().getSimpleName();
}
}

View File

@ -0,0 +1,416 @@
/*
* 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.network.clientpackets.appearance;
import com.l2jserver.gameserver.data.xml.impl.AppearanceItemData;
import com.l2jserver.gameserver.enums.InventorySlot;
import com.l2jserver.gameserver.enums.ItemLocation;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.request.ShapeShiftingItemRequest;
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.appearance.AppearanceTargetType;
import com.l2jserver.gameserver.model.items.appearance.AppearanceType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.items.type.ArmorType;
import com.l2jserver.gameserver.model.items.type.WeaponType;
import com.l2jserver.gameserver.model.variables.ItemVariables;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoEquipSlot;
import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExPutShapeShiftingTargetItemResult;
import com.l2jserver.gameserver.network.serverpackets.appearance.ExShapeShiftingResult;
/**
* @author UnAfraid
*/
public class RequestShapeShiftingItem extends L2GameClientPacket
{
private int _targetItemObjId;
@Override
protected void readImpl()
{
_targetItemObjId = readD();
}
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
if (player == null)
{
return;
}
final ShapeShiftingItemRequest request = player.getRequest(ShapeShiftingItemRequest.class);
if (player.isInStoreMode() || player.isInCraftMode() || player.isProcessingRequest() || player.isProcessingTransaction() || (request == null))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP);
return;
}
final PcInventory inventory = player.getInventory();
final L2ItemInstance targetItem = inventory.getItemByObjectId(_targetItemObjId);
L2ItemInstance stone = request.getAppearanceStone();
if ((targetItem == null) || (stone == null))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (stone.getOwnerId() != player.getObjectId())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!targetItem.isAppearanceable())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((targetItem.getItemLocation() != ItemLocation.INVENTORY) && (targetItem.getItemLocation() != ItemLocation.PAPERDOLL))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((stone = inventory.getItemByObjectId(stone.getObjectId())) == null)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
final AppearanceStone appearanceStone = AppearanceItemData.getInstance().getStone(stone.getId());
if (appearanceStone == null)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (((appearanceStone.getType() != AppearanceType.RESTORE) && (targetItem.getVisualId() > 0)) || ((appearanceStone.getType() == AppearanceType.RESTORE) && (targetItem.getVisualId() == 0)))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
// TODO: Handle hair accessory!
// if (!targetItem.isEtcItem() && (targetItem.getItem().getCrystalType() == CrystalType.NONE))
{
// player.sendPacket(ExShapeShiftingResult.FAILED);
// player.removeRequest(ShapeShiftingItemRequest.class);
// return;
}
if (!appearanceStone.getCrystalTypes().isEmpty() && !appearanceStone.getCrystalTypes().contains(targetItem.getItem().getCrystalType()))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (appearanceStone.getTargetTypes().isEmpty())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!appearanceStone.getTargetTypes().contains(AppearanceTargetType.ALL))
{
if (targetItem.isWeapon() && !appearanceStone.getTargetTypes().contains(AppearanceTargetType.WEAPON))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
else if (targetItem.isArmor() && !appearanceStone.getTargetTypes().contains(AppearanceTargetType.ARMOR) && !appearanceStone.getTargetTypes().contains(AppearanceTargetType.ACCESSORY))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
else if (targetItem.isArmor() && !appearanceStone.getBodyParts().isEmpty() && !appearanceStone.getBodyParts().contains(targetItem.getItem().getBodyPart()))
{
player.sendPacket(ExPutShapeShiftingTargetItemResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
if (appearanceStone.getWeaponType() != WeaponType.NONE)
{
if (!targetItem.isWeapon() || (targetItem.getItemType() != appearanceStone.getWeaponType()))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
switch (appearanceStone.getHandType())
{
case ONE_HANDED:
{
if ((targetItem.getItem().getBodyPart() & L2Item.SLOT_R_HAND) != L2Item.SLOT_R_HAND)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
case TWO_HANDED:
{
if ((targetItem.getItem().getBodyPart() & L2Item.SLOT_LR_HAND) != L2Item.SLOT_LR_HAND)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
}
switch (appearanceStone.getMagicType())
{
case MAGICAL:
{
if (!targetItem.getItem().isMagicWeapon())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
case PHYISICAL:
{
if (targetItem.getItem().isMagicWeapon())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
}
}
if (appearanceStone.getArmorType() != ArmorType.NONE)
{
switch (appearanceStone.getArmorType())
{
case SHIELD:
{
if (!targetItem.isArmor() || (targetItem.getItemType() != ArmorType.SHIELD))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
break;
}
case SIGIL:
{
if (!targetItem.isArmor() || (targetItem.getItemType() != ArmorType.SIGIL))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
}
}
final L2ItemInstance extracItem = request.getAppearanceExtractItem();
int extracItemId = 0;
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getType() != AppearanceType.FIXED))
{
if (extracItem == null)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!extracItem.isAppearanceable())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if ((extracItem.getItemLocation() != ItemLocation.INVENTORY) && (extracItem.getItemLocation() != ItemLocation.PAPERDOLL))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (!extracItem.isEtcItem() && (targetItem.getItem().getCrystalType().ordinal() <= extracItem.getItem().getCrystalType().ordinal()))
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (extracItem.getVisualId() > 0)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (extracItem.getOwnerId() != player.getObjectId())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
extracItemId = extracItem.getId();
}
if (targetItem.getOwnerId() != player.getObjectId())
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
long cost = appearanceStone.getCost();
if (cost > player.getAdena())
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MODIFY_AS_YOU_DO_NOT_HAVE_ENOUGH_ADENA);
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (stone.getCount() < 1L)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
if (appearanceStone.getType() == AppearanceType.NORMAL)
{
if (inventory.destroyItem(getClass().getSimpleName(), extracItem, 1, player, this) == null)
{
player.sendPacket(ExShapeShiftingResult.FAILED);
player.removeRequest(ShapeShiftingItemRequest.class);
return;
}
}
inventory.destroyItem(getClass().getSimpleName(), stone, 1, player, this);
player.reduceAdena(getClass().getSimpleName(), cost, extracItem, true);
switch (appearanceStone.getType())
{
case RESTORE:
{
targetItem.setVisualId(0);
targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_STONE_ID, 0);
break;
}
case NORMAL:
{
targetItem.setVisualId(extracItem.getId());
break;
}
case BLESSED:
{
targetItem.setVisualId(extracItem.getId());
break;
}
case FIXED:
{
targetItem.setVisualId(appearanceStone.getVisualId());
targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_STONE_ID, appearanceStone.getId());
break;
}
}
if ((appearanceStone.getType() != AppearanceType.RESTORE) && (appearanceStone.getLifeTime() > 0))
{
targetItem.getVariables().set(ItemVariables.VISUAL_APPEARANCE_LIFE_TIME, System.currentTimeMillis() + appearanceStone.getLifeTime());
targetItem.scheduleVisualLifeTime();
}
targetItem.getVariables().storeMe();
if (appearanceStone.getCost() > 0)
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_SPENT_S1_ON_A_SUCCESSFUL_APPEARANCE_MODIFICATION).addLong(cost));
}
else
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_S_APPEARANCE_MODIFICATION_HAS_FINISHED).addItemName(targetItem.getDisplayId()));
}
final InventoryUpdate iu = new InventoryUpdate();
iu.addModifiedItem(targetItem);
if (inventory.getItemByObjectId(stone.getObjectId()) == null)
{
iu.addRemovedItem(stone);
}
else
{
iu.addModifiedItem(stone);
}
player.sendPacket(iu);
player.removeRequest(ShapeShiftingItemRequest.class);
player.sendPacket(new ExShapeShiftingResult(ExShapeShiftingResult.RESULT_SUCCESS, targetItem.getId(), extracItemId));
if (targetItem.isEquipped())
{
player.broadcastUserInfo();
final ExUserInfoEquipSlot slots = new ExUserInfoEquipSlot(player, false);
for (InventorySlot slot : InventorySlot.values())
{
if (slot.getSlot() == targetItem.getLocationSlot())
{
slots.addComponentType(slot);
}
}
player.sendPacket(slots);
}
}
@Override
public String getType()
{
return getClass().getSimpleName();
}
}

View File

@ -1,91 +0,0 @@
/*
* 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.network.clientpackets.itemappearance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.itemappearance.ExPut_Shape_Shifting_Extraction_Item_Result;
import com.l2jserver.gameserver.network.serverpackets.itemappearance.ExPut_Shape_Shifting_Target_Item_Result;
public final class RequestExTryToPut_Shape_Shifting_EnchantSupportItem extends L2GameClientPacket
{
private static final String _C__D0_C5_REQUESTEXTRYTOPUT_SHAPE_SHIFTING_ENCHANTSUPPORTITEM = "[C] D0:C5 RequestExTryToPut_Shape_Shifting_EnchantSupportItem";
private int _itemOID;
@Override
protected void readImpl()
{
readD();
_itemOID = readD();
}
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
if (player == null)
{
return;
}
final L2ItemInstance stone = player.getUsingAppearanceStone();
if ((stone == null) || (stone.getEtcItem().getAppearanceStone() == null))
{
player.sendPacket(new ExPut_Shape_Shifting_Target_Item_Result(0));
return;
}
final L2ItemInstance targetItem = player.getInventory().getItemByObjectId(_itemOID);
if (targetItem == null)
{
player.sendPacket(new ExPut_Shape_Shifting_Target_Item_Result(0));
return;
}
if (stone.getEtcItem().getAppearanceStone().getGrades().contains(targetItem.getItem().getCrystalType().getId()))
{
player.sendPacket(new ExPut_Shape_Shifting_Target_Item_Result(0));
return;
}
final L2ItemInstance item = player.getAppearanceItem();
if (item == null)
{
player.sendPacket(new ExPut_Shape_Shifting_Target_Item_Result(0));
return;
}
if (!item.getItemType().equals(targetItem.getItemType()))
{
player.sendPacket(new ExPut_Shape_Shifting_Extraction_Item_Result(0));
return;
}
if ((item.isWeapon() && (item.getWeaponItem().getItemType() != targetItem.getWeaponItem().getItemType())) || (item.isArmor() && (item.getArmorItem().getItemType() != targetItem.getArmorItem().getItemType())))
{
player.sendPacket(new ExPut_Shape_Shifting_Extraction_Item_Result(0));
return;
}
player.sendPacket(new ExPut_Shape_Shifting_Target_Item_Result(1));
player.setTargetAppearanceItem(targetItem);
}
@Override
public String getType()
{
return _C__D0_C5_REQUESTEXTRYTOPUT_SHAPE_SHIFTING_ENCHANTSUPPORTITEM;
}
}

View File

@ -1,78 +0,0 @@
/*
* 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.network.clientpackets.itemappearance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.AppearanceStone.AppearanceItemType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.itemappearance.ExPut_Shape_Shifting_Extraction_Item_Result;
public final class RequestExTryToPut_Shape_Shifting_TargetItem extends L2GameClientPacket
{
private static final String _C__D0_C4_REQUESTEXTRYTOPUT_SHAPE_SHIFTING_TARGETITEM = "[C] D0:C4 RequestExTryToPut_Shape_Shifting_TargetItem";
private int _itemId;
@Override
protected void readImpl()
{
_itemId = readD();
}
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
if (player == null)
{
return;
}
final L2ItemInstance item = player.getInventory().getItemByObjectId(_itemId);
if (item == null)
{
return;
}
final L2ItemInstance stone = player.getUsingAppearanceStone();
if ((stone == null) || (stone.getEtcItem().getAppearanceStone() == null))
{
return;
}
if (stone.getEtcItem().getAppearanceStone().getMaxGrade() < item.getItem().getCrystalType().getId())
{
player.sendPacket(new ExPut_Shape_Shifting_Extraction_Item_Result(0));
return;
}
final boolean isSameType = ((stone.getEtcItem().getAppearanceStone().getItemType() == AppearanceItemType.ARMOR) && item.isArmor()) || ((stone.getEtcItem().getAppearanceStone().getItemType() == AppearanceItemType.WEAPON) && item.isWeapon()) || ((stone.getEtcItem().getAppearanceStone().getItemType() == AppearanceItemType.ACCESSORY) && item.isArmor()) || ((stone.getEtcItem().getAppearanceStone().getItemType() == AppearanceItemType.ALL));
if (!isSameType)
{
player.sendPacket(new ExPut_Shape_Shifting_Extraction_Item_Result(0));
return;
}
player.setAppearanceItem(item);
player.sendPacket(new ExPut_Shape_Shifting_Extraction_Item_Result(1, stone.getEtcItem().getAppearanceStone().getPrice()));
}
@Override
public String getType()
{
return _C__D0_C4_REQUESTEXTRYTOPUT_SHAPE_SHIFTING_TARGETITEM;
}
}

View File

@ -1,109 +0,0 @@
/*
* 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.network.clientpackets.itemappearance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.model.entity.AppearanceStone.StoneType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoEquipSlot;
import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jserver.gameserver.network.serverpackets.itemappearance.ExShape_Shifting_Result;
public final class RequestShape_Shifting_Item extends L2GameClientPacket
{
private static final String _C__D0_C7_REQUESTSHAPE_SHIFTING_ITEM = "[C] D0:C7 RequestShape_Shifting_Item";
@Override
protected void readImpl()
{
readD();
}
@Override
protected void runImpl()
{
final L2PcInstance player = getClient().getActiveChar();
if (player == null)
{
return;
}
final L2ItemInstance stone = player.getUsingAppearanceStone();
final L2ItemInstance item = player.getAppearanceItem();
final L2ItemInstance targetItem = player.getTargetAppearanceItem();
final boolean needTargetItem = (stone != null) && (stone.getEtcItem().getAppearanceStone() != null) && (stone.getEtcItem().getAppearanceStone().getType().equals(StoneType.BLESSED) || stone.getEtcItem().getAppearanceStone().getType().equals(StoneType.NORMAL)) ? true : false;
player.setUsingAppearanceStone(null);
player.setAppearanceItem(null);
player.setTargetAppearanceItem(null);
if ((stone == null) || (item == null) || ((needTargetItem && (targetItem == null))))
{
return;
}
final AppearanceStone st = stone.getEtcItem().getAppearanceStone();
if (st == null)
{
return;
}
final long cost = st.getPrice();
if (cost > player.getAdena())
{
player.sendPacket(SystemMessageId.YOU_CANNOT_MODIFY_AS_YOU_DO_NOT_HAVE_ENOUGH_ADENA);
return;
}
int targetItemId = 0;
int time = -1;
switch (st.getType())
{
case NORMAL:
targetItemId = targetItem.getId();
player.destroyItem("AppearanceStone", targetItem, null, true);
break;
case BLESSED:
targetItemId = targetItem.getId();
break;
case FIXED:
targetItemId = st.getTargetItem();
time = (int) st.getTimeForAppearance();
break;
default:
break;
}
if (cost > 0)
{
player.reduceAdena("AppearanceStone", cost, null, true);
}
player.destroyItem("AppearanceStone", stone.getObjectId(), 1, null, true);
item.setAppearanceId(targetItemId);
item.setAppearanceTime(time);
InventoryUpdate iu = new InventoryUpdate();
iu.addModifiedItem(item);
player.sendPacket(iu);
player.sendPacket(new ExUserInfoEquipSlot(player));
player.broadcastUserInfo();
player.sendPacket(new ExShape_Shifting_Result(1, item.getId(), targetItemId, time));
}
@Override
public String getType()
{
return _C__D0_C7_REQUESTSHAPE_SHIFTING_ITEM;
}
}

View File

@ -0,0 +1,52 @@
/*
* 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.network.serverpackets.appearance;
import com.l2jserver.gameserver.model.items.appearance.AppearanceStone;
import com.l2jserver.gameserver.model.items.appearance.AppearanceTargetType;
import com.l2jserver.gameserver.model.items.appearance.AppearanceType;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author UnAfraid
*/
public class ExChooseShapeShiftingItem extends L2GameServerPacket
{
private final AppearanceType _type;
private final AppearanceTargetType _targetType;
private final int _itemId;
public ExChooseShapeShiftingItem(AppearanceStone stone)
{
_type = stone.getType();
_targetType = stone.getTargetTypes().size() > 1 ? AppearanceTargetType.ALL : stone.getTargetTypes().get(0);
_itemId = stone.getId();
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x129);
writeD(_targetType != null ? _targetType.ordinal() : 0);
writeD(_type != null ? _type.ordinal() : 0);
writeD(_itemId);
}
}

View File

@ -16,20 +16,23 @@
* 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.network.serverpackets.itemappearance;
package com.l2jserver.gameserver.network.serverpackets.appearance;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
* @author UnAfraid
*/
public class ExPut_Shape_Shifting_Target_Item_Result extends L2GameServerPacket
public class ExPutShapeShiftingExtractionItemResult extends L2GameServerPacket
{
private final int _success;
public static ExPutShapeShiftingExtractionItemResult FAILED = new ExPutShapeShiftingExtractionItemResult(0x00);
public static ExPutShapeShiftingExtractionItemResult SUCCESS = new ExPutShapeShiftingExtractionItemResult(0x01);
public ExPut_Shape_Shifting_Target_Item_Result(int success)
private final int _result;
public ExPutShapeShiftingExtractionItemResult(int result)
{
_success = success;
_result = result;
}
@Override
@ -37,6 +40,6 @@ public class ExPut_Shape_Shifting_Target_Item_Result extends L2GameServerPacket
{
writeC(0xFE);
writeH(0x12B);
writeD(_success);
writeD(_result);
}
}
}

View File

@ -16,26 +16,26 @@
* 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.network.serverpackets.itemappearance;
package com.l2jserver.gameserver.network.serverpackets.appearance;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
* @author UnAfraid
*/
public class ExPut_Shape_Shifting_Extraction_Item_Result extends L2GameServerPacket
public class ExPutShapeShiftingTargetItemResult extends L2GameServerPacket
{
private final int _type;
private long _price = 0;
public static int RESULT_FAILED = 0x00;
public static int RESULT_SUCCESS = 0x01;
public ExPut_Shape_Shifting_Extraction_Item_Result(int type)
{
_type = type;
}
public static ExPutShapeShiftingTargetItemResult FAILED = new ExPutShapeShiftingTargetItemResult(RESULT_FAILED, 0L);
public ExPut_Shape_Shifting_Extraction_Item_Result(int type, long price)
private final int _resultId;
private final long _price;
public ExPutShapeShiftingTargetItemResult(int resultId, long price)
{
_type = type;
_resultId = resultId;
_price = price;
}
@ -44,7 +44,7 @@ public class ExPut_Shape_Shifting_Extraction_Item_Result extends L2GameServerPac
{
writeC(0xFE);
writeH(0x12A);
writeD(_type);
writeD(_resultId);
writeQ(_price);
}
}
}

View File

@ -16,34 +16,38 @@
* 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.network.serverpackets.itemappearance;
package com.l2jserver.gameserver.network.serverpackets.appearance;
import com.l2jserver.gameserver.model.entity.AppearanceStone;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
* @author UnAfraid
*/
public class ExChoose_Shape_Shifting_Item extends L2GameServerPacket
public class ExShapeShiftingResult extends L2GameServerPacket
{
private final int _itemId;
private final int _type;
private final int _itemType;
public static int RESULT_FAILED = 0x00;
public static int RESULT_SUCCESS = 0x01;
public ExChoose_Shape_Shifting_Item(AppearanceStone stone)
public static ExShapeShiftingResult FAILED = new ExShapeShiftingResult(RESULT_FAILED, 0, 0);
private final int _result;
private final int _targetItemId;
private final int _extractItemId;
public ExShapeShiftingResult(int result, int targetItemId, int extractItemId)
{
_itemId = stone.getItemId();
_type = stone.getType().ordinal();
_itemType = stone.getItemType().ordinal();
_result = result;
_targetItemId = targetItemId;
_extractItemId = extractItemId;
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x129);
writeD(_type);
writeD(_itemType);
writeD(_itemId);
writeH(0x12C);
writeD(_result);
writeD(_targetItemId);
writeD(_extractItemId);
}
}

View File

@ -1,61 +0,0 @@
/*
* 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.network.serverpackets.itemappearance;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
/**
* @author Erlandys
*/
public class ExShape_Shifting_Result extends L2GameServerPacket
{
private final int _success;
private int _itemId = 0, _targetItemId = 0, _time = -1;
public ExShape_Shifting_Result(int success)
{
_success = success;
}
public ExShape_Shifting_Result(int success, int itemId, int targetItemId)
{
_success = success;
_itemId = itemId;
_targetItemId = targetItemId;
}
public ExShape_Shifting_Result(int success, int itemId, int targetItemId, int time)
{
_success = success;
_itemId = itemId;
_targetItemId = targetItemId;
_time = time;
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x12C);
writeD(_success); // Success - 1, Fail - 0
writeD(_itemId); // targetItemId
writeD(_targetItemId); // extractItemId
writeD(_time); // time
}
}