Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Item Rewards to Events #138

Open
DeveloperPaul123 opened this issue Feb 4, 2020 · 4 comments
Open

Add Item Rewards to Events #138

DeveloperPaul123 opened this issue Feb 4, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@DeveloperPaul123
Copy link

I think it would be interesting to add a way to include item drops to events in the API. I'm not sure about the implementation details since the information is scraped, but special rewards could certainly be added via the contribution site.

This would make it easier to filter which events give special rewards which can then be linked to what those special items are used to craft.

@LartTyler
Copy link
Owner

It would probably require a refactoring of how event data is stored. Since it's scraped, there's no persistent data between events. Each time range is its own object in the database, and none of the information is shared. Which means that even if it was possible to add extra information via the contrib site, it would be thrown away when the event cycle ends and would need to be re-added the next time the event came around.

What I could do is separate it into two parts: the event data and an event schedule. Each item in the schedule could relate to an event object, meaning that any manually added event data could be re-used next time the event rolls around.

So basically:

Endpoints: /events, /events/<id>
Persistent event information, such as rewards, rank, success conditions, etc.

{
	"id": 1,
	"name": "50 Shades of White",
	"location": 10,
	"zennyReward": 25200,
	"rewards": [
		{
			"id": 1196,
			"name": "Fest Ticket",
			"...": "..."
		}
	],
	"monsters": [
		{
			"id": 59,
			"name": "Barioth",
			"...": "..."
		}
	],
	"exclusive": null,
	"questRank": 3,
	"masterRank": true,
	"timeLimit": 50,
        "...": "..."
}

Endpoints: /events/schedule, /events/schedule/<id>
Current event schedule, as scraped from the official event pages. These endpoints would essentially be what's currently at /events, but relates to the persistent event objects, instead of storing their own data.

[
	{
		"id": 174,
		"event": {
			"id": 1,
			"name": "50 Shades of White",
			"location": 10,
			"zennyReward": 25200,
			"rewards": [
				{
					"id": 1196,
					"name": "Fest Ticket",
					"...": "..."
				}
			],
			"...": "..."
		},
		"platform": "pc",
		"startTimestamp": "2020-01-17T00:00:00+0000",
		"endTimestamp": "2020-02-20T23:59:00+0000"
	}
]

@LartTyler LartTyler added the enhancement New feature or request label Feb 4, 2020
@DeveloperPaul123
Copy link
Author

That seems like a good approach to me!

@DeveloperPaul123
Copy link
Author

Actually, thinking through it a bit more, it might be better to add a quests endpoint and add the event quests there and give then an event type of quest.

Here is a starter data set for MHW quests. This can also serve as a way to address other issues that have be filed regarding "item data fluff".

@LartTyler
Copy link
Owner

I think I like that idea a lot more. I had planned on adding quests in the future anyway, and merging the two together would prevent a bunch of duplicate code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants