tibia

Displaying NPCs and Item trades has always been a challenge on TibiaWiki. This has already been the target of two big projects in the past (TibiaWiki:Item Trade Project and TibiaWiki:NPC Trade Project). However, over the years this system also started to present some issues, at the same time better and more modern resources have become available.

Current Problems

The following are the main reasons to change the current system:

Failing to update any of these pages will result in incomplete data or errors on the Trades tables.

New System

The proposed system takes advatange of the ability to use Lua modules in MediaWiki through the extension Scribunto. Scribunto's manual can be found in the Dev Wiki.

This system will work based on the following pages:

Data

In order to make the process faster, but also to avoid repeating existing mistakes, the initial Data in the Module was created based on the Client's Appearances.dat file. This initial data had all the trade information that can be seen in game in the Cyclopedia which are items traded via the NPC trade window. After that, the Data has been manually edited to include other information, such as:

Output

To get trade table of a given Item or NPC, all that is required is to use the template with the corresponding name:

{{Selling|Benjamin}}

Sells

ItemPrice
LabelLabel1 Gold
LetterLetter8 Gold
ParcelParcel15 Gold

Differences

The output of the new system was created to be almost identical to the old system, with some differences:

Progress

The following are the proposed steps for the final migration and their status

Step Status Comment
Generate the Data Missing information on the original data has been added and it has been matched against current data to look for mistakes.
Generate Lua code The code has functions that will output trade tables for NPCs and Items, add notes and take into account special cases.
Update Infoboxes Infoboxes have been migrated.
Remove old data Once the Infoboxes are updated and after some period of testing, the old data can be removed by a Bot. Parameters to be removed are:
  • Infobox NPC: buys and sells
  • Infobox Object: buyfrom and sellto