Travelling Merchant's Shop/Details

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search

The merchant has three changing slots, plus the one unchanging slot containing the green uncharted island map. The three slots are named slot A, B, and C in this page.

Cycle start time[edit | edit source]

The cycle start time for this page is defined as 11 March 2018, primarily due to non-understanding of the merchant in first week following release, giving unreliable data (the merchant was released on 5 March). This is 435 days ago.

Slot A and B[edit | edit source]

Slot A and B both follow a simple, regular pattern of items that loop every 120 days. The same 18 items are available for these slots.

The order of items is as follows. Today (20 May 2019 UTC) we are on number 76 (wrong?).

Slot C[edit | edit source]

Slot C is more involved than A and B. Slot C has 13 items sold in it and rotates every 40 days. However, in each 40-day cycle only 12 of the items are available - one of the items simply won't appear at all for those 40 days. At the end of the cycle the 12 items rotate and the cycle begins again.

The 40-day cycle is always the same order of items. If the 12 items present are given an identifier from 1 to 12, the order is:

Item order (IDs)
DayItem order ID DayItem order ID
11214
21224
32231
41244
53256
642610
73274
812811
95297
106302
116315
126325
135339
1473412
158352
165369
177374
1893812
191394
2024012

The initial cycle had the items assigned to the IDs in this order:

Item initial order
Item order IDItem map IDItem map name
11Dragonkin lamp
28Taijitu
33Deathtouched dart
47Crystal triskelion
54Menaphite gift offering (large)
611Dungeoneering Wildcard
710Unfocused reward enhancer
813D&D token (monthly)
912Harmonic dust
102D&D token (weekly)
119Message in a bottle (Deep Sea Fishing)
125Starved ancient effigy
136Large goebie burial charm

At the end of the 40-day cycle, the 12 IDs move to the next item in the following list, cycling back to the start from the end if necessary.

Item map
Item map IDItem
1Dragonkin lamp
2D&D token (weekly)
3Deathtouched dart
4Menaphite gift offering (large)
5Starved ancient effigy
6Large goebie burial charm
7Crystal triskelion
8Taijitu
9Message in a bottle (Deep Sea Fishing)
10Unfocused reward enhancer
11Dungeoneering Wildcard
12Harmonic dust
13D&D token (monthly)
Example

The first cycle begins with item order IDs 1,1,2,1,3 which correspond to item map IDs 1,1,8,1,3 which are dragonkin lamp, D&D weekly, and deathtouch dart. 40 days later the items rotate to the next in the item map list, so now the order IDs at the beginning of the cycle (1,1,2,1,3) now correspond to map IDs 2,2,9,2,4 which are D&D weekly, message in a bottle, and large gift offering.

Currently

Today (20 May 2019 UTC) we are position 36 of cycle 10 (where 0 is the initial cycle on 11 March 2018) (wrong?).

This means that the items in the initial order (second table) are moved down by 10 positions in the item mapping (third table). For example, item order ID 4 is initially item map ID 7 (trisk); in the current cycle it has moved to item map id 4 (large offering).

The current mapping of order IDs to items is:

Item current order
Item order IDItem map IDItem map name
111Dungeoneering Wildcard
25Starved ancient effigy
313D&D token (monthly)
44Menaphite gift offering (large)
51Dragonkin lamp
68Taijitu
77Crystal triskelion
810Unfocused reward enhancer
99Message in a bottle (Deep Sea Fishing)
1012Harmonic dust
116Large goebie burial charm
122D&D token (weekly)
133Deathtouched dart

Programatically[edit | edit source]

In the following pseudocode, the variables used are:

  • rotation_order: the 40-day cycle (first table as a list of ids)
  • inital_ids: the initial state of the IDs (second table, as an id to id mapping)
  • items: the item order after each 40-day cycle (third table as an id to string mapping)
// number of 40-day periods elapsed since 11 March 2018
rotation_40 = floor((UNIXTIME.now() - UNIXTIME.at(00:00 11 March 2018 UTC)) / (60 * 60 * 24 * 40))

// number of days elapsed since start of this 40-day cycle
rotation_daily = floor((UNIXTIME.now() - UNIXTIME.at(00:00 11 March 2018 UTC)) / (60 * 60 * 24)) % 40

// the ID of the current item
current_item_id = rotation_order[rotation_daily]

// map the current item id to the item order id
mapped_id = inital_ids[current_item_id]

// move the mapped id according to current rotation
// 13 = total number of items in item_cycle
output_item_id = (mapped_id + rotation_40 % 13) + 1

// return the name of the item
return item_cycle[output_item_id]

Wiki implementation[edit | edit source]

For the wiki's implementation of this, see Module:Rotations/Merchant. For the original derivation see Talk:Travelling Merchant's Shop and Module talk:Rotations/Merchant.