Overview
The player right-clicks a flag in the inventory to wear it on the back (click again to remove it). The worn flag appears on the character's back and is also visible to people nearby. Only one flag can be worn at a time, and while a flag is worn it adds an experience percentage bonus according to the configuration. The text on the flag tooltip is sent by the server from Lang, so there is no need to edit the client's tooltip files.
Operating conditions
- This system is not tied to any key in
[Plugin]ofData\Plugin\Plugin.iniand does not need to be purchased separately. It only needsEnable="1"inFlagItemOption.xml. The GameServer code (FlagItem) does not checkPluginCfg. - The client needs a new
Main.dll(handles the right-click to wear the flag, displays the flag on the back, and the tooltip). - A custom flag must be in group 20,
KindA = 22,KindB = 82(character class flag) or83(national flag). Adding a new flag requires editing both the client (Item.bmd,ItemToolTip.bmd,ItemToolTipText.bmd) and the server (Data\Item\ItemList.xml,Data\Plugin\FlagItemOption.xml).
Configuration file
Data\Plugin\FlagItemOption.xml
Root tag FlagItemOption
| Key | Value | Default | Meaning |
|---|---|---|---|
Enable | 0 / 1 | 0 (when the attribute is not written) | 1 = allow wearing flags on the back and adding experience; 0 = off (flags are just ordinary items). |
Flag tag
| Key | Value | Default | Meaning |
|---|---|---|---|
Cat | 0..127 | -1 (row skipped) | Item group of the flag (ItemList.xml). Outside the range the row is skipped. |
Index | 0..511 | -1 (row skipped) | Ordinal number of the flag within the group. Outside the range the row is skipped. |
ExpBonus | real number (%) | 0 | Extra experience in percent while worn, added to the final experience rate. 2.0 = +2%. When calculated, the value is rounded to the nearest integer (for example 35.0 = +35%). |
<!-- -->) inside the <Flag> tags.Configuration example
<FlagItemOption Enable="1">
<Flag Cat="20" Index="0" ExpBonus="35.0" />
<Flag Cat="20" Index="1" ExpBonus="35.0" />
<Flag Cat="20" Index="2" ExpBonus="35.0" />
...
<Flag Cat="20" Index="38" ExpBonus="35.0" />
</FlagItemOption>
The real file declares 39 flags (group 20, indexes 0 to 38), each giving +35% experience.
Detailed behavior
- A worn flag has durability 254 in the inventory; a flag that is not worn has 255. Wearing a new flag automatically removes the old one.
- Every second the server checks again: wearing, removing, selling, storing in the warehouse or dropping a flag is reported to the people nearby.
- On entering the game and on reload, the server sends the client the tooltip text and the EXP % of each flag.
- A worn flag is not taken away when using the Fashion function to change items. Wearing a flag also affects entering Chaos Castle. [TO VERIFY: the specific condition at about line 1631 of ChaosCastle.cpp has not been read in detail]
Messages (Lang)
The <FlagItem> section in Data\Lang\*.xml:
| ID | Content (English.xml) | Used in |
|---|---|---|
| 0 | Experience +%d%% | Experience bonus line on the tooltip (%d = percent) |
| 1 | In use | Tooltip while worn |
| 2 | Right click to wear on the back | Tooltip while not worn |
| 3 | Flag Effect (+%d%%) | Line in the Gained EXP window |
Reload
After editing FlagItemOption.xml or Lang, press the Reload plugin button on the GameServer control panel: the server reloads the file and resends the tooltips to players who are online. There is no need to restart the GameServer.