Updated LuckyGame packets and rewards.
Author: Sdw Source: L2jUnity free files.
This commit is contained in:
@@ -1,225 +1,149 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
||||||
<fortuneReadingTicketRewards>
|
<luckygame index="2" turning_point="50000">
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<common_reward>
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="37715" count="1" chance="0.0059" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="34777" count="1" chance="0.0046" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="35649" count="1" chance="0.01" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="37714" count="1" chance="0.013" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="6656" count="1" chance="0.0151" /> <!-- Antharas' Earring -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="6660" count="1" chance="0.0167" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34776" count="1" chance="0.0108" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="6657" count="1" chance="0.0296" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="21712" count="1" chance="0.0296" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="37507" count="1" chance="0.0342" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37513" count="1" chance="0.05" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="37508" count="1" chance="0.065" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="34775" count="1" chance="0.0365" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="37517" count="1" chance="0.1084" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="37518" count="1" chance="0.1182" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="37509" count="1" chance="0.1301" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="17527" count="1" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="37772" count="1" chance="0.3252" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="6661" count="1" chance="0.2168" /> <!-- Orfen's Earring -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
<item id="37781" count="1" chance="0.7804" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
<item id="39641" count="1" chance="0.271" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="33817" count="1" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
<item id="19447" count="1" chance="0.5912" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="36386" count="1" chance="0.6503" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="36513" count="5" chance="21.6778" /> <!-- Elcyum Powder -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="39639" count="1" chance="0.8129" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="19448" count="1" chance="1.0839" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="27600" count="1" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
<item id="35563" count="2" chance="6.5033" /> <!-- Giant's Energy -->
|
||||||
<item id="27601" count="1" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<item id="39592" count="1" chance="1.8581" /> <!-- Tempest Stone -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
<item id="37771" count="1" chance="0.929" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="37780" count="1" chance="1.3007" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="36513" count="5" /> <!-- Elcyum Powder -->
|
<item id="39633" count="1" chance="2.6013" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="39631" count="1" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="39637" count="1" chance="3.2517" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="19440" count="5" chance="13.0067" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="19440" count="5" /> <!-- Gemstone (R-grade) -->
|
<item id="17526" count="1" chance="5.4195" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="35563" count="2" /> <!-- Giant's Energy -->
|
<item id="36389" count="1" chance="6.5033" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="46395" count="1" /> <!-- Shadow Ingot -->
|
<item id="17527" count="1" chance="14.4519" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="39631" count="1" chance="15.3022" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
</common_reward>
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex Chapter 1 -->
|
</luckygame>
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<luckygame index="102" turning_point="10000">
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<common_reward>
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="39573" count="1" chance="0.0052" /> <!-- Sealed Talisman - Insanity -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="37717" count="1" chance="0.0034" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="37716" count="1" chance="0.0112" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="35001" count="1" chance="0.0048" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="34998" count="1" chance="0.0056" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="37715" count="1" chance="0.0244" /> <!-- Talisman - Anakim -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
<item id="34999" count="1" chance="0.0067" /> <!-- Tauti's Axe -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="34777" count="1" chance="0.0096" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<item id="35649" count="1" chance="0.1033" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="23342" count="1" chance="0.0224" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="37714" count="1" chance="0.0269" /> <!-- Talisman - Lilith -->
|
||||||
</fortuneReadingTicketRewards>
|
<item id="35566" count="1" chance="0.0134" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<luxuryFortuneReadingTicketRewards>
|
<item id="6656" count="1" chance="0.1562" /> <!-- Antharas' Earring -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon: (R-grade) -->
|
<item id="6660" count="1" chance="0.1722" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor: (R-grade) -->
|
<item id="34776" count="1" chance="0.0224" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon: (R-grade) -->
|
<item id="39647" count="1" chance="0.0478" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="36164" count="2" /> <!-- Giant's Scroll: Enchant Armor: (R-grade) -->
|
<item id="6657" count="1" chance="0.1526" /> <!-- Valakas' Necklace -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="21712" count="1" chance="0.1221" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="27600" count="2" /> <!-- Scroll of Blessing: Armor: (R95 grade) -->
|
<item id="37507" count="1" chance="0.0707" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor: (R99 grade) -->
|
<item id="37513" count="1" chance="0.1033" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="37508" count="1" chance="0.1343" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="34775" count="1" chance="0.7545" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="39643" count="1" chance="0.4477" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon: (R95-grade) -->
|
<item id="37517" count="1" chance="0.2238" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon: (R99-grade) -->
|
<item id="37518" count="1" chance="0.2442" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="17527" count="2" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="35567" count="1" chance="0.2686" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37509" count="1" chance="0.2686" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="37772" count="1" chance="0.3358" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
<item id="6661" count="1" chance="0.2238" /> <!-- Orfen's Earring -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="37781" count="1" chance="0.8058" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="39641" count="1" chance="1.1192" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="37719" count="1" chance="0.0839" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="37720" count="1" chance="0.0839" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="37721" count="1" chance="0.0839" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="37722" count="1" chance="0.0839" /> <!-- Eva's Special Pack -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="19447" count="1" chance="1.2209" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="36386" count="1" chance="1.343" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="36515" count="1" chance="1.6788" /> <!-- Elcyum -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="39639" count="1" chance="3.3575" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="19448" count="1" chance="2.2383" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="39738" count="1" chance="2.686" /> <!-- Rune Stone -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="35563" count="10" chance="5.372" /> <!-- Giant's Energy -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="39592" count="1" chance="3.8372" /> <!-- Tempest Stone -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="37771" count="1" chance="1.9186" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="37780" count="2" chance="1.343" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="39633" count="1" chance="5.372" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="39637" count="1" chance="6.715" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="19440" count="15" chance="8.9534" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="27463" count="1" /> <!-- Demon Circlet Box -->
|
<item id="17526" count="1" chance="11.1917" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="27466" count="1" /> <!-- Eyepatch Box -->
|
<item id="36389" count="2" chance="6.715" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="17527" count="2" chance="14.9218" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="39631" count="3" chance="10.5334" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
</common_reward>
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<unique_reward>
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="36946" count="1" points="10000" /> <!-- Lindvior's Earring -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="37717" count="1" points="9000" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="19463" count="1" points="8000" /> <!-- Blessed Antharas' Earring -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="19464" count="1" points="7000" /> <!-- Blessed Valakas' Necklace -->
|
||||||
<item id="36515" count="1" /> <!-- Elcyum -->
|
<item id="35564" count="1" points="6000" /> <!-- Ruler's Authority -->
|
||||||
<item id="39631" count="3" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="17623" count="1" points="5000" /> <!-- Earth Wyrm Heart Ring -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="35570" count="1" points="4000" /> <!-- Tauti's Ring -->
|
||||||
<item id="19440" count="15" /> <!-- Gem Stone - R grade -->
|
<item id="35566" count="1" points="3000" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="35563" count="10" /> <!-- Giant's Energy -->
|
<item id="35568" count="1" points="2000" /> <!-- Bloody Amaranthine Enhancement Stone -->
|
||||||
<item id="39738" count="1" /> <!-- Rune Stone -->
|
<item id="35567" count="1" points="1000" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="35569" count="1" points="500" /> <!-- Bloody Eternal Enhancement Stone -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex - Chapter 1 -->
|
</unique_reward>
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<modify_reward min_game="40" max_game="50">
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="39573" count="1" chance="0.0679" /> <!-- Sealed Talisman - Insanity -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="37717" count="1" chance="0.0441" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="37716" count="1" chance="0.147" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="35001" count="1" chance="0.063" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="34998" count="1" chance="0.0735" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="37715" count="1" chance="0.3208" /> <!-- Talisman - Anakim -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="34999" count="1" chance="0.0882" /> <!-- Tauti's Axe -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="34777" count="1" chance="0.126" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="35649" count="1" chance="0.2714" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="23342" count="1" chance="0.294" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="37714" count="1" chance="0.3528" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="35566" count="1" chance="0.1764" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="6656" count="1" chance="0.0257" /> <!-- Antharas' Earring -->
|
||||||
<item id="26444" count="1" /> <!-- Shadow Buster Pack -->
|
<item id="6660" count="1" chance="2.2618" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="26438" count="1" /> <!-- Shadow Cutter Pack -->
|
<item id="34776" count="1" chance="0.294" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="26446" count="1" /> <!-- Shadow Dualsword Pack -->
|
<item id="39647" count="1" chance="0.6273" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="26440" count="1" /> <!-- Shadow Fighter Pack -->
|
<item id="6657" count="1" chance="2.0048" /> <!-- Valakas' Necklace -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="21712" count="1" chance="1.6039" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="26445" count="1" /> <!-- Shadow Retributer Pack -->
|
<item id="37507" count="1" chance="0.9285" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="26437" count="1" /> <!-- Shadow Shaper Pack -->
|
<item id="37513" count="1" chance="1.3571" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="26443" count="1" /> <!-- Shadow Shooter Pack -->
|
<item id="37508" count="1" chance="1.7642" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="26439" count="1" /> <!-- Shadow Slasher Pack -->
|
<item id="34775" count="1" chance="4.9557" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="26441" count="1" /> <!-- Shadow Stormer Pack -->
|
<item id="39643" count="1" chance="5.8808" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="26442" count="1" /> <!-- Shadow Thrower Pack -->
|
<item id="37517" count="1" chance="2.9404" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37518" count="1" chance="3.2077" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="35567" count="1" chance="3.5285" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="37509" count="1" chance="3.5285" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="37772" count="1" chance="4.4106" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
<item id="6661" count="1" chance="2.9404" /> <!-- Orfen's Earring -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="37781" count="2" chance="10.5854" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
<item id="39641" count="1" chance="14.7015" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
<item id="37719" count="1" chance="2.2053" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
<item id="37720" count="1" chance="2.2053" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<item id="37721" count="1" chance="2.2053" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="37722" count="1" chance="2.2053" /> <!-- Eva's Special Pack -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
</modify_reward>
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
</luckygame>
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
|
||||||
</luxuryFortuneReadingTicketRewards>
|
|
||||||
<rareLuxuryFortuneReadingTicketRewards>
|
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon - R grade -->
|
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
|
||||||
<item id="27463" count="1" /> <!-- Devil Circlet Box -->
|
|
||||||
<item id="27464" count="1" /> <!-- Eyepatch Box -->
|
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
|
||||||
</rareLuxuryFortuneReadingTicketRewards>
|
|
||||||
</list>
|
</list>
|
@@ -17,6 +17,7 @@
|
|||||||
package events.EveTheFortuneTeller;
|
package events.EveTheFortuneTeller;
|
||||||
|
|
||||||
import com.l2jmobius.gameserver.enums.ChatType;
|
import com.l2jmobius.gameserver.enums.ChatType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
import com.l2jmobius.gameserver.model.Location;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@@ -36,6 +37,9 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
// NPCs
|
// NPCs
|
||||||
private static final int EVE = 8542;
|
private static final int EVE = 8542;
|
||||||
private static final int JAYCE = 8540;
|
private static final int JAYCE = 8540;
|
||||||
|
// Items
|
||||||
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
// Misc
|
// Misc
|
||||||
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
||||||
private static final NpcStringId[] JAYCE_TEXT =
|
private static final NpcStringId[] JAYCE_TEXT =
|
||||||
@@ -71,12 +75,12 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
case "FortuneReadingGame":
|
case "FortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 1));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.NORMAL, player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "LuxuryFortuneReadingGame":
|
case "LuxuryFortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 2));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.LUXURY, player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "JAYCE_SHOUT":
|
case "JAYCE_SHOUT":
|
||||||
|
@@ -2,56 +2,68 @@
|
|||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="fortuneReadingTicketRewards">
|
<xs:element name="luckygame" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
<xs:element name="common_reward">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:simpleContent>
|
<xs:sequence>
|
||||||
<xs:extension base="xs:string">
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:simpleContent>
|
||||||
</xs:extension>
|
<xs:extension base="xs:string">
|
||||||
</xs:simpleContent>
|
<xs:attribute type="xs:float" name="chance" use="optional" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
</xs:extension>
|
||||||
</xs:complexType>
|
</xs:simpleContent>
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="luxuryFortuneReadingTicketRewards">
|
</xs:element>
|
||||||
<xs:complexType>
|
</xs:sequence>
|
||||||
<xs:sequence>
|
</xs:complexType>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="unique_reward" minOccurs="0">
|
||||||
<xs:simpleContent>
|
<xs:complexType>
|
||||||
<xs:extension base="xs:string">
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:complexType>
|
||||||
</xs:extension>
|
<xs:simpleContent>
|
||||||
</xs:simpleContent>
|
<xs:extension base="xs:string">
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
<xs:attribute type="xs:short" name="points" use="optional" />
|
||||||
</xs:complexType>
|
</xs:extension>
|
||||||
</xs:element>
|
</xs:simpleContent>
|
||||||
<xs:element name="rareLuxuryFortuneReadingTicketRewards">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:simpleContent>
|
<xs:element name="modify_reward" minOccurs="0">
|
||||||
<xs:extension base="xs:string">
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
</xs:extension>
|
<xs:complexType>
|
||||||
</xs:simpleContent>
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute type="xs:float" name="chance" />
|
||||||
|
<xs:attribute type="xs:byte" name="count" />
|
||||||
|
<xs:attribute type="xs:int" name="id" />
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:byte" name="max_game" />
|
||||||
|
<xs:attribute type="xs:byte" name="min_game" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:int" name="turning_point" use="optional" />
|
||||||
|
<xs:attribute type="xs:byte" name="index" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute type="xs:string" name="enabled"/>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
@@ -17,25 +17,26 @@
|
|||||||
package com.l2jmobius.gameserver.data.xml.impl;
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
|
||||||
import org.w3c.dom.Node;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemPointHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mathael
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class LuckyGameData implements IGameXmlReader
|
public class LuckyGameData implements IGameXmlReader
|
||||||
{
|
{
|
||||||
private static final List<ItemHolder> _fortuneReadingTicketRewards = new ArrayList<>();
|
private final Map<Integer, LuckyGameDataHolder> _luckyGame = new HashMap<>();
|
||||||
private static final List<ItemHolder> _luxuryFortuneReadingTicketRewards = new ArrayList<>();
|
|
||||||
private static final List<ItemHolder> _rareLuxuryFortuneReadingTicketRewards = new ArrayList<>();
|
final AtomicInteger _serverPlay = new AtomicInteger();
|
||||||
|
|
||||||
protected LuckyGameData()
|
protected LuckyGameData()
|
||||||
{
|
{
|
||||||
@@ -45,112 +46,62 @@ public class LuckyGameData implements IGameXmlReader
|
|||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
_fortuneReadingTicketRewards.clear();
|
_luckyGame.clear();
|
||||||
_luxuryFortuneReadingTicketRewards.clear();
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.clear();
|
|
||||||
|
|
||||||
parseDatapackFile("data/LuckyGameData.xml");
|
parseDatapackFile("data/LuckyGameData.xml");
|
||||||
|
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luckyGame.size() + " lucky game data.");
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _fortuneReadingTicketRewards.size() + " Normal item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luxuryFortuneReadingTicketRewards.size() + " Luxury item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _rareLuxuryFortuneReadingTicketRewards.size() + " Rare item rewards.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void parseDocument(Document doc, File f)
|
public void parseDocument(Document doc, File f)
|
||||||
{
|
{
|
||||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
forEach(doc, "list", listNode -> forEach(listNode, "luckygame", rewardNode ->
|
||||||
{
|
{
|
||||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
final LuckyGameDataHolder holder = new LuckyGameDataHolder(new StatsSet(parseAttributes(rewardNode)));
|
||||||
|
|
||||||
|
forEach(rewardNode, "common_reward", commonRewardNode -> forEach(commonRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
final NamedNodeMap at = n.getAttributes();
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
final Node attribute = at.getNamedItem("enabled");
|
holder.addCommonReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "unique_reward", uniqueRewardNode -> forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
|
{
|
||||||
|
holder.addUniqueReward(new ItemPointHolder(new StatsSet(parseAttributes(itemNode))));
|
||||||
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "modify_reward", uniqueRewardNode ->
|
||||||
|
{
|
||||||
|
holder.setMinModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "min_game"));
|
||||||
|
holder.setMaxModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "max_game"));
|
||||||
|
forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
{
|
holder.addModifyReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ("fortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
});
|
||||||
{
|
});
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
_luckyGame.put(parseInteger(rewardNode.getAttributes(), "index"), holder);
|
||||||
final int count = parseInteger(attrs, "count");
|
}));
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_fortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("luxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_luxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("rareLuxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomNormalReward()
|
public int getLuckyGameCount()
|
||||||
{
|
{
|
||||||
return _fortuneReadingTicketRewards.get(Rnd.get(_fortuneReadingTicketRewards.size()));
|
return _luckyGame.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomLuxuryReward()
|
public LuckyGameDataHolder getLuckyGameDataByIndex(int index)
|
||||||
{
|
{
|
||||||
return _luxuryFortuneReadingTicketRewards.get(Rnd.get(_luxuryFortuneReadingTicketRewards.size()));
|
return _luckyGame.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomRareReward()
|
public int increaseGame()
|
||||||
{
|
{
|
||||||
return _rareLuxuryFortuneReadingTicketRewards.get(Rnd.get(_rareLuxuryFortuneReadingTicketRewards.size()));
|
return _serverPlay.incrementAndGet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerPlay()
|
||||||
|
{
|
||||||
|
return _serverPlay.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LuckyGameData getInstance()
|
public static LuckyGameData getInstance()
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameItemType
|
||||||
|
{
|
||||||
|
COMMON(1),
|
||||||
|
UNIQUE(2),
|
||||||
|
RARE(3);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
LuckyGameItemType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameResultType
|
||||||
|
{
|
||||||
|
INVALID_CAPACITY(-2),
|
||||||
|
INVALID_ITEM_COUNT(-1),
|
||||||
|
DISABLED(0),
|
||||||
|
SUCCESS(1);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
private LuckyGameResultType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
NORMAL,
|
||||||
|
LUXURY
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class ItemPointHolder extends ItemHolder
|
||||||
|
{
|
||||||
|
private final int _points;
|
||||||
|
|
||||||
|
public ItemPointHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
this(params.getInt("id"), params.getLong("count"), params.getInt("points"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemPointHolder(int id, long count, int points)
|
||||||
|
{
|
||||||
|
super(id, count);
|
||||||
|
_points = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the point.
|
||||||
|
* @return the number of point to get the item
|
||||||
|
*/
|
||||||
|
public int getPoints()
|
||||||
|
{
|
||||||
|
return _points;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", points: " + _points;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class LuckyGameDataHolder
|
||||||
|
{
|
||||||
|
final private int _index;
|
||||||
|
final private int _turningPoints;
|
||||||
|
final private List<ItemChanceHolder> _commonRewards = new ArrayList<>();
|
||||||
|
final private List<ItemPointHolder> _uniqueRewards = new ArrayList<>();
|
||||||
|
final private List<ItemChanceHolder> _modifyRewards = new ArrayList<>();
|
||||||
|
private int _minModifyRewardGame;
|
||||||
|
private int _maxModifyRewardGame;
|
||||||
|
|
||||||
|
public LuckyGameDataHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
_index = params.getInt("index");
|
||||||
|
_turningPoints = params.getInt("turning_point");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCommonReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_commonRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addUniqueReward(ItemPointHolder item)
|
||||||
|
{
|
||||||
|
_uniqueRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addModifyReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_modifyRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getCommonReward()
|
||||||
|
{
|
||||||
|
return _commonRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemPointHolder> getUniqueReward()
|
||||||
|
{
|
||||||
|
return _uniqueRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getModifyReward()
|
||||||
|
{
|
||||||
|
return _modifyRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinModifyRewardGame(int minModifyRewardGame)
|
||||||
|
{
|
||||||
|
_minModifyRewardGame = minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxModifyRewardGame(int maxModifyRewardGame)
|
||||||
|
{
|
||||||
|
_maxModifyRewardGame = maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex()
|
||||||
|
{
|
||||||
|
return _index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTurningPoints()
|
||||||
|
{
|
||||||
|
return _turningPoints;
|
||||||
|
}
|
||||||
|
}
|
@@ -57,6 +57,8 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
||||||
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
||||||
public static final String EXTEND_DROP = "EXTEND_DROP";
|
public static final String EXTEND_DROP = "EXTEND_DROP";
|
||||||
|
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
|
||||||
|
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
|
||||||
|
|
||||||
private final int _objectId;
|
private final int _objectId;
|
||||||
|
|
||||||
|
@@ -65,6 +65,8 @@ import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchant
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel;
|
import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGamePlay;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGameStartInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
||||||
@@ -322,8 +324,8 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
||||||
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_START_INFO(0xF1, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_START_INFO(0xF1, RequestLuckyGameStartInfo::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_PLAY(0xF2, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_PLAY(0xF2, RequestLuckyGamePlay::new, ConnectionState.IN_GAME),
|
||||||
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
||||||
|
@@ -16,30 +16,169 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketReader;
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.commons.util.CommonUtil;
|
||||||
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
||||||
{
|
{
|
||||||
private int _type;
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
private int _count;
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
|
private LuckyGameType _type;
|
||||||
|
private int _reading;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean read(L2GameClient client, PacketReader packet)
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
{
|
{
|
||||||
_type = packet.readD(); // luxury = 2, normal = 1
|
final int type = CommonUtil.constrain(packet.readD(), 0, LuckyGameType.values().length);
|
||||||
_count = packet.readD(); // count
|
_type = LuckyGameType.values()[type];
|
||||||
|
_reading = CommonUtil.constrain(packet.readD(), 0, 50); // max play is 50
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(L2GameClient client)
|
public void run(L2GameClient client)
|
||||||
{
|
{
|
||||||
client.getActiveChar().sendPacket(new ExBettingLuckyGameResult(client.getActiveChar(), _type, _count));
|
final L2PcInstance player = client.getActiveChar();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int index = _type == LuckyGameType.LUXURY ? 102 : 2; // move to event config
|
||||||
|
|
||||||
|
final LuckyGameDataHolder holder = LuckyGameData.getInstance().getLuckyGameDataByIndex(index);
|
||||||
|
if (holder == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long tickets = _type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1);
|
||||||
|
if (tickets < _reading)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int playCount = player.getVariables().getInt(PlayerVariables.FORTUNE_TELLING_VARIABLE, 0);
|
||||||
|
boolean blackCat = player.getVariables().getBoolean(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, false);
|
||||||
|
final EnumMap<LuckyGameItemType, List<ItemHolder>> rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final double chance = 100 * Rnd.nextDouble();
|
||||||
|
double totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : holder.getCommonReward())
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chance)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.COMMON, k -> new ArrayList<>()).add(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playCount++;
|
||||||
|
if ((playCount >= holder.getMinModifyRewardGame()) && (playCount <= holder.getMaxModifyRewardGame()) && !blackCat)
|
||||||
|
{
|
||||||
|
final List<ItemChanceHolder> modifyReward = holder.getModifyReward();
|
||||||
|
final double chanceModify = 100 * Rnd.nextDouble();
|
||||||
|
totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : modifyReward)
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chanceModify)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(item);
|
||||||
|
blackCat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playCount == holder.getMaxModifyRewardGame())
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(modifyReward.get(Rnd.get(modifyReward.size())));
|
||||||
|
blackCat = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
|
// Check inventory capacity
|
||||||
|
if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.destroyItemByItemId("LuckyGame", _type == LuckyGameType.LUXURY ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _reading, player, true))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final int serverGameNumber = LuckyGameData.getInstance().increaseGame();
|
||||||
|
holder.getUniqueReward().stream().filter(reward -> reward.getPoints() == serverGameNumber).forEach(item -> rewards.computeIfAbsent(LuckyGameItemType.UNIQUE, k -> new ArrayList<>()).add(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(new ExBettingLuckyGameResult(LuckyGameResultType.SUCCESS, _type, rewards, (int) (_type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1))));
|
||||||
|
|
||||||
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : rewards.entrySet())
|
||||||
|
{
|
||||||
|
for (ItemHolder r : reward.getValue())
|
||||||
|
{
|
||||||
|
final L2ItemInstance item = player.addItem("LuckyGame", r.getId(), r.getCount(), player, true);
|
||||||
|
iu.addItem(item);
|
||||||
|
if (reward.getKey() == LuckyGameItemType.UNIQUE)
|
||||||
|
{
|
||||||
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
||||||
|
sm.addPcName(player);
|
||||||
|
sm.addLong(r.getCount());
|
||||||
|
sm.addItemName(item);
|
||||||
|
player.broadcastPacket(sm, 1000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendInventoryUpdate(iu);
|
||||||
|
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_VARIABLE, playCount >= 50 ? (playCount - 50) : playCount);
|
||||||
|
if (blackCat && (playCount < 50))
|
||||||
|
{
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class RequestLuckyGameStartInfo implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -16,121 +16,69 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.NORMAL);
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.LUXURY);
|
||||||
private int _count = 0;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.NORMAL);
|
||||||
private int _type = 0;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.LUXURY);
|
||||||
private final L2PcInstance _activeChar;
|
|
||||||
|
|
||||||
public ExBettingLuckyGameResult(L2PcInstance activeChar, int type, int count)
|
private final LuckyGameResultType _result;
|
||||||
|
private final LuckyGameType _type;
|
||||||
|
private final EnumMap<LuckyGameItemType, List<ItemHolder>> _rewards;
|
||||||
|
private final int _ticketCount;
|
||||||
|
private final int _size;
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type)
|
||||||
{
|
{
|
||||||
_count = count;
|
_result = result;
|
||||||
_type = type;
|
_type = type;
|
||||||
_activeChar = activeChar;
|
_rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
_ticketCount = 0;
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type, EnumMap<LuckyGameItemType, List<ItemHolder>> rewards, int ticketCount)
|
||||||
|
{
|
||||||
|
_result = result;
|
||||||
|
_type = type;
|
||||||
|
_rewards = rewards;
|
||||||
|
_ticketCount = ticketCount;
|
||||||
|
_size = (int) rewards.values().stream().mapToLong(i -> i.stream().count()).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
// Calculate rewards
|
|
||||||
final List<ItemHolder> rewards = new ArrayList<>();
|
|
||||||
int totalWeight = 0;
|
|
||||||
for (int rewardCounter = 0; rewardCounter < _count; rewardCounter++)
|
|
||||||
{
|
|
||||||
if (Rnd.get(3) == 0) // 1 out of 3 chance
|
|
||||||
{
|
|
||||||
ItemHolder reward = null;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
if (_count >= 40)
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomRareReward();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomLuxuryReward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomNormalReward();
|
|
||||||
}
|
|
||||||
rewards.add(reward);
|
|
||||||
totalWeight += new L2ItemInstance(reward.getId()).getItem().getWeight() * reward.getCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check inventory capacity
|
|
||||||
if ((rewards.size() > 0) && (!_activeChar.getInventory().validateCapacity(rewards.size()) || !_activeChar.getInventory().validateWeight(totalWeight)))
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1) < _count)
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove tickets
|
|
||||||
_activeChar.getInventory().destroyItemByItemId("FortuneTelling", _type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _count, _activeChar, "FortuneTelling");
|
|
||||||
|
|
||||||
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
||||||
packet.writeD(0x01); // 0 disabled, 1 enabled
|
packet.writeD(_result.getClientId());
|
||||||
packet.writeD(0x01); // ?
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD((int) _activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1)); // Count remaining tickets
|
packet.writeD(_ticketCount);
|
||||||
|
packet.writeD(_size);
|
||||||
if (rewards.size() > 0)
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : _rewards.entrySet())
|
||||||
{
|
{
|
||||||
packet.writeD(rewards.size());
|
for (ItemHolder item : reward.getValue())
|
||||||
for (ItemHolder reward : rewards)
|
|
||||||
{
|
{
|
||||||
packet.writeD(0x02); // normal = 1, rare = 2 (forcing 2)
|
packet.writeD(reward.getKey().getClientId());
|
||||||
packet.writeD(reward.getId());
|
packet.writeD(item.getId());
|
||||||
packet.writeD((int) reward.getCount());
|
packet.writeD((int) item.getCount());
|
||||||
final SystemMessage sm;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
_activeChar.addItem("LuxuryFortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_IN_THE_LUXURY_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_activeChar.addItem("FortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
sm.addPcName(_activeChar);
|
|
||||||
sm.addLong(reward.getCount());
|
|
||||||
sm.addItemName(new L2ItemInstance(reward.getId()));
|
|
||||||
_activeChar.broadcastPacket(sm, 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
packet.writeD(0x00);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,32 +17,30 @@
|
|||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExStartLuckyGame implements IClientOutgoingPacket
|
public class ExStartLuckyGame implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
private final LuckyGameType _type;
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
private final int _ticketCount;
|
||||||
private int _type = 0;
|
|
||||||
private int _count = 0;
|
|
||||||
|
|
||||||
public ExStartLuckyGame(L2PcInstance activeChar, int type)
|
public ExStartLuckyGame(LuckyGameType type, long ticketCount)
|
||||||
{
|
{
|
||||||
_type = type;
|
_type = type;
|
||||||
_count = (int) activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1);
|
_ticketCount = (int) ticketCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
||||||
packet.writeD(_type);
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD(_count);
|
packet.writeD(_ticketCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,225 +1,224 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
||||||
<fortuneReadingTicketRewards>
|
<luckygame index="2" turning_point="50000">
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<common_reward>
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="37715" count="1" chance="0.0059" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="34777" count="1" chance="0.0046" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="35649" count="1" chance="0.01" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="37714" count="1" chance="0.013" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="6656" count="1" chance="0.0151" /> <!-- Antharas' Earring -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="6660" count="1" chance="0.0167" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34776" count="1" chance="0.0108" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="6657" count="1" chance="0.0296" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="21712" count="1" chance="0.0296" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46395" count="1" chance="0.1626" /> <!-- Shadow Ingot -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0342" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="37513" count="1" chance="0.05" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="37508" count="1" chance="0.065" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="34775" count="1" chance="0.0365" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46494" count="1" chance="0.0417" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="46509" count="1" chance="0.05" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
||||||
<item id="17527" count="1" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="46449" count="1" chance="0.05" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37517" count="1" chance="0.1084" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
<item id="46478" count="1" chance="0.1182" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
<item id="37518" count="1" chance="0.1182" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="33817" count="1" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
<item id="37509" count="1" chance="0.1301" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37772" count="1" chance="0.3252" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46151" count="1" chance="0.1858" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="46493" count="1" chance="0.2032" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46464" count="1" chance="0.2168" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27600" count="1" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
<item id="6661" count="1" chance="0.2168" /> <!-- Orfen's Earring -->
|
||||||
<item id="27601" count="1" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<item id="46508" count="1" chance="0.2365" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
<item id="37781" count="1" chance="0.7804" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="39641" count="1" chance="0.271" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="36513" count="5" /> <!-- Elcyum Powder -->
|
<item id="46150" count="1" chance="0.5203" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="39631" count="1" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="19447" count="1" chance="0.5912" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="36386" count="1" chance="0.6503" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="19440" count="5" /> <!-- Gemstone (R-grade) -->
|
<item id="36513" count="5" chance="21.6778" /> <!-- Elcyum Powder -->
|
||||||
<item id="35563" count="2" /> <!-- Giant's Energy -->
|
<item id="39639" count="1" chance="0.8129" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="46395" count="1" /> <!-- Shadow Ingot -->
|
<item id="19448" count="1" chance="1.0839" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="35563" count="2" chance="6.5033" /> <!-- Giant's Energy -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="39592" count="1" chance="1.8581" /> <!-- Tempest Stone -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex Chapter 1 -->
|
<item id="37771" count="1" chance="0.929" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37780" count="1" chance="1.3007" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="39633" count="1" chance="2.6013" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="39637" count="1" chance="3.2517" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="19440" count="5" chance="13.0067" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="17526" count="1" chance="5.4195" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="36389" count="1" chance="6.5033" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="17527" count="1" chance="14.4519" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="39631" count="1" chance="15.3022" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
</common_reward>
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
</luckygame>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<luckygame index="102" turning_point="10000">
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<common_reward>
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39573" count="1" chance="0.0052" /> <!-- Sealed Talisman - Insanity -->
|
||||||
</fortuneReadingTicketRewards>
|
<item id="37717" count="1" chance="0.0034" /> <!-- Talisman - Seven Signs -->
|
||||||
<luxuryFortuneReadingTicketRewards>
|
<item id="46553" count="1" chance="0.0028" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37716" count="1" chance="0.0112" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor: (R-grade) -->
|
<item id="35001" count="1" chance="0.0048" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon: (R-grade) -->
|
<item id="34998" count="1" chance="0.0056" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="36164" count="2" /> <!-- Giant's Scroll: Enchant Armor: (R-grade) -->
|
<item id="46062" count="1" chance="0.0056" /> <!-- Kelbim Bow -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37715" count="1" chance="0.0244" /> <!-- Talisman - Anakim -->
|
||||||
<item id="27600" count="2" /> <!-- Scroll of Blessing: Armor: (R95 grade) -->
|
<item id="34999" count="1" chance="0.0067" /> <!-- Tauti's Axe -->
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor: (R99 grade) -->
|
<item id="46061" count="1" chance="0.0075" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46063" count="1" chance="0.0084" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="34777" count="1" chance="0.0096" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46060" count="1" chance="0.0096" /> <!-- Kelbim Dagger -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon: (R95-grade) -->
|
<item id="35649" count="1" chance="0.1033" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon: (R99-grade) -->
|
<item id="23342" count="1" chance="0.0224" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="17527" count="2" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="37714" count="1" chance="0.0269" /> <!-- Talisman - Lilith -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="35566" count="1" chance="0.0134" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="6656" count="1" chance="0.1562" /> <!-- Antharas' Earring -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
<item id="6660" count="1" chance="0.1722" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="34776" count="1" chance="0.0224" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="39647" count="1" chance="0.0478" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="6657" count="1" chance="0.1526" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="21712" count="1" chance="0.1221" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="46395" count="10" chance="0.3358" /> <!-- Shadow Ingot -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0707" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="37513" count="1" chance="0.1033" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="46479" count="1" chance="0.0672" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="37508" count="1" chance="0.1343" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="34775" count="1" chance="0.7545" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46494" count="1" chance="0.0517" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="46464" count="1" chance="0.062" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="46449" count="1" chance="0.062" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="39643" count="1" chance="0.4477" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="37517" count="1" chance="0.2238" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46478" count="1" chance="0.1221" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="37518" count="1" chance="0.2442" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="35567" count="1" chance="0.2686" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="37509" count="1" chance="0.2686" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="27463" count="1" /> <!-- Demon Circlet Box -->
|
<item id="37772" count="1" chance="0.3358" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="27466" count="1" /> <!-- Eyepatch Box -->
|
<item id="46151" count="1" chance="0.1919" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="46493" count="1" chance="0.2098" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46464" count="1" chance="0.1343" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="6661" count="1" chance="0.2238" /> <!-- Orfen's Earring -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="46508" count="1" chance="0.0977" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="37781" count="1" chance="0.8058" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="39641" count="1" chance="1.1192" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="27458" count="1" chance="0.0307" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="27459" count="1" chance="0.0307" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="36515" count="1" /> <!-- Elcyum -->
|
<item id="27460" count="1" chance="0.0307" /> <!-- Cat Ears Box -->
|
||||||
<item id="39631" count="3" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="27461" count="1" chance="0.0307" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="27462" count="1" chance="0.0307" /> <!-- Angel Circlet Box -->
|
||||||
<item id="19440" count="15" /> <!-- Gem Stone - R grade -->
|
<item id="27463" count="1" chance="0.0307" /> <!-- Demon Circlet Box -->
|
||||||
<item id="35563" count="10" /> <!-- Giant's Energy -->
|
<item id="27464" count="1" chance="0.0307" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="39738" count="1" /> <!-- Rune Stone -->
|
<item id="27465" count="1" chance="0.0307" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="27466" count="1" chance="0.0307" /> <!-- Eyepatch Box -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex - Chapter 1 -->
|
<item id="27467" count="1" chance="0.0307" /> <!-- Party Hat Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27468" count="1" chance="0.0307" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="27469" count="1" chance="0.0307" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="37719" count="1" chance="0.0839" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="37720" count="1" chance="0.0839" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="37721" count="1" chance="0.0839" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37722" count="1" chance="0.0839" /> <!-- Eva's Special Pack -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46150" count="1" chance="1.0744" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="19447" count="1" chance="1.2209" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="36386" count="1" chance="1.343" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="26446" count="1" chance="0.0672" /> <!-- Shadow Dualsword Box -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="36515" count="1" chance="1.6788" /> <!-- Elcyum -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="26445" count="1" chance="0.0839" /> <!-- Shadow Retributer Box -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="39639" count="1" chance="3.3575" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="26442" count="1" chance="0.0895" /> <!-- Shadow Thrower Box -->
|
||||||
<item id="26444" count="1" /> <!-- Shadow Buster Pack -->
|
<item id="26441" count="1" chance="0.1033" /> <!-- Shadow Stormer Box -->
|
||||||
<item id="26438" count="1" /> <!-- Shadow Cutter Pack -->
|
<item id="19448" count="1" chance="2.2383" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="26446" count="1" /> <!-- Shadow Dualsword Pack -->
|
<item id="39738" count="1" chance="2.686" /> <!-- Rune Stone -->
|
||||||
<item id="26440" count="1" /> <!-- Shadow Fighter Pack -->
|
<item id="35563" count="10" chance="5.372" /> <!-- Giant's Energy -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="26438" count="1" chance="0.1492" /> <!-- Shadow Cutter Box -->
|
||||||
<item id="26445" count="1" /> <!-- Shadow Retributer Pack -->
|
<item id="26439" count="1" chance="0.1679" /> <!-- Shadow Slasher Box -->
|
||||||
<item id="26437" count="1" /> <!-- Shadow Shaper Pack -->
|
<item id="39592" count="1" chance="3.8372" /> <!-- Tempest Stone -->
|
||||||
<item id="26443" count="1" /> <!-- Shadow Shooter Pack -->
|
<item id="37771" count="1" chance="1.9186" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="26439" count="1" /> <!-- Shadow Slasher Pack -->
|
<item id="26437" count="1" chance="0.2238" /> <!-- Shadow Shaper Box -->
|
||||||
<item id="26441" count="1" /> <!-- Shadow Stormer Pack -->
|
<item id="26444" count="1" chance="0.2238" /> <!-- Shadow Buster Box -->
|
||||||
<item id="26442" count="1" /> <!-- Shadow Thrower Pack -->
|
<item id="26443" count="1" chance="0.2686" /> <!-- Shadow Shooter Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37780" count="2" chance="1.343" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39633" count="1" chance="5.372" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="39637" count="1" chance="6.715" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="19440" count="15" chance="8.9534" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
<item id="17526" count="1" chance="11.1917" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="36389" count="2" chance="6.715" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
<item id="17527" count="2" chance="14.9218" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
<item id="39631" count="3" chance="10.5334" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
</common_reward>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<unique_reward>
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="36946" count="1" points="10000" /> <!-- Lindvior's Earring -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="37717" count="1" points="9000" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="19463" count="1" points="8000" /> <!-- Blessed Antharas' Earring -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="19464" count="1" points="7000" /> <!-- Blessed Valakas' Necklace -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="35564" count="1" points="6000" /> <!-- Ruler's Authority -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="17623" count="1" points="5000" /> <!-- Earth Wyrm Heart Ring -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="35570" count="1" points="4000" /> <!-- Tauti's Ring -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="35566" count="1" points="3000" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
</luxuryFortuneReadingTicketRewards>
|
<item id="35568" count="1" points="2000" /> <!-- Bloody Amaranthine Enhancement Stone -->
|
||||||
<rareLuxuryFortuneReadingTicketRewards>
|
<item id="35567" count="1" points="1000" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon - R grade -->
|
<item id="35569" count="1" points="500" /> <!-- Bloody Eternal Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="26511" count="1" points="250" /> <!-- Anakim Set Pack -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
</unique_reward>
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<modify_reward min_game="40" max_game="50">
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="39573" count="1" chance="0.0679" /> <!-- Sealed Talisman - Insanity -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="37717" count="1" chance="0.0441" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46553" count="1" chance="0.0368" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="37716" count="1" chance="0.147" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="35001" count="1" chance="0.063" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="34998" count="1" chance="0.0735" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="46062" count="1" chance="0.0735" /> <!-- Kelbim Bow -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="37715" count="1" chance="0.3208" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="34999" count="1" chance="0.0882" /> <!-- Tauti's Axe -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="46061" count="1" chance="0.098" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="46063" count="1" chance="0.1103" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34777" count="1" chance="0.126" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="46060" count="1" chance="0.126" /> <!-- Kelbim Dagger -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="35649" count="1" chance="0.2714" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="23342" count="1" chance="0.294" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37714" count="1" chance="0.3528" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="35566" count="1" chance="0.1764" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="6656" count="1" chance="0.0257" /> <!-- Antharas' Earring -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="6660" count="1" chance="2.2618" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="34776" count="1" chance="0.294" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="39647" count="1" chance="0.6273" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="6657" count="1" chance="2.0048" /> <!-- Valakas' Necklace -->
|
||||||
<item id="27463" count="1" /> <!-- Devil Circlet Box -->
|
<item id="21712" count="1" chance="1.6039" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="27464" count="1" /> <!-- Eyepatch Box -->
|
<item id="46395" count="10" chance="2.2053" /> <!-- Shadow Ingot -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="37507" count="1" chance="0.9285" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="37513" count="1" chance="1.3571" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46479" count="1" chance="0.8821" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="37508" count="1" chance="1.7642" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="34775" count="1" chance="4.9557" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="46494" count="1" chance="0.6786" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="46464" count="1" chance="0.8143" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="46449" count="1" chance="0.8143" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="39643" count="1" chance="5.8808" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="37517" count="1" chance="2.9404" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="46478" count="1" chance="1.6039" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="37518" count="1" chance="3.2077" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="35567" count="1" chance="3.5285" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37509" count="1" chance="3.5285" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37772" count="1" chance="4.4106" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="46151" count="1" chance="2.5203" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46493" count="1" chance="2.7566" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="46464" count="1" chance="1.7642" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="6661" count="1" chance="2.9404" /> <!-- Orfen's Earring -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="46508" count="1" chance="1.2831" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="37781" count="2" chance="10.5854" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="39641" count="1" chance="14.7015" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="27458" count="1" chance="0.4033" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="27459" count="1" chance="0.4033" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="27460" count="1" chance="0.4033" /> <!-- Cat Ears Box -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="27461" count="1" chance="0.4033" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="27462" count="1" chance="0.4033" /> <!-- Angel Circlet Box -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="27463" count="1" chance="0.4033" /> <!-- Demon Circlet Box -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="27464" count="1" chance="0.4033" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="27465" count="1" chance="0.4033" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27466" count="1" chance="0.4033" /> <!-- Eyepatch Box -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
<item id="27467" count="1" chance="0.4033" /> <!-- Party Hat Box -->
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<item id="27468" count="1" chance="0.4033" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="27469" count="1" chance="0.4033" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37719" count="1" chance="2.2053" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="37720" count="1" chance="2.2053" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="37721" count="1" chance="2.2053" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="37722" count="1" chance="2.2053" /> <!-- Eva's Special Pack -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
</modify_reward>
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
</luckygame>
|
||||||
</rareLuxuryFortuneReadingTicketRewards>
|
|
||||||
</list>
|
</list>
|
@@ -17,6 +17,7 @@
|
|||||||
package events.EveTheFortuneTeller;
|
package events.EveTheFortuneTeller;
|
||||||
|
|
||||||
import com.l2jmobius.gameserver.enums.ChatType;
|
import com.l2jmobius.gameserver.enums.ChatType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
import com.l2jmobius.gameserver.model.Location;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@@ -36,6 +37,9 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
// NPCs
|
// NPCs
|
||||||
private static final int EVE = 8542;
|
private static final int EVE = 8542;
|
||||||
private static final int JAYCE = 8540;
|
private static final int JAYCE = 8540;
|
||||||
|
// Items
|
||||||
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
// Misc
|
// Misc
|
||||||
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
||||||
private static final NpcStringId[] JAYCE_TEXT =
|
private static final NpcStringId[] JAYCE_TEXT =
|
||||||
@@ -71,12 +75,12 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
case "FortuneReadingGame":
|
case "FortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 1));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.NORMAL, player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "LuxuryFortuneReadingGame":
|
case "LuxuryFortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 2));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.LUXURY, player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "JAYCE_SHOUT":
|
case "JAYCE_SHOUT":
|
||||||
|
@@ -2,56 +2,68 @@
|
|||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="fortuneReadingTicketRewards">
|
<xs:element name="luckygame" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
<xs:element name="common_reward">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:simpleContent>
|
<xs:sequence>
|
||||||
<xs:extension base="xs:string">
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:simpleContent>
|
||||||
</xs:extension>
|
<xs:extension base="xs:string">
|
||||||
</xs:simpleContent>
|
<xs:attribute type="xs:float" name="chance" use="optional" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
</xs:extension>
|
||||||
</xs:complexType>
|
</xs:simpleContent>
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="luxuryFortuneReadingTicketRewards">
|
</xs:element>
|
||||||
<xs:complexType>
|
</xs:sequence>
|
||||||
<xs:sequence>
|
</xs:complexType>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="unique_reward" minOccurs="0">
|
||||||
<xs:simpleContent>
|
<xs:complexType>
|
||||||
<xs:extension base="xs:string">
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:complexType>
|
||||||
</xs:extension>
|
<xs:simpleContent>
|
||||||
</xs:simpleContent>
|
<xs:extension base="xs:string">
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
<xs:attribute type="xs:short" name="points" use="optional" />
|
||||||
</xs:complexType>
|
</xs:extension>
|
||||||
</xs:element>
|
</xs:simpleContent>
|
||||||
<xs:element name="rareLuxuryFortuneReadingTicketRewards">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:simpleContent>
|
<xs:element name="modify_reward" minOccurs="0">
|
||||||
<xs:extension base="xs:string">
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
</xs:extension>
|
<xs:complexType>
|
||||||
</xs:simpleContent>
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute type="xs:float" name="chance" />
|
||||||
|
<xs:attribute type="xs:byte" name="count" />
|
||||||
|
<xs:attribute type="xs:int" name="id" />
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:byte" name="max_game" />
|
||||||
|
<xs:attribute type="xs:byte" name="min_game" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:int" name="turning_point" use="optional" />
|
||||||
|
<xs:attribute type="xs:byte" name="index" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute type="xs:string" name="enabled"/>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
@@ -17,25 +17,26 @@
|
|||||||
package com.l2jmobius.gameserver.data.xml.impl;
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
|
||||||
import org.w3c.dom.Node;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemPointHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mathael
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class LuckyGameData implements IGameXmlReader
|
public class LuckyGameData implements IGameXmlReader
|
||||||
{
|
{
|
||||||
private static final List<ItemHolder> _fortuneReadingTicketRewards = new ArrayList<>();
|
private final Map<Integer, LuckyGameDataHolder> _luckyGame = new HashMap<>();
|
||||||
private static final List<ItemHolder> _luxuryFortuneReadingTicketRewards = new ArrayList<>();
|
|
||||||
private static final List<ItemHolder> _rareLuxuryFortuneReadingTicketRewards = new ArrayList<>();
|
final AtomicInteger _serverPlay = new AtomicInteger();
|
||||||
|
|
||||||
protected LuckyGameData()
|
protected LuckyGameData()
|
||||||
{
|
{
|
||||||
@@ -45,112 +46,62 @@ public class LuckyGameData implements IGameXmlReader
|
|||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
_fortuneReadingTicketRewards.clear();
|
_luckyGame.clear();
|
||||||
_luxuryFortuneReadingTicketRewards.clear();
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.clear();
|
|
||||||
|
|
||||||
parseDatapackFile("data/LuckyGameData.xml");
|
parseDatapackFile("data/LuckyGameData.xml");
|
||||||
|
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luckyGame.size() + " lucky game data.");
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _fortuneReadingTicketRewards.size() + " Normal item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luxuryFortuneReadingTicketRewards.size() + " Luxury item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _rareLuxuryFortuneReadingTicketRewards.size() + " Rare item rewards.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void parseDocument(Document doc, File f)
|
public void parseDocument(Document doc, File f)
|
||||||
{
|
{
|
||||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
forEach(doc, "list", listNode -> forEach(listNode, "luckygame", rewardNode ->
|
||||||
{
|
{
|
||||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
final LuckyGameDataHolder holder = new LuckyGameDataHolder(new StatsSet(parseAttributes(rewardNode)));
|
||||||
|
|
||||||
|
forEach(rewardNode, "common_reward", commonRewardNode -> forEach(commonRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
final NamedNodeMap at = n.getAttributes();
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
final Node attribute = at.getNamedItem("enabled");
|
holder.addCommonReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "unique_reward", uniqueRewardNode -> forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
|
{
|
||||||
|
holder.addUniqueReward(new ItemPointHolder(new StatsSet(parseAttributes(itemNode))));
|
||||||
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "modify_reward", uniqueRewardNode ->
|
||||||
|
{
|
||||||
|
holder.setMinModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "min_game"));
|
||||||
|
holder.setMaxModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "max_game"));
|
||||||
|
forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
{
|
holder.addModifyReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ("fortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
});
|
||||||
{
|
});
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
_luckyGame.put(parseInteger(rewardNode.getAttributes(), "index"), holder);
|
||||||
final int count = parseInteger(attrs, "count");
|
}));
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_fortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("luxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_luxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("rareLuxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomNormalReward()
|
public int getLuckyGameCount()
|
||||||
{
|
{
|
||||||
return _fortuneReadingTicketRewards.get(Rnd.get(_fortuneReadingTicketRewards.size()));
|
return _luckyGame.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomLuxuryReward()
|
public LuckyGameDataHolder getLuckyGameDataByIndex(int index)
|
||||||
{
|
{
|
||||||
return _luxuryFortuneReadingTicketRewards.get(Rnd.get(_luxuryFortuneReadingTicketRewards.size()));
|
return _luckyGame.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomRareReward()
|
public int increaseGame()
|
||||||
{
|
{
|
||||||
return _rareLuxuryFortuneReadingTicketRewards.get(Rnd.get(_rareLuxuryFortuneReadingTicketRewards.size()));
|
return _serverPlay.incrementAndGet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerPlay()
|
||||||
|
{
|
||||||
|
return _serverPlay.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LuckyGameData getInstance()
|
public static LuckyGameData getInstance()
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameItemType
|
||||||
|
{
|
||||||
|
COMMON(1),
|
||||||
|
UNIQUE(2),
|
||||||
|
RARE(3);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
LuckyGameItemType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameResultType
|
||||||
|
{
|
||||||
|
INVALID_CAPACITY(-2),
|
||||||
|
INVALID_ITEM_COUNT(-1),
|
||||||
|
DISABLED(0),
|
||||||
|
SUCCESS(1);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
private LuckyGameResultType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
NORMAL,
|
||||||
|
LUXURY
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class ItemPointHolder extends ItemHolder
|
||||||
|
{
|
||||||
|
private final int _points;
|
||||||
|
|
||||||
|
public ItemPointHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
this(params.getInt("id"), params.getLong("count"), params.getInt("points"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemPointHolder(int id, long count, int points)
|
||||||
|
{
|
||||||
|
super(id, count);
|
||||||
|
_points = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the point.
|
||||||
|
* @return the number of point to get the item
|
||||||
|
*/
|
||||||
|
public int getPoints()
|
||||||
|
{
|
||||||
|
return _points;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", points: " + _points;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class LuckyGameDataHolder
|
||||||
|
{
|
||||||
|
final private int _index;
|
||||||
|
final private int _turningPoints;
|
||||||
|
final private List<ItemChanceHolder> _commonRewards = new ArrayList<>();
|
||||||
|
final private List<ItemPointHolder> _uniqueRewards = new ArrayList<>();
|
||||||
|
final private List<ItemChanceHolder> _modifyRewards = new ArrayList<>();
|
||||||
|
private int _minModifyRewardGame;
|
||||||
|
private int _maxModifyRewardGame;
|
||||||
|
|
||||||
|
public LuckyGameDataHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
_index = params.getInt("index");
|
||||||
|
_turningPoints = params.getInt("turning_point");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCommonReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_commonRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addUniqueReward(ItemPointHolder item)
|
||||||
|
{
|
||||||
|
_uniqueRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addModifyReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_modifyRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getCommonReward()
|
||||||
|
{
|
||||||
|
return _commonRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemPointHolder> getUniqueReward()
|
||||||
|
{
|
||||||
|
return _uniqueRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getModifyReward()
|
||||||
|
{
|
||||||
|
return _modifyRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinModifyRewardGame(int minModifyRewardGame)
|
||||||
|
{
|
||||||
|
_minModifyRewardGame = minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxModifyRewardGame(int maxModifyRewardGame)
|
||||||
|
{
|
||||||
|
_maxModifyRewardGame = maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex()
|
||||||
|
{
|
||||||
|
return _index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTurningPoints()
|
||||||
|
{
|
||||||
|
return _turningPoints;
|
||||||
|
}
|
||||||
|
}
|
@@ -57,6 +57,8 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
||||||
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
||||||
public static final String EXTEND_DROP = "EXTEND_DROP";
|
public static final String EXTEND_DROP = "EXTEND_DROP";
|
||||||
|
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
|
||||||
|
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
|
||||||
|
|
||||||
private final int _objectId;
|
private final int _objectId;
|
||||||
|
|
||||||
|
@@ -68,6 +68,8 @@ import com.l2jmobius.gameserver.network.clientpackets.dailymission.RequestOneDay
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoList;
|
import com.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoList;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGamePlay;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGameStartInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
||||||
@@ -328,8 +330,8 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
||||||
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_START_INFO(0xF1, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_START_INFO(0xF1, RequestLuckyGameStartInfo::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_PLAY(0xF2, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_PLAY(0xF2, RequestLuckyGamePlay::new, ConnectionState.IN_GAME),
|
||||||
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
||||||
|
@@ -16,30 +16,169 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketReader;
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.commons.util.CommonUtil;
|
||||||
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
||||||
{
|
{
|
||||||
private int _type;
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
private int _count;
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
|
private LuckyGameType _type;
|
||||||
|
private int _reading;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean read(L2GameClient client, PacketReader packet)
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
{
|
{
|
||||||
_type = packet.readD(); // luxury = 2, normal = 1
|
final int type = CommonUtil.constrain(packet.readD(), 0, LuckyGameType.values().length);
|
||||||
_count = packet.readD(); // count
|
_type = LuckyGameType.values()[type];
|
||||||
|
_reading = CommonUtil.constrain(packet.readD(), 0, 50); // max play is 50
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(L2GameClient client)
|
public void run(L2GameClient client)
|
||||||
{
|
{
|
||||||
client.getActiveChar().sendPacket(new ExBettingLuckyGameResult(client.getActiveChar(), _type, _count));
|
final L2PcInstance player = client.getActiveChar();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int index = _type == LuckyGameType.LUXURY ? 102 : 2; // move to event config
|
||||||
|
|
||||||
|
final LuckyGameDataHolder holder = LuckyGameData.getInstance().getLuckyGameDataByIndex(index);
|
||||||
|
if (holder == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long tickets = _type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1);
|
||||||
|
if (tickets < _reading)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int playCount = player.getVariables().getInt(PlayerVariables.FORTUNE_TELLING_VARIABLE, 0);
|
||||||
|
boolean blackCat = player.getVariables().getBoolean(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, false);
|
||||||
|
final EnumMap<LuckyGameItemType, List<ItemHolder>> rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final double chance = 100 * Rnd.nextDouble();
|
||||||
|
double totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : holder.getCommonReward())
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chance)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.COMMON, k -> new ArrayList<>()).add(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playCount++;
|
||||||
|
if ((playCount >= holder.getMinModifyRewardGame()) && (playCount <= holder.getMaxModifyRewardGame()) && !blackCat)
|
||||||
|
{
|
||||||
|
final List<ItemChanceHolder> modifyReward = holder.getModifyReward();
|
||||||
|
final double chanceModify = 100 * Rnd.nextDouble();
|
||||||
|
totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : modifyReward)
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chanceModify)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(item);
|
||||||
|
blackCat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playCount == holder.getMaxModifyRewardGame())
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(modifyReward.get(Rnd.get(modifyReward.size())));
|
||||||
|
blackCat = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
|
// Check inventory capacity
|
||||||
|
if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.destroyItemByItemId("LuckyGame", _type == LuckyGameType.LUXURY ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _reading, player, true))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final int serverGameNumber = LuckyGameData.getInstance().increaseGame();
|
||||||
|
holder.getUniqueReward().stream().filter(reward -> reward.getPoints() == serverGameNumber).forEach(item -> rewards.computeIfAbsent(LuckyGameItemType.UNIQUE, k -> new ArrayList<>()).add(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(new ExBettingLuckyGameResult(LuckyGameResultType.SUCCESS, _type, rewards, (int) (_type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1))));
|
||||||
|
|
||||||
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : rewards.entrySet())
|
||||||
|
{
|
||||||
|
for (ItemHolder r : reward.getValue())
|
||||||
|
{
|
||||||
|
final L2ItemInstance item = player.addItem("LuckyGame", r.getId(), r.getCount(), player, true);
|
||||||
|
iu.addItem(item);
|
||||||
|
if (reward.getKey() == LuckyGameItemType.UNIQUE)
|
||||||
|
{
|
||||||
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
||||||
|
sm.addPcName(player);
|
||||||
|
sm.addLong(r.getCount());
|
||||||
|
sm.addItemName(item);
|
||||||
|
player.broadcastPacket(sm, 1000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendInventoryUpdate(iu);
|
||||||
|
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_VARIABLE, playCount >= 50 ? (playCount - 50) : playCount);
|
||||||
|
if (blackCat && (playCount < 50))
|
||||||
|
{
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class RequestLuckyGameStartInfo implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -16,121 +16,69 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.NORMAL);
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.LUXURY);
|
||||||
private int _count = 0;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.NORMAL);
|
||||||
private int _type = 0;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.LUXURY);
|
||||||
private final L2PcInstance _activeChar;
|
|
||||||
|
|
||||||
public ExBettingLuckyGameResult(L2PcInstance activeChar, int type, int count)
|
private final LuckyGameResultType _result;
|
||||||
|
private final LuckyGameType _type;
|
||||||
|
private final EnumMap<LuckyGameItemType, List<ItemHolder>> _rewards;
|
||||||
|
private final int _ticketCount;
|
||||||
|
private final int _size;
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type)
|
||||||
{
|
{
|
||||||
_count = count;
|
_result = result;
|
||||||
_type = type;
|
_type = type;
|
||||||
_activeChar = activeChar;
|
_rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
_ticketCount = 0;
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type, EnumMap<LuckyGameItemType, List<ItemHolder>> rewards, int ticketCount)
|
||||||
|
{
|
||||||
|
_result = result;
|
||||||
|
_type = type;
|
||||||
|
_rewards = rewards;
|
||||||
|
_ticketCount = ticketCount;
|
||||||
|
_size = (int) rewards.values().stream().mapToLong(i -> i.stream().count()).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
// Calculate rewards
|
|
||||||
final List<ItemHolder> rewards = new ArrayList<>();
|
|
||||||
int totalWeight = 0;
|
|
||||||
for (int rewardCounter = 0; rewardCounter < _count; rewardCounter++)
|
|
||||||
{
|
|
||||||
if (Rnd.get(3) == 0) // 1 out of 3 chance
|
|
||||||
{
|
|
||||||
ItemHolder reward = null;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
if (_count >= 40)
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomRareReward();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomLuxuryReward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomNormalReward();
|
|
||||||
}
|
|
||||||
rewards.add(reward);
|
|
||||||
totalWeight += new L2ItemInstance(reward.getId()).getItem().getWeight() * reward.getCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check inventory capacity
|
|
||||||
if ((rewards.size() > 0) && (!_activeChar.getInventory().validateCapacity(rewards.size()) || !_activeChar.getInventory().validateWeight(totalWeight)))
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1) < _count)
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove tickets
|
|
||||||
_activeChar.getInventory().destroyItemByItemId("FortuneTelling", _type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _count, _activeChar, "FortuneTelling");
|
|
||||||
|
|
||||||
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
||||||
packet.writeD(0x01); // 0 disabled, 1 enabled
|
packet.writeD(_result.getClientId());
|
||||||
packet.writeD(0x01); // ?
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD((int) _activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1)); // Count remaining tickets
|
packet.writeD(_ticketCount);
|
||||||
|
packet.writeD(_size);
|
||||||
if (rewards.size() > 0)
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : _rewards.entrySet())
|
||||||
{
|
{
|
||||||
packet.writeD(rewards.size());
|
for (ItemHolder item : reward.getValue())
|
||||||
for (ItemHolder reward : rewards)
|
|
||||||
{
|
{
|
||||||
packet.writeD(0x02); // normal = 1, rare = 2 (forcing 2)
|
packet.writeD(reward.getKey().getClientId());
|
||||||
packet.writeD(reward.getId());
|
packet.writeD(item.getId());
|
||||||
packet.writeD((int) reward.getCount());
|
packet.writeD((int) item.getCount());
|
||||||
final SystemMessage sm;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
_activeChar.addItem("LuxuryFortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_IN_THE_LUXURY_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_activeChar.addItem("FortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
sm.addPcName(_activeChar);
|
|
||||||
sm.addLong(reward.getCount());
|
|
||||||
sm.addItemName(new L2ItemInstance(reward.getId()));
|
|
||||||
_activeChar.broadcastPacket(sm, 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
packet.writeD(0x00);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,32 +17,30 @@
|
|||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExStartLuckyGame implements IClientOutgoingPacket
|
public class ExStartLuckyGame implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
private final LuckyGameType _type;
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
private final int _ticketCount;
|
||||||
private int _type = 0;
|
|
||||||
private int _count = 0;
|
|
||||||
|
|
||||||
public ExStartLuckyGame(L2PcInstance activeChar, int type)
|
public ExStartLuckyGame(LuckyGameType type, long ticketCount)
|
||||||
{
|
{
|
||||||
_type = type;
|
_type = type;
|
||||||
_count = (int) activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1);
|
_ticketCount = (int) ticketCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
||||||
packet.writeD(_type);
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD(_count);
|
packet.writeD(_ticketCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,225 +1,224 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
||||||
<fortuneReadingTicketRewards>
|
<luckygame index="2" turning_point="50000">
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<common_reward>
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="37715" count="1" chance="0.0059" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="34777" count="1" chance="0.0046" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="35649" count="1" chance="0.01" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="37714" count="1" chance="0.013" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="6656" count="1" chance="0.0151" /> <!-- Antharas' Earring -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="6660" count="1" chance="0.0167" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34776" count="1" chance="0.0108" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="6657" count="1" chance="0.0296" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="21712" count="1" chance="0.0296" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46395" count="1" chance="0.1626" /> <!-- Shadow Ingot -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0342" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="37513" count="1" chance="0.05" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="37508" count="1" chance="0.065" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="34775" count="1" chance="0.0365" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46494" count="1" chance="0.0417" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="46509" count="1" chance="0.05" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
||||||
<item id="17527" count="1" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="46449" count="1" chance="0.05" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37517" count="1" chance="0.1084" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
<item id="46478" count="1" chance="0.1182" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
<item id="37518" count="1" chance="0.1182" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="33817" count="1" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
<item id="37509" count="1" chance="0.1301" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37772" count="1" chance="0.3252" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46151" count="1" chance="0.1858" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="46493" count="1" chance="0.2032" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46464" count="1" chance="0.2168" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27600" count="1" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
<item id="6661" count="1" chance="0.2168" /> <!-- Orfen's Earring -->
|
||||||
<item id="27601" count="1" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<item id="46508" count="1" chance="0.2365" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
<item id="37781" count="1" chance="0.7804" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="39641" count="1" chance="0.271" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="36513" count="5" /> <!-- Elcyum Powder -->
|
<item id="46150" count="1" chance="0.5203" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="39631" count="1" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="19447" count="1" chance="0.5912" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="36386" count="1" chance="0.6503" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="19440" count="5" /> <!-- Gemstone (R-grade) -->
|
<item id="36513" count="5" chance="21.6778" /> <!-- Elcyum Powder -->
|
||||||
<item id="35563" count="2" /> <!-- Giant's Energy -->
|
<item id="39639" count="1" chance="0.8129" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="46395" count="1" /> <!-- Shadow Ingot -->
|
<item id="19448" count="1" chance="1.0839" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="35563" count="2" chance="6.5033" /> <!-- Giant's Energy -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="39592" count="1" chance="1.8581" /> <!-- Tempest Stone -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex Chapter 1 -->
|
<item id="37771" count="1" chance="0.929" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37780" count="1" chance="1.3007" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="39633" count="1" chance="2.6013" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="39637" count="1" chance="3.2517" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="19440" count="5" chance="13.0067" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="17526" count="1" chance="5.4195" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="36389" count="1" chance="6.5033" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="17527" count="1" chance="14.4519" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="39631" count="1" chance="15.3022" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
</common_reward>
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
</luckygame>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<luckygame index="102" turning_point="10000">
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<common_reward>
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39573" count="1" chance="0.0052" /> <!-- Sealed Talisman - Insanity -->
|
||||||
</fortuneReadingTicketRewards>
|
<item id="37717" count="1" chance="0.0034" /> <!-- Talisman - Seven Signs -->
|
||||||
<luxuryFortuneReadingTicketRewards>
|
<item id="46553" count="1" chance="0.0028" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37716" count="1" chance="0.0112" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor: (R-grade) -->
|
<item id="35001" count="1" chance="0.0048" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon: (R-grade) -->
|
<item id="34998" count="1" chance="0.0056" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="36164" count="2" /> <!-- Giant's Scroll: Enchant Armor: (R-grade) -->
|
<item id="46062" count="1" chance="0.0056" /> <!-- Kelbim Bow -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37715" count="1" chance="0.0244" /> <!-- Talisman - Anakim -->
|
||||||
<item id="27600" count="2" /> <!-- Scroll of Blessing: Armor: (R95 grade) -->
|
<item id="34999" count="1" chance="0.0067" /> <!-- Tauti's Axe -->
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor: (R99 grade) -->
|
<item id="46061" count="1" chance="0.0075" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46063" count="1" chance="0.0084" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="34777" count="1" chance="0.0096" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46060" count="1" chance="0.0096" /> <!-- Kelbim Dagger -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon: (R95-grade) -->
|
<item id="35649" count="1" chance="0.1033" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon: (R99-grade) -->
|
<item id="23342" count="1" chance="0.0224" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="17527" count="2" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="37714" count="1" chance="0.0269" /> <!-- Talisman - Lilith -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="35566" count="1" chance="0.0134" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="6656" count="1" chance="0.1562" /> <!-- Antharas' Earring -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
<item id="6660" count="1" chance="0.1722" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="34776" count="1" chance="0.0224" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="39647" count="1" chance="0.0478" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="6657" count="1" chance="0.1526" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="21712" count="1" chance="0.1221" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="46395" count="10" chance="0.3358" /> <!-- Shadow Ingot -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0707" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="37513" count="1" chance="0.1033" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="46479" count="1" chance="0.0672" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="37508" count="1" chance="0.1343" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="34775" count="1" chance="0.7545" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46494" count="1" chance="0.0517" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="46464" count="1" chance="0.062" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="46449" count="1" chance="0.062" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="39643" count="1" chance="0.4477" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="37517" count="1" chance="0.2238" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46478" count="1" chance="0.1221" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="37518" count="1" chance="0.2442" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="35567" count="1" chance="0.2686" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="37509" count="1" chance="0.2686" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="27463" count="1" /> <!-- Demon Circlet Box -->
|
<item id="37772" count="1" chance="0.3358" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="27466" count="1" /> <!-- Eyepatch Box -->
|
<item id="46151" count="1" chance="0.1919" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="46493" count="1" chance="0.2098" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46464" count="1" chance="0.1343" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="6661" count="1" chance="0.2238" /> <!-- Orfen's Earring -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="46508" count="1" chance="0.0977" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="37781" count="1" chance="0.8058" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="39641" count="1" chance="1.1192" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="27458" count="1" chance="0.0307" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="27459" count="1" chance="0.0307" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="36515" count="1" /> <!-- Elcyum -->
|
<item id="27460" count="1" chance="0.0307" /> <!-- Cat Ears Box -->
|
||||||
<item id="39631" count="3" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="27461" count="1" chance="0.0307" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="27462" count="1" chance="0.0307" /> <!-- Angel Circlet Box -->
|
||||||
<item id="19440" count="15" /> <!-- Gem Stone - R grade -->
|
<item id="27463" count="1" chance="0.0307" /> <!-- Demon Circlet Box -->
|
||||||
<item id="35563" count="10" /> <!-- Giant's Energy -->
|
<item id="27464" count="1" chance="0.0307" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="39738" count="1" /> <!-- Rune Stone -->
|
<item id="27465" count="1" chance="0.0307" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="27466" count="1" chance="0.0307" /> <!-- Eyepatch Box -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex - Chapter 1 -->
|
<item id="27467" count="1" chance="0.0307" /> <!-- Party Hat Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27468" count="1" chance="0.0307" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="27469" count="1" chance="0.0307" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="37719" count="1" chance="0.0839" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="37720" count="1" chance="0.0839" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="37721" count="1" chance="0.0839" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37722" count="1" chance="0.0839" /> <!-- Eva's Special Pack -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46150" count="1" chance="1.0744" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="19447" count="1" chance="1.2209" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="36386" count="1" chance="1.343" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="26446" count="1" chance="0.0672" /> <!-- Shadow Dualsword Box -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="36515" count="1" chance="1.6788" /> <!-- Elcyum -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="26445" count="1" chance="0.0839" /> <!-- Shadow Retributer Box -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="39639" count="1" chance="3.3575" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="26442" count="1" chance="0.0895" /> <!-- Shadow Thrower Box -->
|
||||||
<item id="26444" count="1" /> <!-- Shadow Buster Pack -->
|
<item id="26441" count="1" chance="0.1033" /> <!-- Shadow Stormer Box -->
|
||||||
<item id="26438" count="1" /> <!-- Shadow Cutter Pack -->
|
<item id="19448" count="1" chance="2.2383" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="26446" count="1" /> <!-- Shadow Dualsword Pack -->
|
<item id="39738" count="1" chance="2.686" /> <!-- Rune Stone -->
|
||||||
<item id="26440" count="1" /> <!-- Shadow Fighter Pack -->
|
<item id="35563" count="10" chance="5.372" /> <!-- Giant's Energy -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="26438" count="1" chance="0.1492" /> <!-- Shadow Cutter Box -->
|
||||||
<item id="26445" count="1" /> <!-- Shadow Retributer Pack -->
|
<item id="26439" count="1" chance="0.1679" /> <!-- Shadow Slasher Box -->
|
||||||
<item id="26437" count="1" /> <!-- Shadow Shaper Pack -->
|
<item id="39592" count="1" chance="3.8372" /> <!-- Tempest Stone -->
|
||||||
<item id="26443" count="1" /> <!-- Shadow Shooter Pack -->
|
<item id="37771" count="1" chance="1.9186" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="26439" count="1" /> <!-- Shadow Slasher Pack -->
|
<item id="26437" count="1" chance="0.2238" /> <!-- Shadow Shaper Box -->
|
||||||
<item id="26441" count="1" /> <!-- Shadow Stormer Pack -->
|
<item id="26444" count="1" chance="0.2238" /> <!-- Shadow Buster Box -->
|
||||||
<item id="26442" count="1" /> <!-- Shadow Thrower Pack -->
|
<item id="26443" count="1" chance="0.2686" /> <!-- Shadow Shooter Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37780" count="2" chance="1.343" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39633" count="1" chance="5.372" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="39637" count="1" chance="6.715" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="19440" count="15" chance="8.9534" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
<item id="17526" count="1" chance="11.1917" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="36389" count="2" chance="6.715" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
<item id="17527" count="2" chance="14.9218" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
<item id="39631" count="3" chance="10.5334" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
</common_reward>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<unique_reward>
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="36946" count="1" points="10000" /> <!-- Lindvior's Earring -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="37717" count="1" points="9000" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="19463" count="1" points="8000" /> <!-- Blessed Antharas' Earring -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="19464" count="1" points="7000" /> <!-- Blessed Valakas' Necklace -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="35564" count="1" points="6000" /> <!-- Ruler's Authority -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="17623" count="1" points="5000" /> <!-- Earth Wyrm Heart Ring -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="35570" count="1" points="4000" /> <!-- Tauti's Ring -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="35566" count="1" points="3000" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
</luxuryFortuneReadingTicketRewards>
|
<item id="35568" count="1" points="2000" /> <!-- Bloody Amaranthine Enhancement Stone -->
|
||||||
<rareLuxuryFortuneReadingTicketRewards>
|
<item id="35567" count="1" points="1000" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon - R grade -->
|
<item id="35569" count="1" points="500" /> <!-- Bloody Eternal Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="26511" count="1" points="250" /> <!-- Anakim Set Pack -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
</unique_reward>
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<modify_reward min_game="40" max_game="50">
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="39573" count="1" chance="0.0679" /> <!-- Sealed Talisman - Insanity -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="37717" count="1" chance="0.0441" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46553" count="1" chance="0.0368" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="37716" count="1" chance="0.147" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="35001" count="1" chance="0.063" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="34998" count="1" chance="0.0735" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="46062" count="1" chance="0.0735" /> <!-- Kelbim Bow -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="37715" count="1" chance="0.3208" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="34999" count="1" chance="0.0882" /> <!-- Tauti's Axe -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="46061" count="1" chance="0.098" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="46063" count="1" chance="0.1103" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34777" count="1" chance="0.126" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="46060" count="1" chance="0.126" /> <!-- Kelbim Dagger -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="35649" count="1" chance="0.2714" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="23342" count="1" chance="0.294" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37714" count="1" chance="0.3528" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="35566" count="1" chance="0.1764" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="6656" count="1" chance="0.0257" /> <!-- Antharas' Earring -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="6660" count="1" chance="2.2618" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="34776" count="1" chance="0.294" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="39647" count="1" chance="0.6273" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="6657" count="1" chance="2.0048" /> <!-- Valakas' Necklace -->
|
||||||
<item id="27463" count="1" /> <!-- Devil Circlet Box -->
|
<item id="21712" count="1" chance="1.6039" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="27464" count="1" /> <!-- Eyepatch Box -->
|
<item id="46395" count="10" chance="2.2053" /> <!-- Shadow Ingot -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="37507" count="1" chance="0.9285" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="37513" count="1" chance="1.3571" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46479" count="1" chance="0.8821" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="37508" count="1" chance="1.7642" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="34775" count="1" chance="4.9557" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="46494" count="1" chance="0.6786" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="46464" count="1" chance="0.8143" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="46449" count="1" chance="0.8143" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="39643" count="1" chance="5.8808" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="37517" count="1" chance="2.9404" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="46478" count="1" chance="1.6039" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="37518" count="1" chance="3.2077" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="35567" count="1" chance="3.5285" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37509" count="1" chance="3.5285" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37772" count="1" chance="4.4106" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="46151" count="1" chance="2.5203" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46493" count="1" chance="2.7566" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="46464" count="1" chance="1.7642" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="6661" count="1" chance="2.9404" /> <!-- Orfen's Earring -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="46508" count="1" chance="1.2831" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="37781" count="2" chance="10.5854" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="39641" count="1" chance="14.7015" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="27458" count="1" chance="0.4033" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="27459" count="1" chance="0.4033" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="27460" count="1" chance="0.4033" /> <!-- Cat Ears Box -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="27461" count="1" chance="0.4033" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="27462" count="1" chance="0.4033" /> <!-- Angel Circlet Box -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="27463" count="1" chance="0.4033" /> <!-- Demon Circlet Box -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="27464" count="1" chance="0.4033" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="27465" count="1" chance="0.4033" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27466" count="1" chance="0.4033" /> <!-- Eyepatch Box -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
<item id="27467" count="1" chance="0.4033" /> <!-- Party Hat Box -->
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<item id="27468" count="1" chance="0.4033" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="27469" count="1" chance="0.4033" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37719" count="1" chance="2.2053" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="37720" count="1" chance="2.2053" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="37721" count="1" chance="2.2053" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="37722" count="1" chance="2.2053" /> <!-- Eva's Special Pack -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
</modify_reward>
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
</luckygame>
|
||||||
</rareLuxuryFortuneReadingTicketRewards>
|
|
||||||
</list>
|
</list>
|
@@ -17,6 +17,7 @@
|
|||||||
package events.EveTheFortuneTeller;
|
package events.EveTheFortuneTeller;
|
||||||
|
|
||||||
import com.l2jmobius.gameserver.enums.ChatType;
|
import com.l2jmobius.gameserver.enums.ChatType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
import com.l2jmobius.gameserver.model.Location;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@@ -36,6 +37,9 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
// NPCs
|
// NPCs
|
||||||
private static final int EVE = 8542;
|
private static final int EVE = 8542;
|
||||||
private static final int JAYCE = 8540;
|
private static final int JAYCE = 8540;
|
||||||
|
// Items
|
||||||
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
// Misc
|
// Misc
|
||||||
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
||||||
private static final NpcStringId[] JAYCE_TEXT =
|
private static final NpcStringId[] JAYCE_TEXT =
|
||||||
@@ -71,12 +75,12 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
case "FortuneReadingGame":
|
case "FortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 1));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.NORMAL, player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "LuxuryFortuneReadingGame":
|
case "LuxuryFortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 2));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.LUXURY, player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "JAYCE_SHOUT":
|
case "JAYCE_SHOUT":
|
||||||
|
@@ -2,56 +2,68 @@
|
|||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="fortuneReadingTicketRewards">
|
<xs:element name="luckygame" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
<xs:element name="common_reward">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:simpleContent>
|
<xs:sequence>
|
||||||
<xs:extension base="xs:string">
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:simpleContent>
|
||||||
</xs:extension>
|
<xs:extension base="xs:string">
|
||||||
</xs:simpleContent>
|
<xs:attribute type="xs:float" name="chance" use="optional" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
</xs:extension>
|
||||||
</xs:complexType>
|
</xs:simpleContent>
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="luxuryFortuneReadingTicketRewards">
|
</xs:element>
|
||||||
<xs:complexType>
|
</xs:sequence>
|
||||||
<xs:sequence>
|
</xs:complexType>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="unique_reward" minOccurs="0">
|
||||||
<xs:simpleContent>
|
<xs:complexType>
|
||||||
<xs:extension base="xs:string">
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:complexType>
|
||||||
</xs:extension>
|
<xs:simpleContent>
|
||||||
</xs:simpleContent>
|
<xs:extension base="xs:string">
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
<xs:attribute type="xs:short" name="points" use="optional" />
|
||||||
</xs:complexType>
|
</xs:extension>
|
||||||
</xs:element>
|
</xs:simpleContent>
|
||||||
<xs:element name="rareLuxuryFortuneReadingTicketRewards">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:simpleContent>
|
<xs:element name="modify_reward" minOccurs="0">
|
||||||
<xs:extension base="xs:string">
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
</xs:extension>
|
<xs:complexType>
|
||||||
</xs:simpleContent>
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute type="xs:float" name="chance" />
|
||||||
|
<xs:attribute type="xs:byte" name="count" />
|
||||||
|
<xs:attribute type="xs:int" name="id" />
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:byte" name="max_game" />
|
||||||
|
<xs:attribute type="xs:byte" name="min_game" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:int" name="turning_point" use="optional" />
|
||||||
|
<xs:attribute type="xs:byte" name="index" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute type="xs:string" name="enabled"/>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
@@ -17,25 +17,26 @@
|
|||||||
package com.l2jmobius.gameserver.data.xml.impl;
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
|
||||||
import org.w3c.dom.Node;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemPointHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mathael
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class LuckyGameData implements IGameXmlReader
|
public class LuckyGameData implements IGameXmlReader
|
||||||
{
|
{
|
||||||
private static final List<ItemHolder> _fortuneReadingTicketRewards = new ArrayList<>();
|
private final Map<Integer, LuckyGameDataHolder> _luckyGame = new HashMap<>();
|
||||||
private static final List<ItemHolder> _luxuryFortuneReadingTicketRewards = new ArrayList<>();
|
|
||||||
private static final List<ItemHolder> _rareLuxuryFortuneReadingTicketRewards = new ArrayList<>();
|
final AtomicInteger _serverPlay = new AtomicInteger();
|
||||||
|
|
||||||
protected LuckyGameData()
|
protected LuckyGameData()
|
||||||
{
|
{
|
||||||
@@ -45,112 +46,62 @@ public class LuckyGameData implements IGameXmlReader
|
|||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
_fortuneReadingTicketRewards.clear();
|
_luckyGame.clear();
|
||||||
_luxuryFortuneReadingTicketRewards.clear();
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.clear();
|
|
||||||
|
|
||||||
parseDatapackFile("data/LuckyGameData.xml");
|
parseDatapackFile("data/LuckyGameData.xml");
|
||||||
|
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luckyGame.size() + " lucky game data.");
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _fortuneReadingTicketRewards.size() + " Normal item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luxuryFortuneReadingTicketRewards.size() + " Luxury item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _rareLuxuryFortuneReadingTicketRewards.size() + " Rare item rewards.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void parseDocument(Document doc, File f)
|
public void parseDocument(Document doc, File f)
|
||||||
{
|
{
|
||||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
forEach(doc, "list", listNode -> forEach(listNode, "luckygame", rewardNode ->
|
||||||
{
|
{
|
||||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
final LuckyGameDataHolder holder = new LuckyGameDataHolder(new StatsSet(parseAttributes(rewardNode)));
|
||||||
|
|
||||||
|
forEach(rewardNode, "common_reward", commonRewardNode -> forEach(commonRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
final NamedNodeMap at = n.getAttributes();
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
final Node attribute = at.getNamedItem("enabled");
|
holder.addCommonReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "unique_reward", uniqueRewardNode -> forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
|
{
|
||||||
|
holder.addUniqueReward(new ItemPointHolder(new StatsSet(parseAttributes(itemNode))));
|
||||||
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "modify_reward", uniqueRewardNode ->
|
||||||
|
{
|
||||||
|
holder.setMinModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "min_game"));
|
||||||
|
holder.setMaxModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "max_game"));
|
||||||
|
forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
{
|
holder.addModifyReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ("fortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
});
|
||||||
{
|
});
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
_luckyGame.put(parseInteger(rewardNode.getAttributes(), "index"), holder);
|
||||||
final int count = parseInteger(attrs, "count");
|
}));
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_fortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("luxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_luxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("rareLuxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomNormalReward()
|
public int getLuckyGameCount()
|
||||||
{
|
{
|
||||||
return _fortuneReadingTicketRewards.get(Rnd.get(_fortuneReadingTicketRewards.size()));
|
return _luckyGame.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomLuxuryReward()
|
public LuckyGameDataHolder getLuckyGameDataByIndex(int index)
|
||||||
{
|
{
|
||||||
return _luxuryFortuneReadingTicketRewards.get(Rnd.get(_luxuryFortuneReadingTicketRewards.size()));
|
return _luckyGame.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomRareReward()
|
public int increaseGame()
|
||||||
{
|
{
|
||||||
return _rareLuxuryFortuneReadingTicketRewards.get(Rnd.get(_rareLuxuryFortuneReadingTicketRewards.size()));
|
return _serverPlay.incrementAndGet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerPlay()
|
||||||
|
{
|
||||||
|
return _serverPlay.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LuckyGameData getInstance()
|
public static LuckyGameData getInstance()
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameItemType
|
||||||
|
{
|
||||||
|
COMMON(1),
|
||||||
|
UNIQUE(2),
|
||||||
|
RARE(3);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
LuckyGameItemType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameResultType
|
||||||
|
{
|
||||||
|
INVALID_CAPACITY(-2),
|
||||||
|
INVALID_ITEM_COUNT(-1),
|
||||||
|
DISABLED(0),
|
||||||
|
SUCCESS(1);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
private LuckyGameResultType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
NORMAL,
|
||||||
|
LUXURY
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class ItemPointHolder extends ItemHolder
|
||||||
|
{
|
||||||
|
private final int _points;
|
||||||
|
|
||||||
|
public ItemPointHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
this(params.getInt("id"), params.getLong("count"), params.getInt("points"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemPointHolder(int id, long count, int points)
|
||||||
|
{
|
||||||
|
super(id, count);
|
||||||
|
_points = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the point.
|
||||||
|
* @return the number of point to get the item
|
||||||
|
*/
|
||||||
|
public int getPoints()
|
||||||
|
{
|
||||||
|
return _points;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", points: " + _points;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class LuckyGameDataHolder
|
||||||
|
{
|
||||||
|
final private int _index;
|
||||||
|
final private int _turningPoints;
|
||||||
|
final private List<ItemChanceHolder> _commonRewards = new ArrayList<>();
|
||||||
|
final private List<ItemPointHolder> _uniqueRewards = new ArrayList<>();
|
||||||
|
final private List<ItemChanceHolder> _modifyRewards = new ArrayList<>();
|
||||||
|
private int _minModifyRewardGame;
|
||||||
|
private int _maxModifyRewardGame;
|
||||||
|
|
||||||
|
public LuckyGameDataHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
_index = params.getInt("index");
|
||||||
|
_turningPoints = params.getInt("turning_point");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCommonReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_commonRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addUniqueReward(ItemPointHolder item)
|
||||||
|
{
|
||||||
|
_uniqueRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addModifyReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_modifyRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getCommonReward()
|
||||||
|
{
|
||||||
|
return _commonRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemPointHolder> getUniqueReward()
|
||||||
|
{
|
||||||
|
return _uniqueRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getModifyReward()
|
||||||
|
{
|
||||||
|
return _modifyRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinModifyRewardGame(int minModifyRewardGame)
|
||||||
|
{
|
||||||
|
_minModifyRewardGame = minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxModifyRewardGame(int maxModifyRewardGame)
|
||||||
|
{
|
||||||
|
_maxModifyRewardGame = maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex()
|
||||||
|
{
|
||||||
|
return _index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTurningPoints()
|
||||||
|
{
|
||||||
|
return _turningPoints;
|
||||||
|
}
|
||||||
|
}
|
@@ -57,6 +57,8 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
||||||
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
||||||
public static final String EXTEND_DROP = "EXTEND_DROP";
|
public static final String EXTEND_DROP = "EXTEND_DROP";
|
||||||
|
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
|
||||||
|
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
|
||||||
|
|
||||||
private final int _objectId;
|
private final int _objectId;
|
||||||
|
|
||||||
|
@@ -69,6 +69,8 @@ import com.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoLi
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.faction.RequestUserFactionInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.faction.RequestUserFactionInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGamePlay;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGameStartInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
||||||
@@ -329,8 +331,8 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
||||||
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_START_INFO(0xF1, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_START_INFO(0xF1, RequestLuckyGameStartInfo::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_PLAY(0xF2, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_PLAY(0xF2, RequestLuckyGamePlay::new, ConnectionState.IN_GAME),
|
||||||
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
||||||
|
@@ -16,30 +16,169 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketReader;
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.commons.util.CommonUtil;
|
||||||
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
||||||
{
|
{
|
||||||
private int _type;
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
private int _count;
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
|
private LuckyGameType _type;
|
||||||
|
private int _reading;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean read(L2GameClient client, PacketReader packet)
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
{
|
{
|
||||||
_type = packet.readD(); // luxury = 2, normal = 1
|
final int type = CommonUtil.constrain(packet.readD(), 0, LuckyGameType.values().length);
|
||||||
_count = packet.readD(); // count
|
_type = LuckyGameType.values()[type];
|
||||||
|
_reading = CommonUtil.constrain(packet.readD(), 0, 50); // max play is 50
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(L2GameClient client)
|
public void run(L2GameClient client)
|
||||||
{
|
{
|
||||||
client.getActiveChar().sendPacket(new ExBettingLuckyGameResult(client.getActiveChar(), _type, _count));
|
final L2PcInstance player = client.getActiveChar();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int index = _type == LuckyGameType.LUXURY ? 102 : 2; // move to event config
|
||||||
|
|
||||||
|
final LuckyGameDataHolder holder = LuckyGameData.getInstance().getLuckyGameDataByIndex(index);
|
||||||
|
if (holder == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long tickets = _type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1);
|
||||||
|
if (tickets < _reading)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int playCount = player.getVariables().getInt(PlayerVariables.FORTUNE_TELLING_VARIABLE, 0);
|
||||||
|
boolean blackCat = player.getVariables().getBoolean(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, false);
|
||||||
|
final EnumMap<LuckyGameItemType, List<ItemHolder>> rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final double chance = 100 * Rnd.nextDouble();
|
||||||
|
double totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : holder.getCommonReward())
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chance)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.COMMON, k -> new ArrayList<>()).add(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playCount++;
|
||||||
|
if ((playCount >= holder.getMinModifyRewardGame()) && (playCount <= holder.getMaxModifyRewardGame()) && !blackCat)
|
||||||
|
{
|
||||||
|
final List<ItemChanceHolder> modifyReward = holder.getModifyReward();
|
||||||
|
final double chanceModify = 100 * Rnd.nextDouble();
|
||||||
|
totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : modifyReward)
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chanceModify)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(item);
|
||||||
|
blackCat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playCount == holder.getMaxModifyRewardGame())
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(modifyReward.get(Rnd.get(modifyReward.size())));
|
||||||
|
blackCat = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
|
// Check inventory capacity
|
||||||
|
if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.destroyItemByItemId("LuckyGame", _type == LuckyGameType.LUXURY ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _reading, player, true))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final int serverGameNumber = LuckyGameData.getInstance().increaseGame();
|
||||||
|
holder.getUniqueReward().stream().filter(reward -> reward.getPoints() == serverGameNumber).forEach(item -> rewards.computeIfAbsent(LuckyGameItemType.UNIQUE, k -> new ArrayList<>()).add(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(new ExBettingLuckyGameResult(LuckyGameResultType.SUCCESS, _type, rewards, (int) (_type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1))));
|
||||||
|
|
||||||
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : rewards.entrySet())
|
||||||
|
{
|
||||||
|
for (ItemHolder r : reward.getValue())
|
||||||
|
{
|
||||||
|
final L2ItemInstance item = player.addItem("LuckyGame", r.getId(), r.getCount(), player, true);
|
||||||
|
iu.addItem(item);
|
||||||
|
if (reward.getKey() == LuckyGameItemType.UNIQUE)
|
||||||
|
{
|
||||||
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
||||||
|
sm.addPcName(player);
|
||||||
|
sm.addLong(r.getCount());
|
||||||
|
sm.addItemName(item);
|
||||||
|
player.broadcastPacket(sm, 1000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendInventoryUpdate(iu);
|
||||||
|
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_VARIABLE, playCount >= 50 ? (playCount - 50) : playCount);
|
||||||
|
if (blackCat && (playCount < 50))
|
||||||
|
{
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class RequestLuckyGameStartInfo implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -16,121 +16,69 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.NORMAL);
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.LUXURY);
|
||||||
private int _count = 0;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.NORMAL);
|
||||||
private int _type = 0;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.LUXURY);
|
||||||
private final L2PcInstance _activeChar;
|
|
||||||
|
|
||||||
public ExBettingLuckyGameResult(L2PcInstance activeChar, int type, int count)
|
private final LuckyGameResultType _result;
|
||||||
|
private final LuckyGameType _type;
|
||||||
|
private final EnumMap<LuckyGameItemType, List<ItemHolder>> _rewards;
|
||||||
|
private final int _ticketCount;
|
||||||
|
private final int _size;
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type)
|
||||||
{
|
{
|
||||||
_count = count;
|
_result = result;
|
||||||
_type = type;
|
_type = type;
|
||||||
_activeChar = activeChar;
|
_rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
_ticketCount = 0;
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type, EnumMap<LuckyGameItemType, List<ItemHolder>> rewards, int ticketCount)
|
||||||
|
{
|
||||||
|
_result = result;
|
||||||
|
_type = type;
|
||||||
|
_rewards = rewards;
|
||||||
|
_ticketCount = ticketCount;
|
||||||
|
_size = (int) rewards.values().stream().mapToLong(i -> i.stream().count()).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
// Calculate rewards
|
|
||||||
final List<ItemHolder> rewards = new ArrayList<>();
|
|
||||||
int totalWeight = 0;
|
|
||||||
for (int rewardCounter = 0; rewardCounter < _count; rewardCounter++)
|
|
||||||
{
|
|
||||||
if (Rnd.get(3) == 0) // 1 out of 3 chance
|
|
||||||
{
|
|
||||||
ItemHolder reward = null;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
if (_count >= 40)
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomRareReward();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomLuxuryReward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomNormalReward();
|
|
||||||
}
|
|
||||||
rewards.add(reward);
|
|
||||||
totalWeight += new L2ItemInstance(reward.getId()).getItem().getWeight() * reward.getCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check inventory capacity
|
|
||||||
if ((rewards.size() > 0) && (!_activeChar.getInventory().validateCapacity(rewards.size()) || !_activeChar.getInventory().validateWeight(totalWeight)))
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1) < _count)
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove tickets
|
|
||||||
_activeChar.getInventory().destroyItemByItemId("FortuneTelling", _type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _count, _activeChar, "FortuneTelling");
|
|
||||||
|
|
||||||
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
||||||
packet.writeD(0x01); // 0 disabled, 1 enabled
|
packet.writeD(_result.getClientId());
|
||||||
packet.writeD(0x01); // ?
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD((int) _activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1)); // Count remaining tickets
|
packet.writeD(_ticketCount);
|
||||||
|
packet.writeD(_size);
|
||||||
if (rewards.size() > 0)
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : _rewards.entrySet())
|
||||||
{
|
{
|
||||||
packet.writeD(rewards.size());
|
for (ItemHolder item : reward.getValue())
|
||||||
for (ItemHolder reward : rewards)
|
|
||||||
{
|
{
|
||||||
packet.writeD(0x02); // normal = 1, rare = 2 (forcing 2)
|
packet.writeD(reward.getKey().getClientId());
|
||||||
packet.writeD(reward.getId());
|
packet.writeD(item.getId());
|
||||||
packet.writeD((int) reward.getCount());
|
packet.writeD((int) item.getCount());
|
||||||
final SystemMessage sm;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
_activeChar.addItem("LuxuryFortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_IN_THE_LUXURY_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_activeChar.addItem("FortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
sm.addPcName(_activeChar);
|
|
||||||
sm.addLong(reward.getCount());
|
|
||||||
sm.addItemName(new L2ItemInstance(reward.getId()));
|
|
||||||
_activeChar.broadcastPacket(sm, 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
packet.writeD(0x00);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,32 +17,30 @@
|
|||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExStartLuckyGame implements IClientOutgoingPacket
|
public class ExStartLuckyGame implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
private final LuckyGameType _type;
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
private final int _ticketCount;
|
||||||
private int _type = 0;
|
|
||||||
private int _count = 0;
|
|
||||||
|
|
||||||
public ExStartLuckyGame(L2PcInstance activeChar, int type)
|
public ExStartLuckyGame(LuckyGameType type, long ticketCount)
|
||||||
{
|
{
|
||||||
_type = type;
|
_type = type;
|
||||||
_count = (int) activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1);
|
_ticketCount = (int) ticketCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
||||||
packet.writeD(_type);
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD(_count);
|
packet.writeD(_ticketCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,225 +1,224 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
||||||
<fortuneReadingTicketRewards>
|
<luckygame index="2" turning_point="50000">
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<common_reward>
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="37715" count="1" chance="0.0059" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="34777" count="1" chance="0.0046" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="35649" count="1" chance="0.01" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="37714" count="1" chance="0.013" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="6656" count="1" chance="0.0151" /> <!-- Antharas' Earring -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="6660" count="1" chance="0.0167" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34776" count="1" chance="0.0108" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="6657" count="1" chance="0.0296" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="21712" count="1" chance="0.0296" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46395" count="1" chance="0.1626" /> <!-- Shadow Ingot -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0342" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="37513" count="1" chance="0.05" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="37508" count="1" chance="0.065" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="34775" count="1" chance="0.0365" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46494" count="1" chance="0.0417" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="46509" count="1" chance="0.05" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
||||||
<item id="17527" count="1" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="46449" count="1" chance="0.05" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37517" count="1" chance="0.1084" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
<item id="46478" count="1" chance="0.1182" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
<item id="37518" count="1" chance="0.1182" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="33817" count="1" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
<item id="37509" count="1" chance="0.1301" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37772" count="1" chance="0.3252" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46151" count="1" chance="0.1858" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="46493" count="1" chance="0.2032" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46464" count="1" chance="0.2168" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27600" count="1" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
<item id="6661" count="1" chance="0.2168" /> <!-- Orfen's Earring -->
|
||||||
<item id="27601" count="1" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<item id="46508" count="1" chance="0.2365" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
<item id="37781" count="1" chance="0.7804" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="39641" count="1" chance="0.271" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="36513" count="5" /> <!-- Elcyum Powder -->
|
<item id="46150" count="1" chance="0.5203" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="39631" count="1" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="19447" count="1" chance="0.5912" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="36386" count="1" chance="0.6503" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="19440" count="5" /> <!-- Gemstone (R-grade) -->
|
<item id="36513" count="5" chance="21.6778" /> <!-- Elcyum Powder -->
|
||||||
<item id="35563" count="2" /> <!-- Giant's Energy -->
|
<item id="39639" count="1" chance="0.8129" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="46395" count="1" /> <!-- Shadow Ingot -->
|
<item id="19448" count="1" chance="1.0839" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="35563" count="2" chance="6.5033" /> <!-- Giant's Energy -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="39592" count="1" chance="1.8581" /> <!-- Tempest Stone -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex Chapter 1 -->
|
<item id="37771" count="1" chance="0.929" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37780" count="1" chance="1.3007" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="39633" count="1" chance="2.6013" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="39637" count="1" chance="3.2517" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="19440" count="5" chance="13.0067" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="17526" count="1" chance="5.4195" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="36389" count="1" chance="6.5033" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="17527" count="1" chance="14.4519" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="39631" count="1" chance="15.3022" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
</common_reward>
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
</luckygame>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<luckygame index="102" turning_point="10000">
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<common_reward>
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39573" count="1" chance="0.0052" /> <!-- Sealed Talisman - Insanity -->
|
||||||
</fortuneReadingTicketRewards>
|
<item id="37717" count="1" chance="0.0034" /> <!-- Talisman - Seven Signs -->
|
||||||
<luxuryFortuneReadingTicketRewards>
|
<item id="46553" count="1" chance="0.0028" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37716" count="1" chance="0.0112" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor: (R-grade) -->
|
<item id="35001" count="1" chance="0.0048" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon: (R-grade) -->
|
<item id="34998" count="1" chance="0.0056" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="36164" count="2" /> <!-- Giant's Scroll: Enchant Armor: (R-grade) -->
|
<item id="46062" count="1" chance="0.0056" /> <!-- Kelbim Bow -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37715" count="1" chance="0.0244" /> <!-- Talisman - Anakim -->
|
||||||
<item id="27600" count="2" /> <!-- Scroll of Blessing: Armor: (R95 grade) -->
|
<item id="34999" count="1" chance="0.0067" /> <!-- Tauti's Axe -->
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor: (R99 grade) -->
|
<item id="46061" count="1" chance="0.0075" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46063" count="1" chance="0.0084" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="34777" count="1" chance="0.0096" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46060" count="1" chance="0.0096" /> <!-- Kelbim Dagger -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon: (R95-grade) -->
|
<item id="35649" count="1" chance="0.1033" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon: (R99-grade) -->
|
<item id="23342" count="1" chance="0.0224" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="17527" count="2" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="37714" count="1" chance="0.0269" /> <!-- Talisman - Lilith -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="35566" count="1" chance="0.0134" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="6656" count="1" chance="0.1562" /> <!-- Antharas' Earring -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
<item id="6660" count="1" chance="0.1722" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="34776" count="1" chance="0.0224" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="39647" count="1" chance="0.0478" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="6657" count="1" chance="0.1526" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="21712" count="1" chance="0.1221" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="46395" count="10" chance="0.3358" /> <!-- Shadow Ingot -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0707" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="37513" count="1" chance="0.1033" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="46479" count="1" chance="0.0672" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="37508" count="1" chance="0.1343" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="34775" count="1" chance="0.7545" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46494" count="1" chance="0.0517" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="46464" count="1" chance="0.062" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="46449" count="1" chance="0.062" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="39643" count="1" chance="0.4477" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="37517" count="1" chance="0.2238" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46478" count="1" chance="0.1221" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="37518" count="1" chance="0.2442" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="35567" count="1" chance="0.2686" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="37509" count="1" chance="0.2686" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="27463" count="1" /> <!-- Demon Circlet Box -->
|
<item id="37772" count="1" chance="0.3358" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="27466" count="1" /> <!-- Eyepatch Box -->
|
<item id="46151" count="1" chance="0.1919" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="46493" count="1" chance="0.2098" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46464" count="1" chance="0.1343" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="6661" count="1" chance="0.2238" /> <!-- Orfen's Earring -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="46508" count="1" chance="0.0977" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="37781" count="1" chance="0.8058" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="39641" count="1" chance="1.1192" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="27458" count="1" chance="0.0307" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="27459" count="1" chance="0.0307" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="36515" count="1" /> <!-- Elcyum -->
|
<item id="27460" count="1" chance="0.0307" /> <!-- Cat Ears Box -->
|
||||||
<item id="39631" count="3" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="27461" count="1" chance="0.0307" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="27462" count="1" chance="0.0307" /> <!-- Angel Circlet Box -->
|
||||||
<item id="19440" count="15" /> <!-- Gem Stone - R grade -->
|
<item id="27463" count="1" chance="0.0307" /> <!-- Demon Circlet Box -->
|
||||||
<item id="35563" count="10" /> <!-- Giant's Energy -->
|
<item id="27464" count="1" chance="0.0307" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="39738" count="1" /> <!-- Rune Stone -->
|
<item id="27465" count="1" chance="0.0307" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="27466" count="1" chance="0.0307" /> <!-- Eyepatch Box -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex - Chapter 1 -->
|
<item id="27467" count="1" chance="0.0307" /> <!-- Party Hat Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27468" count="1" chance="0.0307" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="27469" count="1" chance="0.0307" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="37719" count="1" chance="0.0839" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="37720" count="1" chance="0.0839" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="37721" count="1" chance="0.0839" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37722" count="1" chance="0.0839" /> <!-- Eva's Special Pack -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46150" count="1" chance="1.0744" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="19447" count="1" chance="1.2209" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="36386" count="1" chance="1.343" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="26446" count="1" chance="0.0672" /> <!-- Shadow Dualsword Box -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="36515" count="1" chance="1.6788" /> <!-- Elcyum -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="26445" count="1" chance="0.0839" /> <!-- Shadow Retributer Box -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="39639" count="1" chance="3.3575" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="26442" count="1" chance="0.0895" /> <!-- Shadow Thrower Box -->
|
||||||
<item id="26444" count="1" /> <!-- Shadow Buster Pack -->
|
<item id="26441" count="1" chance="0.1033" /> <!-- Shadow Stormer Box -->
|
||||||
<item id="26438" count="1" /> <!-- Shadow Cutter Pack -->
|
<item id="19448" count="1" chance="2.2383" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="26446" count="1" /> <!-- Shadow Dualsword Pack -->
|
<item id="39738" count="1" chance="2.686" /> <!-- Rune Stone -->
|
||||||
<item id="26440" count="1" /> <!-- Shadow Fighter Pack -->
|
<item id="35563" count="10" chance="5.372" /> <!-- Giant's Energy -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="26438" count="1" chance="0.1492" /> <!-- Shadow Cutter Box -->
|
||||||
<item id="26445" count="1" /> <!-- Shadow Retributer Pack -->
|
<item id="26439" count="1" chance="0.1679" /> <!-- Shadow Slasher Box -->
|
||||||
<item id="26437" count="1" /> <!-- Shadow Shaper Pack -->
|
<item id="39592" count="1" chance="3.8372" /> <!-- Tempest Stone -->
|
||||||
<item id="26443" count="1" /> <!-- Shadow Shooter Pack -->
|
<item id="37771" count="1" chance="1.9186" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="26439" count="1" /> <!-- Shadow Slasher Pack -->
|
<item id="26437" count="1" chance="0.2238" /> <!-- Shadow Shaper Box -->
|
||||||
<item id="26441" count="1" /> <!-- Shadow Stormer Pack -->
|
<item id="26444" count="1" chance="0.2238" /> <!-- Shadow Buster Box -->
|
||||||
<item id="26442" count="1" /> <!-- Shadow Thrower Pack -->
|
<item id="26443" count="1" chance="0.2686" /> <!-- Shadow Shooter Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37780" count="2" chance="1.343" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39633" count="1" chance="5.372" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="39637" count="1" chance="6.715" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="19440" count="15" chance="8.9534" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
<item id="17526" count="1" chance="11.1917" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="36389" count="2" chance="6.715" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
<item id="17527" count="2" chance="14.9218" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
<item id="39631" count="3" chance="10.5334" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
</common_reward>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<unique_reward>
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="36946" count="1" points="10000" /> <!-- Lindvior's Earring -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="37717" count="1" points="9000" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="19463" count="1" points="8000" /> <!-- Blessed Antharas' Earring -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="19464" count="1" points="7000" /> <!-- Blessed Valakas' Necklace -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="35564" count="1" points="6000" /> <!-- Ruler's Authority -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="17623" count="1" points="5000" /> <!-- Earth Wyrm Heart Ring -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="35570" count="1" points="4000" /> <!-- Tauti's Ring -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="35566" count="1" points="3000" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
</luxuryFortuneReadingTicketRewards>
|
<item id="35568" count="1" points="2000" /> <!-- Bloody Amaranthine Enhancement Stone -->
|
||||||
<rareLuxuryFortuneReadingTicketRewards>
|
<item id="35567" count="1" points="1000" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon - R grade -->
|
<item id="35569" count="1" points="500" /> <!-- Bloody Eternal Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="26511" count="1" points="250" /> <!-- Anakim Set Pack -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
</unique_reward>
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<modify_reward min_game="40" max_game="50">
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="39573" count="1" chance="0.0679" /> <!-- Sealed Talisman - Insanity -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="37717" count="1" chance="0.0441" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46553" count="1" chance="0.0368" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="37716" count="1" chance="0.147" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="35001" count="1" chance="0.063" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="34998" count="1" chance="0.0735" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="46062" count="1" chance="0.0735" /> <!-- Kelbim Bow -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="37715" count="1" chance="0.3208" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="34999" count="1" chance="0.0882" /> <!-- Tauti's Axe -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="46061" count="1" chance="0.098" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="46063" count="1" chance="0.1103" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34777" count="1" chance="0.126" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="46060" count="1" chance="0.126" /> <!-- Kelbim Dagger -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="35649" count="1" chance="0.2714" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="23342" count="1" chance="0.294" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37714" count="1" chance="0.3528" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="35566" count="1" chance="0.1764" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="6656" count="1" chance="0.0257" /> <!-- Antharas' Earring -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="6660" count="1" chance="2.2618" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="34776" count="1" chance="0.294" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="39647" count="1" chance="0.6273" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="6657" count="1" chance="2.0048" /> <!-- Valakas' Necklace -->
|
||||||
<item id="27463" count="1" /> <!-- Devil Circlet Box -->
|
<item id="21712" count="1" chance="1.6039" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="27464" count="1" /> <!-- Eyepatch Box -->
|
<item id="46395" count="10" chance="2.2053" /> <!-- Shadow Ingot -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="37507" count="1" chance="0.9285" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="37513" count="1" chance="1.3571" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46479" count="1" chance="0.8821" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="37508" count="1" chance="1.7642" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="34775" count="1" chance="4.9557" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="46494" count="1" chance="0.6786" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="46464" count="1" chance="0.8143" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="46449" count="1" chance="0.8143" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="39643" count="1" chance="5.8808" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="37517" count="1" chance="2.9404" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="46478" count="1" chance="1.6039" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="37518" count="1" chance="3.2077" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="35567" count="1" chance="3.5285" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37509" count="1" chance="3.5285" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37772" count="1" chance="4.4106" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="46151" count="1" chance="2.5203" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46493" count="1" chance="2.7566" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="46464" count="1" chance="1.7642" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="6661" count="1" chance="2.9404" /> <!-- Orfen's Earring -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="46508" count="1" chance="1.2831" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="37781" count="2" chance="10.5854" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="39641" count="1" chance="14.7015" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="27458" count="1" chance="0.4033" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="27459" count="1" chance="0.4033" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="27460" count="1" chance="0.4033" /> <!-- Cat Ears Box -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="27461" count="1" chance="0.4033" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="27462" count="1" chance="0.4033" /> <!-- Angel Circlet Box -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="27463" count="1" chance="0.4033" /> <!-- Demon Circlet Box -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="27464" count="1" chance="0.4033" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="27465" count="1" chance="0.4033" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27466" count="1" chance="0.4033" /> <!-- Eyepatch Box -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
<item id="27467" count="1" chance="0.4033" /> <!-- Party Hat Box -->
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<item id="27468" count="1" chance="0.4033" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="27469" count="1" chance="0.4033" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37719" count="1" chance="2.2053" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="37720" count="1" chance="2.2053" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="37721" count="1" chance="2.2053" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="37722" count="1" chance="2.2053" /> <!-- Eva's Special Pack -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
</modify_reward>
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
</luckygame>
|
||||||
</rareLuxuryFortuneReadingTicketRewards>
|
|
||||||
</list>
|
</list>
|
@@ -17,6 +17,7 @@
|
|||||||
package events.EveTheFortuneTeller;
|
package events.EveTheFortuneTeller;
|
||||||
|
|
||||||
import com.l2jmobius.gameserver.enums.ChatType;
|
import com.l2jmobius.gameserver.enums.ChatType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
import com.l2jmobius.gameserver.model.Location;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@@ -36,6 +37,9 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
// NPCs
|
// NPCs
|
||||||
private static final int EVE = 8542;
|
private static final int EVE = 8542;
|
||||||
private static final int JAYCE = 8540;
|
private static final int JAYCE = 8540;
|
||||||
|
// Items
|
||||||
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
// Misc
|
// Misc
|
||||||
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
private static final Location JAYCE_SPAWN = new Location(148090, 26644, -2209, 16383);
|
||||||
private static final NpcStringId[] JAYCE_TEXT =
|
private static final NpcStringId[] JAYCE_TEXT =
|
||||||
@@ -71,12 +75,12 @@ public final class EveTheFortuneTeller extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
case "FortuneReadingGame":
|
case "FortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 1));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.NORMAL, player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "LuxuryFortuneReadingGame":
|
case "LuxuryFortuneReadingGame":
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStartLuckyGame(player, 2));
|
player.sendPacket(new ExStartLuckyGame(LuckyGameType.LUXURY, player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "JAYCE_SHOUT":
|
case "JAYCE_SHOUT":
|
||||||
|
@@ -2,56 +2,68 @@
|
|||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="fortuneReadingTicketRewards">
|
<xs:element name="luckygame" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
<xs:element name="common_reward">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:simpleContent>
|
<xs:sequence>
|
||||||
<xs:extension base="xs:string">
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:simpleContent>
|
||||||
</xs:extension>
|
<xs:extension base="xs:string">
|
||||||
</xs:simpleContent>
|
<xs:attribute type="xs:float" name="chance" use="optional" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
</xs:extension>
|
||||||
</xs:complexType>
|
</xs:simpleContent>
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="luxuryFortuneReadingTicketRewards">
|
</xs:element>
|
||||||
<xs:complexType>
|
</xs:sequence>
|
||||||
<xs:sequence>
|
</xs:complexType>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="unique_reward" minOccurs="0">
|
||||||
<xs:simpleContent>
|
<xs:complexType>
|
||||||
<xs:extension base="xs:string">
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:complexType>
|
||||||
</xs:extension>
|
<xs:simpleContent>
|
||||||
</xs:simpleContent>
|
<xs:extension base="xs:string">
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
<xs:attribute type="xs:short" name="points" use="optional" />
|
||||||
</xs:complexType>
|
</xs:extension>
|
||||||
</xs:element>
|
</xs:simpleContent>
|
||||||
<xs:element name="rareLuxuryFortuneReadingTicketRewards">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:simpleContent>
|
<xs:element name="modify_reward" minOccurs="0">
|
||||||
<xs:extension base="xs:string">
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
</xs:extension>
|
<xs:complexType>
|
||||||
</xs:simpleContent>
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute type="xs:float" name="chance" />
|
||||||
|
<xs:attribute type="xs:byte" name="count" />
|
||||||
|
<xs:attribute type="xs:int" name="id" />
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:byte" name="max_game" />
|
||||||
|
<xs:attribute type="xs:byte" name="min_game" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:int" name="turning_point" use="optional" />
|
||||||
|
<xs:attribute type="xs:byte" name="index" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute type="xs:string" name="enabled"/>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
@@ -17,25 +17,26 @@
|
|||||||
package com.l2jmobius.gameserver.data.xml.impl;
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
|
||||||
import org.w3c.dom.Node;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemPointHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mathael
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class LuckyGameData implements IGameXmlReader
|
public class LuckyGameData implements IGameXmlReader
|
||||||
{
|
{
|
||||||
private static final List<ItemHolder> _fortuneReadingTicketRewards = new ArrayList<>();
|
private final Map<Integer, LuckyGameDataHolder> _luckyGame = new HashMap<>();
|
||||||
private static final List<ItemHolder> _luxuryFortuneReadingTicketRewards = new ArrayList<>();
|
|
||||||
private static final List<ItemHolder> _rareLuxuryFortuneReadingTicketRewards = new ArrayList<>();
|
final AtomicInteger _serverPlay = new AtomicInteger();
|
||||||
|
|
||||||
protected LuckyGameData()
|
protected LuckyGameData()
|
||||||
{
|
{
|
||||||
@@ -45,112 +46,62 @@ public class LuckyGameData implements IGameXmlReader
|
|||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
_fortuneReadingTicketRewards.clear();
|
_luckyGame.clear();
|
||||||
_luxuryFortuneReadingTicketRewards.clear();
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.clear();
|
|
||||||
|
|
||||||
parseDatapackFile("data/LuckyGameData.xml");
|
parseDatapackFile("data/LuckyGameData.xml");
|
||||||
|
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luckyGame.size() + " lucky game data.");
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _fortuneReadingTicketRewards.size() + " Normal item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luxuryFortuneReadingTicketRewards.size() + " Luxury item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _rareLuxuryFortuneReadingTicketRewards.size() + " Rare item rewards.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void parseDocument(Document doc, File f)
|
public void parseDocument(Document doc, File f)
|
||||||
{
|
{
|
||||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
forEach(doc, "list", listNode -> forEach(listNode, "luckygame", rewardNode ->
|
||||||
{
|
{
|
||||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
final LuckyGameDataHolder holder = new LuckyGameDataHolder(new StatsSet(parseAttributes(rewardNode)));
|
||||||
|
|
||||||
|
forEach(rewardNode, "common_reward", commonRewardNode -> forEach(commonRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
final NamedNodeMap at = n.getAttributes();
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
final Node attribute = at.getNamedItem("enabled");
|
holder.addCommonReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "unique_reward", uniqueRewardNode -> forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
|
{
|
||||||
|
holder.addUniqueReward(new ItemPointHolder(new StatsSet(parseAttributes(itemNode))));
|
||||||
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "modify_reward", uniqueRewardNode ->
|
||||||
|
{
|
||||||
|
holder.setMinModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "min_game"));
|
||||||
|
holder.setMaxModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "max_game"));
|
||||||
|
forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
{
|
holder.addModifyReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ("fortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
});
|
||||||
{
|
});
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
_luckyGame.put(parseInteger(rewardNode.getAttributes(), "index"), holder);
|
||||||
final int count = parseInteger(attrs, "count");
|
}));
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_fortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("luxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_luxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("rareLuxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomNormalReward()
|
public int getLuckyGameCount()
|
||||||
{
|
{
|
||||||
return _fortuneReadingTicketRewards.get(Rnd.get(_fortuneReadingTicketRewards.size()));
|
return _luckyGame.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomLuxuryReward()
|
public LuckyGameDataHolder getLuckyGameDataByIndex(int index)
|
||||||
{
|
{
|
||||||
return _luxuryFortuneReadingTicketRewards.get(Rnd.get(_luxuryFortuneReadingTicketRewards.size()));
|
return _luckyGame.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomRareReward()
|
public int increaseGame()
|
||||||
{
|
{
|
||||||
return _rareLuxuryFortuneReadingTicketRewards.get(Rnd.get(_rareLuxuryFortuneReadingTicketRewards.size()));
|
return _serverPlay.incrementAndGet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerPlay()
|
||||||
|
{
|
||||||
|
return _serverPlay.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LuckyGameData getInstance()
|
public static LuckyGameData getInstance()
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameItemType
|
||||||
|
{
|
||||||
|
COMMON(1),
|
||||||
|
UNIQUE(2),
|
||||||
|
RARE(3);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
LuckyGameItemType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameResultType
|
||||||
|
{
|
||||||
|
INVALID_CAPACITY(-2),
|
||||||
|
INVALID_ITEM_COUNT(-1),
|
||||||
|
DISABLED(0),
|
||||||
|
SUCCESS(1);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
private LuckyGameResultType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
NORMAL,
|
||||||
|
LUXURY
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class ItemPointHolder extends ItemHolder
|
||||||
|
{
|
||||||
|
private final int _points;
|
||||||
|
|
||||||
|
public ItemPointHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
this(params.getInt("id"), params.getLong("count"), params.getInt("points"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemPointHolder(int id, long count, int points)
|
||||||
|
{
|
||||||
|
super(id, count);
|
||||||
|
_points = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the point.
|
||||||
|
* @return the number of point to get the item
|
||||||
|
*/
|
||||||
|
public int getPoints()
|
||||||
|
{
|
||||||
|
return _points;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", points: " + _points;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class LuckyGameDataHolder
|
||||||
|
{
|
||||||
|
final private int _index;
|
||||||
|
final private int _turningPoints;
|
||||||
|
final private List<ItemChanceHolder> _commonRewards = new ArrayList<>();
|
||||||
|
final private List<ItemPointHolder> _uniqueRewards = new ArrayList<>();
|
||||||
|
final private List<ItemChanceHolder> _modifyRewards = new ArrayList<>();
|
||||||
|
private int _minModifyRewardGame;
|
||||||
|
private int _maxModifyRewardGame;
|
||||||
|
|
||||||
|
public LuckyGameDataHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
_index = params.getInt("index");
|
||||||
|
_turningPoints = params.getInt("turning_point");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCommonReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_commonRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addUniqueReward(ItemPointHolder item)
|
||||||
|
{
|
||||||
|
_uniqueRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addModifyReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_modifyRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getCommonReward()
|
||||||
|
{
|
||||||
|
return _commonRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemPointHolder> getUniqueReward()
|
||||||
|
{
|
||||||
|
return _uniqueRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getModifyReward()
|
||||||
|
{
|
||||||
|
return _modifyRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinModifyRewardGame(int minModifyRewardGame)
|
||||||
|
{
|
||||||
|
_minModifyRewardGame = minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxModifyRewardGame(int maxModifyRewardGame)
|
||||||
|
{
|
||||||
|
_maxModifyRewardGame = maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex()
|
||||||
|
{
|
||||||
|
return _index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTurningPoints()
|
||||||
|
{
|
||||||
|
return _turningPoints;
|
||||||
|
}
|
||||||
|
}
|
@@ -57,6 +57,8 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
||||||
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
||||||
public static final String EXTEND_DROP = "EXTEND_DROP";
|
public static final String EXTEND_DROP = "EXTEND_DROP";
|
||||||
|
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
|
||||||
|
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
|
||||||
|
|
||||||
private final int _objectId;
|
private final int _objectId;
|
||||||
|
|
||||||
|
@@ -69,6 +69,8 @@ import com.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoLi
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.faction.RequestUserFactionInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.faction.RequestUserFactionInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGamePlay;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGameStartInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
||||||
@@ -334,8 +336,8 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
||||||
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_START_INFO(0xF1, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_START_INFO(0xF1, RequestLuckyGameStartInfo::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_PLAY(0xF2, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_PLAY(0xF2, RequestLuckyGamePlay::new, ConnectionState.IN_GAME),
|
||||||
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
||||||
|
@@ -16,30 +16,169 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketReader;
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.commons.util.CommonUtil;
|
||||||
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
||||||
{
|
{
|
||||||
private int _type;
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
private int _count;
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
|
private LuckyGameType _type;
|
||||||
|
private int _reading;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean read(L2GameClient client, PacketReader packet)
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
{
|
{
|
||||||
_type = packet.readD(); // luxury = 2, normal = 1
|
final int type = CommonUtil.constrain(packet.readD(), 0, LuckyGameType.values().length);
|
||||||
_count = packet.readD(); // count
|
_type = LuckyGameType.values()[type];
|
||||||
|
_reading = CommonUtil.constrain(packet.readD(), 0, 50); // max play is 50
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(L2GameClient client)
|
public void run(L2GameClient client)
|
||||||
{
|
{
|
||||||
client.getActiveChar().sendPacket(new ExBettingLuckyGameResult(client.getActiveChar(), _type, _count));
|
final L2PcInstance player = client.getActiveChar();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int index = _type == LuckyGameType.LUXURY ? 102 : 2; // move to event config
|
||||||
|
|
||||||
|
final LuckyGameDataHolder holder = LuckyGameData.getInstance().getLuckyGameDataByIndex(index);
|
||||||
|
if (holder == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long tickets = _type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1);
|
||||||
|
if (tickets < _reading)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int playCount = player.getVariables().getInt(PlayerVariables.FORTUNE_TELLING_VARIABLE, 0);
|
||||||
|
boolean blackCat = player.getVariables().getBoolean(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, false);
|
||||||
|
final EnumMap<LuckyGameItemType, List<ItemHolder>> rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final double chance = 100 * Rnd.nextDouble();
|
||||||
|
double totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : holder.getCommonReward())
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chance)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.COMMON, k -> new ArrayList<>()).add(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playCount++;
|
||||||
|
if ((playCount >= holder.getMinModifyRewardGame()) && (playCount <= holder.getMaxModifyRewardGame()) && !blackCat)
|
||||||
|
{
|
||||||
|
final List<ItemChanceHolder> modifyReward = holder.getModifyReward();
|
||||||
|
final double chanceModify = 100 * Rnd.nextDouble();
|
||||||
|
totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : modifyReward)
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chanceModify)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(item);
|
||||||
|
blackCat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playCount == holder.getMaxModifyRewardGame())
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(modifyReward.get(Rnd.get(modifyReward.size())));
|
||||||
|
blackCat = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
|
// Check inventory capacity
|
||||||
|
if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.destroyItemByItemId("LuckyGame", _type == LuckyGameType.LUXURY ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _reading, player, true))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final int serverGameNumber = LuckyGameData.getInstance().increaseGame();
|
||||||
|
holder.getUniqueReward().stream().filter(reward -> reward.getPoints() == serverGameNumber).forEach(item -> rewards.computeIfAbsent(LuckyGameItemType.UNIQUE, k -> new ArrayList<>()).add(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(new ExBettingLuckyGameResult(LuckyGameResultType.SUCCESS, _type, rewards, (int) (_type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1))));
|
||||||
|
|
||||||
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : rewards.entrySet())
|
||||||
|
{
|
||||||
|
for (ItemHolder r : reward.getValue())
|
||||||
|
{
|
||||||
|
final L2ItemInstance item = player.addItem("LuckyGame", r.getId(), r.getCount(), player, true);
|
||||||
|
iu.addItem(item);
|
||||||
|
if (reward.getKey() == LuckyGameItemType.UNIQUE)
|
||||||
|
{
|
||||||
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
||||||
|
sm.addPcName(player);
|
||||||
|
sm.addLong(r.getCount());
|
||||||
|
sm.addItemName(item);
|
||||||
|
player.broadcastPacket(sm, 1000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendInventoryUpdate(iu);
|
||||||
|
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_VARIABLE, playCount >= 50 ? (playCount - 50) : playCount);
|
||||||
|
if (blackCat && (playCount < 50))
|
||||||
|
{
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class RequestLuckyGameStartInfo implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -16,121 +16,69 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.NORMAL);
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.LUXURY);
|
||||||
private int _count = 0;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.NORMAL);
|
||||||
private int _type = 0;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.LUXURY);
|
||||||
private final L2PcInstance _activeChar;
|
|
||||||
|
|
||||||
public ExBettingLuckyGameResult(L2PcInstance activeChar, int type, int count)
|
private final LuckyGameResultType _result;
|
||||||
|
private final LuckyGameType _type;
|
||||||
|
private final EnumMap<LuckyGameItemType, List<ItemHolder>> _rewards;
|
||||||
|
private final int _ticketCount;
|
||||||
|
private final int _size;
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type)
|
||||||
{
|
{
|
||||||
_count = count;
|
_result = result;
|
||||||
_type = type;
|
_type = type;
|
||||||
_activeChar = activeChar;
|
_rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
_ticketCount = 0;
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type, EnumMap<LuckyGameItemType, List<ItemHolder>> rewards, int ticketCount)
|
||||||
|
{
|
||||||
|
_result = result;
|
||||||
|
_type = type;
|
||||||
|
_rewards = rewards;
|
||||||
|
_ticketCount = ticketCount;
|
||||||
|
_size = (int) rewards.values().stream().mapToLong(i -> i.stream().count()).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
// Calculate rewards
|
|
||||||
final List<ItemHolder> rewards = new ArrayList<>();
|
|
||||||
int totalWeight = 0;
|
|
||||||
for (int rewardCounter = 0; rewardCounter < _count; rewardCounter++)
|
|
||||||
{
|
|
||||||
if (Rnd.get(3) == 0) // 1 out of 3 chance
|
|
||||||
{
|
|
||||||
ItemHolder reward = null;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
if (_count >= 40)
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomRareReward();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomLuxuryReward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomNormalReward();
|
|
||||||
}
|
|
||||||
rewards.add(reward);
|
|
||||||
totalWeight += new L2ItemInstance(reward.getId()).getItem().getWeight() * reward.getCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check inventory capacity
|
|
||||||
if ((rewards.size() > 0) && (!_activeChar.getInventory().validateCapacity(rewards.size()) || !_activeChar.getInventory().validateWeight(totalWeight)))
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1) < _count)
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove tickets
|
|
||||||
_activeChar.getInventory().destroyItemByItemId("FortuneTelling", _type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _count, _activeChar, "FortuneTelling");
|
|
||||||
|
|
||||||
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
||||||
packet.writeD(0x01); // 0 disabled, 1 enabled
|
packet.writeD(_result.getClientId());
|
||||||
packet.writeD(0x01); // ?
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD((int) _activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1)); // Count remaining tickets
|
packet.writeD(_ticketCount);
|
||||||
|
packet.writeD(_size);
|
||||||
if (rewards.size() > 0)
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : _rewards.entrySet())
|
||||||
{
|
{
|
||||||
packet.writeD(rewards.size());
|
for (ItemHolder item : reward.getValue())
|
||||||
for (ItemHolder reward : rewards)
|
|
||||||
{
|
{
|
||||||
packet.writeD(0x02); // normal = 1, rare = 2 (forcing 2)
|
packet.writeD(reward.getKey().getClientId());
|
||||||
packet.writeD(reward.getId());
|
packet.writeD(item.getId());
|
||||||
packet.writeD((int) reward.getCount());
|
packet.writeD((int) item.getCount());
|
||||||
final SystemMessage sm;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
_activeChar.addItem("LuxuryFortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_IN_THE_LUXURY_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_activeChar.addItem("FortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
sm.addPcName(_activeChar);
|
|
||||||
sm.addLong(reward.getCount());
|
|
||||||
sm.addItemName(new L2ItemInstance(reward.getId()));
|
|
||||||
_activeChar.broadcastPacket(sm, 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
packet.writeD(0x00);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,32 +17,30 @@
|
|||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExStartLuckyGame implements IClientOutgoingPacket
|
public class ExStartLuckyGame implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
private final LuckyGameType _type;
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
private final int _ticketCount;
|
||||||
private int _type = 0;
|
|
||||||
private int _count = 0;
|
|
||||||
|
|
||||||
public ExStartLuckyGame(L2PcInstance activeChar, int type)
|
public ExStartLuckyGame(LuckyGameType type, long ticketCount)
|
||||||
{
|
{
|
||||||
_type = type;
|
_type = type;
|
||||||
_count = (int) activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1);
|
_ticketCount = (int) ticketCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
||||||
packet.writeD(_type);
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD(_count);
|
packet.writeD(_ticketCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,225 +1,224 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/LuckyGameData.xsd">
|
||||||
<fortuneReadingTicketRewards>
|
<luckygame index="2" turning_point="50000">
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<common_reward>
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="37715" count="1" chance="0.0059" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="34777" count="1" chance="0.0046" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="35649" count="1" chance="0.01" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="37714" count="1" chance="0.013" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="6656" count="1" chance="0.0151" /> <!-- Antharas' Earring -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="6660" count="1" chance="0.0167" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34776" count="1" chance="0.0108" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="6657" count="1" chance="0.0296" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="21712" count="1" chance="0.0296" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46395" count="1" chance="0.1626" /> <!-- Shadow Ingot -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0342" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="37513" count="1" chance="0.05" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="37508" count="1" chance="0.065" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="34775" count="1" chance="0.0365" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46494" count="1" chance="0.0417" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="46509" count="1" chance="0.05" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
||||||
<item id="17527" count="1" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="46449" count="1" chance="0.05" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37517" count="1" chance="0.1084" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
<item id="46478" count="1" chance="0.1182" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
<item id="37518" count="1" chance="0.1182" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="33817" count="1" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
<item id="37509" count="1" chance="0.1301" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37772" count="1" chance="0.3252" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46151" count="1" chance="0.1858" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="46493" count="1" chance="0.2032" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46464" count="1" chance="0.2168" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27600" count="1" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
<item id="6661" count="1" chance="0.2168" /> <!-- Orfen's Earring -->
|
||||||
<item id="27601" count="1" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<item id="46508" count="1" chance="0.2365" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
<item id="37781" count="1" chance="0.7804" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="39641" count="1" chance="0.271" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="36513" count="5" /> <!-- Elcyum Powder -->
|
<item id="46150" count="1" chance="0.5203" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="39631" count="1" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="19447" count="1" chance="0.5912" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="36386" count="1" chance="0.6503" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="19440" count="5" /> <!-- Gemstone (R-grade) -->
|
<item id="36513" count="5" chance="21.6778" /> <!-- Elcyum Powder -->
|
||||||
<item id="35563" count="2" /> <!-- Giant's Energy -->
|
<item id="39639" count="1" chance="0.8129" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="46395" count="1" /> <!-- Shadow Ingot -->
|
<item id="19448" count="1" chance="1.0839" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="35563" count="2" chance="6.5033" /> <!-- Giant's Energy -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="39592" count="1" chance="1.8581" /> <!-- Tempest Stone -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex Chapter 1 -->
|
<item id="37771" count="1" chance="0.929" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37780" count="1" chance="1.3007" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="39633" count="1" chance="2.6013" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="39637" count="1" chance="3.2517" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="19440" count="5" chance="13.0067" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="17526" count="1" chance="5.4195" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="36389" count="1" chance="6.5033" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="17527" count="1" chance="14.4519" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="39631" count="1" chance="15.3022" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
</common_reward>
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
</luckygame>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<luckygame index="102" turning_point="10000">
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<common_reward>
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39573" count="1" chance="0.0052" /> <!-- Sealed Talisman - Insanity -->
|
||||||
</fortuneReadingTicketRewards>
|
<item id="37717" count="1" chance="0.0034" /> <!-- Talisman - Seven Signs -->
|
||||||
<luxuryFortuneReadingTicketRewards>
|
<item id="46553" count="1" chance="0.0028" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon: (R-grade) -->
|
<item id="37716" count="1" chance="0.0112" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="19448" count="1" /> <!-- Blessed Scroll: Enchant Armor: (R-grade) -->
|
<item id="35001" count="1" chance="0.0048" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="19447" count="1" /> <!-- Blessed Scroll: Enchant Weapon: (R-grade) -->
|
<item id="34998" count="1" chance="0.0056" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="36164" count="2" /> <!-- Giant's Scroll: Enchant Armor: (R-grade) -->
|
<item id="46062" count="1" chance="0.0056" /> <!-- Kelbim Bow -->
|
||||||
<item id="33811" count="1" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
<item id="37715" count="1" chance="0.0244" /> <!-- Talisman - Anakim -->
|
||||||
<item id="27600" count="2" /> <!-- Scroll of Blessing: Armor: (R95 grade) -->
|
<item id="34999" count="1" chance="0.0067" /> <!-- Tauti's Axe -->
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor: (R99 grade) -->
|
<item id="46061" count="1" chance="0.0075" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="46063" count="1" chance="0.0084" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="34777" count="1" chance="0.0096" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46060" count="1" chance="0.0096" /> <!-- Kelbim Dagger -->
|
||||||
<item id="27597" count="1" /> <!-- Scroll of Blessing: Weapon: (R95-grade) -->
|
<item id="35649" count="1" chance="0.1033" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon: (R99-grade) -->
|
<item id="23342" count="1" chance="0.0224" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="17527" count="2" /> <!-- Scroll: Enchant Armor: (R-grade) -->
|
<item id="37714" count="1" chance="0.0269" /> <!-- Talisman - Lilith -->
|
||||||
<item id="17526" count="1" /> <!-- Scroll: Enchant Weapon: (R-grade) -->
|
<item id="35566" count="1" chance="0.0134" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="6656" count="1" chance="0.1562" /> <!-- Antharas' Earring -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
<item id="6660" count="1" chance="0.1722" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="34776" count="1" chance="0.0224" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="39647" count="1" chance="0.0478" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="6657" count="1" chance="0.1526" /> <!-- Valakas' Necklace -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="21712" count="1" chance="0.1221" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="46395" count="10" chance="0.3358" /> <!-- Shadow Ingot -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="37507" count="1" chance="0.0707" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="37513" count="1" chance="0.1033" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="46479" count="1" chance="0.0672" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="37508" count="1" chance="0.1343" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="34775" count="1" chance="0.7545" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="46494" count="1" chance="0.0517" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="46464" count="1" chance="0.062" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="46449" count="1" chance="0.062" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="39643" count="1" chance="0.4477" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="37517" count="1" chance="0.2238" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="46478" count="1" chance="0.1221" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="37518" count="1" chance="0.2442" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="35567" count="1" chance="0.2686" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="37509" count="1" chance="0.2686" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="27463" count="1" /> <!-- Demon Circlet Box -->
|
<item id="37772" count="1" chance="0.3358" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="27466" count="1" /> <!-- Eyepatch Box -->
|
<item id="46151" count="1" chance="0.1919" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="46493" count="1" chance="0.2098" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46464" count="1" chance="0.1343" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="6661" count="1" chance="0.2238" /> <!-- Orfen's Earring -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="46508" count="1" chance="0.0977" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="37781" count="1" chance="0.8058" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="39641" count="1" chance="1.1192" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="27458" count="1" chance="0.0307" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="27459" count="1" chance="0.0307" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="36515" count="1" /> <!-- Elcyum -->
|
<item id="27460" count="1" chance="0.0307" /> <!-- Cat Ears Box -->
|
||||||
<item id="39631" count="3" /> <!-- Fortune Pocket - Stage 3 -->
|
<item id="27461" count="1" chance="0.0307" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="39633" count="1" /> <!-- Fortune Pocket - Stage 5 -->
|
<item id="27462" count="1" chance="0.0307" /> <!-- Angel Circlet Box -->
|
||||||
<item id="19440" count="15" /> <!-- Gem Stone - R grade -->
|
<item id="27463" count="1" chance="0.0307" /> <!-- Demon Circlet Box -->
|
||||||
<item id="35563" count="10" /> <!-- Giant's Energy -->
|
<item id="27464" count="1" chance="0.0307" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="39738" count="1" /> <!-- Rune Stone -->
|
<item id="27465" count="1" chance="0.0307" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="39592" count="1" /> <!-- Tempest Stone -->
|
<item id="27466" count="1" chance="0.0307" /> <!-- Eyepatch Box -->
|
||||||
<item id="46150" count="1" /> <!-- Superior Giant's Codex - Chapter 1 -->
|
<item id="27467" count="1" chance="0.0307" /> <!-- Party Hat Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27468" count="1" chance="0.0307" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="27469" count="1" chance="0.0307" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="37719" count="1" chance="0.0839" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="37720" count="1" chance="0.0839" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="37721" count="1" chance="0.0839" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37722" count="1" chance="0.0839" /> <!-- Eva's Special Pack -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46150" count="1" chance="1.0744" /> <!-- Superior Giant's Codex Chapter 1 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="19447" count="1" chance="1.2209" /> <!-- Blessed Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="36386" count="1" chance="1.343" /> <!-- Giant's Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="26446" count="1" chance="0.0672" /> <!-- Shadow Dualsword Box -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="36515" count="1" chance="1.6788" /> <!-- Elcyum -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="26445" count="1" chance="0.0839" /> <!-- Shadow Retributer Box -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="39639" count="1" chance="3.3575" /> <!-- Venir's Talisman - Stage 6 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="26442" count="1" chance="0.0895" /> <!-- Shadow Thrower Box -->
|
||||||
<item id="26444" count="1" /> <!-- Shadow Buster Pack -->
|
<item id="26441" count="1" chance="0.1033" /> <!-- Shadow Stormer Box -->
|
||||||
<item id="26438" count="1" /> <!-- Shadow Cutter Pack -->
|
<item id="19448" count="1" chance="2.2383" /> <!-- Blessed Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="26446" count="1" /> <!-- Shadow Dualsword Pack -->
|
<item id="39738" count="1" chance="2.686" /> <!-- Rune Stone -->
|
||||||
<item id="26440" count="1" /> <!-- Shadow Fighter Pack -->
|
<item id="35563" count="10" chance="5.372" /> <!-- Giant's Energy -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="26438" count="1" chance="0.1492" /> <!-- Shadow Cutter Box -->
|
||||||
<item id="26445" count="1" /> <!-- Shadow Retributer Pack -->
|
<item id="26439" count="1" chance="0.1679" /> <!-- Shadow Slasher Box -->
|
||||||
<item id="26437" count="1" /> <!-- Shadow Shaper Pack -->
|
<item id="39592" count="1" chance="3.8372" /> <!-- Tempest Stone -->
|
||||||
<item id="26443" count="1" /> <!-- Shadow Shooter Pack -->
|
<item id="37771" count="1" chance="1.9186" /> <!-- Scroll of Blessing: Weapon (R95-grade) -->
|
||||||
<item id="26439" count="1" /> <!-- Shadow Slasher Pack -->
|
<item id="26437" count="1" chance="0.2238" /> <!-- Shadow Shaper Box -->
|
||||||
<item id="26441" count="1" /> <!-- Shadow Stormer Pack -->
|
<item id="26444" count="1" chance="0.2238" /> <!-- Shadow Buster Box -->
|
||||||
<item id="26442" count="1" /> <!-- Shadow Thrower Pack -->
|
<item id="26443" count="1" chance="0.2686" /> <!-- Shadow Shooter Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37780" count="2" chance="1.343" /> <!-- Scroll of Blessing: Armor (R95-grade) -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="39633" count="1" chance="5.372" /> <!-- Fortune Pocket - Stage 5 -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="39637" count="1" chance="6.715" /> <!-- Venir's Talisman - Stage 4 -->
|
||||||
<item id="39637" count="1" /> <!-- Venir's Talisman - Stage 4 -->
|
<item id="19440" count="15" chance="8.9534" /> <!-- Gemstone (R-grade) -->
|
||||||
<item id="39639" count="1" /> <!-- Venir's Talisman - Stage 6 -->
|
<item id="17526" count="1" chance="11.1917" /> <!-- Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="36389" count="2" chance="6.715" /> <!-- Giant's Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
<item id="17527" count="2" chance="14.9218" /> <!-- Scroll: Enchant Armor (R-grade) -->
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
<item id="39631" count="3" chance="10.5334" /> <!-- Fortune Pocket - Stage 3 -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
</common_reward>
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<unique_reward>
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="36946" count="1" points="10000" /> <!-- Lindvior's Earring -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="37717" count="1" points="9000" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="19463" count="1" points="8000" /> <!-- Blessed Antharas' Earring -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="19464" count="1" points="7000" /> <!-- Blessed Valakas' Necklace -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="35564" count="1" points="6000" /> <!-- Ruler's Authority -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="17623" count="1" points="5000" /> <!-- Earth Wyrm Heart Ring -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="35570" count="1" points="4000" /> <!-- Tauti's Ring -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="35566" count="1" points="3000" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
</luxuryFortuneReadingTicketRewards>
|
<item id="35568" count="1" points="2000" /> <!-- Bloody Amaranthine Enhancement Stone -->
|
||||||
<rareLuxuryFortuneReadingTicketRewards>
|
<item id="35567" count="1" points="1000" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="22426" count="1" /> <!-- Ancient Scroll: Enchant Weapon - R grade -->
|
<item id="35569" count="1" points="500" /> <!-- Bloody Eternal Enhancement Stone -->
|
||||||
<item id="35566" count="1" /> <!-- Dark Amaranthine Enhancement Stone -->
|
<item id="26511" count="1" points="250" /> <!-- Anakim Set Pack -->
|
||||||
<item id="35567" count="1" /> <!-- Dark Eternal Enhancement Stone -->
|
</unique_reward>
|
||||||
<item id="27601" count="2" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
<modify_reward min_game="40" max_game="50">
|
||||||
<item id="36160" count="1" /> <!-- Scroll of Blessing: (R2-grade) -->
|
<item id="39573" count="1" chance="0.0679" /> <!-- Sealed Talisman - Insanity -->
|
||||||
<item id="36161" count="1" /> <!-- Scroll of Blessing: (R95-grade) -->
|
<item id="37717" count="1" chance="0.0441" /> <!-- Talisman - Seven Signs -->
|
||||||
<item id="36162" count="1" /> <!-- Scroll of Blessing: (R99-grade) -->
|
<item id="46553" count="1" chance="0.0368" /> <!-- Mystic Soul Crystal -->
|
||||||
<item id="27598" count="1" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
<item id="37716" count="1" chance="0.147" /> <!-- Seven Signs' Energy -->
|
||||||
<item id="6656" count="1" /> <!-- Antharas' Earring -->
|
<item id="35001" count="1" chance="0.063" /> <!-- Tauti's Dual Axe -->
|
||||||
<item id="21712" count="1" /> <!-- Blessed Zaken's Earring -->
|
<item id="34998" count="1" chance="0.0735" /> <!-- Tauti's One-handed Axe -->
|
||||||
<item id="37511" count="1" /> <!-- Enhanced Istina's Earring - Warrior -->
|
<item id="46062" count="1" chance="0.0735" /> <!-- Kelbim Bow -->
|
||||||
<item id="37517" count="1" /> <!-- Enhanced Istina's Earring - Wizard -->
|
<item id="37715" count="1" chance="0.3208" /> <!-- Talisman - Anakim -->
|
||||||
<item id="37512" count="1" /> <!-- Enhanced Istina's Necklace - Warrior -->
|
<item id="34999" count="1" chance="0.0882" /> <!-- Tauti's Axe -->
|
||||||
<item id="37518" count="1" /> <!-- Enhanced Istina's Necklace - Wizard -->
|
<item id="46061" count="1" chance="0.098" /> <!-- Kelbim Dual Dagger -->
|
||||||
<item id="37510" count="1" /> <!-- Enhanced Istina's Ring - Warrior -->
|
<item id="46063" count="1" chance="0.1103" /> <!-- Kelbim Crossbow -->
|
||||||
<item id="37516" count="1" /> <!-- Enhanced Istina's Ring - Wizard -->
|
<item id="34777" count="1" chance="0.126" /> <!-- Scroll of Blessing: (R99-grade) -->
|
||||||
<item id="37508" count="1" /> <!-- Enhanced Octavis' Earring - Warrior -->
|
<item id="46060" count="1" chance="0.126" /> <!-- Kelbim Dagger -->
|
||||||
<item id="37514" count="1" /> <!-- Enhanced Octavis' Earring - Wizard -->
|
<item id="35649" count="1" chance="0.2714" /> <!-- Sealed Talisman - Longing -->
|
||||||
<item id="37509" count="1" /> <!-- Enhanced Octavis' Necklace - Warrior -->
|
<item id="23342" count="1" chance="0.294" /> <!-- Ancient Scroll: Enchant Weapon (R-grade) -->
|
||||||
<item id="37515" count="1" /> <!-- Enhanced Octavis' Necklace - Wizard -->
|
<item id="37714" count="1" chance="0.3528" /> <!-- Talisman - Lilith -->
|
||||||
<item id="37507" count="1" /> <!-- Enhanced Octavis' Ring - Warrior -->
|
<item id="35566" count="1" chance="0.1764" /> <!-- Dark Amaranthine Enhancement Stone -->
|
||||||
<item id="37513" count="1" /> <!-- Enhanced Octavis' Ring - Wizard -->
|
<item id="6656" count="1" chance="0.0257" /> <!-- Antharas' Earring -->
|
||||||
<item id="6661" count="1" /> <!-- Orfen's Earring -->
|
<item id="6660" count="1" chance="2.2618" /> <!-- Queen Ant's Ring -->
|
||||||
<item id="6660" count="1" /> <!-- Queen Ant's Ring -->
|
<item id="34776" count="1" chance="0.294" /> <!-- Scroll of Blessing: (R95-grade) -->
|
||||||
<item id="27462" count="1" /> <!-- Angel Circlet Box -->
|
<item id="39647" count="1" chance="0.6273" /> <!-- Venir's Talisman - Stage 14 -->
|
||||||
<item id="27460" count="1" /> <!-- Cat Ears Box -->
|
<item id="6657" count="1" chance="2.0048" /> <!-- Valakas' Necklace -->
|
||||||
<item id="27463" count="1" /> <!-- Devil Circlet Box -->
|
<item id="21712" count="1" chance="1.6039" /> <!-- Blessed Zaken's Earring -->
|
||||||
<item id="27464" count="1" /> <!-- Eyepatch Box -->
|
<item id="46395" count="10" chance="2.2053" /> <!-- Shadow Ingot -->
|
||||||
<item id="27465" count="1" /> <!-- Outlaw's Eyepatch Box -->
|
<item id="37507" count="1" chance="0.9285" /> <!-- Enhanced Octavis' Ring (Warrior) -->
|
||||||
<item id="27467" count="1" /> <!-- Party Hat Box -->
|
<item id="37513" count="1" chance="1.3571" /> <!-- Enhanced Octavis' Ring (Wizard) -->
|
||||||
<item id="27464" count="1" /> <!-- Pirate's Eyepatch Box -->
|
<item id="46479" count="1" chance="0.8821" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
||||||
<item id="27458" count="1" /> <!-- Rabbit Ears Box -->
|
<item id="37508" count="1" chance="1.7642" /> <!-- Enhanced Octavis' Earring (Warrior) -->
|
||||||
<item id="27459" count="1" /> <!-- Raccoon Ears Box -->
|
<item id="34775" count="1" chance="4.9557" /> <!-- Scroll of Blessing: (R2-grade) (Event) -->
|
||||||
<item id="27468" count="1" /> <!-- Refined Angel Ring Box -->
|
<item id="46494" count="1" chance="0.6786" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
||||||
<item id="27469" count="1" /> <!-- Refined Devil Horn Box -->
|
<item id="46464" count="1" chance="0.8143" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="27461" count="1" /> <!-- Romantic Chapeau Box -->
|
<item id="46449" count="1" chance="0.8143" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
||||||
<item id="37722" count="1" /> <!-- Eva's Special Pack -->
|
<item id="39643" count="1" chance="5.8808" /> <!-- Venir's Talisman - Stage 10 -->
|
||||||
<item id="37720" count="1" /> <!-- Maphr's Special Pack -->
|
<item id="37517" count="1" chance="2.9404" /> <!-- Enhanced Istina's Earring (Wizard) -->
|
||||||
<item id="37719" count="1" /> <!-- Pa'agrio's Special Pack -->
|
<item id="46478" count="1" chance="1.6039" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
||||||
<item id="37721" count="1" /> <!-- Sayha's Special Pack -->
|
<item id="37518" count="1" chance="3.2077" /> <!-- Enhanced Istina's Necklace (Wizard) -->
|
||||||
<item id="46449" count="1" /> <!-- Kain's Soul Crystal - Stage 6 -->
|
<item id="35567" count="1" chance="3.5285" /> <!-- Dark Eternal Enhancement Stone -->
|
||||||
<item id="46478" count="1" /> <!-- Leona's Soul Crystal - Stage 5 -->
|
<item id="37509" count="1" chance="3.5285" /> <!-- Enhanced Octavis' Necklace (Warrior) -->
|
||||||
<item id="46479" count="1" /> <!-- Leona's Soul Crystal - Stage 6 -->
|
<item id="37772" count="1" chance="4.4106" /> <!-- Scroll of Blessing: Weapon (R99-grade) -->
|
||||||
<item id="46508" count="1" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
<item id="46151" count="1" chance="2.5203" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
||||||
<item id="46509" count="1" /> <!-- Lionel's Soul Crystal - Stage 6 -->
|
<item id="46493" count="1" chance="2.7566" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
||||||
<item id="46464" count="1" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
<item id="46464" count="1" chance="1.7642" /> <!-- Mermoden's Soul Crystal - Stage 6 -->
|
||||||
<item id="46493" count="1" /> <!-- Pantheon's Soul Crystal - Stage 5 -->
|
<item id="6661" count="1" chance="2.9404" /> <!-- Orfen's Earring -->
|
||||||
<item id="46494" count="1" /> <!-- Pantheon's Soul Crystal - Stage 6 -->
|
<item id="46508" count="1" chance="1.2831" /> <!-- Lionel's Soul Crystal - Stage 5 -->
|
||||||
<item id="46553" count="1" /> <!-- Mystic Soul Crystal -->
|
<item id="37781" count="2" chance="10.5854" /> <!-- Scroll of Blessing: Armor (R99-grade) -->
|
||||||
<item id="46063" count="1" /> <!-- Kelbim Crossbow -->
|
<item id="39641" count="1" chance="14.7015" /> <!-- Venir's Talisman - Stage 8 -->
|
||||||
<item id="46061" count="1" /> <!-- Kelbim Dual Dagger -->
|
<item id="27458" count="1" chance="0.4033" /> <!-- Rabbit Ears Box -->
|
||||||
<item id="46062" count="1" /> <!-- Kelbim's Bow -->
|
<item id="27459" count="1" chance="0.4033" /> <!-- Raccoon Ears Box -->
|
||||||
<item id="46060" count="1" /> <!-- Kelbim's Dagger -->
|
<item id="27460" count="1" chance="0.4033" /> <!-- Cat Ears Box -->
|
||||||
<item id="34999" count="1" /> <!-- Tauti's Axe -->
|
<item id="27461" count="1" chance="0.4033" /> <!-- Romantic Chapeau Box -->
|
||||||
<item id="35001" count="1" /> <!-- Tauti's Dual Axe -->
|
<item id="27462" count="1" chance="0.4033" /> <!-- Angel Circlet Box -->
|
||||||
<item id="34998" count="1" /> <!-- Tauti's One-handed Axe -->
|
<item id="27463" count="1" chance="0.4033" /> <!-- Demon Circlet Box -->
|
||||||
<item id="6657" count="1" /> <!-- Valakas' Necklace -->
|
<item id="27464" count="1" chance="0.4033" /> <!-- Pirate's Eyepatch Box -->
|
||||||
<item id="46395" count="10" /> <!-- Shadow Ingot -->
|
<item id="27465" count="1" chance="0.4033" /> <!-- Outlaw's Eyepatch Box -->
|
||||||
<item id="46151" count="1" /> <!-- Superior Giant's Codex - Mastery Chapter 1 -->
|
<item id="27466" count="1" chance="0.4033" /> <!-- Eyepatch Box -->
|
||||||
<item id="39573" count="1" /> <!-- Sealed Talisman - Insanity -->
|
<item id="27467" count="1" chance="0.4033" /> <!-- Party Hat Box -->
|
||||||
<item id="35649" count="1" /> <!-- Sealed Talisman - Longing -->
|
<item id="27468" count="1" chance="0.4033" /> <!-- Refined Angel Ring Box -->
|
||||||
<item id="37716" count="1" /> <!-- Seven Signs' Energy -->
|
<item id="27469" count="1" chance="0.4033" /> <!-- Refined Devil Horn Box -->
|
||||||
<item id="37715" count="1" /> <!-- Talisman - Anakim -->
|
<item id="37719" count="1" chance="2.2053" /> <!-- Pa'agrio's Special Pack -->
|
||||||
<item id="37714" count="1" /> <!-- Talisman - Lilith -->
|
<item id="37720" count="1" chance="2.2053" /> <!-- Maphr's Special Pack -->
|
||||||
<item id="37717" count="1" /> <!-- Talisman - Seven Signs -->
|
<item id="37721" count="1" chance="2.2053" /> <!-- Sayha's Special Pack -->
|
||||||
<item id="39641" count="1" /> <!-- Venir's Talisman - Stage 8 -->
|
<item id="37722" count="1" chance="2.2053" /> <!-- Eva's Special Pack -->
|
||||||
<item id="39643" count="1" /> <!-- Venir's Talisman - Stage 10 -->
|
</modify_reward>
|
||||||
<item id="39647" count="1" /> <!-- Venir's Talisman - Stage 14 -->
|
</luckygame>
|
||||||
</rareLuxuryFortuneReadingTicketRewards>
|
|
||||||
</list>
|
</list>
|
@@ -2,56 +2,68 @@
|
|||||||
<xs:element name="list">
|
<xs:element name="list">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="fortuneReadingTicketRewards">
|
<xs:element name="luckygame" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
<xs:element name="common_reward">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:simpleContent>
|
<xs:sequence>
|
||||||
<xs:extension base="xs:string">
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:simpleContent>
|
||||||
</xs:extension>
|
<xs:extension base="xs:string">
|
||||||
</xs:simpleContent>
|
<xs:attribute type="xs:float" name="chance" use="optional" />
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
</xs:extension>
|
||||||
</xs:complexType>
|
</xs:simpleContent>
|
||||||
</xs:element>
|
</xs:complexType>
|
||||||
<xs:element name="luxuryFortuneReadingTicketRewards">
|
</xs:element>
|
||||||
<xs:complexType>
|
</xs:sequence>
|
||||||
<xs:sequence>
|
</xs:complexType>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:element>
|
||||||
<xs:complexType>
|
<xs:element name="unique_reward" minOccurs="0">
|
||||||
<xs:simpleContent>
|
<xs:complexType>
|
||||||
<xs:extension base="xs:string">
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:complexType>
|
||||||
</xs:extension>
|
<xs:simpleContent>
|
||||||
</xs:simpleContent>
|
<xs:extension base="xs:string">
|
||||||
</xs:complexType>
|
<xs:attribute type="xs:byte" name="count" use="optional" />
|
||||||
</xs:element>
|
<xs:attribute type="xs:int" name="id" use="optional" />
|
||||||
</xs:sequence>
|
<xs:attribute type="xs:short" name="points" use="optional" />
|
||||||
</xs:complexType>
|
</xs:extension>
|
||||||
</xs:element>
|
</xs:simpleContent>
|
||||||
<xs:element name="rareLuxuryFortuneReadingTicketRewards">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:sequence>
|
</xs:sequence>
|
||||||
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
</xs:complexType>
|
||||||
<xs:complexType>
|
</xs:element>
|
||||||
<xs:simpleContent>
|
<xs:element name="modify_reward" minOccurs="0">
|
||||||
<xs:extension base="xs:string">
|
<xs:complexType>
|
||||||
<xs:attribute type="xs:int" name="id" use="optional"/>
|
<xs:sequence>
|
||||||
<xs:attribute type="xs:byte" name="count" use="optional"/>
|
<xs:element name="item" maxOccurs="unbounded" minOccurs="0">
|
||||||
</xs:extension>
|
<xs:complexType>
|
||||||
</xs:simpleContent>
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute type="xs:float" name="chance" />
|
||||||
|
<xs:attribute type="xs:byte" name="count" />
|
||||||
|
<xs:attribute type="xs:int" name="id" />
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:byte" name="max_game" />
|
||||||
|
<xs:attribute type="xs:byte" name="min_game" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute type="xs:int" name="turning_point" use="optional" />
|
||||||
|
<xs:attribute type="xs:byte" name="index" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute type="xs:string" name="enabled"/>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
@@ -17,25 +17,26 @@
|
|||||||
package com.l2jmobius.gameserver.data.xml.impl;
|
package com.l2jmobius.gameserver.data.xml.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
|
||||||
import org.w3c.dom.Node;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemPointHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mathael
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class LuckyGameData implements IGameXmlReader
|
public class LuckyGameData implements IGameXmlReader
|
||||||
{
|
{
|
||||||
private static final List<ItemHolder> _fortuneReadingTicketRewards = new ArrayList<>();
|
private final Map<Integer, LuckyGameDataHolder> _luckyGame = new HashMap<>();
|
||||||
private static final List<ItemHolder> _luxuryFortuneReadingTicketRewards = new ArrayList<>();
|
|
||||||
private static final List<ItemHolder> _rareLuxuryFortuneReadingTicketRewards = new ArrayList<>();
|
final AtomicInteger _serverPlay = new AtomicInteger();
|
||||||
|
|
||||||
protected LuckyGameData()
|
protected LuckyGameData()
|
||||||
{
|
{
|
||||||
@@ -45,112 +46,62 @@ public class LuckyGameData implements IGameXmlReader
|
|||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
_fortuneReadingTicketRewards.clear();
|
_luckyGame.clear();
|
||||||
_luxuryFortuneReadingTicketRewards.clear();
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.clear();
|
|
||||||
|
|
||||||
parseDatapackFile("data/LuckyGameData.xml");
|
parseDatapackFile("data/LuckyGameData.xml");
|
||||||
|
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luckyGame.size() + " lucky game data.");
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _fortuneReadingTicketRewards.size() + " Normal item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _luxuryFortuneReadingTicketRewards.size() + " Luxury item rewards.");
|
|
||||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _rareLuxuryFortuneReadingTicketRewards.size() + " Rare item rewards.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void parseDocument(Document doc, File f)
|
public void parseDocument(Document doc, File f)
|
||||||
{
|
{
|
||||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
forEach(doc, "list", listNode -> forEach(listNode, "luckygame", rewardNode ->
|
||||||
{
|
{
|
||||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
final LuckyGameDataHolder holder = new LuckyGameDataHolder(new StatsSet(parseAttributes(rewardNode)));
|
||||||
|
|
||||||
|
forEach(rewardNode, "common_reward", commonRewardNode -> forEach(commonRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
final NamedNodeMap at = n.getAttributes();
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
final Node attribute = at.getNamedItem("enabled");
|
holder.addCommonReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ((attribute != null) && Boolean.parseBoolean(attribute.getNodeValue())) // <list enabled="true"
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "unique_reward", uniqueRewardNode -> forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
|
{
|
||||||
|
holder.addUniqueReward(new ItemPointHolder(new StatsSet(parseAttributes(itemNode))));
|
||||||
|
}));
|
||||||
|
|
||||||
|
forEach(rewardNode, "modify_reward", uniqueRewardNode ->
|
||||||
|
{
|
||||||
|
holder.setMinModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "min_game"));
|
||||||
|
holder.setMaxModifyRewardGame(parseInteger(uniqueRewardNode.getAttributes(), "max_game"));
|
||||||
|
forEach(uniqueRewardNode, "item", itemNode ->
|
||||||
{
|
{
|
||||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
final StatsSet stats = new StatsSet(parseAttributes(itemNode));
|
||||||
{
|
holder.addModifyReward(new ItemChanceHolder(stats.getInt("id"), stats.getDouble("chance"), stats.getLong("count")));
|
||||||
if ("fortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
});
|
||||||
{
|
});
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
_luckyGame.put(parseInteger(rewardNode.getAttributes(), "index"), holder);
|
||||||
final int count = parseInteger(attrs, "count");
|
}));
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_fortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("luxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_luxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ("rareLuxuryFortuneReadingTicketRewards".equalsIgnoreCase(d.getNodeName()))
|
|
||||||
{
|
|
||||||
for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling())
|
|
||||||
{
|
|
||||||
if ("item".equalsIgnoreCase(b.getNodeName()))
|
|
||||||
{
|
|
||||||
final NamedNodeMap attrs = b.getAttributes();
|
|
||||||
|
|
||||||
final int itemId = parseInteger(attrs, "id");
|
|
||||||
final int count = parseInteger(attrs, "count");
|
|
||||||
|
|
||||||
if ((itemId == 0) || (count == 0))
|
|
||||||
{
|
|
||||||
LOGGER.severe(getClass().getSimpleName() + ": itemId: [" + itemId + "] count: [" + count + "] cannot be zero.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_rareLuxuryFortuneReadingTicketRewards.add(new ItemHolder(itemId, count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomNormalReward()
|
public int getLuckyGameCount()
|
||||||
{
|
{
|
||||||
return _fortuneReadingTicketRewards.get(Rnd.get(_fortuneReadingTicketRewards.size()));
|
return _luckyGame.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomLuxuryReward()
|
public LuckyGameDataHolder getLuckyGameDataByIndex(int index)
|
||||||
{
|
{
|
||||||
return _luxuryFortuneReadingTicketRewards.get(Rnd.get(_luxuryFortuneReadingTicketRewards.size()));
|
return _luckyGame.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemHolder getRandomRareReward()
|
public int increaseGame()
|
||||||
{
|
{
|
||||||
return _rareLuxuryFortuneReadingTicketRewards.get(Rnd.get(_rareLuxuryFortuneReadingTicketRewards.size()));
|
return _serverPlay.incrementAndGet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerPlay()
|
||||||
|
{
|
||||||
|
return _serverPlay.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LuckyGameData getInstance()
|
public static LuckyGameData getInstance()
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameItemType
|
||||||
|
{
|
||||||
|
COMMON(1),
|
||||||
|
UNIQUE(2),
|
||||||
|
RARE(3);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
LuckyGameItemType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameResultType
|
||||||
|
{
|
||||||
|
INVALID_CAPACITY(-2),
|
||||||
|
INVALID_ITEM_COUNT(-1),
|
||||||
|
DISABLED(0),
|
||||||
|
SUCCESS(1);
|
||||||
|
|
||||||
|
private final int _clientId;
|
||||||
|
|
||||||
|
private LuckyGameResultType(int clientId)
|
||||||
|
{
|
||||||
|
_clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getClientId()
|
||||||
|
{
|
||||||
|
return _clientId;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public enum LuckyGameType
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
NORMAL,
|
||||||
|
LUXURY
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class ItemPointHolder extends ItemHolder
|
||||||
|
{
|
||||||
|
private final int _points;
|
||||||
|
|
||||||
|
public ItemPointHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
this(params.getInt("id"), params.getLong("count"), params.getInt("points"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemPointHolder(int id, long count, int points)
|
||||||
|
{
|
||||||
|
super(id, count);
|
||||||
|
_points = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the point.
|
||||||
|
* @return the number of point to get the item
|
||||||
|
*/
|
||||||
|
public int getPoints()
|
||||||
|
{
|
||||||
|
return _points;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", points: " + _points;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.model.holders;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class LuckyGameDataHolder
|
||||||
|
{
|
||||||
|
final private int _index;
|
||||||
|
final private int _turningPoints;
|
||||||
|
final private List<ItemChanceHolder> _commonRewards = new ArrayList<>();
|
||||||
|
final private List<ItemPointHolder> _uniqueRewards = new ArrayList<>();
|
||||||
|
final private List<ItemChanceHolder> _modifyRewards = new ArrayList<>();
|
||||||
|
private int _minModifyRewardGame;
|
||||||
|
private int _maxModifyRewardGame;
|
||||||
|
|
||||||
|
public LuckyGameDataHolder(StatsSet params)
|
||||||
|
{
|
||||||
|
_index = params.getInt("index");
|
||||||
|
_turningPoints = params.getInt("turning_point");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCommonReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_commonRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addUniqueReward(ItemPointHolder item)
|
||||||
|
{
|
||||||
|
_uniqueRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addModifyReward(ItemChanceHolder item)
|
||||||
|
{
|
||||||
|
_modifyRewards.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getCommonReward()
|
||||||
|
{
|
||||||
|
return _commonRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemPointHolder> getUniqueReward()
|
||||||
|
{
|
||||||
|
return _uniqueRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemChanceHolder> getModifyReward()
|
||||||
|
{
|
||||||
|
return _modifyRewards;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinModifyRewardGame(int minModifyRewardGame)
|
||||||
|
{
|
||||||
|
_minModifyRewardGame = minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxModifyRewardGame(int maxModifyRewardGame)
|
||||||
|
{
|
||||||
|
_maxModifyRewardGame = maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _minModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxModifyRewardGame()
|
||||||
|
{
|
||||||
|
return _maxModifyRewardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex()
|
||||||
|
{
|
||||||
|
return _index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTurningPoints()
|
||||||
|
{
|
||||||
|
return _turningPoints;
|
||||||
|
}
|
||||||
|
}
|
@@ -57,6 +57,8 @@ public class PlayerVariables extends AbstractVariables
|
|||||||
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
public static final String REVELATION_SKILL_1_DUAL_CLASS = "DualclassRevelationSkill1";
|
||||||
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
public static final String REVELATION_SKILL_2_DUAL_CLASS = "DualclassRevelationSkill2";
|
||||||
public static final String EXTEND_DROP = "EXTEND_DROP";
|
public static final String EXTEND_DROP = "EXTEND_DROP";
|
||||||
|
public static final String FORTUNE_TELLING_VARIABLE = "FortuneTelling";
|
||||||
|
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
|
||||||
|
|
||||||
private final int _objectId;
|
private final int _objectId;
|
||||||
|
|
||||||
|
@@ -69,6 +69,8 @@ import com.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoLi
|
|||||||
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
import com.l2jmobius.gameserver.network.clientpackets.ensoul.RequestItemEnsoul;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.faction.RequestUserFactionInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.faction.RequestUserFactionInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
import com.l2jmobius.gameserver.network.clientpackets.friend.RequestFriendDetailInfo;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGamePlay;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.luckygame.RequestLuckyGameStartInfo;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.ConfirmMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
import com.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
|
||||||
@@ -329,8 +331,8 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
|||||||
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_OPEN(0xEE, RequestAbilityWndOpen::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
REQUEST_ABILITY_WND_CLOSE(0xEF, RequestAbilityWndClose::new, ConnectionState.IN_GAME),
|
||||||
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
EX_PC_CAFE_REQUEST_OPEN_WINDOW_WITHOUT_NPC(0xF0, ExPCCafeRequestOpenWindowWithoutNPC::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_START_INFO(0xF1, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_START_INFO(0xF1, RequestLuckyGameStartInfo::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_LUCKY_GAME_PLAY(0xF2, null, ConnectionState.IN_GAME),
|
REQUEST_LUCKY_GAME_PLAY(0xF2, RequestLuckyGamePlay::new, ConnectionState.IN_GAME),
|
||||||
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
NOTIFY_TRAINING_ROOM_END(0xF3, null, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_PUSH_ONE(0xF4, RequestNewEnchantPushOne::new, ConnectionState.IN_GAME),
|
||||||
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
REQUEST_NEW_ENCHANT_REMOVE_ONE(0xF5, RequestNewEnchantRemoveOne::new, ConnectionState.IN_GAME),
|
||||||
|
@@ -16,30 +16,169 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
package com.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketReader;
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.commons.util.CommonUtil;
|
||||||
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.holders.LuckyGameDataHolder;
|
||||||
|
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||||
|
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
import com.l2jmobius.gameserver.network.serverpackets.luckygame.ExBettingLuckyGameResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
public class RequestLuckyGamePlay implements IClientIncomingPacket
|
||||||
{
|
{
|
||||||
private int _type;
|
private static final int FORTUNE_READING_TICKET = 23767;
|
||||||
private int _count;
|
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
||||||
|
private LuckyGameType _type;
|
||||||
|
private int _reading;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean read(L2GameClient client, PacketReader packet)
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
{
|
{
|
||||||
_type = packet.readD(); // luxury = 2, normal = 1
|
final int type = CommonUtil.constrain(packet.readD(), 0, LuckyGameType.values().length);
|
||||||
_count = packet.readD(); // count
|
_type = LuckyGameType.values()[type];
|
||||||
|
_reading = CommonUtil.constrain(packet.readD(), 0, 50); // max play is 50
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(L2GameClient client)
|
public void run(L2GameClient client)
|
||||||
{
|
{
|
||||||
client.getActiveChar().sendPacket(new ExBettingLuckyGameResult(client.getActiveChar(), _type, _count));
|
final L2PcInstance player = client.getActiveChar();
|
||||||
|
if (player == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int index = _type == LuckyGameType.LUXURY ? 102 : 2; // move to event config
|
||||||
|
|
||||||
|
final LuckyGameDataHolder holder = LuckyGameData.getInstance().getLuckyGameDataByIndex(index);
|
||||||
|
if (holder == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long tickets = _type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1);
|
||||||
|
if (tickets < _reading)
|
||||||
|
{
|
||||||
|
player.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int playCount = player.getVariables().getInt(PlayerVariables.FORTUNE_TELLING_VARIABLE, 0);
|
||||||
|
boolean blackCat = player.getVariables().getBoolean(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, false);
|
||||||
|
final EnumMap<LuckyGameItemType, List<ItemHolder>> rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final double chance = 100 * Rnd.nextDouble();
|
||||||
|
double totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : holder.getCommonReward())
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chance)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.COMMON, k -> new ArrayList<>()).add(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playCount++;
|
||||||
|
if ((playCount >= holder.getMinModifyRewardGame()) && (playCount <= holder.getMaxModifyRewardGame()) && !blackCat)
|
||||||
|
{
|
||||||
|
final List<ItemChanceHolder> modifyReward = holder.getModifyReward();
|
||||||
|
final double chanceModify = 100 * Rnd.nextDouble();
|
||||||
|
totalChance = 0;
|
||||||
|
|
||||||
|
for (ItemChanceHolder item : modifyReward)
|
||||||
|
{
|
||||||
|
totalChance += item.getChance();
|
||||||
|
if (totalChance >= chanceModify)
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(item);
|
||||||
|
blackCat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playCount == holder.getMaxModifyRewardGame())
|
||||||
|
{
|
||||||
|
rewards.computeIfAbsent(LuckyGameItemType.RARE, k -> new ArrayList<>()).add(modifyReward.get(Rnd.get(modifyReward.size())));
|
||||||
|
blackCat = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final int totalWeight = rewards.values().stream().mapToInt(list -> list.stream().mapToInt(item -> ItemTable.getInstance().getTemplate(item.getId()).getWeight()).sum()).sum();
|
||||||
|
|
||||||
|
// Check inventory capacity
|
||||||
|
if ((rewards.size() > 0) && (!player.getInventory().validateCapacity(rewards.size()) || !player.getInventory().validateWeight(totalWeight)))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_CAPACITY : ExBettingLuckyGameResult.NORMAL_INVALID_CAPACITY);
|
||||||
|
player.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.destroyItemByItemId("LuckyGame", _type == LuckyGameType.LUXURY ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _reading, player, true))
|
||||||
|
{
|
||||||
|
player.sendPacket(_type == LuckyGameType.LUXURY ? ExBettingLuckyGameResult.LUXURY_INVALID_ITEM_COUNT : ExBettingLuckyGameResult.NORMAL_INVALID_ITEM_COUNT);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _reading; i++)
|
||||||
|
{
|
||||||
|
final int serverGameNumber = LuckyGameData.getInstance().increaseGame();
|
||||||
|
holder.getUniqueReward().stream().filter(reward -> reward.getPoints() == serverGameNumber).forEach(item -> rewards.computeIfAbsent(LuckyGameItemType.UNIQUE, k -> new ArrayList<>()).add(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendPacket(new ExBettingLuckyGameResult(LuckyGameResultType.SUCCESS, _type, rewards, (int) (_type == LuckyGameType.LUXURY ? player.getInventory().getInventoryItemCount(LUXURY_FORTUNE_READING_TICKET, -1) : player.getInventory().getInventoryItemCount(FORTUNE_READING_TICKET, -1))));
|
||||||
|
|
||||||
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : rewards.entrySet())
|
||||||
|
{
|
||||||
|
for (ItemHolder r : reward.getValue())
|
||||||
|
{
|
||||||
|
final L2ItemInstance item = player.addItem("LuckyGame", r.getId(), r.getCount(), player, true);
|
||||||
|
iu.addItem(item);
|
||||||
|
if (reward.getKey() == LuckyGameItemType.UNIQUE)
|
||||||
|
{
|
||||||
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
||||||
|
sm.addPcName(player);
|
||||||
|
sm.addLong(r.getCount());
|
||||||
|
sm.addItemName(item);
|
||||||
|
player.broadcastPacket(sm, 1000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendInventoryUpdate(iu);
|
||||||
|
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_VARIABLE, playCount >= 50 ? (playCount - 50) : playCount);
|
||||||
|
if (blackCat && (playCount < 50))
|
||||||
|
{
|
||||||
|
player.getVariables().set(PlayerVariables.FORTUNE_TELLING_BLACK_CAT_VARIABLE, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the L2J Mobius project.
|
||||||
|
*
|
||||||
|
* This program 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.
|
||||||
|
*
|
||||||
|
* This program 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.l2jmobius.gameserver.network.clientpackets.luckygame;
|
||||||
|
|
||||||
|
import com.l2jmobius.commons.network.PacketReader;
|
||||||
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
|
import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Sdw
|
||||||
|
*/
|
||||||
|
public class RequestLuckyGameStartInfo implements IClientIncomingPacket
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean read(L2GameClient client, PacketReader packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(L2GameClient client)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -16,121 +16,69 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.gameserver.enums.LuckyGameItemType;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.LuckyGameData;
|
import com.l2jmobius.gameserver.enums.LuckyGameResultType;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
public class ExBettingLuckyGameResult implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.NORMAL);
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_ITEM_COUNT = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_ITEM_COUNT, LuckyGameType.LUXURY);
|
||||||
private int _count = 0;
|
public static final ExBettingLuckyGameResult NORMAL_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.NORMAL);
|
||||||
private int _type = 0;
|
public static final ExBettingLuckyGameResult LUXURY_INVALID_CAPACITY = new ExBettingLuckyGameResult(LuckyGameResultType.INVALID_CAPACITY, LuckyGameType.LUXURY);
|
||||||
private final L2PcInstance _activeChar;
|
|
||||||
|
|
||||||
public ExBettingLuckyGameResult(L2PcInstance activeChar, int type, int count)
|
private final LuckyGameResultType _result;
|
||||||
|
private final LuckyGameType _type;
|
||||||
|
private final EnumMap<LuckyGameItemType, List<ItemHolder>> _rewards;
|
||||||
|
private final int _ticketCount;
|
||||||
|
private final int _size;
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type)
|
||||||
{
|
{
|
||||||
_count = count;
|
_result = result;
|
||||||
_type = type;
|
_type = type;
|
||||||
_activeChar = activeChar;
|
_rewards = new EnumMap<>(LuckyGameItemType.class);
|
||||||
|
_ticketCount = 0;
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExBettingLuckyGameResult(LuckyGameResultType result, LuckyGameType type, EnumMap<LuckyGameItemType, List<ItemHolder>> rewards, int ticketCount)
|
||||||
|
{
|
||||||
|
_result = result;
|
||||||
|
_type = type;
|
||||||
|
_rewards = rewards;
|
||||||
|
_ticketCount = ticketCount;
|
||||||
|
_size = (int) rewards.values().stream().mapToLong(i -> i.stream().count()).sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
// Calculate rewards
|
|
||||||
final List<ItemHolder> rewards = new ArrayList<>();
|
|
||||||
int totalWeight = 0;
|
|
||||||
for (int rewardCounter = 0; rewardCounter < _count; rewardCounter++)
|
|
||||||
{
|
|
||||||
if (Rnd.get(3) == 0) // 1 out of 3 chance
|
|
||||||
{
|
|
||||||
ItemHolder reward = null;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
if (_count >= 40)
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomRareReward();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomLuxuryReward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
reward = LuckyGameData.getRandomNormalReward();
|
|
||||||
}
|
|
||||||
rewards.add(reward);
|
|
||||||
totalWeight += new L2ItemInstance(reward.getId()).getItem().getWeight() * reward.getCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check inventory capacity
|
|
||||||
if ((rewards.size() > 0) && (!_activeChar.getInventory().validateCapacity(rewards.size()) || !_activeChar.getInventory().validateWeight(totalWeight)))
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_EITHER_FULL_OR_OVERWEIGHT);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1) < _count)
|
|
||||||
{
|
|
||||||
_activeChar.sendPacket(new ExStartLuckyGame(_activeChar, _type));
|
|
||||||
_activeChar.sendPacket(SystemMessageId.NOT_ENOUGH_TICKETS);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove tickets
|
|
||||||
_activeChar.getInventory().destroyItemByItemId("FortuneTelling", _type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, _count, _activeChar, "FortuneTelling");
|
|
||||||
|
|
||||||
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
OutgoingPackets.EX_BETTING_LUCKY_GAME_RESULT.writeId(packet);
|
||||||
packet.writeD(0x01); // 0 disabled, 1 enabled
|
packet.writeD(_result.getClientId());
|
||||||
packet.writeD(0x01); // ?
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD((int) _activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1)); // Count remaining tickets
|
packet.writeD(_ticketCount);
|
||||||
|
packet.writeD(_size);
|
||||||
if (rewards.size() > 0)
|
for (Entry<LuckyGameItemType, List<ItemHolder>> reward : _rewards.entrySet())
|
||||||
{
|
{
|
||||||
packet.writeD(rewards.size());
|
for (ItemHolder item : reward.getValue())
|
||||||
for (ItemHolder reward : rewards)
|
|
||||||
{
|
{
|
||||||
packet.writeD(0x02); // normal = 1, rare = 2 (forcing 2)
|
packet.writeD(reward.getKey().getClientId());
|
||||||
packet.writeD(reward.getId());
|
packet.writeD(item.getId());
|
||||||
packet.writeD((int) reward.getCount());
|
packet.writeD((int) item.getCount());
|
||||||
final SystemMessage sm;
|
|
||||||
if (_type == 2)
|
|
||||||
{
|
|
||||||
_activeChar.addItem("LuxuryFortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_IN_THE_LUXURY_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_activeChar.addItem("FortuneTelling", reward, _activeChar, false);
|
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_C1_HAS_OBTAINED_S2_OF_S3_THROUGH_FORTUNE_READING);
|
|
||||||
}
|
|
||||||
sm.addPcName(_activeChar);
|
|
||||||
sm.addLong(reward.getCount());
|
|
||||||
sm.addItemName(new L2ItemInstance(reward.getId()));
|
|
||||||
_activeChar.broadcastPacket(sm, 1000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
packet.writeD(0x00);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,32 +17,30 @@
|
|||||||
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
package com.l2jmobius.gameserver.network.serverpackets.luckygame;
|
||||||
|
|
||||||
import com.l2jmobius.commons.network.PacketWriter;
|
import com.l2jmobius.commons.network.PacketWriter;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.enums.LuckyGameType;
|
||||||
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
import com.l2jmobius.gameserver.network.OutgoingPackets;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Sdw
|
||||||
*/
|
*/
|
||||||
public class ExStartLuckyGame implements IClientOutgoingPacket
|
public class ExStartLuckyGame implements IClientOutgoingPacket
|
||||||
{
|
{
|
||||||
private static final int FORTUNE_READING_TICKET = 23767;
|
private final LuckyGameType _type;
|
||||||
private static final int LUXURY_FORTUNE_READING_TICKET = 23768;
|
private final int _ticketCount;
|
||||||
private int _type = 0;
|
|
||||||
private int _count = 0;
|
|
||||||
|
|
||||||
public ExStartLuckyGame(L2PcInstance activeChar, int type)
|
public ExStartLuckyGame(LuckyGameType type, long ticketCount)
|
||||||
{
|
{
|
||||||
_type = type;
|
_type = type;
|
||||||
_count = (int) activeChar.getInventory().getInventoryItemCount(_type == 2 ? LUXURY_FORTUNE_READING_TICKET : FORTUNE_READING_TICKET, -1);
|
_ticketCount = (int) ticketCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean write(PacketWriter packet)
|
public boolean write(PacketWriter packet)
|
||||||
{
|
{
|
||||||
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
OutgoingPackets.EX_START_LUCKY_GAME.writeId(packet);
|
||||||
packet.writeD(_type);
|
packet.writeD(_type.ordinal());
|
||||||
packet.writeD(_count);
|
packet.writeD(_ticketCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user