Addition of mission level rewards.
Contributed by Index.
This commit is contained in:
parent
b1bd7af5b9
commit
66eaec5562
@ -193,6 +193,7 @@
|
||||
<item id="90907" count="6" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="20" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="6" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2302" reward_id="2302" name="Daily Hunting II (Lv. 61-70)" requiredCompletion="120" isOneTime="false">
|
||||
@ -205,6 +206,7 @@
|
||||
<item id="90907" count="6" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="20" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="6" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2303" reward_id="2303" name="Daily Hunting III (Lv. 61-70)" requiredCompletion="180" isOneTime="false">
|
||||
@ -217,6 +219,7 @@
|
||||
<item id="90907" count="6" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="20" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="6" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2304" reward_id="2304" name="Daily Hunting IV (Lv. 61-70)" requiredCompletion="240" isOneTime="false">
|
||||
@ -229,6 +232,7 @@
|
||||
<item id="90907" count="6" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="20" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="6" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2305" reward_id="2305" name="Daily Hunting V (Lv. 61-70)" requiredCompletion="300" isOneTime="false">
|
||||
@ -241,6 +245,7 @@
|
||||
<item id="90907" count="6" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="20" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="6" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2401" reward_id="2401" name="Daily Hunting I (Lv. 71-75)" requiredCompletion="80" isOneTime="false">
|
||||
@ -253,6 +258,7 @@
|
||||
<item id="90907" count="7" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="30" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="7" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2402" reward_id="2402" name="Daily Hunting II (Lv. 71-75)" requiredCompletion="150" isOneTime="false">
|
||||
@ -265,6 +271,7 @@
|
||||
<item id="90907" count="7" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="30" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="7" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2403" reward_id="2403" name="Daily Hunting III (Lv. 71-75)" requiredCompletion="200" isOneTime="false">
|
||||
@ -277,6 +284,7 @@
|
||||
<item id="90907" count="7" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="30" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="7" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2404" reward_id="2404" name="Daily Hunting IV (Lv. 71-75)" requiredCompletion="300" isOneTime="false">
|
||||
@ -289,6 +297,7 @@
|
||||
<item id="90907" count="7" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="30" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="7" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2405" reward_id="2405" name="Daily Hunting V (Lv. 71-75)" requiredCompletion="400" isOneTime="false">
|
||||
@ -301,6 +310,7 @@
|
||||
<item id="90907" count="7" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="30" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="7" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2501" reward_id="2501" name="Daily Hunting I (Lv. 76+)" requiredCompletion="100" isOneTime="false">
|
||||
@ -313,6 +323,7 @@
|
||||
<item id="90907" count="8" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="40" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="8" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2502" reward_id="2502" name="Daily Hunting II (Lv. 76+)" requiredCompletion="200" isOneTime="false">
|
||||
@ -325,6 +336,7 @@
|
||||
<item id="90907" count="8" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="40" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="8" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2503" reward_id="2503" name="Daily Hunting III (Lv. 76+)" requiredCompletion="300" isOneTime="false">
|
||||
@ -337,6 +349,7 @@
|
||||
<item id="90907" count="8" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="40" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="8" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2504" reward_id="2504" name="Daily Hunting IV (Lv. 76+)" requiredCompletion="400" isOneTime="false">
|
||||
@ -349,6 +362,8 @@
|
||||
<item id="90907" count="8" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="40" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="8" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
<item id="97145" count="30" /> <!-- Ancient Adena -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="2505" reward_id="2505" name="Daily Hunting V (Lv. 76+)" requiredCompletion="500" isOneTime="false">
|
||||
@ -361,6 +376,8 @@
|
||||
<item id="90907" count="8" /> <!-- Soulshot Ticket -->
|
||||
<item id="3031" count="40" /> <!-- Spirit Ore -->
|
||||
<item id="91912" count="8" /> <!-- Hp Potion (Exchangeable) -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
<item id="97145" count="30" /> <!-- Ancient Adena -->
|
||||
</items>
|
||||
</reward>
|
||||
|
||||
@ -793,6 +810,7 @@
|
||||
</handler>
|
||||
<items>
|
||||
<item id="91030" count="10" /> Blessed Soul
|
||||
<item id="97224" count="10" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
-->
|
||||
@ -854,6 +872,20 @@
|
||||
<item id="91186" count="30" />
|
||||
</items>
|
||||
</reward>
|
||||
|
||||
<reward id="1500" reward_id="1500" name="Hunt in Transcendent Instance Zones" requiredCompletion="300">
|
||||
Daily mission (once per account). A reward is given for killing 300 monsters in transcendent instance zones.
|
||||
<handler name="monster">
|
||||
<param name="minLevel">40</param>
|
||||
<param name="maxLevel">99</param>
|
||||
<param name="ids">22192,22193,22194,22195,22196,22197,22198,22199</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="93274" count="100" /> Sayha's Cookie Sealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
<item id="97145" count="50" /> Ancient Adena
|
||||
</items>
|
||||
</reward>
|
||||
-->
|
||||
|
||||
<reward id="1501" reward_id="2040" name="Hunt on Alligator Island I (Lv. 60+)" requiredCompletion="100">
|
||||
@ -880,16 +912,74 @@
|
||||
</reward>
|
||||
|
||||
<!-- TODO:
|
||||
<reward id="1503" reward_id="1503" name="Explore Primeval Isle" requiredCompletion="200">
|
||||
A reward is given for killing 200 monsters on the Primeval Isle.
|
||||
<handler name="monster">
|
||||
<param name="minLevel">79</param>
|
||||
<param name="maxLevel">99</param>
|
||||
<param name="ids">22192,22193,22194,22195,22196,22197,22198,22199</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="94879" count="50" /> Grace PotionSealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="1505" reward_id="1505" name="Monster Purge" requiredCompletion="1">
|
||||
A reward is given after receiving the reward for using the Purge system in the corresponding hunting zones.
|
||||
TODO: Make handler "on purge reward receive"
|
||||
<items>
|
||||
<item id="94879" count="1" /> Aden Purge Crystal Sealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="1509" reward_id="1509" name="Exploring Dreamland" requiredCompletion="1">
|
||||
reset_period=2
|
||||
A reward is given for killing one of the following monsters in the Dream Dungeon: Gustav, Gustav's Steward, Gabrielle, Gabrielle's Minion, Ventus, Rekario, Tiat, Baint. / Kill 1 raid boss in one of the four dungeons.
|
||||
<handler name="monster">
|
||||
<param name="minLevel">76</param>
|
||||
<param name="maxLevel">99</param>
|
||||
<param name="ids">22192,22193,22194,22195,22196,22197,22198,22199</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="96925" count="1" /> Dream Orb Sealed
|
||||
<item id="93068" count="1" /> Red Lantern - 1st Place Sealed
|
||||
<item id="97224" count="5" /> Mission Points
|
||||
<item id="97145" count="100" /> Ancient Adena
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="1510" reward_id="1510" name="Exploring Dreamland's Secret Places" requiredCompletion="1">
|
||||
reset_period=2
|
||||
A reward is given for killing Feline King or Feline Queen in the Cat Guild's Lair of the Dream Dungeon. / Kill 1 raid boss in the Cat Guild's dungeon.
|
||||
<handler name="monster">
|
||||
<param name="minLevel">76</param>
|
||||
<param name="maxLevel">99</param>
|
||||
<param name="ids">22192,22193,22194,22195,22196,22197,22198,22199</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="96925" count="1" /> Dream Orb Sealed
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="1511" reward_id="1511" name="Exploring Alligator Island" requiredCompletion="100">
|
||||
reset_period=2
|
||||
A reward is given for killing 100 Evolved monsters on Alligator Island. / Kill 100 Evolved monsters.
|
||||
<handler name="monster">
|
||||
<param name="minLevel">70</param>
|
||||
<param name="maxLevel">99</param>
|
||||
<param name="ids">22192,22193,22194,22195,22196,22197,22198,22199</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="96925" count="1" /> Dream Orb Sealed
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="3007" reward_id="3007" name="Sayha's Blessing" requiredCompletion="10">
|
||||
<!–A reward is given for using Sayha's Blessing that is not limited by level, 10 times.–>
|
||||
A reward is given for using Sayha's Blessing that is not limited by level, 10 times.
|
||||
<handler name="item">
|
||||
<param name="maxUse">10</param>
|
||||
<param name="id">91910</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="90907" count="30" /> <!–Soulshot Ticket–>
|
||||
<item id="3031" count="500" /> <!–Spirit Ore–>
|
||||
<item id="93274" count="10" /> <!–Sayha's Cookie–>
|
||||
<item id="94780" count="2" /> Growth Rune Fragment Sealed
|
||||
<item id="97224" count="5" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
|
||||
@ -963,6 +1053,14 @@
|
||||
<item id="93290" count="1" /> Victory Pack
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="3018" reward_id="3018" name="Olympiad Percipient" requiredCompletion="50">
|
||||
A reward is given when player will percipient in Olympiad, 50 times. Available from monday to friday.
|
||||
<handler name="olympiad" />
|
||||
<items>
|
||||
<item id="97224" count="150" /> Mission Points
|
||||
<item id="95687" count="1" /> Olympiad Treasure Chest Sealed
|
||||
</items>
|
||||
</reward>
|
||||
-->
|
||||
<reward id="9001" reward_id="9001" name="Clan Raid Attack" requiredCompletion="1">
|
||||
<!-- Weekly mission. A reward is given for defeating 1 enemy together with your clan members in the Clan Arena. -->
|
||||
@ -989,6 +1087,8 @@
|
||||
<item id="91832" count="5" /> <!-- Improved Wind Attack Potion -->
|
||||
<item id="91833" count="5" /> <!-- Improved Earth Attack Potion -->
|
||||
<item id="91830" count="5" /> <!-- Improved Fire Attack Potion -->
|
||||
<item id="94481" count="250" /> <!-- Clan XP Sealed -->
|
||||
<item id="97224" count="10" /> <!-- Mission Points -->
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="9003" reward_id="9003" name="Spirit Kings" requiredCompletion="1">
|
||||
@ -1005,4 +1105,74 @@
|
||||
<item id="91830" count="5" /> <!-- Improved Fire Attack Potion -->
|
||||
</items>
|
||||
</reward>
|
||||
<!-- TODO: FIND ID
|
||||
<reward id="9004" reward_id="9004" name="Battle with Frintezza" requiredCompletion="1">
|
||||
Weekly mission. A reward is given for defeating Scarlet van Halisha during a command channel raid to Frintezza.
|
||||
<handler name="monster">
|
||||
<param name="ids">22271,22272,22273</param>
|
||||
<param name="minLevel">76</param>
|
||||
<param name="maxLevel">99</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="90907" count="20" /> Soulshot Ticket Sealed
|
||||
<item id="3031" count="200" /> Spirit Ore Sealed
|
||||
<item id="94481" count="200" /> Clan XP Sealed
|
||||
<item id="94879" count="300" /> Grace Potion Sealed
|
||||
<item id="97145" count="20" /> Ancient Adena
|
||||
<item id="97224" count="10" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="5036" reward_id="5036" name="Assault on Elmoreden Tower" requiredCompletion="50">
|
||||
Daily mission. A reward is given for killing 50 monsters in the Elmoreden Tower. Required level: 60-74.
|
||||
<handler name="monster">
|
||||
<param name="ids">22271,22272,22273</param>
|
||||
<param name="minLevel">60</param>
|
||||
<param name="maxLevel">74</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="91671" count="1" /> Green Lantern (Time-limited) Sealed
|
||||
<item id="97247" count="1" /> Asofe Sealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="5037" reward_id="5037" name="Assault on Elmoreden Tower" requiredCompletion="50">
|
||||
Daily mission. A reward is given for killing 50 monsters in the Elmoreden Tower. Required level: 75-79.
|
||||
<handler name="monster">
|
||||
<param name="ids">22271,22272,22273</param>
|
||||
<param name="minLevel">75</param>
|
||||
<param name="maxLevel">79</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="91671" count="1" /> Green Lantern (Time-limited) Sealed
|
||||
<item id="97247" count="3" /> Asofe Sealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="5038" reward_id="5038" name="Assault on Elmoreden Tower" requiredCompletion="50">
|
||||
Daily mission. A reward is given for killing 50 monsters in the Elmoreden Tower. Required level: 80-84.
|
||||
<handler name="monster">
|
||||
<param name="ids">22271,22272,22273</param>
|
||||
<param name="minLevel">80</param>
|
||||
<param name="maxLevel">84</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="91671" count="1" /> Green Lantern (Time-limited) Sealed
|
||||
<item id="97247" count="5" /> Asofe Sealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
<reward id="5038" reward_id="5038" name="Assault on Elmoreden Tower" requiredCompletion="50">
|
||||
Daily mission. A reward is given for killing 50 monsters in the Elmoreden Tower. Required level: 85+.
|
||||
<handler name="monster">
|
||||
<param name="ids">22271,22272,22273</param>
|
||||
<param name="minLevel">85</param>
|
||||
<param name="maxLevel">99</param>
|
||||
</handler>
|
||||
<items>
|
||||
<item id="91671" count="1" /> Green Lantern (Time-limited) Sealed
|
||||
<item id="97247" count="7" /> Asofe Sealed
|
||||
<item id="97224" count="20" /> Mission Points
|
||||
</items>
|
||||
</reward>
|
||||
-->
|
||||
</list>
|
1106
L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/MissionLevel.xml
vendored
Normal file
1106
L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/MissionLevel.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
87
L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/xsd/MissionLevel.xsd
vendored
Normal file
87
L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/xsd/MissionLevel.xsd
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="list" type="listType" />
|
||||
<xs:complexType name="currentType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="season" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="expType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="level" use="optional" />
|
||||
<xs:attribute type="xs:string" name="amount" use="optional" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="expTableType">
|
||||
<xs:sequence>
|
||||
<xs:element type="expType" name="exp" maxOccurs="unbounded" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="baseRewardType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="level" use="optional" />
|
||||
<xs:attribute type="xs:string" name="itemId" use="optional" />
|
||||
<xs:attribute type="xs:string" name="itemCount" use="optional" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="baseRewardsType">
|
||||
<xs:sequence>
|
||||
<xs:element type="baseRewardType" name="baseReward" maxOccurs="unbounded" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="keyRewardType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="level" use="optional" />
|
||||
<xs:attribute type="xs:string" name="itemId" use="optional" />
|
||||
<xs:attribute type="xs:string" name="itemCount" use="optional" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="keyRewardsType">
|
||||
<xs:sequence>
|
||||
<xs:element type="keyRewardType" name="keyReward" maxOccurs="unbounded" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="specialRewardType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="itemId" use="optional" />
|
||||
<xs:attribute type="xs:string" name="itemCount" use="optional" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="bonusRewardType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute type="xs:string" name="itemId" use="optional" />
|
||||
<xs:attribute type="xs:string" name="itemCount" use="optional" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="missionLevelType">
|
||||
<xs:sequence>
|
||||
<xs:element type="expTableType" name="expTable" />
|
||||
<xs:element type="baseRewardsType" name="baseRewards" />
|
||||
<xs:element type="keyRewardsType" name="keyRewards" />
|
||||
<xs:element type="specialRewardType" name="specialReward" />
|
||||
<xs:element type="bonusRewardType" name="bonusReward" />
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:string" name="season" use="optional" />
|
||||
<xs:attribute type="xs:string" name="maxLevel" use="optional" />
|
||||
<xs:attribute type="xs:string" name="bonusRewardIsAvailable" use="optional" />
|
||||
<xs:attribute type="xs:string" name="bonusRewardByLevelUP" use="optional" />
|
||||
</xs:complexType>
|
||||
<xs:complexType name="listType">
|
||||
<xs:sequence>
|
||||
<xs:element type="currentType" name="current" />
|
||||
<xs:element type="missionLevelType" name="missionLevel" maxOccurs="unbounded" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
@ -88,6 +88,7 @@ import org.l2jmobius.gameserver.data.xml.LimitShopCraftData;
|
||||
import org.l2jmobius.gameserver.data.xml.LimitShopData;
|
||||
import org.l2jmobius.gameserver.data.xml.LuckyGameData;
|
||||
import org.l2jmobius.gameserver.data.xml.MagicLampData;
|
||||
import org.l2jmobius.gameserver.data.xml.MissionLevel;
|
||||
import org.l2jmobius.gameserver.data.xml.MultisellData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcNameLocalisationData;
|
||||
@ -265,6 +266,7 @@ public class GameServer
|
||||
SecondaryAuthData.getInstance();
|
||||
SayuneData.getInstance();
|
||||
ClanRewardData.getInstance();
|
||||
MissionLevel.getInstance();
|
||||
DailyMissionHandler.getInstance().executeScript();
|
||||
DailyMissionData.getInstance();
|
||||
ElementalSpiritData.getInstance();
|
||||
|
@ -29,6 +29,7 @@ import org.w3c.dom.Document;
|
||||
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.enums.ClassId;
|
||||
import org.l2jmobius.gameserver.handler.AbstractDailyMissionHandler;
|
||||
import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@ -68,6 +69,10 @@ public class DailyMissionData implements IXmlReader
|
||||
{
|
||||
final int itemId = parseInteger(itemNode.getAttributes(), "id");
|
||||
final int itemCount = parseInteger(itemNode.getAttributes(), "count");
|
||||
if ((itemId == AbstractDailyMissionHandler.MISSION_LEVEL_POINTS) && (MissionLevel.getInstance().getCurrentSeason() <= 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
items.add(new ItemHolder(itemId, itemCount));
|
||||
}));
|
||||
|
||||
|
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.data.xml;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.model.MissionLevelHolder;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class MissionLevel implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(MissionLevel.class.getName());
|
||||
|
||||
private final Map<Integer, MissionLevelHolder> _template = new HashMap<>();
|
||||
private int _currentSeason;
|
||||
|
||||
protected MissionLevel()
|
||||
{
|
||||
load();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
_template.clear();
|
||||
parseDatapackFile("data/MissionLevel.xml");
|
||||
if (_currentSeason > 0)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _template.size() + " seasons.");
|
||||
}
|
||||
else
|
||||
{
|
||||
_template.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseDocument(Document doc, File f)
|
||||
{
|
||||
forEach(doc, "list", listNode ->
|
||||
{
|
||||
forEach(listNode, "current", current -> _currentSeason = parseInteger(current.getAttributes(), "season"));
|
||||
forEach(listNode, "missionLevel", missionNode ->
|
||||
{
|
||||
final StatSet missionSet = new StatSet(parseAttributes(missionNode));
|
||||
final AtomicInteger season = new AtomicInteger(missionSet.getInt("season"));
|
||||
final AtomicInteger maxLevel = new AtomicInteger(missionSet.getInt("maxLevel"));
|
||||
final AtomicBoolean bonusRewardIsAvailable = new AtomicBoolean(missionSet.getBoolean("bonusRewardIsAvailable"));
|
||||
final AtomicBoolean bonusRewardByLevelUp = new AtomicBoolean(missionSet.getBoolean("bonusRewardByLevelUP"));
|
||||
final AtomicReference<Map<Integer, ItemHolder>> keyReward = new AtomicReference<>(new HashMap<>());
|
||||
final AtomicReference<Map<Integer, ItemHolder>> normalReward = new AtomicReference<>(new HashMap<>());
|
||||
final AtomicReference<Map<Integer, Integer>> xpForLevel = new AtomicReference<>(new HashMap<>());
|
||||
final AtomicReference<ItemHolder> specialReward = new AtomicReference<>();
|
||||
final AtomicReference<ItemHolder> bonusReward = new AtomicReference<>();
|
||||
forEach(missionNode, "expTable", expListNode -> forEach(expListNode, "exp", expNode ->
|
||||
{
|
||||
final StatSet expSet = new StatSet(parseAttributes(expNode));
|
||||
xpForLevel.get().put(expSet.getInt("level"), expSet.getInt("amount"));
|
||||
}));
|
||||
forEach(missionNode, "baseRewards", baseRewardsNode -> forEach(baseRewardsNode, "baseReward", rewards ->
|
||||
{
|
||||
final StatSet rewardsSet = new StatSet(parseAttributes(rewards));
|
||||
normalReward.get().put(rewardsSet.getInt("level"), new ItemHolder(rewardsSet.getInt("itemId"), rewardsSet.getLong("itemCount")));
|
||||
}));
|
||||
forEach(missionNode, "keyRewards", keyRewardsNode -> forEach(keyRewardsNode, "keyReward", rewards ->
|
||||
{
|
||||
final StatSet rewardsSet = new StatSet(parseAttributes(rewards));
|
||||
keyReward.get().put(rewardsSet.getInt("level"), new ItemHolder(rewardsSet.getInt("itemId"), rewardsSet.getLong("itemCount")));
|
||||
}));
|
||||
forEach(missionNode, "specialReward", specialRewardNode ->
|
||||
{
|
||||
final StatSet specialRewardSet = new StatSet(parseAttributes(specialRewardNode));
|
||||
specialReward.set(new ItemHolder(specialRewardSet.getInt("itemId"), specialRewardSet.getLong("itemCount")));
|
||||
});
|
||||
forEach(missionNode, "bonusReward", bonusRewardNode ->
|
||||
{
|
||||
final StatSet bonusRewardSet = new StatSet(parseAttributes(bonusRewardNode));
|
||||
bonusReward.set(new ItemHolder(bonusRewardSet.getInt("itemId"), bonusRewardSet.getLong("itemCount")));
|
||||
});
|
||||
int bonusLevel = normalReward.get().keySet().stream().max(Integer::compare).orElse(maxLevel.get());
|
||||
if (bonusLevel == maxLevel.get())
|
||||
{
|
||||
bonusLevel = bonusLevel - 1;
|
||||
}
|
||||
_template.put(season.get(), new MissionLevelHolder(maxLevel.get(), bonusLevel + 1, xpForLevel.get(), normalReward.get(), keyReward.get(), specialReward.get(), bonusReward.get(), bonusRewardByLevelUp.get(), bonusRewardIsAvailable.get()));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public int getCurrentSeason()
|
||||
{
|
||||
return _currentSeason;
|
||||
}
|
||||
|
||||
public MissionLevelHolder getMissionBySeason(int season)
|
||||
{
|
||||
return _template.getOrDefault(season, null);
|
||||
}
|
||||
|
||||
public static MissionLevel getInstance()
|
||||
{
|
||||
return MissionLevel.SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final MissionLevel INSTANCE = new MissionLevel();
|
||||
}
|
||||
}
|
@ -31,12 +31,18 @@ import org.l2jmobius.gameserver.model.DailyMissionDataHolder;
|
||||
import org.l2jmobius.gameserver.model.DailyMissionPlayerEntry;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.events.ListenersContainer;
|
||||
import org.l2jmobius.gameserver.model.holders.MissionLevelPlayerDataHolder;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
{
|
||||
public static final int MISSION_LEVEL_POINTS = 97224;
|
||||
private static final int CLAN_EXP = 94481;
|
||||
|
||||
protected Logger LOGGER = Logger.getLogger(getClass().getName());
|
||||
|
||||
private final Map<Integer, DailyMissionPlayerEntry> _entries = new ConcurrentHashMap<>();
|
||||
@ -118,7 +124,21 @@ public abstract class AbstractDailyMissionHandler extends ListenersContainer
|
||||
|
||||
protected void giveRewards(Player player)
|
||||
{
|
||||
_holder.getRewards().forEach(i -> player.addItem("One Day Reward", i, player, true));
|
||||
_holder.getRewards().stream().filter(i -> i.getId() != MISSION_LEVEL_POINTS).filter(i -> i.getId() != CLAN_EXP).forEach(i -> player.addItem("One Day Reward", i, player, true));
|
||||
if (_holder.getRewards().stream().anyMatch(i -> i.getId() == CLAN_EXP))
|
||||
{
|
||||
int points = (int) _holder.getRewards().stream().filter(i -> i.getId() == CLAN_EXP).iterator().next().getCount();
|
||||
player.getClan().addExp(player.getObjectId(), points);
|
||||
player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1_X_S2).addItemName(MISSION_LEVEL_POINTS).addLong(points));
|
||||
}
|
||||
if (_holder.getRewards().stream().anyMatch(i -> i.getId() == MISSION_LEVEL_POINTS))
|
||||
{
|
||||
final MissionLevelPlayerDataHolder info = player.getMissionLevelProgress();
|
||||
final int points = (int) _holder.getRewards().stream().filter(i -> i.getId() == MISSION_LEVEL_POINTS).iterator().next().getCount();
|
||||
info.calculateEXP(points);
|
||||
info.storeInfoInVariable(player);
|
||||
player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_OBTAINED_S1_X_S2).addItemName(MISSION_LEVEL_POINTS).addLong(points));
|
||||
}
|
||||
}
|
||||
|
||||
protected void storePlayerEntry(DailyMissionPlayerEntry entry)
|
||||
|
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class MissionLevelHolder
|
||||
{
|
||||
private int _maxLevel;
|
||||
private final int _bonusLevel;
|
||||
private final Map<Integer, Integer> _xpForLevel = new HashMap<>();
|
||||
private final Map<Integer, ItemHolder> _normalReward = new HashMap<>();
|
||||
private final Map<Integer, ItemHolder> _keyReward = new HashMap<>();
|
||||
private final ItemHolder _specialReward;
|
||||
private final ItemHolder _bonusReward;
|
||||
private final boolean _bonusRewardIsAvailable;
|
||||
private final boolean _bonusRewardByLevelUp;
|
||||
|
||||
public MissionLevelHolder(int maxLevel, int bonusLevel, Map<Integer, Integer> xpForLevel, Map<Integer, ItemHolder> normalReward, Map<Integer, ItemHolder> keyReward, ItemHolder specialReward, ItemHolder bonusReward, boolean bonusRewardByLevelUp, boolean bonusRewardIsAvailable)
|
||||
{
|
||||
_maxLevel = maxLevel;
|
||||
_bonusLevel = bonusLevel;
|
||||
_xpForLevel.putAll(xpForLevel);
|
||||
_normalReward.putAll(normalReward);
|
||||
_keyReward.putAll(keyReward);
|
||||
_specialReward = specialReward;
|
||||
_bonusReward = bonusReward;
|
||||
_bonusRewardByLevelUp = bonusRewardByLevelUp;
|
||||
_bonusRewardIsAvailable = bonusRewardIsAvailable;
|
||||
}
|
||||
|
||||
public int getMaxLevel()
|
||||
{
|
||||
return _maxLevel;
|
||||
}
|
||||
|
||||
public void setMaxLevel(int maxLevel)
|
||||
{
|
||||
_maxLevel = maxLevel;
|
||||
}
|
||||
|
||||
public int getBonusLevel()
|
||||
{
|
||||
return _bonusLevel;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getXPForLevel()
|
||||
{
|
||||
return _xpForLevel;
|
||||
}
|
||||
|
||||
public int getXPForSpecifiedLevel(int level)
|
||||
{
|
||||
return _xpForLevel.get(level == 0 ? level + 1 : level);
|
||||
}
|
||||
|
||||
public Map<Integer, ItemHolder> getNormalRewards()
|
||||
{
|
||||
return _normalReward;
|
||||
}
|
||||
|
||||
public Map<Integer, ItemHolder> getKeyRewards()
|
||||
{
|
||||
return _keyReward;
|
||||
}
|
||||
|
||||
public ItemHolder getSpecialReward()
|
||||
{
|
||||
return _specialReward;
|
||||
}
|
||||
|
||||
public ItemHolder getBonusReward()
|
||||
{
|
||||
return _bonusReward;
|
||||
}
|
||||
|
||||
public boolean getBonusRewardByLevelUp()
|
||||
{
|
||||
return _bonusRewardByLevelUp;
|
||||
}
|
||||
|
||||
public boolean getBonusRewardIsAvailable()
|
||||
{
|
||||
return _bonusRewardIsAvailable;
|
||||
}
|
||||
}
|
@ -76,6 +76,7 @@ import org.l2jmobius.gameserver.data.xml.ElementalSpiritData;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.data.xml.HennaData;
|
||||
import org.l2jmobius.gameserver.data.xml.HennaPatternPotentialData;
|
||||
import org.l2jmobius.gameserver.data.xml.MissionLevel;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcData;
|
||||
import org.l2jmobius.gameserver.data.xml.NpcNameLocalisationData;
|
||||
import org.l2jmobius.gameserver.data.xml.OptionData;
|
||||
@ -239,6 +240,7 @@ import org.l2jmobius.gameserver.model.holders.DamageTakenHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ElementalSpiritDataHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.MissionLevelPlayerDataHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.MovieHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.PetEvolveHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.PlayerCollectionData;
|
||||
@ -961,6 +963,8 @@ public class Player extends Playable
|
||||
|
||||
private int _clanDonationPoints = 3;
|
||||
|
||||
private MissionLevelPlayerDataHolder _missionLevelProgress = null;
|
||||
|
||||
private final List<QuestTimer> _questTimers = new ArrayList<>();
|
||||
private final List<TimerHolder<?>> _timerHolders = new ArrayList<>();
|
||||
|
||||
@ -15666,4 +15670,22 @@ public class Player extends Playable
|
||||
LOGGER.log(Level.SEVERE, "Could not restore clan donation points for playerId: " + getObjectId(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public MissionLevelPlayerDataHolder getMissionLevelProgress()
|
||||
{
|
||||
if (_missionLevelProgress == null)
|
||||
{
|
||||
final String variable = PlayerVariables.MISSION_LEVEL_PROGRESS + MissionLevel.getInstance().getCurrentSeason();
|
||||
if (getVariables().hasVariable(variable))
|
||||
{
|
||||
_missionLevelProgress = new MissionLevelPlayerDataHolder(variable);
|
||||
}
|
||||
else
|
||||
{
|
||||
_missionLevelProgress = new MissionLevelPlayerDataHolder();
|
||||
_missionLevelProgress.storeInfoInVariable(this);
|
||||
}
|
||||
}
|
||||
return _missionLevelProgress;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,256 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.model.holders;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.data.xml.MissionLevel;
|
||||
import org.l2jmobius.gameserver.model.MissionLevelHolder;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class MissionLevelPlayerDataHolder
|
||||
{
|
||||
private int _currentLevel = 0;
|
||||
private int _currentEXP = 0;
|
||||
private final List<Integer> _collectedNormalRewards = new ArrayList<>();
|
||||
private final List<Integer> _collectedKeyRewards = new ArrayList<>();
|
||||
private boolean _collectedSpecialReward = false;
|
||||
private boolean _collectedBonusReward = false;
|
||||
|
||||
/**
|
||||
* @implNote used only for missions where on bonus_reward_by_level_up;
|
||||
* @apiNote store levels of taken bonus reward. If last reward be on 20 on 20, 21, 22... you will be get bonus reward;
|
||||
*/
|
||||
private final List<Integer> _listOfCollectedBonusRewards = new ArrayList<>();
|
||||
|
||||
public MissionLevelPlayerDataHolder()
|
||||
{
|
||||
}
|
||||
|
||||
public MissionLevelPlayerDataHolder(String variable)
|
||||
{
|
||||
for (String data : variable.split(";"))
|
||||
{
|
||||
final List<String> values = new ArrayList<>(List.of(data.split(":")));
|
||||
final String key = values.get(0);
|
||||
values.remove(0);
|
||||
if (key.equals("CurrentLevel"))
|
||||
{
|
||||
_currentLevel = Integer.parseInt(values.get(0));
|
||||
continue;
|
||||
}
|
||||
if (key.equals("LevelXP"))
|
||||
{
|
||||
_currentEXP = Integer.parseInt(values.get(0));
|
||||
continue;
|
||||
}
|
||||
if (key.equals("SpecialReward"))
|
||||
{
|
||||
_collectedSpecialReward = Boolean.parseBoolean(values.get(0));
|
||||
continue;
|
||||
}
|
||||
if (key.equals("BonusReward"))
|
||||
{
|
||||
_collectedBonusReward = Boolean.parseBoolean(values.get(0));
|
||||
if (_collectedBonusReward && MissionLevel.getInstance().getMissionBySeason(MissionLevel.getInstance().getCurrentSeason()).getBonusRewardByLevelUp())
|
||||
{
|
||||
_collectedBonusReward = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
final List<Integer> valuesData = new ArrayList<>();
|
||||
final String[] missions = values.isEmpty() ? values.toArray(new String[0]) : values.get(0).split(",");
|
||||
for (String mission : missions)
|
||||
{
|
||||
valuesData.add(Integer.parseInt(mission));
|
||||
}
|
||||
if (key.equals("ListOfNormalRewards"))
|
||||
{
|
||||
_collectedNormalRewards.addAll(valuesData);
|
||||
continue;
|
||||
}
|
||||
if (key.equals("ListOfKeyRewards"))
|
||||
{
|
||||
_collectedKeyRewards.addAll(valuesData);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key.equals("ListOfBonusRewards"))
|
||||
{
|
||||
_listOfCollectedBonusRewards.addAll(valuesData);
|
||||
if (!_collectedBonusReward && !_listOfCollectedBonusRewards.isEmpty() && !MissionLevel.getInstance().getMissionBySeason(MissionLevel.getInstance().getCurrentSeason()).getBonusRewardByLevelUp())
|
||||
{
|
||||
_collectedBonusReward = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getVariablesFromInfo()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// CurrentLevel:5;LevelXP:10;ListOfBaseRewards:2,19,20;ListOfKeyRewards:;SpecialRewards:;BonusRewards:;ListOfBonusRewards:;
|
||||
sb.append("CurrentLevel").append(":").append(_currentLevel).append(";");
|
||||
sb.append("LevelXP").append(":").append(_currentEXP).append(";");
|
||||
sb.append("ListOfNormalRewards").append(":");
|
||||
sb.append(getStringFromList(_collectedNormalRewards));
|
||||
sb.append(";");
|
||||
sb.append("ListOfKeyRewards").append(":");
|
||||
sb.append(getStringFromList(_collectedKeyRewards));
|
||||
sb.append(";");
|
||||
sb.append("SpecialReward").append(":");
|
||||
sb.append(_collectedSpecialReward);
|
||||
sb.append(";");
|
||||
sb.append("BonusReward").append(":");
|
||||
sb.append(_collectedBonusReward);
|
||||
sb.append(";");
|
||||
sb.append("ListOfBonusRewards").append(":");
|
||||
sb.append(getStringFromList(_listOfCollectedBonusRewards));
|
||||
sb.append(";");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String getStringFromList(List<Integer> list)
|
||||
{
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
for (int value : list)
|
||||
{
|
||||
sb.append(value);
|
||||
if (list.lastIndexOf(value) == (list.size() - 1))
|
||||
{
|
||||
break;
|
||||
}
|
||||
sb.append(",");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void storeInfoInVariable(Player player)
|
||||
{
|
||||
player.getVariables().set(PlayerVariables.MISSION_LEVEL_PROGRESS + MissionLevel.getInstance().getCurrentSeason(), getVariablesFromInfo());
|
||||
}
|
||||
|
||||
public void calculateEXP(int exp)
|
||||
{
|
||||
final MissionLevelHolder holder = MissionLevel.getInstance().getMissionBySeason(MissionLevel.getInstance().getCurrentSeason());
|
||||
if (getCurrentLevel() >= holder.getMaxLevel())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int giveEXP = exp;
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
// char have 20 exp, for next level 25, you will give 10 exp = 25 - (20 + 10) = -5; 5 going to current EXP and char get level up ;)
|
||||
int takeEXP = holder.getXPForSpecifiedLevel(getCurrentLevel() + 1) - (getCurrentEXP() + giveEXP);
|
||||
if (takeEXP <= 0)
|
||||
{
|
||||
giveEXP = Math.abs(takeEXP);
|
||||
setCurrentLevel(getCurrentLevel() + 1);
|
||||
setCurrentEXP(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
setCurrentEXP(getCurrentEXP() + giveEXP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getCurrentLevel()
|
||||
{
|
||||
return _currentLevel;
|
||||
}
|
||||
|
||||
public void setCurrentLevel(int currentLevel)
|
||||
{
|
||||
_currentLevel = currentLevel;
|
||||
}
|
||||
|
||||
public int getCurrentEXP()
|
||||
{
|
||||
return _currentEXP;
|
||||
}
|
||||
|
||||
public void setCurrentEXP(int currentEXP)
|
||||
{
|
||||
_currentEXP = currentEXP;
|
||||
}
|
||||
|
||||
public List<Integer> getCollectedNormalRewards()
|
||||
{
|
||||
return _collectedNormalRewards;
|
||||
}
|
||||
|
||||
public void addToCollectedNormalRewards(int pos)
|
||||
{
|
||||
_collectedNormalRewards.add(pos);
|
||||
}
|
||||
|
||||
public List<Integer> getCollectedKeyRewards()
|
||||
{
|
||||
return _collectedKeyRewards;
|
||||
}
|
||||
|
||||
public void addToCollectedKeyReward(int pos)
|
||||
{
|
||||
_collectedKeyRewards.add(pos);
|
||||
}
|
||||
|
||||
public boolean getCollectedSpecialReward()
|
||||
{
|
||||
return _collectedSpecialReward;
|
||||
}
|
||||
|
||||
public void setCollectedSpecialReward(boolean collectedSpecialReward)
|
||||
{
|
||||
_collectedSpecialReward = collectedSpecialReward;
|
||||
}
|
||||
|
||||
public boolean getCollectedBonusReward()
|
||||
{
|
||||
return _collectedBonusReward;
|
||||
}
|
||||
|
||||
public void setCollectedBonusReward(boolean collectedBonusReward)
|
||||
{
|
||||
_collectedBonusReward = collectedBonusReward;
|
||||
}
|
||||
|
||||
public List<Integer> getListOfCollectedBonusRewards()
|
||||
{
|
||||
return _listOfCollectedBonusRewards;
|
||||
}
|
||||
|
||||
public void addToListOfCollectedBonusRewards(int pos)
|
||||
{
|
||||
_listOfCollectedBonusRewards.add(pos);
|
||||
}
|
||||
}
|
@ -90,6 +90,7 @@ public class PlayerVariables extends AbstractVariables
|
||||
public static final String DYE_POTENTIAL_DAILY_COUNT = "DYE_POTENTIAL_DAILY_COUNT";
|
||||
public static final String DYE_POTENTIAL_DAILY_EXP = "DYE_POTENTIAL_DAILY_EXP";
|
||||
public static final String DYE_POTENTIAL_DAILY_LVL = "DYE_POTENTIAL_DAILY_LVL";
|
||||
public static final String MISSION_LEVEL_PROGRESS = "MISSION_LEVEL_PROGRESS_";
|
||||
|
||||
private final int _objectId;
|
||||
|
||||
|
@ -70,6 +70,8 @@ import org.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchant
|
||||
import org.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantTry;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestMissionLevelReceiveReward;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestMissionRewardList;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestOneDayRewardReceive;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.dailymission.RequestTodoList;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.elementalspirits.ExElementalInitTalent;
|
||||
@ -771,8 +773,8 @@ public enum ExIncomingPackets implements IIncomingPackets<GameClient>
|
||||
EX_REQ_HOMUNCULUS_PROB_LIST(0x233, null, ConnectionState.IN_GAME),
|
||||
EX_WORLDCASTLEWAR_HOST_CASTLE_SIEGE_ALL_RANKING_INFO(0x234, null, ConnectionState.IN_GAME),
|
||||
EX_WORLDCASTLEWAR_CASTLE_SIEGE_ALL_RANKING_INFO(0x235, null, ConnectionState.IN_GAME),
|
||||
EX_MISSION_LEVEL_REWARD_LIST(0x236, null, ConnectionState.IN_GAME),
|
||||
EX_MISSION_LEVEL_RECEIVE_REWARD(0x237, null, ConnectionState.IN_GAME),
|
||||
EX_MISSION_LEVEL_REWARD_LIST(0x236, RequestMissionRewardList::new, ConnectionState.IN_GAME),
|
||||
EX_MISSION_LEVEL_RECEIVE_REWARD(0x237, RequestMissionLevelReceiveReward::new, ConnectionState.IN_GAME),
|
||||
EX_BALROGWAR_TELEPORT(0x238, null, ConnectionState.IN_GAME),
|
||||
EX_BALROGWAR_SHOW_UI(0x239, null, ConnectionState.IN_GAME),
|
||||
EX_BALROGWAR_SHOW_RANKING(0x23A, null, ConnectionState.IN_GAME),
|
||||
|
@ -628,6 +628,9 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
{
|
||||
player.sendPacket(new ExWorldChatCnt(player));
|
||||
}
|
||||
|
||||
// Initial mission level progress for correct show RewardList.
|
||||
player.getMissionLevelProgress();
|
||||
player.sendPacket(new ExConnectedTimeAndGettableReward(player));
|
||||
player.sendPacket(new ExOneDayReceiveRewardList(player, true));
|
||||
|
||||
|
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.clientpackets.dailymission;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.gameserver.data.xml.MissionLevel;
|
||||
import org.l2jmobius.gameserver.model.MissionLevelHolder;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import org.l2jmobius.gameserver.model.holders.MissionLevelPlayerDataHolder;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.dailymission.ExMissionLevelRewardList;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class RequestMissionLevelReceiveReward implements IClientIncomingPacket
|
||||
{
|
||||
private final MissionLevelHolder _holder = MissionLevel.getInstance().getMissionBySeason(MissionLevel.getInstance().getCurrentSeason());
|
||||
private int _level;
|
||||
private int _rewardType;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_level = packet.readD();
|
||||
_rewardType = packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final MissionLevelPlayerDataHolder info = player.getMissionLevelProgress();
|
||||
switch (_rewardType)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
if (!_holder.getNormalRewards().containsKey(_level) || info.getCollectedNormalRewards().contains(_level) || ((info.getCurrentLevel() != _level) && (info.getCurrentLevel() < _level)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemHolder reward = _holder.getNormalRewards().get(_level);
|
||||
player.addItem("Mission Level", reward.getId(), reward.getCount(), null, true);
|
||||
info.addToCollectedNormalRewards(_level);
|
||||
info.storeInfoInVariable(player);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (!_holder.getKeyRewards().containsKey(_level) || info.getCollectedKeyRewards().contains(_level) || ((info.getCurrentLevel() != _level) && (info.getCurrentLevel() < _level)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemHolder reward = _holder.getKeyRewards().get(_level);
|
||||
player.addItem("Mission Level", reward.getId(), reward.getCount(), null, true);
|
||||
info.addToCollectedKeyReward(_level);
|
||||
info.storeInfoInVariable(player);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if ((_holder.getSpecialReward() == null) || info.getCollectedSpecialReward() || ((info.getCurrentLevel() != _level) && (info.getCurrentLevel() < _level)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemHolder reward = _holder.getSpecialReward();
|
||||
player.addItem("Mission Level", reward.getId(), reward.getCount(), null, true);
|
||||
info.setCollectedSpecialReward(true);
|
||||
info.storeInfoInVariable(player);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
if (!_holder.getBonusRewardIsAvailable() || (_holder.getBonusReward() == null) || !info.getCollectedSpecialReward() || info.getCollectedBonusReward() || ((info.getCurrentLevel() != _level) && (info.getCurrentLevel() < _level)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_holder.getBonusRewardByLevelUp())
|
||||
{
|
||||
int maxNormalLevel = _holder.getBonusLevel();
|
||||
int availableReward = -1;
|
||||
for (int level = maxNormalLevel; level <= _holder.getMaxLevel(); level++)
|
||||
{
|
||||
if ((level <= info.getCurrentLevel()) && !info.getListOfCollectedBonusRewards().contains(level))
|
||||
{
|
||||
availableReward = level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (availableReward != -1)
|
||||
{
|
||||
info.addToListOfCollectedBonusRewards(availableReward);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
info.setCollectedBonusReward(true);
|
||||
}
|
||||
|
||||
final ItemHolder reward = _holder.getBonusReward();
|
||||
player.addItem("Mission Level", reward.getId(), reward.getCount(), null, true);
|
||||
info.storeInfoInVariable(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
player.sendPacket(new ExMissionLevelRewardList(player));
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 org.l2jmobius.gameserver.network.clientpackets.dailymission;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.dailymission.ExMissionLevelRewardList;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class RequestMissionRewardList implements IClientIncomingPacket
|
||||
{
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExMissionLevelRewardList(player));
|
||||
}
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
package org.l2jmobius.gameserver.network.serverpackets.dailymission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.data.xml.MissionLevel;
|
||||
import org.l2jmobius.gameserver.model.MissionLevelHolder;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.MissionLevelPlayerDataHolder;
|
||||
import org.l2jmobius.gameserver.network.OutgoingPackets;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
||||
|
||||
/**
|
||||
* @author Index
|
||||
*/
|
||||
public class ExMissionLevelRewardList implements IClientOutgoingPacket
|
||||
{
|
||||
private final String _currentSeason = String.valueOf(MissionLevel.getInstance().getCurrentSeason());
|
||||
private final MissionLevelHolder _holder = MissionLevel.getInstance().getMissionBySeason(MissionLevel.getInstance().getCurrentSeason());
|
||||
|
||||
private final Player _player;
|
||||
private final int _maxNormalLevel;
|
||||
|
||||
private List<Integer> _collectedNormalRewards;
|
||||
private List<Integer> _collectedKeyRewards;
|
||||
private List<Integer> _collectedBonusRewards;
|
||||
|
||||
public ExMissionLevelRewardList(Player player)
|
||||
{
|
||||
_player = player;
|
||||
// After normal rewards there will be bonus.
|
||||
_maxNormalLevel = _holder.getBonusLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean write(PacketWriter packet)
|
||||
{
|
||||
final MissionLevelPlayerDataHolder info = _player.getMissionLevelProgress();
|
||||
_collectedNormalRewards = info.getCollectedNormalRewards();
|
||||
_collectedKeyRewards = info.getCollectedKeyRewards();
|
||||
_collectedBonusRewards = info.getListOfCollectedBonusRewards();
|
||||
|
||||
OutgoingPackets.EX_MISSION_LEVEL_REWARD_LIST.writeId(packet);
|
||||
if (info.getCurrentLevel() == 0)
|
||||
{
|
||||
packet.writeD(1); // 0 -> does not work, -1 -> game crushed
|
||||
packet.writeD(3); // Type
|
||||
packet.writeD(-1); // Level
|
||||
packet.writeD(0); // State
|
||||
}
|
||||
else
|
||||
{
|
||||
sendAvailableRewardsList(packet, info);
|
||||
}
|
||||
packet.writeD(info.getCurrentLevel()); // Level
|
||||
packet.writeD(getPercent(info)); // PointPercent
|
||||
String year = _currentSeason.substring(0, 4);
|
||||
packet.writeD(Integer.parseInt(year)); // SeasonYear
|
||||
String month = _currentSeason.substring(4, 6);
|
||||
packet.writeD(Integer.parseInt(month)); // SeasonMonth
|
||||
packet.writeD(getAvailableRewards(info)); // TotalRewardsAvailable
|
||||
if (_holder.getBonusRewardIsAvailable() && _holder.getBonusRewardByLevelUp())
|
||||
{
|
||||
boolean check = false;
|
||||
for (int level = _maxNormalLevel; level <= _holder.getMaxLevel(); level++)
|
||||
{
|
||||
if ((level <= info.getCurrentLevel()) && !_collectedBonusRewards.contains(level))
|
||||
{
|
||||
check = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
packet.writeD(check ? 1 : 0); // ExtraRewardsAvailable
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_holder.getBonusRewardIsAvailable() && info.getCollectedSpecialReward() && !info.getCollectedBonusReward())
|
||||
{
|
||||
packet.writeD(1); // ExtraRewardsAvailable
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.writeD(0); // ExtraRewardsAvailable
|
||||
}
|
||||
}
|
||||
packet.writeD(0); // RemainSeasonTime / does not work? / not used?
|
||||
return true;
|
||||
}
|
||||
|
||||
private int getAvailableRewards(MissionLevelPlayerDataHolder info)
|
||||
{
|
||||
int availableRewards = 0;
|
||||
for (int level : _holder.getNormalRewards().keySet())
|
||||
{
|
||||
if ((level <= info.getCurrentLevel()) && !_collectedNormalRewards.contains(level))
|
||||
{
|
||||
availableRewards++;
|
||||
}
|
||||
}
|
||||
for (int level : _holder.getKeyRewards().keySet())
|
||||
{
|
||||
if ((level <= info.getCurrentLevel()) && !_collectedKeyRewards.contains(level))
|
||||
{
|
||||
availableRewards++;
|
||||
}
|
||||
}
|
||||
if (_holder.getBonusRewardIsAvailable() && _holder.getBonusRewardByLevelUp() && info.getCollectedSpecialReward())
|
||||
{
|
||||
final List<Integer> collectedBonusRewards = info.getListOfCollectedBonusRewards();
|
||||
for (int level = _maxNormalLevel; level <= _holder.getMaxLevel(); level++)
|
||||
{
|
||||
if ((level <= info.getCurrentLevel()) && !collectedBonusRewards.contains(level))
|
||||
{
|
||||
availableRewards++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_holder.getBonusRewardIsAvailable() && _holder.getBonusRewardByLevelUp() && (info.getCurrentLevel() >= _maxNormalLevel))
|
||||
{
|
||||
availableRewards++;
|
||||
}
|
||||
else if (_holder.getBonusRewardIsAvailable() && (info.getCurrentLevel() >= _holder.getMaxLevel()) && !info.getCollectedBonusReward() && info.getCollectedSpecialReward())
|
||||
{
|
||||
availableRewards++;
|
||||
}
|
||||
else if ((info.getCurrentLevel() >= _holder.getMaxLevel()) && !info.getCollectedBonusReward())
|
||||
{
|
||||
availableRewards++;
|
||||
}
|
||||
return availableRewards;
|
||||
}
|
||||
|
||||
private int getTotalRewards(MissionLevelPlayerDataHolder info)
|
||||
{
|
||||
int totalRewards = 0;
|
||||
for (int level : _holder.getNormalRewards().keySet())
|
||||
{
|
||||
if (level <= info.getCurrentLevel())
|
||||
{
|
||||
totalRewards++;
|
||||
}
|
||||
}
|
||||
for (int level : _holder.getKeyRewards().keySet())
|
||||
{
|
||||
if (level <= info.getCurrentLevel())
|
||||
{
|
||||
totalRewards++;
|
||||
}
|
||||
}
|
||||
if (_holder.getBonusRewardByLevelUp() && info.getCollectedSpecialReward() && _holder.getBonusRewardIsAvailable() && (_maxNormalLevel <= info.getCurrentLevel()))
|
||||
{
|
||||
for (int level = _maxNormalLevel; level <= _holder.getMaxLevel(); level++)
|
||||
{
|
||||
if (level <= info.getCurrentLevel())
|
||||
{
|
||||
totalRewards++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (info.getCollectedSpecialReward() && _holder.getBonusRewardIsAvailable() && (_maxNormalLevel <= info.getCurrentLevel()))
|
||||
{
|
||||
totalRewards++;
|
||||
}
|
||||
else if (_maxNormalLevel <= info.getCurrentLevel())
|
||||
{
|
||||
totalRewards++;
|
||||
}
|
||||
return totalRewards;
|
||||
}
|
||||
|
||||
private int getPercent(MissionLevelPlayerDataHolder info)
|
||||
{
|
||||
if (info.getCurrentLevel() >= _holder.getMaxLevel())
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
return (int) Math.floor(((double) info.getCurrentEXP() / (double) _holder.getXPForSpecifiedLevel(info.getCurrentLevel())) * 100.0);
|
||||
}
|
||||
|
||||
private void sendAvailableRewardsList(PacketWriter packet, MissionLevelPlayerDataHolder info)
|
||||
{
|
||||
packet.writeD(getTotalRewards(info)); // PkMissionLevelReward
|
||||
for (int level : _holder.getNormalRewards().keySet())
|
||||
{
|
||||
if (level <= info.getCurrentLevel())
|
||||
{
|
||||
packet.writeD(1); // Type
|
||||
packet.writeD(level); // Level
|
||||
packet.writeD(_collectedNormalRewards.contains(level) ? 2 : 1); // State
|
||||
}
|
||||
}
|
||||
for (int level : _holder.getKeyRewards().keySet())
|
||||
{
|
||||
if (level <= info.getCurrentLevel())
|
||||
{
|
||||
packet.writeD(2); // Type
|
||||
packet.writeD(level); // Level
|
||||
packet.writeD(_collectedKeyRewards.contains(level) ? 2 : 1); // State
|
||||
}
|
||||
}
|
||||
if (_holder.getBonusRewardByLevelUp() && info.getCollectedSpecialReward() && _holder.getBonusRewardIsAvailable() && (_maxNormalLevel <= info.getCurrentLevel()))
|
||||
{
|
||||
packet.writeD(3); // Type
|
||||
int sendLevel = 0;
|
||||
for (int level = _maxNormalLevel; level <= _holder.getMaxLevel(); level++)
|
||||
{
|
||||
if ((level <= info.getCurrentLevel()) && !_collectedBonusRewards.contains(level))
|
||||
{
|
||||
sendLevel = level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
packet.writeD(sendLevel == 0 ? _holder.getMaxLevel() : sendLevel); // Level
|
||||
packet.writeD(2); // State
|
||||
}
|
||||
else if (info.getCollectedSpecialReward() && _holder.getBonusRewardIsAvailable() && (_maxNormalLevel <= info.getCurrentLevel()))
|
||||
{
|
||||
packet.writeD(3); // Type
|
||||
packet.writeD(_holder.getMaxLevel()); // Level
|
||||
packet.writeD(2); // State
|
||||
}
|
||||
else if (_maxNormalLevel <= info.getCurrentLevel())
|
||||
{
|
||||
packet.writeD(3); // Type
|
||||
packet.writeD(_holder.getMaxLevel()); // Level
|
||||
packet.writeD(info.getCollectedSpecialReward() ? 0 : 1); // State
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user