Skip to content
black-sliver edited this page Oct 29, 2021 · 4 revisions

New randomization (v40)

Drops are defined as type,index. Generated (script) code (call to a function that sets up variables) sets what type,index would normally reward.
Type is one of alchemy, boss, gourd. Index is an arbitrary number e.g. CHECK_GOURD,0 is the Gourd #0, CHECK_ALCHEMY,0 is Acid Rain.

Gourds (chest drops)

gourds.csv lists all chests, pots and gourds. From this file, patches are generated for each vanilla gourds to

  1. replace the original drop (adding a CALL to set the drop, see gourd_data[])
  2. set up variables as if it was the original drop (at an arbitrary address, see gourd_drops_data[])

If a chest is looted, the chest's patched code path (1) is run, from which it jumps to any other patched-in setup function (2). After setting up the values, the regular "loot gourd" function can be called.

Alchemists

Starting with v040 spells are regular items 0x1000…0x1022. They are added in patches/gourdomizer_drops.txt.
All alchemy flags are replaced by new alchemy location flags (based on alchemy_locations[] in data.h), see RAM Layout.
All alchemists are rewritten to jump to a function that rewards the drop in patches/alchemy_rando_drops.txt.
Alchemy drops are two parts: 1. jump to a function that sets up variables (compatible to gourds), 2. call a "loot alchemy" function.

Boss drops

TBD

NPC drops

TBD

Remote items

Sending

Sending remote items will reward item id 0x01ff ("Sent an Item") locally. The client has to read location flags to send the location to the server.

Receiving

Receiving an item from PC works by setting up amount and id, and then scheduling a script by writing a single "lock" byte. See Memory Layout for details.

Clone this wiki locally