Lets you create fruit-style jewels / items: when the player uses one (right-click), they receive extra Level Up Points (unassigned points). The total points a character receives from this system is limited by MaxRewardPoint.
Requirements
- The
PluginPlusfeature has been purchased andData\Plugin\Plugin.inihasPluginPlus = 1(see PluginPlus). Enabled="1"inData\Plugin\ConsumeItem.xml.- The item must exist in
Data\Item\ItemList.xmland in the client's item list. Two sample items, 19,200 "Consume Item 1" and 19,201 "Consume Item 2", are already provided.
How it works
- The player uses an item that is in the
<Item>list. - If
(total points received + RewardPoints) > MaxRewardPoint: the item is not consumed and the player receives the limit message (LangConsumeItemID 1). - Otherwise:
RewardPointsis added to the unassigned points, the total points received is saved, the stats are resent, success is reported (Lang ID 0) and 1 item is deducted.
The total points received is stored per character in the database table chr_consume_item (columns Guid, Points). The Lua function Player.GetConsumePoint(aIndex) returns this total, so a stat reset script can refund the points that were used.
Configuration
File: Data\Plugin\ConsumeItem.xml. Root element <ConsumeItemSystem>:
| Key | Value | Default | Meaning |
|---|---|---|---|
Enabled | 0 / 1 | 0 (when the attribute is missing) | 0 = system off, 1 = on. |
MaxRewardPoint | integer | 1000000 (when the attribute is missing; the sample file sets 1000) | Maximum total points one character can receive from all items in this file. |
UseSuccessMsg, UseFailMessage | string | - | Kept only for file compatibility; the GameServer does not read them. The real text comes from Lang. |
Each child element <Item>:
| Key | Value | Default | Meaning |
|---|---|---|---|
Cat | 0 - 127 | -1 (row skipped) | Item group. Outside the range 0-127 the row is skipped. |
Index | 0 - 511 | -1 (row skipped) | Item ordinal number within the group. Outside the range 0-511 the row is skipped. |
RewardPoints | integer | 0 | Number of Level Up Points per use of 1 item. |
<!-- --> comments inside XML tags (keep it exactly as in the warning line in the file).Example
<ConsumeItemSystem Enabled="1" MaxRewardPoint="1000" UseSuccessMsg="You received %d Level Up Points" UseFailMessage="Max points exceeds upper limit %d">
<Item Cat="19" Index="200" RewardPoints="40" />
<Item Cat="19" Index="201" RewardPoints="59" />
</ConsumeItemSystem>
Messages (Lang)
The <ConsumeItem> section in the Data\Lang files:
| ID | Content (English version) | When |
|---|---|---|
| 0 | You received %d Level Up Points | Successful use, %d = number of points received. |
| 1 | Max points exceeds upper limit %d | Limit exceeded, %d = MaxRewardPoint. |
Reload
After editing ConsumeItem.xml or Lang, press Reload plugin on the GameServer control panel.