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 PluginPlus feature has been purchased and Data\Plugin\Plugin.ini has PluginPlus = 1 (see PluginPlus).
  • Enabled="1" in Data\Plugin\ConsumeItem.xml.
  • The item must exist in Data\Item\ItemList.xml and in the client's item list. Two sample items, 19,200 "Consume Item 1" and 19,201 "Consume Item 2", are already provided.
[TO VERIFY: the GameServer does not check that the item exists in ItemList.xml when loading ConsumeItem.xml; the requirement "exists in ItemList / client" is taken from the guide at the top of the XML file]

How it works

  1. The player uses an item that is in the <Item> list.
  2. If (total points received + RewardPoints) > MaxRewardPoint: the item is not consumed and the player receives the limit message (Lang ConsumeItem ID 1).
  3. Otherwise: RewardPoints is 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>:

KeyValueDefaultMeaning
Enabled0 / 10 (when the attribute is missing)0 = system off, 1 = on.
MaxRewardPointinteger1000000 (when the attribute is missing; the sample file sets 1000)Maximum total points one character can receive from all items in this file.
UseSuccessMsg, UseFailMessagestring-Kept only for file compatibility; the GameServer does not read them. The real text comes from Lang.

Each child element <Item>:

KeyValueDefaultMeaning
Cat0 - 127-1 (row skipped)Item group. Outside the range 0-127 the row is skipped.
Index0 - 511-1 (row skipped)Item ordinal number within the group. Outside the range 0-511 the row is skipped.
RewardPointsinteger0Number of Level Up Points per use of 1 item.
Do not write <!-- --> 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:

IDContent (English version)When
0You received %d Level Up PointsSuccessful use, %d = number of points received.
1Max points exceeds upper limit %dLimit exceeded, %d = MaxRewardPoint.

Reload

After editing ConsumeItem.xml or Lang, press Reload plugin on the GameServer control panel.