This repository provides a method of updating or adding new events to tw-calc.net website (in the events section) for the community. If you spot any incorrect/outdated/missing information, or the whole event feel free to submit a pull request. Please follow the contribution guidelines.
All of the events on the https://tw-calc.net/event are defined in the events
directory of this repository.
To update the event on the website you need to update the respective file of that event in this repository.
We are happy you would like to contribute! Please read the instructions below to get familiar with the process. As soon as you get familiar with the process, fork the repository, make the desired and submit the pull request.
- Clone/Fork this repository
- Run
npm install
inside of the repository (you need to have Node installed, we use versionv10.x.x
)
To add a new event you need to create a new .json file inside the events
directory. The file name consists of the event year and event key and must match this pattern eventYear_eventKey
(eg. 2020_octoberfest
, 2019_xmas_sale
).
The eventKey
is usually name of the event in lowercase, where spaces are replaced with the underscores (_
) and special characters (eg. !,?-'"
) are removed.
The changes will be visible on the website after the new file change is merged to the master branch and the pipeline succeeds (the deploy stage must run).
Every event json file must comply with the event schema.json.
You can check if the files inside the event directory complies with the schema by running - npm run schema:lint
.
This check is also done in the lint
stage of the pipeline.
You can define the following properties to the event - key, year, name, items, sets, quests, tombola, from, to, beta_from, beta_to, forum_url, hidden, widget_config.
This is an example how the schema looks like. You can find more examples in the events directory.
{
"key": "valentine",
"items": [51890000, 51891000, 51892000],
"sets": ["valentine_2020_set_1", "valentine_2020_set_2", "valentine_2020_set_3", "valentine_2020_set_4"],
"from": "2020-02-13 10:00:00",
"to": "2020-03-04 23:59:59",
"year": 2020,
"quests": [216],
"tombola": 27,
"beta_from": "2020-02-03 00:00:00",
"beta_to": "2020-02-26 23:59:59"
}
This property is required. The key (in the combination with year) must be unique.
The key
is usually name of the event in lowercase, where spaces are replaced with the underscores (_
) and special characters (eg. !,?-'"
) are removed.
This property must be same as the eventKey
in the filename.
For the following recurring events always use these keys. Then the event will have a special background and text in its banner, also you don't need to provide its name property as it will be added automatically (the name will also be translated).
- Valentine's day -
valentine
- The Independence day -
independence
- Octoberfest -
octoberfest
- Easter -
easter
- Christmas Sale -
xmas_sale
- Day of the Dead -
dotd
This property is required. It denotes the year when the event started.
The name of the event, eg. Soccer Event, Spring Sale. This property is required if the event key is not one from the: valentine, independence, octoberfest, easter, xmas_sale, dotd.
The array of item ids which can be gained during this event from quests, tombola etc. or are introduced by this event. If you specify the set key/s in the sets property, the items of that set/s will be automatically included and you don't need to reference them in this property anymore.
You can obtain the item id on the item page or from its url - https://tw-calc.net/item/<item_id>
(eg. https://tw-calc.net/item/396000)
The array of set keys which can be gained during this event from quests, tombola etc. or are introduced by this event.
You can obtain the set key from the set url - https://tw-calc.net/sets/<set_key>
(eg. https://tw-calc.net/sets/set_dancer)
The array of quest ids which comes together with this event.
You can obtain the quest id from the quest url - https://tw-calc.net/quests/group/<quest_id>
(eg. https://tw-calc.net/quests/group/171)
The tombola id, if the event comes with the tombola.
You can obtain the tombola id from the tombola url - https://tw-calc.net/tombola/<tombola_id>_2020
(eg. https://tw-calc.net/tombola/29_2020)
These properties define the start and the end of the event on regular and the beta servers (you can obtain these dates from forum announcements).
The date must be in the following format - YYYY-MM-DD hh:mm:ss
. (eg. 2020-01-20 20:01:00
which is 20 Jan 2020 20:01:00)
All of these fields are optional, if they are unknown in the time of creating event, however they should be provided later.
The url to the forum announcement of this event. Refer to the english forums and prefer beta.
To update an event you need to change the respective file in the events
directory (according to the event schema).
If you would like to delete some event, you need to remove its file from the repository. The changes will be visible on the website after your change is merged to the master branch.