From 499d20fdb35f1f76a1de08b466610b5d38fd78a4 Mon Sep 17 00:00:00 2001 From: Fiereu Date: Mon, 10 Aug 2026 14:52:44 +0200 Subject: [PATCH] feat(game): open the mart shop and key items by the ids the client reads (#151) --- .gitmodules | 3 - README.md | 8 +- codegen/build.gradle.kts | 15 +- codegen/src/generator/jte/item/Items.jte | 12 +- .../src/generator/jte/item/ItemsRegistry.jte | 25 + .../openmmo/codegen/item/ItemDataParser.kt | 68 + .../fiereu/openmmo/codegen/item/ItemParser.kt | 30 - .../openmmo/codegen/item/ItemsRenderer.kt | 4 + .../de/fiereu/openmmo/codegen/item/Main.kt | 14 +- .../openmmo/codegen/item/ParsedModel.kt | 9 +- .../fiereu/openmmo/codegen/item/RenderUtil.kt | 14 + .../kotlin/de/fiereu/openmmo/items/ItemDef.kt | 6 + .../de/fiereu/openmmo/items/ItemRegistry.kt | 42 + .../codegen/item/ItemDataParserTest.kt | 72 + .../openmmo/codegen/item/ItemParserTest.kt | 41 - .../fiereu/openmmo/items/ItemRegistryTest.kt | 78 + decomp/pokeblack | 1 - decomp/pokeblack/item_names.json | 629 ++ decomp/pokeblack/items.json | 6272 +++++++++++++++++ .../content/docs/guides/porting-scripts.md | 18 +- .../content/docs/guides/writing-generators.md | 18 +- .../fiereu/openmmo/net/game/GameProtocol.kt | 2 +- .../game/packets/EventOverlayStatePacket.kt | 134 - .../net/game/packets/ShopCatalogPacket.kt | 59 + .../openmmo/net/game/ShopCatalogPacketTest.kt | 46 + .../fixtures/game/c2s/23/buy_poke_balls.bin | Bin 0 -> 5 bytes .../fixtures/game/s2c/23/mart_catalog.bin | Bin 0 -> 67 bytes .../fixtures/game/s2c/23/shop_closed.bin | 1 + .../server/game/handler/GameAppHandler.kt | 6 + .../server/game/script/ScriptContext.kt | 16 +- .../server/game/script/ScriptRunner.kt | 3 + .../generated/hoenn/RustboroCity_Gym.kt | 4 +- .../kanto/PalletTown_ProfessorOaksLab.kt | 2 +- .../script/generated/kanto/ViridianCity.kt | 6 +- .../generated/kanto/ViridianCity_Mart.kt | 7 +- .../server/game/services/BattleService.kt | 8 +- .../server/game/services/ShopService.kt | 143 + .../game/services/StoryPlayerService.kt | 32 +- .../game/services/command/KantoCheckpoints.kt | 2 +- .../game/services/command/StoryCheckpoint.kt | 3 +- .../game/services/command/StoryCommand.kt | 4 +- .../server/game/session/SessionAttributes.kt | 15 + .../server/game/services/BattleServiceTest.kt | 18 + .../server/game/services/ShopServiceTest.kt | 230 + .../game/services/command/StoryResetTest.kt | 5 + .../server/game/testsupport/Services.kt | 7 +- 46 files changed, 7863 insertions(+), 269 deletions(-) create mode 100644 codegen/src/generator/jte/item/ItemsRegistry.jte create mode 100644 codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParser.kt delete mode 100644 codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemParser.kt create mode 100644 codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/RenderUtil.kt create mode 100644 codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemDef.kt create mode 100644 codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemRegistry.kt create mode 100644 codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParserTest.kt delete mode 100644 codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemParserTest.kt create mode 100644 codegen/src/test/kotlin/de/fiereu/openmmo/items/ItemRegistryTest.kt delete mode 160000 decomp/pokeblack create mode 100644 decomp/pokeblack/item_names.json create mode 100644 decomp/pokeblack/items.json delete mode 100644 protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/EventOverlayStatePacket.kt create mode 100644 protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/ShopCatalogPacket.kt create mode 100644 protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/ShopCatalogPacketTest.kt create mode 100644 protocols.game/src/test/resources/fixtures/game/c2s/23/buy_poke_balls.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/23/mart_catalog.bin create mode 100644 protocols.game/src/test/resources/fixtures/game/s2c/23/shop_closed.bin create mode 100644 server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/ShopService.kt create mode 100644 server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/ShopServiceTest.kt diff --git a/.gitmodules b/.gitmodules index cdfdd11..243f652 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "decomp/pokefirered"] path = decomp/pokefirered url = https://github.com/pret/pokefirered.git -[submodule "decomp/pokeblack"] - path = decomp/pokeblack - url = https://github.com/pokemodding/pokeblack.git [submodule "decomp/pokeheartgold"] path = decomp/pokeheartgold url = https://github.com/pret/pokeheartgold.git diff --git a/README.md b/README.md index 3ef715b..67beb51 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The goal is it to provide a free and open-source alternative to the PokeMMO serv ## Building -The map data is generated at build time from the [pret](https://github.com/pret) +Game data is generated at build time from the [pret](https://github.com/pret) decompilation projects, which are vendored as git submodules under `decomp/`. Clone the repository with its submodules: @@ -30,8 +30,10 @@ git clone --recurse-submodules git submodule update --init --recursive ``` -Without the submodules the `:maps` build fails, because the generator has no -decomp data to read. +Without the submodules the `:codegen` build fails, because the generators have no +decomp data to read. The one exception is `decomp/pokeblack`, which holds the +item data as committed files rather than a submodule, because its source +repository is private. ### ROMs diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index d56f35d..24a5db2 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -13,6 +13,7 @@ dependencies { "generatorImplementation"(libs.jte) "generatorImplementation"(libs.kotlinx.serialization.json) testImplementation(sourceSets["generator"].output) + testImplementation(libs.kotlinx.serialization.json) testImplementation(libs.bundles.kotest) } @@ -28,6 +29,11 @@ val regionSources = // is the canonical pick, same as byRegion is for maps. val sourceDecompDir = rootProject.layout.projectDirectory.dir("decomp/pokeemerald") +// The Gen 5 table the live client speaks, not the GBA decomps, which number the same items +// differently. Committed rather than a submodule because openmmo-org/pokeblack is private, taken +// from its src/data/items.json and container 54 of its src/data/text1.json. +val itemDataDir = rootProject.layout.projectDirectory.dir("decomp/pokeblack") + // ROMs (gitignored) that dialog codegen reads offsets from val romsDir = rootProject.layout.projectDirectory.dir("roms") @@ -41,15 +47,10 @@ jteCodegen { "$region|${rootProject.layout.projectDirectory.dir("decomp/$decomp").asFile.absolutePath}" }) } - // Item ids scripts hand to giveItem. Both GBA games number items the same, so one decomp is - // enough, like moves and species. The client holds one item table per region, so the region - // decides what a number means. Checked against a real client: region 0 reads 3, 4 and 13 as - // Great Ball, Poke Ball and Potion, matching the decomp, while region 1 and region 5 read the - // same numbers as unrelated items. register("item") { mainClass.set("de.fiereu.openmmo.codegen.item.Main") - inputDirs.from(sourceDecompDir) - extraArgs.set(listOf("kanto|${sourceDecompDir.asFile.absolutePath}")) + inputDirs.from(itemDataDir) + extraArgs.set(listOf(itemDataDir.asFile.absolutePath)) } register("moves") { mainClass.set("de.fiereu.openmmo.codegen.move.Main") diff --git a/codegen/src/generator/jte/item/Items.jte b/codegen/src/generator/jte/item/Items.jte index d3a2740..54462cf 100644 --- a/codegen/src/generator/jte/item/Items.jte +++ b/codegen/src/generator/jte/item/Items.jte @@ -1,15 +1,17 @@ @import java.util.List @import de.fiereu.openmmo.codegen.item.ParsedItem +@import de.fiereu.openmmo.codegen.item.RenderUtil @param List items package de.fiereu.openmmo.items.generated -/** - * Item ids the client uses, already carrying the region prefix of the decomp they were read from. - * Generated from the GBA decomp item header, do not edit by hand. - */ +import de.fiereu.openmmo.items.ItemDef + +/** Generated, do not edit by hand. The KDoc on an entry is the wire ids it answers to. */ object Items { @for(ParsedItem item : items) - const val ${item.getName()} = ${item.getId()} +${RenderUtil.INSTANCE.declaration(item)} @endfor + + private fun item(name: String, price: Int) = ItemDef(name, price) } diff --git a/codegen/src/generator/jte/item/ItemsRegistry.jte b/codegen/src/generator/jte/item/ItemsRegistry.jte new file mode 100644 index 0000000..7438896 --- /dev/null +++ b/codegen/src/generator/jte/item/ItemsRegistry.jte @@ -0,0 +1,25 @@ +@import java.util.List +@import de.fiereu.openmmo.codegen.item.ParsedItem +@import de.fiereu.openmmo.codegen.item.RenderUtil + +@param List> chunks +package de.fiereu.openmmo.items.generated + +import de.fiereu.openmmo.items.ItemRegistry + +internal object GeneratedItems { + fun loadInto(reg: ItemRegistry) { +@for(int i = 0; i < chunks.size(); i++) + registerChunk${i}(reg) +@endfor + } + +@for(int c = 0; c < chunks.size(); c++) + private fun registerChunk${c}(reg: ItemRegistry) { +@for(ParsedItem item : chunks.get(c)) + ${RenderUtil.INSTANCE.register(item)} +@endfor + } + +@endfor +} diff --git a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParser.kt b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParser.kt new file mode 100644 index 0000000..43d8e7a --- /dev/null +++ b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParser.kt @@ -0,0 +1,68 @@ +package de.fiereu.openmmo.codegen.item + +import java.io.File +import java.text.Normalizer +import java.util.Locale +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.int +import kotlinx.serialization.json.jsonArray +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive + +// A wire id is regionId * 1000 + index, and the client answers in the region 5 table. +private const val ITEM_REGION_BLOCK = 5000 + +private val PLACEHOLDER_NAMES = setOf("None", "?????", "???", "-", "?", "") + +/** A name's position in `item_names.json` is the index `items.json` keys by. */ +class ItemDataParser(private val dataDir: File) { + + private val json = Json { ignoreUnknownKeys = true } + + fun parseAll(): List { + val itemsFile = File(dataDir, "items.json") + val namesFile = File(dataDir, "item_names.json") + require(itemsFile.exists() && namesFile.exists()) { + "Item data not found at $dataDir (missing ${itemsFile.name} or ${namesFile.name})" + } + + val names = + json.parseToJsonElement(namesFile.readText()).jsonArray.map { it.jsonPrimitive.content } + val prices = + json.parseToJsonElement(itemsFile.readText()).jsonArray.associate { entry -> + val obj = entry.jsonObject + obj.getValue("index").jsonPrimitive.int to obj.getValue("price").jsonPrimitive.int + } + + return names + .withIndex() + .filterNot { (index, name) -> index == 0 || name.trim() in PLACEHOLDER_NAMES } + .mapNotNull { (index, name) -> + val identifier = identifierOf(name) + if (identifier.isEmpty()) null else Triple(identifier, name, index) + } + .groupBy { it.first } + .map { (identifier, group) -> + // Two different names normalising the same would silently become one item. + val grouped = group.map { it.second }.distinct() + check(grouped.size == 1) { "Items $grouped all derive the identifier $identifier" } + val lowest = group.minBy { it.third } + ParsedItem( + identifier = identifier, + name = lowest.second, + price = prices[lowest.third] ?: 0, + ids = group.map { ITEM_REGION_BLOCK + it.third }.sorted(), + ) + } + .sortedBy { it.ids.first() } + } + + /** Turns a display name into a Kotlin constant name: "Poké Ball" becomes POKE_BALL. */ + private fun identifierOf(name: String): String = + Normalizer.normalize(name, Normalizer.Form.NFD) + .replace(Regex("\\p{Mn}+"), "") + .uppercase(Locale.ROOT) + .replace(Regex("[^A-Z0-9]+"), "_") + .trim('_') + .let { if (it.firstOrNull()?.isDigit() == true) "_$it" else it } +} diff --git a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemParser.kt b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemParser.kt deleted file mode 100644 index 9a2e745..0000000 --- a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemParser.kt +++ /dev/null @@ -1,30 +0,0 @@ -package de.fiereu.openmmo.codegen.item - -import java.io.File - -/** - * Reads the item constants out of a GBA decomp header. The two GBA decomps use the same item - * numbering, so one decomp is the single source of truth, the same way moves and species are. - * - * The client keys an item by `regionId * 1000 + itemId` and holds one item table per region. - * [regionId] picks the table that matches the decomp's own numbering, which leaves the Poke Ball at - * its decomp 4. - */ -class ItemParser(private val decompDir: File, private val regionId: Int) { - - fun parseAll(): List { - val header = File(decompDir, "include/constants/items.h") - require(header.exists()) { "Missing ${header.path}" } - val define = Regex("""^#define\s+ITEM_([A-Z0-9_]+)\s+(\d+)\s*$""") - // ITEMS_COUNT closes the item list. Everything after it reuses the ITEM_ prefix for unrelated - // constants like the bag usage types, so parsing stops there. - return header - .readLines() - .takeWhile { !it.trimStart().startsWith("#define ITEMS_COUNT") } - .mapNotNull { define.find(it.trim()) } - .map { ParsedItem(it.groupValues[1], regionId * 1000 + it.groupValues[2].toInt()) } - // Placeholder slots are named after their hex index, for example ITEM_15C. - .filterNot { it.name.first().isDigit() } - .distinctBy(ParsedItem::name) - } -} diff --git a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemsRenderer.kt b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemsRenderer.kt index e9a4e2f..386ef07 100644 --- a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemsRenderer.kt +++ b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ItemsRenderer.kt @@ -10,6 +10,7 @@ class ItemsRenderer( private val templatesDir: File, private val outputDir: File, private val classCacheDir: File, + private val registryChunkSize: Int = 50, ) { fun render(items: List) { @@ -28,6 +29,9 @@ class ItemsRenderer( FileOutput(File(packageRoot, "Items.kt").toPath()).use { out -> engine.render("Items.jte", mapOf("items" to items), out) } + FileOutput(File(packageRoot, "GeneratedItems.kt").toPath()).use { out -> + engine.render("ItemsRegistry.jte", mapOf("chunks" to items.chunked(registryChunkSize)), out) + } } private companion object { diff --git a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/Main.kt b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/Main.kt index 40c8e8e..c707578 100644 --- a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/Main.kt +++ b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/Main.kt @@ -2,23 +2,21 @@ package de.fiereu.openmmo.codegen.item -import de.fiereu.openmmo.common.enums.Region import java.io.File fun main(args: Array) { require(args.size >= 4) { - "Usage: got ${args.toList()}" + "Usage: got ${args.toList()}" } val outputDir = File(args[0]) val templatesDir = File(args[1]) val classCacheDir = File(args[2]) - val (region, decomp) = args[3].split("|") - val decompDir = File(decomp) - val regionId = Region.valueOf(region.uppercase()).wireValue.toInt() + val dataDir = File(args[3]) - println("[item] parsing $region items from $decompDir") - val items = ItemParser(decompDir, regionId).parseAll() - println("[item] parsed ${items.size} items. writing to $outputDir") + println("[item] parsing from $dataDir") + val items = ItemDataParser(dataDir).parseAll() + val ids = items.sumOf { it.ids.size } + println("[item] parsed ${items.size} items carrying $ids ids. writing to $outputDir") ItemsRenderer(templatesDir, outputDir, classCacheDir).render(items) println("[item] done") } diff --git a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ParsedModel.kt b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ParsedModel.kt index a2d262f..1f793c7 100644 --- a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ParsedModel.kt +++ b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/ParsedModel.kt @@ -1,4 +1,9 @@ package de.fiereu.openmmo.codegen.item -/** One item constant: the decomp name without its ITEM_ prefix and the id the client uses. */ -data class ParsedItem(val name: String, val id: Int) +/** [ids] is a list because the table lists some items in more than one slot. */ +data class ParsedItem( + val identifier: String, + val name: String, + val price: Int, + val ids: List, +) diff --git a/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/RenderUtil.kt b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/RenderUtil.kt new file mode 100644 index 0000000..d583a4d --- /dev/null +++ b/codegen/src/generator/kotlin/de/fiereu/openmmo/codegen/item/RenderUtil.kt @@ -0,0 +1,14 @@ +package de.fiereu.openmmo.codegen.item + +object RenderUtil { + + fun declaration(item: ParsedItem): String = + " /** ${item.ids.joinToString(", ")} */\n" + + " val ${item.identifier} = item(${escapeString(item.name)}, ${item.price})" + + fun register(item: ParsedItem): String = + "reg.register(Items.${item.identifier}, ${item.ids.joinToString(", ")})" + + private fun escapeString(s: String): String = + "\"" + s.replace("\\", "\\\\").replace("\"", "\\\"") + "\"" +} diff --git a/codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemDef.kt b/codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemDef.kt new file mode 100644 index 0000000..b2d3b67 --- /dev/null +++ b/codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemDef.kt @@ -0,0 +1,6 @@ +package de.fiereu.openmmo.items + +/** Not a data class on purpose. The catalogue instance is the identity, so equality is by it. */ +class ItemDef(val name: String, val price: Int) { + override fun toString(): String = name +} diff --git a/codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemRegistry.kt b/codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemRegistry.kt new file mode 100644 index 0000000..5a341d3 --- /dev/null +++ b/codegen/src/main/kotlin/de/fiereu/openmmo/items/ItemRegistry.kt @@ -0,0 +1,42 @@ +package de.fiereu.openmmo.items + +import de.fiereu.openmmo.items.generated.GeneratedItems +import java.util.concurrent.ConcurrentHashMap +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class ItemRegistry @Inject constructor() { + + private val byId = ConcurrentHashMap() + private val idsByItem = ConcurrentHashMap>() + + init { + GeneratedItems.loadInto(this) + } + + fun register(item: ItemDef, vararg ids: Int) { + for (id in ids) { + val previous = byId.put(id, item) + // Generated data, so a clash is a codegen bug rather than bad input. + check(previous == null || previous === item) { + "Item id $id is claimed by both ${previous?.name} and ${item.name}" + } + } + idsByItem.merge(item, ids.toList()) { old, new -> (old + new).distinct().sorted() } + } + + fun get(id: Int): ItemDef? = byId[id] + + fun idsOf(item: ItemDef): List = idsByItem[item].orEmpty() + + /** An item with several ids is named by its lowest. */ + fun idOf(item: ItemDef): Int = + idsOf(item).firstOrNull() ?: error("Item '${item.name}' has no id in this build") + + fun idOrNull(item: ItemDef): Int? = idsOf(item).firstOrNull() + + fun all(): Collection = idsByItem.keys + + fun size(): Int = idsByItem.size +} diff --git a/codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParserTest.kt b/codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParserTest.kt new file mode 100644 index 0000000..9763373 --- /dev/null +++ b/codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemDataParserTest.kt @@ -0,0 +1,72 @@ +package de.fiereu.openmmo.codegen.item + +import io.kotest.assertions.throwables.shouldThrow +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.collections.shouldContainExactly +import io.kotest.matchers.shouldBe +import java.io.File + +private fun dataDir(names: List, prices: Map): File { + val dir = kotlin.io.path.createTempDirectory("item-data").toFile() + dir.resolve("item_names.json").writeText(names.joinToString(",", "[", "]") { "\"$it\"" }) + dir.resolve("items.json") + .writeText( + prices.entries.joinToString(",", "[", "]") { (index, price) -> + """{"index":$index,"price":$price,"hold_effect":0}""" + }) + return dir +} + +class ItemDataParserTest : + FunSpec({ + test("reads a name and its price into the region 5 id block") { + val items = + ItemDataParser( + dataDir( + listOf("None", "Master Ball", "Ultra Ball", "Poké Ball"), + mapOf(1 to 0, 2 to 1200, 3 to 200))) + .parseAll() + + items.single { it.identifier == "POKE_BALL" } shouldBe + ParsedItem("POKE_BALL", "Poké Ball", 200, listOf(5003)) + } + + test("collects every slot sharing a name into one item with several ids") { + val items = + ItemDataParser( + dataDir( + listOf("None", "Potion", "Antidote", "Potion"), + mapOf(1 to 300, 2 to 100, 3 to 300))) + .parseAll() + + items.single { it.identifier == "POTION" }.ids shouldContainExactly listOf(5001, 5003) + } + + test("skips index 0 and the placeholder slots") { + val items = + ItemDataParser(dataDir(listOf("None", "?????", "-", "", "Potion"), mapOf(4 to 300))) + .parseAll() + + items.map { it.identifier } shouldContainExactly listOf("POTION") + } + + test("derives identifiers that are legal Kotlin names") { + val names = listOf("None", "Poké Ball", "Parlyz Heal", "Up-Grade", "10 Coins", "X Attack") + val items = ItemDataParser(dataDir(names, emptyMap())).parseAll() + + items.map { it.identifier } shouldContainExactly + listOf("POKE_BALL", "PARLYZ_HEAL", "UP_GRADE", "_10_COINS", "X_ATTACK") + } + + test("prices an item the table has no entry for at zero") { + val items = ItemDataParser(dataDir(listOf("None", "Parcel"), emptyMap())).parseAll() + + items.single().price shouldBe 0 + } + + test("fails loudly when the vendored data is missing") { + val empty = kotlin.io.path.createTempDirectory("item-data-empty").toFile() + + shouldThrow { ItemDataParser(empty).parseAll() } + } + }) diff --git a/codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemParserTest.kt b/codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemParserTest.kt deleted file mode 100644 index 8a4cf70..0000000 --- a/codegen/src/test/kotlin/de/fiereu/openmmo/codegen/item/ItemParserTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -package de.fiereu.openmmo.codegen.item - -import de.fiereu.openmmo.common.enums.Region -import io.kotest.core.spec.style.FunSpec -import io.kotest.matchers.shouldBe - -class ItemParserTest : - FunSpec({ - test("prefixes decomp item ids with their region and stops at the list end") { - val decomp = kotlin.io.path.createTempDirectory("items").toFile() - decomp.resolve("include/constants").mkdirs() - decomp - .resolve("include/constants/items.h") - .writeText( - """ - #define ITEM_NONE 0 - #define ITEM_GREAT_BALL 3 - #define ITEM_POKE_BALL 4 - #define ITEM_15C 348 - #define ITEM_LIST_END 0xFFFF - #define ITEMS_COUNT 377 - #define ITEM_USE_MAIL 0 - #define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION) - """ - .trimIndent()) - - ItemParser(decomp, Region.KANTO.wireValue.toInt()).parseAll() shouldBe - listOf( - ParsedItem("NONE", 0), - ParsedItem("GREAT_BALL", 3), - ParsedItem("POKE_BALL", 4), - ) - - ItemParser(decomp, Region.HOENN.wireValue.toInt()).parseAll() shouldBe - listOf( - ParsedItem("NONE", 1000), - ParsedItem("GREAT_BALL", 1003), - ParsedItem("POKE_BALL", 1004), - ) - } - }) diff --git a/codegen/src/test/kotlin/de/fiereu/openmmo/items/ItemRegistryTest.kt b/codegen/src/test/kotlin/de/fiereu/openmmo/items/ItemRegistryTest.kt new file mode 100644 index 0000000..92f6773 --- /dev/null +++ b/codegen/src/test/kotlin/de/fiereu/openmmo/items/ItemRegistryTest.kt @@ -0,0 +1,78 @@ +package de.fiereu.openmmo.items + +import de.fiereu.openmmo.items.generated.Items +import io.kotest.assertions.throwables.shouldThrow +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.collections.shouldContainExactly +import io.kotest.matchers.ints.shouldBeGreaterThan +import io.kotest.matchers.nulls.shouldBeNull +import io.kotest.matchers.shouldBe + +class ItemRegistryTest : + FunSpec({ + // Kotest shares the spec instance, so the tests that register have to work on their own + // registry rather than a shared one. + fun registry() = ItemRegistry() + + test("loads the generated catalogue") { registry().size() shouldBeGreaterThan 500 } + + test("resolves the ids the live client sends") { + val items = registry() + + items.idOf(Items.POKE_BALL) shouldBe 5004 + items.idOf(Items.POTION) shouldBe 5017 + items.idOf(Items.ANTIDOTE) shouldBe 5018 + items.idOf(Items.PARLYZ_HEAL) shouldBe 5022 + items.idOf(Items.PARCEL) shouldBe 5459 + } + + test("carries the price the item table gives") { + Items.POKE_BALL.price shouldBe 200 + Items.POTION.price shouldBe 300 + Items.ANTIDOTE.price shouldBe 100 + Items.PARLYZ_HEAL.price shouldBe 200 + } + + test("round trips every item through its ids") { + val items = registry() + + for (item in items.all()) { + for (id in items.idsOf(item)) { + items.get(id) shouldBe item + } + } + } + + test("answers nothing for an id no item claims") { registry().get(1).shouldBeNull() } + + test("an item is its identity, so a look-alike does not resolve") { + val items = registry() + + items.idOrNull(ItemDef(Items.POTION.name, Items.POTION.price)).shouldBeNull() + } + + test("refuses an id already claimed by another item") { + val items = registry() + + shouldThrow { + items.register(ItemDef("Impostor", 0), items.idOf(Items.POTION)) + } + } + + test("registering the same item twice merges its ids") { + val items = registry() + val item = ItemDef("Multi", 10) + + items.register(item, 90002) + items.register(item, 90001, 90002) + + items.idsOf(item) shouldContainExactly listOf(90001, 90002) + items.idOf(item) shouldBe 90001 + } + + test("throws by name for an item this build has no id for") { + val thrown = shouldThrow { registry().idOf(ItemDef("Teachy TV", 0)) } + + thrown.message shouldBe "Item 'Teachy TV' has no id in this build" + } + }) diff --git a/decomp/pokeblack b/decomp/pokeblack deleted file mode 160000 index 35cbcc8..0000000 --- a/decomp/pokeblack +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 35cbcc871639ed4c36b0fe9f8da5e37999213a26 diff --git a/decomp/pokeblack/item_names.json b/decomp/pokeblack/item_names.json new file mode 100644 index 0000000..4747bcc --- /dev/null +++ b/decomp/pokeblack/item_names.json @@ -0,0 +1,629 @@ +[ + "None", + "Master Ball", + "Ultra Ball", + "Great Ball", + "Poké Ball", + "Safari Ball", + "Net Ball", + "Dive Ball", + "Nest Ball", + "Repeat Ball", + "Timer Ball", + "Luxury Ball", + "Premier Ball", + "Dusk Ball", + "Heal Ball", + "Quick Ball", + "Cherish Ball", + "Potion", + "Antidote", + "Burn Heal", + "Ice Heal", + "Awakening", + "Parlyz Heal", + "Full Restore", + "Max Potion", + "Hyper Potion", + "Super Potion", + "Full Heal", + "Revive", + "Max Revive", + "Fresh Water", + "Soda Pop", + "Lemonade", + "Moomoo Milk", + "EnergyPowder", + "Energy Root", + "Heal Powder", + "Revival Herb", + "Ether", + "Max Ether", + "Elixir", + "Max Elixir", + "Lava Cookie", + "Berry Juice", + "Sacred Ash", + "HP Up", + "Protein", + "Iron", + "Carbos", + "Calcium", + "Rare Candy", + "PP Up", + "Zinc", + "PP Max", + "Old Gateau", + "Guard Spec.", + "Dire Hit", + "X Attack", + "X Defend", + "X Speed", + "X Accuracy", + "X Special", + "X Sp. Def", + "Poké Doll", + "Fluffy Tail", + "Blue Flute", + "Yellow Flute", + "Red Flute", + "Black Flute", + "White Flute", + "Shoal Salt", + "Shoal Shell", + "Red Shard", + "Blue Shard", + "Yellow Shard", + "Green Shard", + "Super Repel", + "Max Repel", + "Escape Rope", + "Repel", + "Sun Stone", + "Moon Stone", + "Fire Stone", + "Thunderstone", + "Water Stone", + "Leaf Stone", + "TinyMushroom", + "Big Mushroom", + "Pearl", + "Big Pearl", + "Stardust", + "Star Piece", + "Nugget", + "Heart Scale", + "Honey", + "Growth Mulch", + "Damp Mulch", + "Stable Mulch", + "Gooey Mulch", + "Root Fossil", + "Claw Fossil", + "Helix Fossil", + "Dome Fossil", + "Old Amber", + "Armor Fossil", + "Skull Fossil", + "Rare Bone", + "Shiny Stone", + "Dusk Stone", + "Dawn Stone", + "Oval Stone", + "Odd Keystone", + "Griseous Orb", + "???", + "???", + "???", + "Douse Drive", + "Shock Drive", + "Burn Drive", + "Chill Drive", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "???", + "Sweet Heart", + "Adamant Orb", + "Lustrous Orb", + "Greet Mail", + "Favored Mail", + "RSVP Mail", + "Thanks Mail", + "Inquiry Mail", + "Like Mail", + "Reply Mail", + "BridgeMail S", + "BridgeMail D", + "BridgeMail T", + "BridgeMail V", + "BridgeMail M", + "Cheri Berry", + "Chesto Berry", + "Pecha Berry", + "Rawst Berry", + "Aspear Berry", + "Leppa Berry", + "Oran Berry", + "Persim Berry", + "Lum Berry", + "Sitrus Berry", + "Figy Berry", + "Wiki Berry", + "Mago Berry", + "Aguav Berry", + "Iapapa Berry", + "Razz Berry", + "Bluk Berry", + "Nanab Berry", + "Wepear Berry", + "Pinap Berry", + "Pomeg Berry", + "Kelpsy Berry", + "Qualot Berry", + "Hondew Berry", + "Grepa Berry", + "Tamato Berry", + "Cornn Berry", + "Magost Berry", + "Rabuta Berry", + "Nomel Berry", + "Spelon Berry", + "Pamtre Berry", + "Watmel Berry", + "Durin Berry", + "Belue Berry", + "Occa Berry", + "Passho Berry", + "Wacan Berry", + "Rindo Berry", + "Yache Berry", + "Chople Berry", + "Kebia Berry", + "Shuca Berry", + "Coba Berry", + "Payapa Berry", + "Tanga Berry", + "Charti Berry", + "Kasib Berry", + "Haban Berry", + "Colbur Berry", + "Babiri Berry", + "Chilan Berry", + "Liechi Berry", + "Ganlon Berry", + "Salac Berry", + "Petaya Berry", + "Apicot Berry", + "Lansat Berry", + "Starf Berry", + "Enigma Berry", + "Micle Berry", + "Custap Berry", + "Jaboca Berry", + "Rowap Berry", + "BrightPowder", + "White Herb", + "Macho Brace", + "Exp. Share", + "Quick Claw", + "Soothe Bell", + "Mental Herb", + "Choice Band", + "King's Rock", + "SilverPowder", + "Amulet Coin", + "Cleanse Tag", + "Soul Dew", + "DeepSeaTooth", + "DeepSeaScale", + "Smoke Ball", + "Everstone", + "Focus Band", + "Lucky Egg", + "Scope Lens", + "Metal Coat", + "Leftovers", + "Dragon Scale", + "Light Ball", + "Soft Sand", + "Hard Stone", + "Miracle Seed", + "BlackGlasses", + "Black Belt", + "Magnet", + "Mystic Water", + "Sharp Beak", + "Poison Barb", + "NeverMeltIce", + "Spell Tag", + "TwistedSpoon", + "Charcoal", + "Dragon Fang", + "Silk Scarf", + "Up-Grade", + "Shell Bell", + "Sea Incense", + "Lax Incense", + "Lucky Punch", + "Metal Powder", + "Thick Club", + "Stick", + "Red Scarf", + "Blue Scarf", + "Pink Scarf", + "Green Scarf", + "Yellow Scarf", + "Wide Lens", + "Muscle Band", + "Wise Glasses", + "Expert Belt", + "Light Clay", + "Life Orb", + "Power Herb", + "Toxic Orb", + "Flame Orb", + "Quick Powder", + "Focus Sash", + "Zoom Lens", + "Metronome", + "Iron Ball", + "Lagging Tail", + "Destiny Knot", + "Black Sludge", + "Icy Rock", + "Smooth Rock", + "Heat Rock", + "Damp Rock", + "Grip Claw", + "Choice Scarf", + "Sticky Barb", + "Power Bracer", + "Power Belt", + "Power Lens", + "Power Band", + "Power Anklet", + "Power Weight", + "Shed Shell", + "Big Root", + "Choice Specs", + "Flame Plate", + "Splash Plate", + "Zap Plate", + "Meadow Plate", + "Icicle Plate", + "Fist Plate", + "Toxic Plate", + "Earth Plate", + "Sky Plate", + "Mind Plate", + "Insect Plate", + "Stone Plate", + "Spooky Plate", + "Draco Plate", + "Dread Plate", + "Iron Plate", + "Odd Incense", + "Rock Incense", + "Full Incense", + "Wave Incense", + "Rose Incense", + "Luck Incense", + "Pure Incense", + "Protector", + "Electirizer", + "Magmarizer", + "Dubious Disc", + "Reaper Cloth", + "Razor Claw", + "Razor Fang", + "TM01", + "TM02", + "TM03", + "TM04", + "TM05", + "TM06", + "TM07", + "TM08", + "TM09", + "TM10", + "TM11", + "TM12", + "TM13", + "TM14", + "TM15", + "TM16", + "TM17", + "TM18", + "TM19", + "TM20", + "TM21", + "TM22", + "TM23", + "TM24", + "TM25", + "TM26", + "TM27", + "TM28", + "TM29", + "TM30", + "TM31", + "TM32", + "TM33", + "TM34", + "TM35", + "TM36", + "TM37", + "TM38", + "TM39", + "TM40", + "TM41", + "TM42", + "TM43", + "TM44", + "TM45", + "TM46", + "TM47", + "TM48", + "TM49", + "TM50", + "TM51", + "TM52", + "TM53", + "TM54", + "TM55", + "TM56", + "TM57", + "TM58", + "TM59", + "TM60", + "TM61", + "TM62", + "TM63", + "TM64", + "TM65", + "TM66", + "TM67", + "TM68", + "TM69", + "TM70", + "TM71", + "TM72", + "TM73", + "TM74", + "TM75", + "TM76", + "TM77", + "TM78", + "TM79", + "TM80", + "TM81", + "TM82", + "TM83", + "TM84", + "TM85", + "TM86", + "TM87", + "TM88", + "TM89", + "TM90", + "TM91", + "TM92", + "HM01", + "HM02", + "HM03", + "HM04", + "HM05", + "HM06", + "???", + "???", + "Explorer Kit", + "Loot Sack", + "Rule Book", + "Poké Radar", + "Point Card", + "Journal", + "Seal Case", + "Fashion Case", + "Seal Bag", + "Pal Pad", + "Works Key", + "Old Charm", + "Galactic Key", + "Red Chain", + "Town Map", + "Vs. Seeker", + "Coin Case", + "Old Rod", + "Good Rod", + "Super Rod", + "Sprayduck", + "Poffin Case", + "Bicycle", + "Suite Key", + "Oak's Letter", + "Lunar Wing", + "Member Card", + "Azure Flute", + "S.S. Ticket", + "Contest Pass", + "Magma Stone", + "Parcel", + "Coupon 1", + "Coupon 2", + "Coupon 3", + "Storage Key", + "SecretPotion", + "Vs. Recorder", + "Gracidea", + "Secret Key", + "Apricorn Box", + "Unown Report", + "Berry Pots", + "Dowsing MCHN", + "Blue Card", + "SlowpokeTail", + "Clear Bell", + "Card Key", + "Basement Key", + "SquirtBottle", + "Red Scale", + "Lost Item", + "Pass", + "Machine Part", + "Silver Wing", + "Rainbow Wing", + "Mystery Egg", + "Red Apricorn", + "Blu Apricorn", + "Ylw Apricorn", + "Grn Apricorn", + "Pnk Apricorn", + "Wht Apricorn", + "Blk Apricorn", + "Fast Ball", + "Level Ball", + "Lure Ball", + "Heavy Ball", + "Love Ball", + "Friend Ball", + "Moon Ball", + "Sport Ball", + "Park Ball", + "Photo Album", + "GB Sounds", + "Tidal Bell", + "RageCandyBar", + "Data Card 01", + "Data Card 02", + "Data Card 03", + "Data Card 04", + "Data Card 05", + "Data Card 06", + "Data Card 07", + "Data Card 08", + "Data Card 09", + "Data Card 10", + "Data Card 11", + "Data Card 12", + "Data Card 13", + "Data Card 14", + "Data Card 15", + "Data Card 16", + "Data Card 17", + "Data Card 18", + "Data Card 19", + "Data Card 20", + "Data Card 21", + "Data Card 22", + "Data Card 23", + "Data Card 24", + "Data Card 25", + "Data Card 26", + "Data Card 27", + "Jade Orb", + "Lock Capsule", + "Red Orb", + "Blue Orb", + "Enigma Stone", + "Prism Scale", + "Eviolite", + "Float Stone", + "Rocky Helmet", + "Air Balloon", + "Red Card", + "Ring Target", + "Binding Band", + "Absorb Bulb", + "Cell Battery", + "Eject Button", + "Fire Gem", + "Water Gem", + "Electric Gem", + "Grass Gem", + "Ice Gem", + "Fighting Gem", + "Poison Gem", + "Ground Gem", + "Flying Gem", + "Psychic Gem", + "Bug Gem", + "Rock Gem", + "Ghost Gem", + "Dragon Gem", + "Dark Gem", + "Steel Gem", + "Normal Gem", + "Health Wing", + "Muscle Wing", + "Resist Wing", + "Genius Wing", + "Clever Wing", + "Swift Wing", + "Pretty Wing", + "Cover Fossil", + "Plume Fossil", + "Liberty Pass", + "Pass Orb", + "Dream Ball", + "Poké Toy", + "Prop Case", + "Dragon Skull", + "BalmMushroom", + "Big Nugget", + "Pearl String", + "Comet Shard", + "Relic Copper", + "Relic Silver", + "Relic Gold", + "Relic Vase", + "Relic Band", + "Relic Statue", + "Relic Crown", + "Casteliacone", + "Dire Hit 2", + "X Speed 2", + "X Special 2", + "X Sp. Def 2", + "X Defend 2", + "X Attack 2", + "X Accuracy 2", + "X Speed 3", + "X Special 3", + "X Sp. Def 3", + "X Defend 3", + "X Attack 3", + "X Accuracy 3", + "X Speed 6", + "X Special 6", + "X Sp. Def 6", + "X Defend 6", + "X Attack 6", + "X Accuracy 6", + "Ability Urge", + "Item Drop", + "Item Urge", + "Reset Urge", + "Dire Hit 3", + "Light Stone", + "Dark Stone", + "TM93", + "TM94", + "TM95", + "Xtransceiver", + "???", + "Gram 1", + "Gram 2", + "Gram 3", + "Xtransceiver" +] diff --git a/decomp/pokeblack/items.json b/decomp/pokeblack/items.json new file mode 100644 index 0000000..7440199 --- /dev/null +++ b/decomp/pokeblack/items.json @@ -0,0 +1,6272 @@ +[ + { + "index": 0, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 1, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 3, + "rest": "000000001f080100000000000000000000000000000000000000000000" + }, + { + "index": 2, + "price": 1200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 2, + "rest": "000000001f080100000100000000000000000000000000000000000000" + }, + { + "index": 3, + "price": 600, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 1, + "rest": "000000001f080100000200000000000000000000000000000000000000" + }, + { + "index": 4, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 0, + "rest": "000000001f080100000300000000000000000000000000000000000000" + }, + { + "index": 5, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 15, + "rest": "000000001f080100000400000000000000000000000000000000000000" + }, + { + "index": 6, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 7, + "rest": "000000001f080100000500000000000000000000000000000000000000" + }, + { + "index": 7, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 13, + "rest": "000000001f080100000600000000000000000000000000000000000000" + }, + { + "index": 8, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 8, + "rest": "000000001f080100000700000000000000000000000000000000000000" + }, + { + "index": 9, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 12, + "rest": "000000001f080100000800000000000000000000000000000000000000" + }, + { + "index": 10, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 11, + "rest": "000000001f080100000900000000000000000000000000000000000000" + }, + { + "index": 11, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 14, + "rest": "000000001f080100000a00000000000000000000000000000000000000" + }, + { + "index": 12, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 4, + "rest": "000000001f080100000b00000000000000000000000000000000000000" + }, + { + "index": 13, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 10, + "rest": "000000001f080100000c00000000000000000000000000000000000000" + }, + { + "index": 14, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 6, + "rest": "000000001f080100000d00000000000000000000000000000000000000" + }, + { + "index": 15, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 9, + "rest": "000000001f080100000e00000000000000000000000000000000000000" + }, + { + "index": 16, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 5, + "rest": "000000001f080100000f00000000000000000000000000000000000000" + }, + { + "index": 17, + "price": 300, + "hold_effect": 0, + "amount": 20, + "field_use": "medicine", + "use_class": 0, + "kind_index": 0, + "rest": "00001e009f200201000000000000040000000000000014000000000000" + }, + { + "index": 18, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 21, + "rest": "00001e009f400201000200000000000000000000000000000000000000" + }, + { + "index": 19, + "price": 250, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 23, + "rest": "00001e009f400201000400000000000000000000000000000000000000" + }, + { + "index": 20, + "price": 250, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 24, + "rest": "00001e009f400201000800000000000000000000000000000000000000" + }, + { + "index": 21, + "price": 250, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 25, + "rest": "00001e009f400201000100000000000000000000000000000000000000" + }, + { + "index": 22, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 22, + "rest": "00001e009f400201001000000000000000000000000000000000000000" + }, + { + "index": 23, + "price": 3000, + "hold_effect": 0, + "amount": 255, + "field_use": "medicine", + "use_class": 0, + "kind_index": 4, + "rest": "00001e009f600201003f000000000400000000000000ff000000000000" + }, + { + "index": 24, + "price": 2500, + "hold_effect": 0, + "amount": 255, + "field_use": "medicine", + "use_class": 0, + "kind_index": 3, + "rest": "00001e009f2002010000000000000400000000000000ff000000000000" + }, + { + "index": 25, + "price": 1200, + "hold_effect": 0, + "amount": 200, + "field_use": "medicine", + "use_class": 0, + "kind_index": 2, + "rest": "00001e009f2002010000000000000400000000000000c8000000000000" + }, + { + "index": 26, + "price": 700, + "hold_effect": 0, + "amount": 50, + "field_use": "medicine", + "use_class": 0, + "kind_index": 1, + "rest": "00001e009f200201000000000000040000000000000032000000000000" + }, + { + "index": 27, + "price": 600, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 26, + "rest": "00001e009f400201003f00000000000000000000000000000000000000" + }, + { + "index": 28, + "price": 1500, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 5, + "rest": "00001e009f4002010000010000000000000000000000fe000000000000" + }, + { + "index": 29, + "price": 4000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 6, + "rest": "00001e009f4002010000010000000000000000000000ff000000000000" + }, + { + "index": 30, + "price": 200, + "hold_effect": 0, + "amount": 50, + "field_use": "medicine", + "use_class": 0, + "kind_index": 9, + "rest": "00001e009f200201000000000000040000000000000032000000000000" + }, + { + "index": 31, + "price": 300, + "hold_effect": 0, + "amount": 60, + "field_use": "medicine", + "use_class": 0, + "kind_index": 10, + "rest": "00001e009f20020100000000000004000000000000003c000000000000" + }, + { + "index": 32, + "price": 350, + "hold_effect": 0, + "amount": 80, + "field_use": "medicine", + "use_class": 0, + "kind_index": 11, + "rest": "00001e009f200201000000000000040000000000000050000000000000" + }, + { + "index": 33, + "price": 500, + "hold_effect": 0, + "amount": 100, + "field_use": "medicine", + "use_class": 0, + "kind_index": 12, + "rest": "00001e009f200201000000000000040000000000000064000000000000" + }, + { + "index": 34, + "price": 500, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 13, + "rest": "00001e009f200201000000000000041c0000000000003200fbfbf60000" + }, + { + "index": 35, + "price": 800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 14, + "rest": "00001e009f200201000000000000041c000000000000c800f6f6f10000" + }, + { + "index": 36, + "price": 450, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 27, + "rest": "00001e009f400201003f00000000001c0000000000000000fbfbf60000" + }, + { + "index": 37, + "price": 2800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 15, + "rest": "00001e009f400201000001000000001c000000000000ff00f1f1ec0000" + }, + { + "index": 38, + "price": 1200, + "hold_effect": 0, + "amount": 10, + "field_use": "medicine", + "use_class": 0, + "kind_index": 41, + "rest": "00001e009f2002010000000000000100000000000000000a0000000000" + }, + { + "index": 39, + "price": 2000, + "hold_effect": 0, + "amount": 255, + "field_use": "medicine", + "use_class": 0, + "kind_index": 42, + "rest": "00001e009f2002010000000000000100000000000000007f0000000000" + }, + { + "index": 40, + "price": 3000, + "hold_effect": 0, + "amount": 10, + "field_use": "medicine", + "use_class": 0, + "kind_index": 43, + "rest": "00001e009f2002010000000000000200000000000000000a0000000000" + }, + { + "index": 41, + "price": 4500, + "hold_effect": 0, + "amount": 255, + "field_use": "medicine", + "use_class": 0, + "kind_index": 50, + "rest": "00001e009f2002010000000000000200000000000000007f0000000000" + }, + { + "index": 42, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 28, + "rest": "00001e009f400201003f00000000000000000000000000000000000000" + }, + { + "index": 43, + "price": 100, + "hold_effect": 1, + "amount": 20, + "field_use": "medicine", + "use_class": 0, + "kind_index": 7, + "rest": "00001e009f200201010000000000040000000000000014000000000000" + }, + { + "index": 44, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 20, + "rest": "00001e009f0000010000030000000400000000000000ff000000000000" + }, + { + "index": 45, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 51, + "rest": "00001e009f000001000000000000081c0a000000000000000503020000" + }, + { + "index": 46, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 52, + "rest": "00001e009f000001000000000000101c000a0000000000000503020000" + }, + { + "index": 47, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 53, + "rest": "00001e009f000001000000000000201c00000a00000000000503020000" + }, + { + "index": 48, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 56, + "rest": "00001e009f000001000000000000401c0000000a000000000503020000" + }, + { + "index": 49, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 54, + "rest": "00001e009f000001000000000000801c000000000a0000000503020000" + }, + { + "index": 50, + "price": 4800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 100, + "rest": "00001e009f000001000005000000001c00000000000000000503020000" + }, + { + "index": 51, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 63, + "rest": "00001e009f000001000000000040001c00000000000000000503020000" + }, + { + "index": 52, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 55, + "rest": "00001e009f000001000000000000001d00000000000a00000503020000" + }, + { + "index": 53, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 64, + "rest": "00001e009f000001000000000080001c00000000000000000503020000" + }, + { + "index": 54, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 29, + "rest": "00001e009f400201003f00000000000000000000000000000000000000" + }, + { + "index": 55, + "price": 700, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 7, + "rest": "00001e001f100001008000000000000c00000000000000000101000000" + }, + { + "index": 56, + "price": 650, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 6, + "rest": "00001e001f100001000000000010000c00000000000000000101000000" + }, + { + "index": 57, + "price": 500, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 0, + "rest": "00001e001f100001000010000000000c00000000000000000101000000" + }, + { + "index": 58, + "price": 550, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 1, + "rest": "00001e001f100001000000010000000c00000000000000000101000000" + }, + { + "index": 59, + "price": 350, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 2, + "rest": "00001e001f100001000000001000000c00000000000000000101000000" + }, + { + "index": 60, + "price": 950, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 5, + "rest": "00001e001f100001000000000001000c00000000000000000101000000" + }, + { + "index": 61, + "price": 350, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 3, + "rest": "00001e001f100001000000100000000c00000000000000000101000000" + }, + { + "index": 62, + "price": 350, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 4, + "rest": "00001e001f100001000000000100000000000000000000000000000000" + }, + { + "index": 63, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 8, + "rest": "00001e001f100301000000000000000000000000000000000000000000" + }, + { + "index": 64, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 9, + "rest": "00001e001f100301000000000000000000000000000000000000000000" + }, + { + "index": 65, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 8, + "rest": "00001e001f000001000100000000000000000000000000000000000000" + }, + { + "index": 66, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 82, + "rest": "00001e001f000001002000000000000000000000000000000000000000" + }, + { + "index": 67, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 57, + "rest": "00001e001f000001004000000000000000000000000000000000000000" + }, + { + "index": 68, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 5, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 69, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 80, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 70, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 69, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 71, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 70, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 72, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 58, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 73, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 9, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 74, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 83, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 75, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 20, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 76, + "price": 500, + "hold_effect": 0, + "amount": 200, + "field_use": "repel", + "use_class": 2, + "kind_index": 76, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 77, + "price": 700, + "hold_effect": 0, + "amount": 250, + "field_use": "repel", + "use_class": 2, + "kind_index": 42, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 78, + "price": 550, + "hold_effect": 0, + "amount": 0, + "field_use": "escape_rope", + "use_class": 2, + "kind_index": 17, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 79, + "price": 350, + "hold_effect": 0, + "amount": 100, + "field_use": "repel", + "use_class": 2, + "kind_index": 66, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 80, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 75, + "rest": "00001e001f000001000008000000000000000000000000000000000000" + }, + { + "index": 81, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 43, + "rest": "00001e001f000001000008000000000000000000000000000000000000" + }, + { + "index": 82, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 18, + "rest": "00001e001f000001000008000000000000000000000000000000000000" + }, + { + "index": 83, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 77, + "rest": "00001e001f000001000008000000000000000000000000000000000000" + }, + { + "index": 84, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 79, + "rest": "00001e001f000001000008000000000000000000000000000000000000" + }, + { + "index": 85, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 41, + "rest": "00001e001f000001000008000000000000000000000000000000000000" + }, + { + "index": 86, + "price": 500, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 78, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 87, + "price": 5000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 2, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 88, + "price": 1400, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 49, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 89, + "price": 7500, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 4, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 90, + "price": 2000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 73, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 91, + "price": 9800, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 74, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 92, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 44, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 93, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 23, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 94, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "honey", + "use_class": 2, + "kind_index": 25, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 95, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 22, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 96, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 13, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 97, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 72, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 98, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 19, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 99, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 67, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 100, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 10, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 101, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 24, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 102, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 15, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 103, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 46, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 104, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 0, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 105, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 71, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 106, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 55, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 107, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 68, + "rest": "000050001f000001000008000000000000000000000000000000000000" + }, + { + "index": 108, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 16, + "rest": "000050001f000001000008000000000000000000000000000000000000" + }, + { + "index": 109, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 14, + "rest": "000050001f000001000008000000000000000000000000000000000000" + }, + { + "index": 110, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "evolution_stone", + "use_class": 2, + "kind_index": 47, + "rest": "000050001f000001000008000000000000000000000000000000000000" + }, + { + "index": 111, + "price": 2100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 45, + "rest": "000050001f000001000000000000000000000000000000000000000000" + }, + { + "index": 112, + "price": 10000, + "hold_effect": 2, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 54, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 113, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 114, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 115, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 116, + "price": 1000, + "hold_effect": 3, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 25, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 117, + "price": 1000, + "hold_effect": 3, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 120, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 118, + "price": 1000, + "hold_effect": 3, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 12, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 119, + "price": 1000, + "hold_effect": 3, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 15, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 120, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 26, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 121, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 27, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 122, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 28, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 123, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 29, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 124, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 30, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 125, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 31, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 126, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 127, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 32, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 128, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 33, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 129, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 34, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 130, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 35, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 131, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 36, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 132, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 37, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 133, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 38, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 134, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 8, + "rest": "00001e009f200201000000000000041c00000000000014000101010000" + }, + { + "index": 135, + "price": 10000, + "hold_effect": 3, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 1, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 136, + "price": 10000, + "hold_effect": 4, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 74, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 137, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 0, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 138, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 1, + "rest": "000000001f000000000100000000000000000000000000000000000000" + }, + { + "index": 139, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 2, + "rest": "000000001f000000000200000000000000000000000000000000000000" + }, + { + "index": 140, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 3, + "rest": "000000001f000000000300000000000000000000000000000000000000" + }, + { + "index": 141, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 4, + "rest": "000000001f000000000400000000000000000000000000000000000000" + }, + { + "index": 142, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 5, + "rest": "000000001f000000000500000000000000000000000000000000000000" + }, + { + "index": 143, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 6, + "rest": "000000001f000000000600000000000000000000000000000000000000" + }, + { + "index": 144, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 7, + "rest": "000000001f000000000700000000000000000000000000000000000000" + }, + { + "index": 145, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 8, + "rest": "000000001f000000000800000000000000000000000000000000000000" + }, + { + "index": 146, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 9, + "rest": "000000001f000000000900000000000000000000000000000000000000" + }, + { + "index": 147, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 10, + "rest": "000000001f000000000a00000000000000000000000000000000000000" + }, + { + "index": 148, + "price": 50, + "hold_effect": 0, + "amount": 0, + "field_use": "mail", + "use_class": "mail", + "kind_index": 11, + "rest": "000000001f000000000b00000000000000000000000000000000000000" + }, + { + "index": 149, + "price": 20, + "hold_effect": 5, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "01010a3c89410001011000000000000000000000000000000000000000" + }, + { + "index": 150, + "price": 20, + "hold_effect": 6, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "02020a3c8a410001010100000000000000000000000000000000000000" + }, + { + "index": 151, + "price": 20, + "hold_effect": 7, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "03030a3c8c410001010200000000000000000000000000000000000000" + }, + { + "index": 152, + "price": 20, + "hold_effect": 8, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "04040a3c8b410001010400000000000000000000000000000000000000" + }, + { + "index": 153, + "price": 20, + "hold_effect": 9, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "05050a3c8e410001010800000000000000000000000000000000000000" + }, + { + "index": 154, + "price": 20, + "hold_effect": 10, + "amount": 10, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "06060a3c812100010100000000000100000000000000000a0000000000" + }, + { + "index": 155, + "price": 20, + "hold_effect": 1, + "amount": 10, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "07070a3c8321000101000000000004000000000000000a000000000000" + }, + { + "index": 156, + "price": 20, + "hold_effect": 11, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "08080a3c84410001012000000000000000000000000000000000000000" + }, + { + "index": 157, + "price": 20, + "hold_effect": 12, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "09090a3c82410001013f00000000000000000000000000000000000000" + }, + { + "index": 158, + "price": 20, + "hold_effect": 13, + "amount": 25, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "0a0a0a3c8d2100010100000000000400000000000000fd000000000000" + }, + { + "index": 159, + "price": 20, + "hold_effect": 14, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "0b0b0a3c86010001010000000000000000000000000000000000000000" + }, + { + "index": 160, + "price": 20, + "hold_effect": 15, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "0c0c0a3c85010001010000000000000000000000000000000000000000" + }, + { + "index": 161, + "price": 20, + "hold_effect": 16, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "0d0d0a3c87010001010000000000000000000000000000000000000000" + }, + { + "index": 162, + "price": 20, + "hold_effect": 17, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "0e0e0a3c8f010001010000000000000000000000000000000000000000" + }, + { + "index": 163, + "price": 20, + "hold_effect": 18, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "0f0f0a3c90010001010000000000000000000000000000000000000000" + }, + { + "index": 164, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c88010001010000000000000000000000000000000000000000" + }, + { + "index": 165, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4689010001010000000000000000000000000000000000000000" + }, + { + "index": 166, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a468a010001010000000000000000000000000000000000000000" + }, + { + "index": 167, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a468c010001010000000000000000000000000000000000000000" + }, + { + "index": 168, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a468b010001010000000000000000000000000000000000000000" + }, + { + "index": 169, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a468e010001010000000000081cf6000000000000000a05020000" + }, + { + "index": 170, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4681010001010000000000101c00f60000000000000a05020000" + }, + { + "index": 171, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4683010001010000000000201c0000f600000000000a05020000" + }, + { + "index": 172, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4684010001010000000000801c00000000f60000000a05020000" + }, + { + "index": 173, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4682010001010000000000001d0000000000f600000a05020000" + }, + { + "index": 174, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a468d010001010000000000401c000000f6000000000a05020000" + }, + { + "index": 175, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4686010001010000000000000000000000000000000000000000" + }, + { + "index": 176, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4685010001010000000000000000000000000000000000000000" + }, + { + "index": 177, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4687010001010000000000000000000000000000000000000000" + }, + { + "index": 178, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a468f010001010000000000000000000000000000000000000000" + }, + { + "index": 179, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4690010001010000000000000000000000000000000000000000" + }, + { + "index": 180, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a4688010001010000000000000000000000000000000000000000" + }, + { + "index": 181, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a5089010001010000000000000000000000000000000000000000" + }, + { + "index": 182, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a508a010001010000000000000000000000000000000000000000" + }, + { + "index": 183, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 0, + "rest": "00000a508c010001010000000000000000000000000000000000000000" + }, + { + "index": 184, + "price": 20, + "hold_effect": 19, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c89010001010000000000000000000000000000000000000000" + }, + { + "index": 185, + "price": 20, + "hold_effect": 20, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c8a010001010000000000000000000000000000000000000000" + }, + { + "index": 186, + "price": 20, + "hold_effect": 21, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c8c010001010000000000000000000000000000000000000000" + }, + { + "index": 187, + "price": 20, + "hold_effect": 22, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c8b010001010000000000000000000000000000000000000000" + }, + { + "index": 188, + "price": 20, + "hold_effect": 23, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c8e010001010000000000000000000000000000000000000000" + }, + { + "index": 189, + "price": 20, + "hold_effect": 24, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c81010001010000000000000000000000000000000000000000" + }, + { + "index": 190, + "price": 20, + "hold_effect": 25, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c83010001010000000000000000000000000000000000000000" + }, + { + "index": 191, + "price": 20, + "hold_effect": 26, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c84010001010000000000000000000000000000000000000000" + }, + { + "index": 192, + "price": 20, + "hold_effect": 27, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c82010001010000000000000000000000000000000000000000" + }, + { + "index": 193, + "price": 20, + "hold_effect": 28, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c8d010001010000000000000000000000000000000000000000" + }, + { + "index": 194, + "price": 20, + "hold_effect": 29, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c86010001010000000000000000000000000000000000000000" + }, + { + "index": 195, + "price": 20, + "hold_effect": 30, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c85010001010000000000000000000000000000000000000000" + }, + { + "index": 196, + "price": 20, + "hold_effect": 31, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c87010001010000000000000000000000000000000000000000" + }, + { + "index": 197, + "price": 20, + "hold_effect": 32, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c8f010001010000000000000000000000000000000000000000" + }, + { + "index": 198, + "price": 20, + "hold_effect": 33, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c90010001010000000000000000000000000000000000000000" + }, + { + "index": 199, + "price": 20, + "hold_effect": 34, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c88010001010000000000000000000000000000000000000000" + }, + { + "index": 200, + "price": 20, + "hold_effect": 35, + "amount": 0, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a3c80010001010000000000000000000000000000000000000000" + }, + { + "index": 201, + "price": 20, + "hold_effect": 36, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "10100a508b010001010000000000000000000000000000000000000000" + }, + { + "index": 202, + "price": 20, + "hold_effect": 37, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "11110a508e010001010000000000000000000000000000000000000000" + }, + { + "index": 203, + "price": 20, + "hold_effect": 38, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "12120a5081010001010000000000000000000000000000000000000000" + }, + { + "index": 204, + "price": 20, + "hold_effect": 39, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "13130a5083010001010000000000000000000000000000000000000000" + }, + { + "index": 205, + "price": 20, + "hold_effect": 40, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "14140a5084010001010000000000000000000000000000000000000000" + }, + { + "index": 206, + "price": 20, + "hold_effect": 41, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "15150a5082010001010000000000000000000000000000000000000000" + }, + { + "index": 207, + "price": 20, + "hold_effect": 42, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "16160a508d010001010000000000000000000000000000000000000000" + }, + { + "index": 208, + "price": 20, + "hold_effect": 43, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a5086010001010000000000000000000000000000000000000000" + }, + { + "index": 209, + "price": 20, + "hold_effect": 44, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "17170a5085010001010000000000000000000000000000000000000000" + }, + { + "index": 210, + "price": 20, + "hold_effect": 45, + "amount": 4, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a5087010001010000000000000000000000000000000000000000" + }, + { + "index": 211, + "price": 20, + "hold_effect": 46, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a508f010001010000000000000000000000000000000000000000" + }, + { + "index": 212, + "price": 20, + "hold_effect": 47, + "amount": 8, + "field_use": "berry", + "use_class": 0, + "kind_index": 0, + "rest": "00000a5090010001010000000000000000000000000000000000000000" + }, + { + "index": 213, + "price": 10, + "hold_effect": 48, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 10, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 214, + "price": 100, + "hold_effect": 49, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 143, + "rest": "00180a001f000000010000000000000000000000000000000000000000" + }, + { + "index": 215, + "price": 3000, + "hold_effect": 50, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 75, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 216, + "price": 3000, + "hold_effect": 51, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 39, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 217, + "price": 100, + "hold_effect": 52, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 103, + "rest": "000050001f000000000000000000000000000000000000000000000000" + }, + { + "index": 218, + "price": 100, + "hold_effect": 53, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 127, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 219, + "price": 100, + "hold_effect": 54, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 79, + "rest": "00190a001f000000010000000000000000000000000000000000000000" + }, + { + "index": 220, + "price": 100, + "hold_effect": 55, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 16, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 221, + "price": 100, + "hold_effect": 56, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 64, + "rest": "001a1e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 222, + "price": 100, + "hold_effect": 57, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 122, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 223, + "price": 100, + "hold_effect": 58, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 3, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 224, + "price": 200, + "hold_effect": 59, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 19, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 225, + "price": 200, + "hold_effect": 60, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 128, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 226, + "price": 200, + "hold_effect": 61, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 23, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 227, + "price": 200, + "hold_effect": 62, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 22, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 228, + "price": 200, + "hold_effect": 63, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 124, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 229, + "price": 200, + "hold_effect": 64, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 36, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 230, + "price": 200, + "hold_effect": 65, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 47, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 231, + "price": 200, + "hold_effect": 66, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 72, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 232, + "price": 200, + "hold_effect": 67, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 115, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 233, + "price": 100, + "hold_effect": 68, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 80, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 234, + "price": 200, + "hold_effect": 69, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 67, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 235, + "price": 2100, + "hold_effect": 70, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 29, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 236, + "price": 100, + "hold_effect": 71, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 69, + "rest": "001b1e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 237, + "price": 100, + "hold_effect": 72, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 126, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 238, + "price": 100, + "hold_effect": 73, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 56, + "rest": "000064001f000000000000000000000000000000000000000000000000" + }, + { + "index": 239, + "price": 100, + "hold_effect": 74, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 84, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 240, + "price": 100, + "hold_effect": 75, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 7, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 241, + "price": 100, + "hold_effect": 76, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 6, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 242, + "price": 100, + "hold_effect": 77, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 77, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 243, + "price": 100, + "hold_effect": 78, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 86, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 244, + "price": 100, + "hold_effect": 79, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 117, + "rest": "000032001f000000000000000000000000000000000000000000000000" + }, + { + "index": 245, + "price": 100, + "hold_effect": 80, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 91, + "rest": "001c46001f000000000000000000000000000000000000000000000000" + }, + { + "index": 246, + "price": 100, + "hold_effect": 81, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 87, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 247, + "price": 100, + "hold_effect": 82, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 129, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 248, + "price": 100, + "hold_effect": 83, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 139, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 249, + "price": 9800, + "hold_effect": 84, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 14, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 250, + "price": 100, + "hold_effect": 85, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 27, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 251, + "price": 100, + "hold_effect": 86, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 121, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 252, + "price": 2100, + "hold_effect": 87, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 140, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 253, + "price": 200, + "hold_effect": 88, + "amount": 8, + "field_use": "none", + "use_class": 1, + "kind_index": 119, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 254, + "price": 9600, + "hold_effect": 78, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 116, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 255, + "price": 9600, + "hold_effect": 48, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 66, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 256, + "price": 10, + "hold_effect": 89, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 73, + "rest": "000028001f000000000000000000000000000000000000000000000000" + }, + { + "index": 257, + "price": 10, + "hold_effect": 90, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 81, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 258, + "price": 500, + "hold_effect": 91, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 136, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 259, + "price": 200, + "hold_effect": 92, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 133, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 260, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 109, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 261, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 9, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 262, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 90, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 263, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 52, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 264, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 146, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 265, + "price": 200, + "hold_effect": 93, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 144, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 266, + "price": 200, + "hold_effect": 94, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 85, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 267, + "price": 200, + "hold_effect": 95, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 145, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 268, + "price": 200, + "hold_effect": 96, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 38, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 269, + "price": 200, + "hold_effect": 97, + "amount": 3, + "field_use": "none", + "use_class": 1, + "kind_index": 70, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 270, + "price": 200, + "hold_effect": 98, + "amount": 30, + "field_use": "none", + "use_class": 1, + "kind_index": 68, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 271, + "price": 100, + "hold_effect": 99, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 97, + "rest": "00000a001f000000010000000000000000000000000000000000000000" + }, + { + "index": 272, + "price": 100, + "hold_effect": 100, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 137, + "rest": "001d1e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 273, + "price": 100, + "hold_effect": 101, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 43, + "rest": "001e1e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 274, + "price": 10, + "hold_effect": 102, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 104, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 275, + "price": 200, + "hold_effect": 103, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 48, + "rest": "00000a001f000000010000000000000000000000000000000000000000" + }, + { + "index": 276, + "price": 200, + "hold_effect": 104, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 148, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 277, + "price": 200, + "hold_effect": 105, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 82, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 278, + "price": 200, + "hold_effect": 106, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 62, + "rest": "000082001f000000000000000000000000000000000000000000000000" + }, + { + "index": 279, + "price": 200, + "hold_effect": 107, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 65, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 280, + "price": 200, + "hold_effect": 108, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 24, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 281, + "price": 200, + "hold_effect": 109, + "amount": 16, + "field_use": "none", + "use_class": 1, + "kind_index": 8, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 282, + "price": 200, + "hold_effect": 110, + "amount": 3, + "field_use": "none", + "use_class": 1, + "kind_index": 60, + "rest": "000028001f000000000000000000000000000000000000000000000000" + }, + { + "index": 283, + "price": 200, + "hold_effect": 111, + "amount": 3, + "field_use": "none", + "use_class": 1, + "kind_index": 125, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 284, + "price": 200, + "hold_effect": 112, + "amount": 3, + "field_use": "none", + "use_class": 1, + "kind_index": 57, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 285, + "price": 200, + "hold_effect": 113, + "amount": 3, + "field_use": "none", + "use_class": 1, + "kind_index": 20, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 286, + "price": 200, + "hold_effect": 114, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 53, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 287, + "price": 200, + "hold_effect": 115, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 17, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 288, + "price": 200, + "hold_effect": 116, + "amount": 8, + "field_use": "none", + "use_class": 1, + "kind_index": 134, + "rest": "000050001f000000000000000000000000000000000000000000000000" + }, + { + "index": 289, + "price": 3000, + "hold_effect": 117, + "amount": 4, + "field_use": "none", + "use_class": 1, + "kind_index": 96, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 290, + "price": 3000, + "hold_effect": 118, + "amount": 4, + "field_use": "none", + "use_class": 1, + "kind_index": 95, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 291, + "price": 3000, + "hold_effect": 119, + "amount": 4, + "field_use": "none", + "use_class": 1, + "kind_index": 98, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 292, + "price": 3000, + "hold_effect": 120, + "amount": 4, + "field_use": "none", + "use_class": 1, + "kind_index": 94, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 293, + "price": 3000, + "hold_effect": 121, + "amount": 4, + "field_use": "none", + "use_class": 1, + "kind_index": 93, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 294, + "price": 3000, + "hold_effect": 122, + "amount": 4, + "field_use": "none", + "use_class": 1, + "kind_index": 99, + "rest": "000046001f000000000000000000000000000000000000000000000000" + }, + { + "index": 295, + "price": 100, + "hold_effect": 123, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 118, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 296, + "price": 200, + "hold_effect": 124, + "amount": 30, + "field_use": "none", + "use_class": 1, + "kind_index": 4, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 297, + "price": 200, + "hold_effect": 125, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 18, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 298, + "price": 1000, + "hold_effect": 126, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 44, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 299, + "price": 1000, + "hold_effect": 127, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 130, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 300, + "price": 1000, + "hold_effect": 128, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 147, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 301, + "price": 1000, + "hold_effect": 129, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 78, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 302, + "price": 1000, + "hold_effect": 130, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 59, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 303, + "price": 1000, + "hold_effect": 131, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 42, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 304, + "price": 1000, + "hold_effect": 132, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 138, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 305, + "price": 1000, + "hold_effect": 133, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 32, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 306, + "price": 1000, + "hold_effect": 134, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 123, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 307, + "price": 1000, + "hold_effect": 135, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 83, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 308, + "price": 1000, + "hold_effect": 136, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 61, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 309, + "price": 1000, + "hold_effect": 137, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 135, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 310, + "price": 1000, + "hold_effect": 138, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 131, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 311, + "price": 1000, + "hold_effect": 139, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 26, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 312, + "price": 1000, + "hold_effect": 140, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 30, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 313, + "price": 1000, + "hold_effect": 141, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 63, + "rest": "00005a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 314, + "price": 9600, + "hold_effect": 83, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 89, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 315, + "price": 9600, + "hold_effect": 73, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 112, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 316, + "price": 9600, + "hold_effect": 107, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 49, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 317, + "price": 9600, + "hold_effect": 78, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 142, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 318, + "price": 9600, + "hold_effect": 74, + "amount": 20, + "field_use": "none", + "use_class": 1, + "kind_index": 114, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 319, + "price": 9600, + "hold_effect": 58, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 71, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 320, + "price": 9600, + "hold_effect": 59, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 102, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 321, + "price": 2100, + "hold_effect": 142, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 100, + "rest": "000050001f000000000000000000000000000000000000000000000000" + }, + { + "index": 322, + "price": 2100, + "hold_effect": 143, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 34, + "rest": "000050001f000000000000000000000000000000000000000000000000" + }, + { + "index": 323, + "price": 2100, + "hold_effect": 144, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 76, + "rest": "000050001f000000000000000000000000000000000000000000000000" + }, + { + "index": 324, + "price": 2100, + "hold_effect": 145, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 31, + "rest": "000032001f000000000000000000000000000000000000000000000000" + }, + { + "index": 325, + "price": 2100, + "hold_effect": 146, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 107, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 326, + "price": 2100, + "hold_effect": 67, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 105, + "rest": "000050001f000000000000000000000000000000000000000000000000" + }, + { + "index": 327, + "price": 2100, + "hold_effect": 56, + "amount": 10, + "field_use": "none", + "use_class": 1, + "kind_index": 106, + "rest": "001a1e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 328, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 0, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 329, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 1, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 330, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 2, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 331, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 3, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 332, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 4, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 333, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 5, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 334, + "price": 50000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 6, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 335, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 7, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 336, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 8, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 337, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 9, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 338, + "price": 50000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 10, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 339, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 11, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 340, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 12, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 341, + "price": 70000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 13, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 342, + "price": 90000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 14, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 343, + "price": 30000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 15, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 344, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 16, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 345, + "price": 50000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 17, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 346, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 18, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 347, + "price": 30000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 19, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 348, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 20, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 349, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 21, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 350, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 22, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 351, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 23, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 352, + "price": 70000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 24, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 353, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 25, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 354, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 26, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 355, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 27, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 356, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 28, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 357, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 29, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 358, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 30, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 359, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 31, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 360, + "price": 30000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 32, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 361, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 33, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 362, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 34, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 363, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 35, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 364, + "price": 50000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 36, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 365, + "price": 70000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 37, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 366, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 38, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 367, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 39, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 368, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 40, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 369, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 41, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 370, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 42, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 371, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 43, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 372, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 44, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 373, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 45, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 374, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 46, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 375, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 47, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 376, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 48, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 377, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 49, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 378, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 50, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 379, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 51, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 380, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 52, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 381, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 53, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 382, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 54, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 383, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 55, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 384, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 56, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 385, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 57, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 386, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 58, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 387, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 59, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 388, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 60, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 389, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 61, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 390, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 62, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 391, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 63, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 392, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 64, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 393, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 65, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 394, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 66, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 395, + "price": 90000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 67, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 396, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 68, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 397, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 69, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 398, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 70, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 399, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 71, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 400, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 72, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 401, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 73, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 402, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 74, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 403, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 75, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 404, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 76, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 405, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 77, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 406, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 78, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 407, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 79, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 408, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 80, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 409, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 81, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 410, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 82, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 411, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 83, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 412, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 84, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 413, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 85, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 414, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 86, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 415, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 87, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 416, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 88, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 417, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 89, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 418, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 90, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 419, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 91, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 420, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 95, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 421, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 96, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 422, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 97, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 423, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 98, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 424, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 99, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 425, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 100, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 426, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 39, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 427, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 40, + "rest": "0000000000000000000000000000000000000000000000000000000000" + }, + { + "index": 428, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 429, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 430, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 431, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 432, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 433, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 434, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 435, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 436, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 437, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "pal_pad", + "use_class": 0, + "kind_index": 5, + "rest": "000000007f020000000000000000000000000000000000000000000000" + }, + { + "index": 438, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 439, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 440, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 441, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 442, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "town_map", + "use_class": 0, + "kind_index": 3, + "rest": "000000007f020000000000000000000000000000000000000000000000" + }, + { + "index": 443, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 444, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 445, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 446, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000100000000000000000000000000000000000000" + }, + { + "index": 447, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "super_rod", + "use_class": 0, + "kind_index": 1, + "rest": "000000007f020000000200000000000000000000000000000000000000" + }, + { + "index": 448, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 449, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 450, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "bicycle", + "use_class": 0, + "kind_index": 0, + "rest": "000000007f020000000000000000000000000000000000000000000000" + }, + { + "index": 451, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 452, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 453, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 454, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 455, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 456, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 457, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 458, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 459, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 460, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 461, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 462, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 463, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 464, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 465, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "vs_recorder", + "use_class": 0, + "kind_index": 4, + "rest": "000000007f020000000000000000000000000000000000000000000000" + }, + { + "index": 466, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "gracidea", + "use_class": 0, + "kind_index": 6, + "rest": "000000007f020000000000000000000000000000000000000000000000" + }, + { + "index": 467, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 468, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 469, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 470, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 471, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "dowsing_machine", + "use_class": 0, + "kind_index": 2, + "rest": "000000007f020000000000000000000000000000000000000000000000" + }, + { + "index": 472, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 473, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 474, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 475, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 476, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 477, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 478, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 479, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 480, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 481, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 482, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 483, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 484, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 485, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 56, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 486, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 7, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 487, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 84, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 488, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 21, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 489, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 52, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 490, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 81, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 491, + "price": 20, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 6, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 492, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001000000000000000000000000000000000000000" + }, + { + "index": 493, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001100000000000000000000000000000000000000" + }, + { + "index": 494, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001200000000000000000000000000000000000000" + }, + { + "index": 495, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001300000000000000000000000000000000000000" + }, + { + "index": 496, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001400000000000000000000000000000000000000" + }, + { + "index": 497, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001500000000000000000000000000000000000000" + }, + { + "index": 498, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001600000000000000000000000000000000000000" + }, + { + "index": 499, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000100001700000000000000000000000000000000000000" + }, + { + "index": 500, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 50, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 501, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 502, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 503, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 504, + "price": 300, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 40, + "rest": "00001e009f200201000000000000040000000000000014000000000000" + }, + { + "index": 505, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 506, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 507, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 508, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 509, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 510, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 511, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 512, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 513, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 514, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 515, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 516, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 517, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 518, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 519, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 520, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 521, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 522, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 523, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 524, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 525, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 526, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 527, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 528, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 529, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 530, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 531, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 100, + "rest": "000000001f000000000000000000000000000000000000000000000000" + }, + { + "index": 532, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 533, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 13, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 534, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 535, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 536, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 100, + "rest": "000000001f020000000000000000000000000000000000000000000000" + }, + { + "index": 537, + "price": 500, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 54, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 538, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 37, + "rest": "000028001f000000000000000000000000000000000000000000000000" + }, + { + "index": 539, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 45, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 540, + "price": 200, + "hold_effect": 147, + "amount": 6, + "field_use": "none", + "use_class": 1, + "kind_index": 113, + "rest": "00003c001f000000000000000000000000000000000000000000000000" + }, + { + "index": 541, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 2, + "rest": "00000a001f000000010000000000000000000000000000000000000000" + }, + { + "index": 542, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 108, + "rest": "00000a001f000000010000000000000000000000000000000000000000" + }, + { + "index": 543, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 110, + "rest": "00000a001f000000000000000000000000000000000000000000000000" + }, + { + "index": 544, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 5, + "rest": "00001e001f000000000000000000000000000000000000000000000000" + }, + { + "index": 545, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 0, + "rest": "00001e001f000000010000000000000000000000000000000000000000" + }, + { + "index": 546, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 13, + "rest": "00001e001f000000010000000000000000000000000000000000000000" + }, + { + "index": 547, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 33, + "rest": "00001e001f000000010000000000000000000000000000000000000000" + }, + { + "index": 548, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 41, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 549, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 141, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 550, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 35, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 551, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 51, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 552, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 58, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 553, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 40, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 554, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 92, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 555, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 55, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 556, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 46, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 557, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 101, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 558, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 11, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 559, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 111, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 560, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 50, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 561, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 28, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 562, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 21, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 563, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 132, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 564, + "price": 200, + "hold_effect": 147, + "amount": 0, + "field_use": "none", + "use_class": 1, + "kind_index": 88, + "rest": "000000001f000000010000000000000000000000000000000000000000" + }, + { + "index": 565, + "price": 3000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 57, + "rest": "000014009f000001000000000000081e01000000000000000302010000" + }, + { + "index": 566, + "price": 3000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 58, + "rest": "000014009f000001000000000000101e00010000000000000302010000" + }, + { + "index": 567, + "price": 3000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 59, + "rest": "000014009f000001000000000000201e00000100000000000302010000" + }, + { + "index": 568, + "price": 3000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 60, + "rest": "000014009f000001000000000000801e00000000010000000302010000" + }, + { + "index": 569, + "price": 3000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 61, + "rest": "000014009f000001000000000000001f00000000000100000302010000" + }, + { + "index": 570, + "price": 3000, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 62, + "rest": "000014009f000001000000000000401e00000001000000000302010000" + }, + { + "index": 571, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 53, + "rest": "000014001f000001000000000000000000000000000000000000000000" + }, + { + "index": 572, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 12, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 573, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 51, + "rest": "000064001f000001000000000000000000000000000000000000000000" + }, + { + "index": 574, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 17, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 575, + "price": 200, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 48, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 576, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": "ball", + "kind_index": 16, + "rest": "000000001f080100001800000000000000000000000000000000000000" + }, + { + "index": 577, + "price": 1000, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 10, + "rest": "00001e001f100301000000000000000000000000000000000000000000" + }, + { + "index": 578, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 8, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 579, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 12, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 580, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 1, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 581, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 3, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 582, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 50, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 583, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 11, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 584, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 60, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 585, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 63, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 586, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 62, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 587, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 65, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 588, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 59, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 589, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 64, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 590, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 2, + "kind_index": 61, + "rest": "00001e001f000001000000000000000000000000000000000000000000" + }, + { + "index": 591, + "price": 100, + "hold_effect": 0, + "amount": 0, + "field_use": "medicine", + "use_class": 0, + "kind_index": 30, + "rest": "00001e009f400201003f00000000000000000000000000000000000000" + }, + { + "index": 592, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000020000000000000000000000000000000" + }, + { + "index": 593, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000002000000000000000000000000000000000" + }, + { + "index": 594, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000200000000000000000000000000000000000" + }, + { + "index": 595, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000200000000000000000000000000000000" + }, + { + "index": 596, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000020000000000000000000000000000000000" + }, + { + "index": 597, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000020000000000000000000000000000000000000" + }, + { + "index": 598, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000002000000000000000000000000000000" + }, + { + "index": 599, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000003000000000000000000000000000000000" + }, + { + "index": 600, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000300000000000000000000000000000000000" + }, + { + "index": 601, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000300000000000000000000000000000000" + }, + { + "index": 602, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000030000000000000000000000000000000000" + }, + { + "index": 603, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000030000000000000000000000000000000000000" + }, + { + "index": 604, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000003000000000000000000000000000000" + }, + { + "index": 605, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000006000000000000000000000000000000000" + }, + { + "index": 606, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000600000000000000000000000000000000000" + }, + { + "index": 607, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000600000000000000000000000000000000" + }, + { + "index": 608, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000060000000000000000000000000000000000" + }, + { + "index": 609, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000060000000000000000000000000000000000000" + }, + { + "index": 610, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000006000000000000000000000000000000" + }, + { + "index": 611, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000000000000000000000000000000000000" + }, + { + "index": 612, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000000000000000000000000000000000000" + }, + { + "index": 613, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000000000000000000000000000000000000" + }, + { + "index": 614, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000000000000000000000000000000000000" + }, + { + "index": 615, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 3, + "kind_index": 50, + "rest": "000000001f000001000000000030000000000000000000000000000000" + }, + { + "index": 616, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 9, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 617, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 10, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 618, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 92, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 619, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 93, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 620, + "price": 10000, + "hold_effect": 0, + "amount": 0, + "field_use": "machine", + "use_class": 0, + "kind_index": 94, + "rest": "000000003f010000000000000000000000000000000000000000000000" + }, + { + "index": 621, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 7, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 622, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 11, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 623, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 14, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 624, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 15, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 625, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 16, + "rest": "000000003f020000000000000000000000000000000000000000000000" + }, + { + "index": 626, + "price": 0, + "hold_effect": 0, + "amount": 0, + "field_use": "none", + "use_class": 0, + "kind_index": 7, + "rest": "000000003f020000000000000000000000000000000000000000000000" + } +] diff --git a/docs/src/content/docs/guides/porting-scripts.md b/docs/src/content/docs/guides/porting-scripts.md index 1fe0757..219da5c 100644 --- a/docs/src/content/docs/guides/porting-scripts.md +++ b/docs/src/content/docs/guides/porting-scripts.md @@ -67,12 +67,18 @@ end of your function. | `warp MAP, x, y` | `ctx.warp(region, bank, map, x, y, facing)` | | `setdynamicwarp ...` | `ctx.setDynamicWarp(region, bank, map, x, y, facing)` | -Item ids come from the generated `Items` object, never a raw number: -`ctx.giveItem(Items.POKE_BALL, 5)`. It is generated from the decomp item header, -so every item the games know about is in it. The client keys an item by -`regionId * 1000 + itemId` and holds one item table per region, so the ids in -`Items` sit in the region whose table matches the decomp numbering. Sending the -same number under another region reaches a different item entirely. +Items are named, never numbered: `ctx.giveItem(Items.POKE_BALL, 5)`. A value in +the generated `Items` object is an identity rather than an id, and `ItemRegistry` +maps it to the ids the wire uses, so a script never sees a number and an item +listed twice in the client's table still resolves. Services translate at the +point they build a packet. + +`Items` is generated from the Gen 5 table the live client speaks, so it holds +what the client can actually show. An item the decomp has and the client does not +is simply absent, and naming it fails the build rather than handing the player +something that arrives as another item or as nothing. The Teachy TV in Viridian +City is the case that came up first. Where the decomp's item does not exist, +drop the reward and say so, rather than substituting a different one. `ctx.warp` continues into the destination map's ON_TRANSITION and ON_FRAME scripts on the same coroutine, exactly the way the decomp's `warp` does, so a diff --git a/docs/src/content/docs/guides/writing-generators.md b/docs/src/content/docs/guides/writing-generators.md index d831fbf..4007af3 100644 --- a/docs/src/content/docs/guides/writing-generators.md +++ b/docs/src/content/docs/guides/writing-generators.md @@ -30,7 +30,7 @@ Gradle task (`generateMaps`, `generateMoves`, `generatePokemon`, ...). ## Pick a data source first -There are two ways to choose which decomp to read from: +There are three ways to choose which decomp to read from: - **By region:** for data that is different in each region, like maps. Hoenn maps come from `pokeemerald`, Kanto maps from `pokefirered`. The generator gets @@ -39,13 +39,21 @@ There are two ways to choose which decomp to read from: and species. We just read one decomp (`pokeemerald`). Where the two games disagree on a detail (a wild held item, a flee rate) we accept the values from that one decomp instead of trying to merge them. +- **Whatever the live client speaks:** for data the client indexes itself, like + items. The retail client answers in the Gen 5 table no matter which region the + player is in, so `generateItem` reads `decomp/pokeblack` and the GBA numbering + never enters the picture. Rule of thumb: if the same thing (a move, a Pokémon) exists in both games, use a -single source. If the thing belongs to one region, use by-region. +single source. If the thing belongs to one region, use by-region. If the client +is the one doing the lookup, follow the client. -> **Note:** the NDS decomps (`pokeblack`, `pokeheartgold`, `pokeplatinum`) are -> **not implemented yet**. They use 3D maps and a different data format, so only -> the GBA decomps (`pokeemerald`, `pokefirered`) are wired up today. +> **Note:** the NDS decomps (`pokeheartgold`, `pokeplatinum`) are submodules but +> **not implemented**. They use 3D maps and a different data format, so every +> generator but the item one reads the GBA decomps (`pokeemerald`, +> `pokefirered`). Item data is the exception: it comes from two JSON files +> extracted from the Gen 5 decomp and committed under `decomp/pokeblack`, whose +> source repository is private and so cannot be a submodule. ## The pieces of a generator diff --git a/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/GameProtocol.kt b/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/GameProtocol.kt index 5ae1688..aaa1546 100644 --- a/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/GameProtocol.kt +++ b/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/GameProtocol.kt @@ -106,7 +106,7 @@ object GameProtocol : Protocol() { bidi(0x22u, EntityInteractPacketCodec) c2s(0x23u, ExchangeItemRequestPacketCodec) - s2c(0x23u, EventOverlayStatePacketCodec) + s2c(0x23u, ShopCatalogPacketCodec) c2s(0x24u, ShopSellRequestPacketCodec) s2c(0x24u, NpcPanelTogglePacketCodec) diff --git a/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/EventOverlayStatePacket.kt b/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/EventOverlayStatePacket.kt deleted file mode 100644 index dc18954..0000000 --- a/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/EventOverlayStatePacket.kt +++ /dev/null @@ -1,134 +0,0 @@ -package de.fiereu.openmmo.net.game.packets - -import de.fiereu.bytecodec.* - -private const val GRID_OVERLAY_TYPE: Int = 1 - -data class OverlayGridPoint(val x: Short, val y: Short) - -data class OverlayRegion( - val regionId: Short, - val secondary: Short, - val gridPoints: List?, - val value: Int?, -) - -data class OverlayHole(val regionId: Short, val secondary: Short) - -data class EventOverlayStatePacket( - val active: Boolean, - val overlayType: Byte, - val flagBits: Byte, - val ignoredEnum: Byte, - val timeRemaining: Int?, - val valueA: Int?, - val valueB: Int?, - val anchorEntityId: Long?, - val regions: List, - val holes: List, -) - -object EventOverlayStatePacketCodec : PacketCodec() { - override fun CodecScope.body(): EventOverlayStatePacket { - val codec = EventOverlayStateCodec - return field(codec) { it } - } -} - -private val EventOverlayStateCodec: Codec = - object : Codec { - override fun read(buf: ReadBuffer): EventOverlayStatePacket { - val typeByte = S8.read(buf) - val active = typeByte.toInt() != -1 - if (!active) { - return EventOverlayStatePacket( - active = false, - overlayType = typeByte, - flagBits = 0, - ignoredEnum = 0, - timeRemaining = null, - valueA = null, - valueB = null, - anchorEntityId = null, - regions = emptyList(), - holes = emptyList(), - ) - } - val grid = typeByte.toInt() == GRID_OVERLAY_TYPE - val flagBits = S8.read(buf) - val fb = flagBits.toInt() - val ignoredEnum = S8.read(buf) - val timeRemaining = if (fb and 32 != 0) S32LE.read(buf) else null - val valueA = if (fb and 8 != 0) S32LE.read(buf) else null - val valueB = if (fb and 16 != 0) S32LE.read(buf) else null - val anchorEntityId = if (fb and 64 != 0) S64LE.read(buf) else null - val regionCount = U16LE.read(buf) - val regions = ArrayList(regionCount) - repeat(regionCount) { - val regionId = S16LE.read(buf) - val secondary = S16LE.read(buf) - if (grid) { - val n = U8.read(buf) - val points = ArrayList(n) - repeat(n) { points.add(OverlayGridPoint(S16LE.read(buf), S16LE.read(buf))) } - regions.add(OverlayRegion(regionId, secondary, points, null)) - } else { - val v = S32LE.read(buf) - regions.add(OverlayRegion(regionId, secondary, null, v)) - } - } - val holes = ArrayList() - if (grid && fb and 4 != 0) { - val holeCount = U16LE.read(buf) - repeat(holeCount) { holes.add(OverlayHole(S16LE.read(buf), S16LE.read(buf))) } - } - return EventOverlayStatePacket( - active = true, - overlayType = typeByte, - flagBits = flagBits, - ignoredEnum = ignoredEnum, - timeRemaining = timeRemaining, - valueA = valueA, - valueB = valueB, - anchorEntityId = anchorEntityId, - regions = regions, - holes = holes, - ) - } - - override fun write(buf: WriteBuffer, value: EventOverlayStatePacket) { - S8.write(buf, value.overlayType) - if (!value.active) return - val grid = value.overlayType.toInt() == GRID_OVERLAY_TYPE - S8.write(buf, value.flagBits) - val fb = value.flagBits.toInt() - S8.write(buf, value.ignoredEnum) - if (fb and 32 != 0) S32LE.write(buf, value.timeRemaining!!) - if (fb and 8 != 0) S32LE.write(buf, value.valueA!!) - if (fb and 16 != 0) S32LE.write(buf, value.valueB!!) - if (fb and 64 != 0) S64LE.write(buf, value.anchorEntityId!!) - U16LE.write(buf, value.regions.size) - for (r in value.regions) { - S16LE.write(buf, r.regionId) - S16LE.write(buf, r.secondary) - if (grid) { - val points = - r.gridPoints ?: throw MalformedPacketException("grid overlay region missing points") - U8.write(buf, points.size) - for (p in points) { - S16LE.write(buf, p.x) - S16LE.write(buf, p.y) - } - } else { - S32LE.write(buf, r.value!!) - } - } - if (grid && fb and 4 != 0) { - U16LE.write(buf, value.holes.size) - for (h in value.holes) { - S16LE.write(buf, h.regionId) - S16LE.write(buf, h.secondary) - } - } - } - } diff --git a/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/ShopCatalogPacket.kt b/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/ShopCatalogPacket.kt new file mode 100644 index 0000000..3dd119a --- /dev/null +++ b/protocols.game/src/main/kotlin/de/fiereu/openmmo/net/game/packets/ShopCatalogPacket.kt @@ -0,0 +1,59 @@ +package de.fiereu.openmmo.net.game.packets + +import de.fiereu.bytecodec.* + +/** [stock] is 0x7FFF on every captured mart line, which the client reads as an endless shelf. */ +data class ShopItem( + val itemId: Short, + val unknownA: Short, + val stock: Short, + val price: Int, +) + +object ShopItemCodec : PacketCodec() { + override fun CodecScope.body(): ShopItem { + val itemId = field(S16LE) { it.itemId } + val unknownA = field(S16LE) { it.unknownA } + val stock = field(S16LE) { it.stock } + val price = field(S32LE) { it.price } + return ShopItem(itemId, unknownA, stock, price) + } +} + +/** + * Opens or closes the shop window. A close is the single byte [CLOSED] with no body, so everything + * after the first byte only rides along on an open. + */ +data class ShopCatalogPacket( + val kind: Byte, + val shopId: Short? = null, + val unknownA: Int? = null, + val npcEntityId: Long? = null, + val items: List = emptyList(), +) { + companion object { + const val OPEN: Byte = 0 + const val CLOSED: Byte = -1 + + /** + * [unknownA] is the same value in every capture, across three different shops, so it is sent + * back rather than derived. + */ + fun open(shopId: Short, npcEntityId: Long, items: List): ShopCatalogPacket = + ShopCatalogPacket(OPEN, shopId, CAPTURED_UNKNOWN_A, npcEntityId, items) + + private const val CAPTURED_UNKNOWN_A = 0x1A5190 + } +} + +object ShopCatalogPacketCodec : PacketCodec() { + override fun CodecScope.body(): ShopCatalogPacket { + val kind = field(S8) { it.kind } + val open = kind == ShopCatalogPacket.OPEN + val shopId = optionalField(open, S16LE) { it.shopId } + val unknownA = optionalField(open, S32LE) { it.unknownA } + val npcEntityId = optionalField(open, S64LE) { it.npcEntityId } + val items = optionalField(open, ShopItemCodec.listPrefixed(U16LE)) { it.items } + return ShopCatalogPacket(kind, shopId, unknownA, npcEntityId, items ?: emptyList()) + } +} diff --git a/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/ShopCatalogPacketTest.kt b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/ShopCatalogPacketTest.kt new file mode 100644 index 0000000..250b5bc --- /dev/null +++ b/protocols.game/src/test/kotlin/de/fiereu/openmmo/net/game/ShopCatalogPacketTest.kt @@ -0,0 +1,46 @@ +package de.fiereu.openmmo.net.game + +import de.fiereu.openmmo.common.test.assertBytesRoundtrip +import de.fiereu.openmmo.common.test.decodeBytes +import de.fiereu.openmmo.common.test.fixture +import de.fiereu.openmmo.net.game.packets.ExchangeItemRequestPacketCodec +import de.fiereu.openmmo.net.game.packets.ShopCatalogPacket +import de.fiereu.openmmo.net.game.packets.ShopCatalogPacketCodec +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.shouldBe + +class ShopCatalogPacketTest : + FunSpec({ + test("the viridian mart catalog decodes to its shelves and their prices") { + val bytes = fixture("game/s2c/23/mart_catalog.bin") + + val packet = ShopCatalogPacketCodec.decodeBytes(bytes) + + packet.kind shouldBe ShopCatalogPacket.OPEN + packet.shopId shouldBe 103 + packet.npcEntityId shouldBe 0x1AD3B85EBE48E000L + packet.items.map { it.itemId.toInt() } shouldBe listOf(5004, 5017, 5018, 5022, 5019) + packet.items.map { it.price } shouldBe listOf(200, 200, 200, 300, 300) + // Every line carries the same endless shelf marker. + packet.items.map { it.stock.toInt() }.toSet() shouldBe setOf(0x7FFF) + ShopCatalogPacketCodec.assertBytesRoundtrip(bytes) + } + + test("a close carries nothing but its marker") { + val bytes = fixture("game/s2c/23/shop_closed.bin") + + ShopCatalogPacketCodec.decodeBytes(bytes).kind shouldBe ShopCatalogPacket.CLOSED + + ShopCatalogPacketCodec.assertBytesRoundtrip(bytes) + } + + test("a buy names the item and how many of it") { + val bytes = fixture("game/c2s/23/buy_poke_balls.bin") + + val packet = ExchangeItemRequestPacketCodec.decodeBytes(bytes) + + packet.itemEntityRef.toInt() shouldBe 5004 + packet.quantity.toInt() shouldBe 3 + ExchangeItemRequestPacketCodec.assertBytesRoundtrip(bytes) + } + }) diff --git a/protocols.game/src/test/resources/fixtures/game/c2s/23/buy_poke_balls.bin b/protocols.game/src/test/resources/fixtures/game/c2s/23/buy_poke_balls.bin new file mode 100644 index 0000000000000000000000000000000000000000..38d590dc50c7771442d4a27636470037214cbe3d GIT binary patch literal 5 McmeAXW@caj00R~PqW}N^ literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/23/mart_catalog.bin b/protocols.game/src/test/resources/fixtures/game/s2c/23/mart_catalog.bin new file mode 100644 index 0000000000000000000000000000000000000000..afb6bf5275f141603d78d0887ac0f9a5fb0124fd GIT binary patch literal 67 ycmZQbXP6Ku#lY~uV_)2k%TlZiJ;IC(|LadMFfh!7vu43r^S~?}Mh1r2a25co!V=X0 literal 0 HcmV?d00001 diff --git a/protocols.game/src/test/resources/fixtures/game/s2c/23/shop_closed.bin b/protocols.game/src/test/resources/fixtures/game/s2c/23/shop_closed.bin new file mode 100644 index 0000000..ce542ef --- /dev/null +++ b/protocols.game/src/test/resources/fixtures/game/s2c/23/shop_closed.bin @@ -0,0 +1 @@ +ÿ \ No newline at end of file diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/handler/GameAppHandler.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/handler/GameAppHandler.kt index da7c1f6..e8c9fb5 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/handler/GameAppHandler.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/handler/GameAppHandler.kt @@ -15,6 +15,7 @@ import de.fiereu.openmmo.net.game.packets.CreateCharacterPacket import de.fiereu.openmmo.net.game.packets.DeleteCharacterPacket import de.fiereu.openmmo.net.game.packets.DialogChoicePacket import de.fiereu.openmmo.net.game.packets.EntityInteractPacket +import de.fiereu.openmmo.net.game.packets.ExchangeItemRequestPacket import de.fiereu.openmmo.net.game.packets.FaceDirectionPacket import de.fiereu.openmmo.net.game.packets.JoinPacket import de.fiereu.openmmo.net.game.packets.KeepAlivePacket @@ -26,6 +27,7 @@ import de.fiereu.openmmo.net.game.packets.RequestCharactersPacket import de.fiereu.openmmo.net.game.packets.RequestPlayerPacket import de.fiereu.openmmo.net.game.packets.RequestSocialProfilePacket import de.fiereu.openmmo.net.game.packets.SelectCharacterPacket +import de.fiereu.openmmo.net.game.packets.ShopSellRequestPacket import de.fiereu.openmmo.net.game.packets.TileInteractPacket import de.fiereu.openmmo.net.game.packets.UnblockPlayerPacket import de.fiereu.openmmo.net.game.packets.battle.BattleActionPacket @@ -69,6 +71,7 @@ import de.fiereu.openmmo.server.game.services.LoginService import de.fiereu.openmmo.server.game.services.MovementService import de.fiereu.openmmo.server.game.services.MultiplayerService import de.fiereu.openmmo.server.game.services.PresenceService +import de.fiereu.openmmo.server.game.services.ShopService import de.fiereu.openmmo.server.game.services.SocialService import de.fiereu.openmmo.server.game.services.command.ChatCommandService import de.fiereu.openmmo.server.game.session.PLAYER_STATE @@ -95,6 +98,7 @@ constructor( private val guildService: GuildService, private val battleService: BattleService, private val chatCommandService: ChatCommandService, + private val shopService: ShopService, private val scriptRunner: ScriptRunner, private val sessionRegistry: SessionRegistry, private val characterStore: CharacterStore, @@ -116,6 +120,8 @@ constructor( onSuspend { event -> interactionService.onTileInteract(event) } onSuspend { event -> dialogService.onInteractive(event) } onSuspend { event -> dialogService.onDialogChoice(event) } + onSuspend { event -> shopService.onBuy(event) } + onSuspend { event -> shopService.onSell(event) } on { event -> socialService.onAddFriend(event) } on { event -> socialService.onRemoveFriend(event) } diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptContext.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptContext.kt index ee8046a..8d8c166 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptContext.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptContext.kt @@ -5,6 +5,7 @@ import de.fiereu.openmmo.common.DynamicWarp import de.fiereu.openmmo.common.dialog.DialogLine import de.fiereu.openmmo.common.enums.Direction import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemDef import de.fiereu.openmmo.maps.MapManager import de.fiereu.openmmo.net.game.packets.dialog.TextPokemonSpeciesArg import de.fiereu.openmmo.server.game.battle.BattleResult @@ -14,6 +15,7 @@ import de.fiereu.openmmo.server.game.services.DialogService import de.fiereu.openmmo.server.game.services.MapEntryScripts import de.fiereu.openmmo.server.game.services.ScriptMovementService import de.fiereu.openmmo.server.game.services.ScriptWarpService +import de.fiereu.openmmo.server.game.services.ShopService import de.fiereu.openmmo.server.game.services.StoryClientState import de.fiereu.openmmo.server.game.services.StoryPlayerService import de.fiereu.openmmo.server.game.services.StoryService @@ -36,6 +38,7 @@ internal constructor( internal val characters: CharacterStore? = null, private val maps: MapManager? = null, private val entryScripts: MapEntryScripts? = null, + private val shops: ShopService? = null, ) { private val characterId: Long? get() = state.characterId @@ -135,11 +138,18 @@ internal constructor( fun healParty() = checkNotNull(player) { STORY_PLAYER_UNAVAILABLE }.healParty(session, state) - suspend fun giveItem(itemId: Int, quantity: Int = 1): Boolean = - checkNotNull(player) { STORY_PLAYER_UNAVAILABLE }.giveItem(session, state, itemId, quantity) + suspend fun giveItem(item: ItemDef, quantity: Int = 1): Boolean = + checkNotNull(player) { STORY_PLAYER_UNAVAILABLE }.giveItem(session, state, item, quantity) /** Take an item back out of the bag, the decomp removeitem. False when the bag lacks it. */ - suspend fun takeItem(itemId: Int, quantity: Int = 1): Boolean = giveItem(itemId, -quantity) + suspend fun takeItem(item: ItemDef, quantity: Int = 1): Boolean = giveItem(item, -quantity) + + /** + * Opens the mart window on [items], the decomp pokemart. It does not wait: the player shops while + * the script ends, because nothing in the capture tells the server when the window closed. + */ + fun pokemart(vararg items: ItemDef) = + checkNotNull(shops) { "Shop service is unavailable" }.open(session, entityId, items.toList()) /** Run a non-catchable, non-escapable story battle and wait for its result. */ suspend fun battle(dexId: Int, level: Int, vararg moveIds: Int): BattleResult = diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptRunner.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptRunner.kt index 86c727e..a442009 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptRunner.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/ScriptRunner.kt @@ -7,6 +7,7 @@ import de.fiereu.openmmo.server.game.services.DialogService import de.fiereu.openmmo.server.game.services.MapEntryScripts import de.fiereu.openmmo.server.game.services.ScriptMovementService import de.fiereu.openmmo.server.game.services.ScriptWarpService +import de.fiereu.openmmo.server.game.services.ShopService import de.fiereu.openmmo.server.game.services.StoryPlayerService import de.fiereu.openmmo.server.game.services.StoryService import de.fiereu.openmmo.server.game.session.PlayerState @@ -44,6 +45,7 @@ constructor( private val characterStore: CharacterStore, private val mapManager: MapManager, private val entryScripts: MapEntryScripts, + private val shopService: ShopService, ) { fun run(session: SessionContext, state: PlayerState, script: Script, entityId: Long) = runAll(session, state, listOf(script), entityId) @@ -94,6 +96,7 @@ constructor( characterStore, mapManager, entryScripts, + shopService, ) scope.launch { var finished = false diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/hoenn/RustboroCity_Gym.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/hoenn/RustboroCity_Gym.kt index c74e20c..c28982b 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/hoenn/RustboroCity_Gym.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/hoenn/RustboroCity_Gym.kt @@ -1,6 +1,7 @@ package de.fiereu.openmmo.server.game.script.generated.hoenn import de.fiereu.openmmo.dialog.generated.hoenn.RustboroCity_Gym +import de.fiereu.openmmo.items.generated.Items import de.fiereu.openmmo.server.game.battle.BattleResult import de.fiereu.openmmo.server.game.script.Script import de.fiereu.openmmo.server.game.script.ScriptContext @@ -9,7 +10,6 @@ import de.fiereu.openmmo.story.generated.hoenn.HoennVars private const val GEODUDE = 74 private const val NOSEPASS = 299 -private const val TM39_ROCK_TOMB_ITEM = 5327 /** * Not ported yet. Decomp body: @@ -52,7 +52,7 @@ internal object RustboroCity_Gym_EventScript_Roxanne : Script { } private suspend fun giveRockTomb(ctx: ScriptContext) { - if (ctx.giveItem(TM39_ROCK_TOMB_ITEM)) { + if (ctx.giveItem(Items.TM39)) { ctx.setFlag(HoennFlags.FLAG_RECEIVED_TM_ROCK_TOMB) ctx.say(RustboroCity_Gym.ExplainRockTomb) } diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/PalletTown_ProfessorOaksLab.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/PalletTown_ProfessorOaksLab.kt index 2a222bb..4b21187 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/PalletTown_ProfessorOaksLab.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/PalletTown_ProfessorOaksLab.kt @@ -265,7 +265,7 @@ internal object PalletTown_ProfessorOaksLab_EventScript_ProfOak : Script { private suspend fun receiveDexScene(ctx: ScriptContext) { ctx.say(PalletTown_ProfessorOaksLab.OakHaveSomethingForMe) ctx.sign(PalletTown_ProfessorOaksLab.DeliveredOaksParcel) - ctx.takeItem(Items.OAKS_PARCEL) + ctx.takeItem(Items.PARCEL) ctx.say(PalletTown_ProfessorOaksLab.OakCustomBallIOrdered) ctx.sign(PalletTown_ProfessorOaksLab.RivalGramps) diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity.kt index 35019bb..9ba4148 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity.kt @@ -60,16 +60,16 @@ internal object ViridianCity_EventScript_TutorialTriggerRight : Script { } } -/** The old man's catching demonstration, which ends with him handing over the Teachy TV. */ private suspend fun tutorialBattle(ctx: ScriptContext) { ctx.sayNpc(LOCALID_TUTORIAL_MAN, ViridianCity.ShowYouHowToCatchMons) // TODO Play the catching tutorial battle // The decomp runs StartOldManTutorialBattle, a scripted battle the old man fights for the // player. Scripted battles always use the player's own party today, so the demonstration is - // skipped and only its reward is given. + // skipped. ctx.sayNpc(LOCALID_TUTORIAL_MAN, ViridianCity.ThatWasEducationalTakeThis) ctx.setVar(KantoVars.VAR_MAP_SCENE_VIRIDIAN_CITY_OLD_MAN, 2) - ctx.giveItem(Items.TEACHY_TV) + // The decomp hands over a Teachy TV here. PokeMMO has no such item, so the reward is dropped + // rather than substituted, and the lines around it are all the player gets. ctx.sayNpc(LOCALID_TUTORIAL_MAN, ViridianCity.WatchThatToLearnBasics) } diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity_Mart.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity_Mart.kt index 464a2c4..baf8c72 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity_Mart.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/script/generated/kanto/ViridianCity_Mart.kt @@ -1,5 +1,6 @@ package de.fiereu.openmmo.server.game.script.generated.kanto +import de.fiereu.openmmo.dialog.generated.kanto.Misc import de.fiereu.openmmo.dialog.generated.kanto.ViridianCity_Mart import de.fiereu.openmmo.items.generated.Items import de.fiereu.openmmo.server.game.script.MovementStep.FACE_DOWN @@ -23,7 +24,7 @@ internal object ViridianCity_Mart_EventScript_ParcelScene : Script { ) ctx.sayNpc(LOCALID_MART_CLERK, ViridianCity_Mart.TakeThisToProfOak) ctx.setVar(KantoVars.VAR_MAP_SCENE_VIRIDIAN_CITY_MART, 1) - ctx.giveItem(Items.OAKS_PARCEL) + ctx.giveItem(Items.PARCEL) ctx.sign(ViridianCity_Mart.ReceivedOaksParcelFromClerk) ctx.setVar(KantoVars.VAR_MAP_SCENE_PALLET_TOWN_PROFESSOR_OAKS_LAB, 5) } @@ -34,8 +35,8 @@ internal object ViridianCity_Mart_EventScript_Clerk : Script { if (ctx.getVar(KantoVars.VAR_MAP_SCENE_VIRIDIAN_CITY_MART) == 1) { return ctx.say(ViridianCity_Mart.SayHiToOakForMe) } - // TODO Open the mart shop - // The decomp runs pokemart with the shop's item list. Buying and selling needs a shop verb. + ctx.say(Misc.Text_MayIHelpYou) + ctx.pokemart(Items.POKE_BALL, Items.POTION, Items.ANTIDOTE, Items.PARLYZ_HEAL) } } diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/BattleService.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/BattleService.kt index e53cca2..2b83938 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/BattleService.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/BattleService.kt @@ -7,6 +7,7 @@ import de.fiereu.openmmo.common.enums.BattleAction import de.fiereu.openmmo.common.enums.IVs import de.fiereu.openmmo.common.enums.PokemonContainer import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemRegistry import de.fiereu.openmmo.items.generated.Items import de.fiereu.openmmo.moves.MoveRegistry import de.fiereu.openmmo.net.game.packets.MapLoadedAckPacket @@ -43,8 +44,6 @@ import javax.inject.Singleton private val log = KotlinLogging.logger {} -private val POKE_BALL_ITEM: Short = Items.POKE_BALL.toShort() - /** * A prompt waiting for its answer, kept after the battle ends. A trainer battle can raise one * monster past a level more than once, so these are held per monster rather than per player. @@ -75,8 +74,11 @@ constructor( private val speciesRegistry: SpeciesRegistry, private val moveRegistry: MoveRegistry, private val trainers: TrainerRegistry, + private val items: ItemRegistry, ) { + private val pokeBallItemId: Short by lazy { items.idOf(Items.POKE_BALL).toShort() } + private val pendingLearns = ConcurrentHashMap() fun onBattlePacket(event: PacketEvent<*>) { @@ -425,7 +427,7 @@ constructor( battle.session.send( BattleListEventPacket( kind = 0, - value = POKE_BALL_ITEM, + value = pokeBallItemId, subKind = 4, detail = BattleListEventDetail(listType = 1, value = 1), ), diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/ShopService.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/ShopService.kt new file mode 100644 index 0000000..06901a6 --- /dev/null +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/ShopService.kt @@ -0,0 +1,143 @@ +package de.fiereu.openmmo.server.game.services + +import de.fiereu.network.PacketEvent +import de.fiereu.network.SessionContext +import de.fiereu.openmmo.items.ItemDef +import de.fiereu.openmmo.items.ItemRegistry +import de.fiereu.openmmo.net.game.packets.ExchangeItemRequestPacket +import de.fiereu.openmmo.net.game.packets.LocalCharacterDeltaPacket +import de.fiereu.openmmo.net.game.packets.ShopCatalogPacket +import de.fiereu.openmmo.net.game.packets.ShopItem +import de.fiereu.openmmo.net.game.packets.ShopSellRequestPacket +import de.fiereu.openmmo.server.game.session.OPEN_SHOP +import de.fiereu.openmmo.server.game.session.OpenShop +import de.fiereu.openmmo.server.game.session.PLAYER_STATE +import de.fiereu.openmmo.server.game.storage.CharacterStore +import io.github.oshai.kotlinlogging.KotlinLogging +import javax.inject.Inject +import javax.inject.Singleton + +private val log = KotlinLogging.logger {} + +// From the captures: every mart carries the same shop id, and a shelf the player cannot empty. +private const val MART_SHOP_ID: Short = 103 +private const val ENDLESS_SHELF: Short = 0x7FFF +// A bag stack id is the item id shifted up, with the item entity tag in the low bits. +private const val ITEM_ENTITY_SHIFT = 16 + +@Singleton +class ShopService +@Inject +constructor( + private val characterStore: CharacterStore, + private val items: ItemRegistry, +) { + + fun open(session: SessionContext, npcEntityId: Long, shelf: List) { + // Deliberately the item table's price, until we know where the real one comes from. The + // mart_catalog capture charges 200 for a Potion where the table says 300. + val offered = + shelf.mapNotNull { item -> + val id = items.idOrNull(item) + if (id == null) { + log.warn { "Shop offered ${item.name}, which has no id in this build" } + null + } else { + item to ShopItem(id.toShort(), 1, ENDLESS_SHELF, item.price) + } + } + val state = session.attributes[PLAYER_STATE] ?: return + session.attributes[OPEN_SHOP] = + OpenShop(state.regionId, state.bankId, state.mapId, offered.toMap()) + session.send(ShopCatalogPacket.open(MART_SHOP_ID, npcEntityId, offered.map { it.second })) + } + + /** The shelf, if one is open and the player is still standing where they opened it. */ + private fun openShelf(session: SessionContext): Map? { + val open = session.attributes[OPEN_SHOP] ?: return null + val state = session.attributes[PLAYER_STATE] ?: return null + if (open.regionId != state.regionId || + open.bankId != state.bankId || + open.mapId != state.mapId) { + session.attributes.remove(OPEN_SHOP) + return null + } + return open.shelf + } + + suspend fun onBuy(event: PacketEvent) { + val session = event.session + val shelf = openShelf(session) ?: return + val charId = session.attributes[PLAYER_STATE]?.characterId ?: return + val quantity = event.packet.quantity.toInt() + val item = items.get(event.packet.itemEntityRef.toInt()) + val offer = item?.let { shelf[it] } + if (offer == null || quantity <= 0) { + log.warn { + "char=$charId asked for $quantity of ${event.packet.itemEntityRef}, not on this shelf" + } + return + } + + val itemId = offer.itemId.toInt() + // A quantity is a signed Short, so a dear enough item would wrap the product negative. + val cost = offer.price.toLong() * quantity + val stored = characterStore.getCharacter(charId) ?: return + if (stored.info.money < cost) { + log.info { "char=$charId cannot afford $quantity of ${item.name} at $cost" } + return + } + + // The item goes in first, so a bag that refuses it costs the player nothing. + if (!characterStore.addItem(charId, itemId, quantity)) return + if (!characterStore.addMoney(charId, -cost.toInt())) { + if (!characterStore.addItem(charId, itemId, -quantity)) { + log.error { "char=$charId keeps $quantity ${item.name} unpaid, the refund did not persist" } + } + return + } + + log.info { "char=$charId bought $quantity ${item.name} for $cost" } + sendBagAndMoney(session, charId, itemId) + } + + suspend fun onSell(event: PacketEvent) { + val session = event.session + if (openShelf(session) == null) return + val charId = session.attributes[PLAYER_STATE]?.characterId ?: return + val quantity = event.packet.quantity.toInt() + val stored = characterStore.getCharacter(charId) ?: return + // The client sells the bag stack by the id the bag packet gave it, not by item id. + val itemId = (event.packet.itemEntityId shr ITEM_ENTITY_SHIFT).toInt() + val held = stored.items[itemId] ?: 0 + if (quantity <= 0 || held < quantity) { + log.warn { "char=$charId offered $quantity of stack $itemId, holding $held" } + return + } + + val item = items.get(itemId) + // Anything halving to nothing, a key item above all, would be deleted and paid nothing for. + if (item == null || item.price < 2) { + log.warn { "char=$charId offered stack $itemId, which a mart does not buy" } + return + } + + val paid = item.price / 2 * quantity + if (!characterStore.addItem(charId, itemId, -quantity)) return + if (!characterStore.addMoney(charId, paid)) { + if (!characterStore.addItem(charId, itemId, quantity)) { + log.error { "char=$charId lost $quantity of stack $itemId, the refund did not persist" } + } + return + } + + log.info { "char=$charId sold $quantity of ${item.name} for $paid" } + sendBagAndMoney(session, charId, itemId) + } + + private fun sendBagAndMoney(session: SessionContext, charId: Long, itemId: Int) { + val after = characterStore.getCharacter(charId) ?: return + session.send(LocalCharacterDeltaPacket(money = after.info.money)) + session.send(itemStackUpdatePacket(itemId, after.items[itemId] ?: 0)) + } +} diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/StoryPlayerService.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/StoryPlayerService.kt index 16c1388..4a64579 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/StoryPlayerService.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/StoryPlayerService.kt @@ -5,9 +5,13 @@ import de.fiereu.openmmo.common.MAX_PARTY_SIZE import de.fiereu.openmmo.common.Pokemon import de.fiereu.openmmo.common.PokemonMove import de.fiereu.openmmo.common.enums.PokemonContainer +import de.fiereu.openmmo.items.ItemDef +import de.fiereu.openmmo.items.ItemRegistry import de.fiereu.openmmo.moves.MoveRegistry import de.fiereu.openmmo.net.game.packets.PokemonContainerPacket import de.fiereu.openmmo.net.game.packets.SocialListEntryAddPacket +import de.fiereu.openmmo.net.game.packets.battle.BattleAddPokemon +import de.fiereu.openmmo.net.game.packets.battle.BattleSideAddPokemonPacket import de.fiereu.openmmo.net.game.packets.battle.ItemStack import de.fiereu.openmmo.net.game.packets.battle.itemStacksPacket import de.fiereu.openmmo.pokemon.SpeciesRegistry @@ -29,6 +33,7 @@ constructor( private val pokemonFactory: WildMonFactory, private val species: SpeciesRegistry, private val moves: MoveRegistry, + private val items: ItemRegistry, ) { /** Gives a story Pokemon and syncs it. */ @@ -94,13 +99,13 @@ constructor( suspend fun giveItem( session: SessionContext, state: PlayerState, - itemId: Int, + item: ItemDef, quantity: Int ): Boolean { val characterId = state.characterId ?: return false - if (!characters.addItem(characterId, itemId, quantity)) return false - val items = characters.getCharacter(characterId)?.items ?: return false - session.send(storyItemStacksPacket(items)) + if (!characters.addItem(characterId, items.idOf(item), quantity)) return false + val bag: Map = characters.getCharacter(characterId)?.items ?: return false + session.send(storyItemStacksPacket(bag)) return true } @@ -127,4 +132,23 @@ fun storyItemStacksPacket(items: Map) = ) }) +/** + * A bag stack, not a monster. The open shop window only refreshes its count when the update arrives + * as this single stack rather than as a whole new bag. + */ +fun itemStackUpdatePacket(itemId: Int, quantity: Int) = + BattleSideAddPokemonPacket( + side = 1, + pokemon = + BattleAddPokemon( + entityId = (itemId.toLong() shl 16) or ITEM_ENTITY_TAG, + frontSpriteId = itemId.toShort(), + backSpriteId = quantity.toShort(), + side = 1, + slot = 0, + partyIndex = -1, + statusEffect = null, + ), + ) + private const val ITEM_ENTITY_TAG = 0x5000L diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/KantoCheckpoints.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/KantoCheckpoints.kt index b137a5d..0d05215 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/KantoCheckpoints.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/KantoCheckpoints.kt @@ -146,6 +146,6 @@ val KANTO_CHECKPOINTS: List = KantoVars.VAR_STARTER_MON to 0, ), party = listOf(BULBASAUR), - items = mapOf(Items.OAKS_PARCEL to 1), + items = mapOf(Items.PARCEL to 1), ), ) diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCheckpoint.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCheckpoint.kt index 3dd08c6..2a0e887 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCheckpoint.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCheckpoint.kt @@ -2,6 +2,7 @@ package de.fiereu.openmmo.server.game.services.command import de.fiereu.openmmo.common.enums.Direction import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemDef data class CheckpointMon(val dexId: Int, val level: Int, val moveIds: List) @@ -20,5 +21,5 @@ data class StoryCheckpoint( val storyFlags: Set, val storyVars: Map = emptyMap(), val party: List = emptyList(), - val items: Map = emptyMap(), + val items: Map = emptyMap(), ) diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCommand.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCommand.kt index bfdf714..08f9f67 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCommand.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/services/command/StoryCommand.kt @@ -4,6 +4,7 @@ import de.fiereu.openmmo.common.CharacterPermissions import de.fiereu.openmmo.common.enums.CharacterGender import de.fiereu.openmmo.common.enums.Direction import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemRegistry import de.fiereu.openmmo.maps.WarpTile import de.fiereu.openmmo.server.game.services.BattleService import de.fiereu.openmmo.server.game.services.StoryPlayerService @@ -23,6 +24,7 @@ constructor( private val storyPlayerService: StoryPlayerService, private val warpService: WarpService, private val battleService: BattleService, + private val items: ItemRegistry, ) : ChatCommand { override val name = "story" override val usage = "/story [checkpoint|reset]" @@ -103,7 +105,7 @@ constructor( characterStore.replaceProgress( characterId = charId, party = emptyList(), - items = checkpoint.items, + items = checkpoint.items.mapKeys { items.idOf(it.key) }, storyFlags = checkpoint.storyFlags, storyVars = checkpoint.storyVars, ) diff --git a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/session/SessionAttributes.kt b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/session/SessionAttributes.kt index abc82a3..e58ce24 100644 --- a/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/session/SessionAttributes.kt +++ b/server.game/src/main/kotlin/de/fiereu/openmmo/server/game/session/SessionAttributes.kt @@ -1,6 +1,8 @@ package de.fiereu.openmmo.server.game.session import de.fiereu.network.SessionAttribute +import de.fiereu.openmmo.items.ItemDef +import de.fiereu.openmmo.net.game.packets.ShopItem import de.fiereu.openmmo.net.game.packets.dialog.DialogActionResponsePacket import de.fiereu.openmmo.server.game.storage.StoredCharacter import kotlinx.coroutines.CompletableDeferred @@ -25,3 +27,16 @@ val SCRIPT_SCOPE = SessionAttribute.of("scriptScope") * The character as it was before the running script started, so an unfinished one can be undone. */ val SCRIPT_SNAPSHOT = SessionAttribute.of("scriptSnapshot") + +/** + * Nothing tells the server the mart window closed, so the map it opened on is recorded and a shelf + * left behind stops applying once the player walks off that map. + */ +data class OpenShop( + val regionId: Int, + val bankId: Int, + val mapId: Int, + val shelf: Map, +) + +val OPEN_SHOP = SessionAttribute.of("openShop") diff --git a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/BattleServiceTest.kt b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/BattleServiceTest.kt index b466f81..cf65678 100644 --- a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/BattleServiceTest.kt +++ b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/BattleServiceTest.kt @@ -9,6 +9,7 @@ import de.fiereu.openmmo.common.enums.EVs import de.fiereu.openmmo.common.enums.IVs import de.fiereu.openmmo.common.enums.PokemonContainer import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemRegistry import de.fiereu.openmmo.moves.MoveRegistry import de.fiereu.openmmo.net.game.packets.EntityMovePpPacket import de.fiereu.openmmo.net.game.packets.EntityPresencePacket @@ -17,6 +18,7 @@ import de.fiereu.openmmo.net.game.packets.battle.BattleActionSelectPacket import de.fiereu.openmmo.net.game.packets.battle.BattleBulkStatePacket import de.fiereu.openmmo.net.game.packets.battle.BattleEntityDeltaPacket import de.fiereu.openmmo.net.game.packets.battle.BattleFieldStatePacket +import de.fiereu.openmmo.net.game.packets.battle.BattleListEventPacket import de.fiereu.openmmo.net.game.packets.battle.BattleQueuedEventPacket import de.fiereu.openmmo.net.game.packets.battle.BattleSidePacket import de.fiereu.openmmo.net.game.packets.battle.BattleSwitchInPacket @@ -103,6 +105,7 @@ private class Fixture(scope: CoroutineScope) { speciesRegistry = SpeciesRegistry(), moveRegistry = MoveRegistry(), trainers = TrainerRegistry(), + items = ItemRegistry(), ) suspend fun playerWithParty(level: Byte = 50, hp: Short = 999): Pair { @@ -303,6 +306,21 @@ class BattleServiceTest : } } + test("the ball throw names the Poke Ball by the id the client knows") { + runTest { + val fx = Fixture(this) + val (session, _) = fx.playerWithParty() + session.startBattle(fx.service) + + session.act(fx.service, BattleAction.ITEM) + + session.sent + .filterIsInstance() + .single { it.subKind == 4.toByte() } + .value shouldBe 5004.toShort() + } + } + test("a disconnect persists and removes the battle") { runTest { val fx = Fixture(this) diff --git a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/ShopServiceTest.kt b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/ShopServiceTest.kt new file mode 100644 index 0000000..9dddcfb --- /dev/null +++ b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/ShopServiceTest.kt @@ -0,0 +1,230 @@ +package de.fiereu.openmmo.server.game.services + +import de.fiereu.network.PacketEvent +import de.fiereu.openmmo.common.enums.CharacterGender +import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemDef +import de.fiereu.openmmo.items.ItemRegistry +import de.fiereu.openmmo.items.generated.Items +import de.fiereu.openmmo.net.game.packets.ExchangeItemRequestPacket +import de.fiereu.openmmo.net.game.packets.LocalCharacterDeltaPacket +import de.fiereu.openmmo.net.game.packets.ShopCatalogPacket +import de.fiereu.openmmo.net.game.packets.ShopSellRequestPacket +import de.fiereu.openmmo.net.game.packets.battle.BattleSideAddPokemonPacket +import de.fiereu.openmmo.server.game.session.OPEN_SHOP +import de.fiereu.openmmo.server.game.storage.CharacterStore +import de.fiereu.openmmo.server.game.storage.EntityIdService +import de.fiereu.openmmo.server.game.testsupport.FakeCharacterRepository +import de.fiereu.openmmo.server.game.testsupport.FakeSession +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.collections.shouldBeEmpty +import io.kotest.matchers.collections.shouldContainExactly +import io.kotest.matchers.nulls.shouldBeNull +import io.kotest.matchers.shouldBe +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.test.runTest + +private val SHELF = listOf(Items.POKE_BALL, Items.POTION, Items.ANTIDOTE, Items.PARLYZ_HEAL) +private const val CLERK_ENTITY = 4711L + +private class ShopFixture(scope: CoroutineScope) { + val items = ItemRegistry() + val store = CharacterStore(FakeCharacterRepository(), EntityIdService(), scope) + val service = ShopService(store, items) + + suspend fun shopper(): Pair { + val created = store.createCharacter(1, "Ash", CharacterGender.MALE, Region.HOENN) + val session = FakeSession(created.info.id) + service.open(session, CLERK_ENTITY, SHELF) + session.sent.clear() + return session to created.info.id + } + + suspend fun buy(session: FakeSession, id: Int, quantity: Int) { + service.onBuy( + PacketEvent(ExchangeItemRequestPacket(id.toShort(), quantity.toShort(), 0), session)) + } + + suspend fun sell(session: FakeSession, id: Int, quantity: Int) { + service.onSell( + PacketEvent( + ShopSellRequestPacket((id.toLong() shl 16) or 0x5000, quantity.toShort()), session)) + } + + suspend fun money(charId: Long): Int = store.getCharacter(charId)!!.info.money + + suspend fun held(charId: Long, id: Int): Int = store.getCharacter(charId)!!.items[id] ?: 0 +} + +@OptIn(ExperimentalCoroutinesApi::class) +class ShopServiceTest : + FunSpec({ + test("the shelf carries the ids and prices the client expects") { + runTest { + val fx = ShopFixture(backgroundScope) + val created = fx.store.createCharacter(1, "Ash", CharacterGender.MALE, Region.HOENN) + val session = FakeSession(created.info.id) + + fx.service.open(session, CLERK_ENTITY, SHELF) + + val catalog = session.sent.filterIsInstance().single() + catalog.npcEntityId shouldBe CLERK_ENTITY + catalog.items.map { it.itemId.toInt() to it.price } shouldContainExactly + listOf(5004 to 200, 5017 to 300, 5018 to 100, 5022 to 200) + } + } + + test("an item with no id is left off the shelf rather than failing the open") { + runTest { + val fx = ShopFixture(backgroundScope) + val created = fx.store.createCharacter(1, "Ash", CharacterGender.MALE, Region.HOENN) + val session = FakeSession(created.info.id) + + fx.service.open(session, CLERK_ENTITY, listOf(Items.POTION, ItemDef("Teachy TV", 100))) + + session.sent.filterIsInstance().single().items.map { + it.itemId.toInt() + } shouldContainExactly listOf(5017) + } + } + + test("buying resolves the id the client sends") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + + fx.buy(session, 5017, 3) + + fx.held(charId, 5017) shouldBe 3 + fx.money(charId) shouldBe 30000 - 900 + session.sent.filterIsInstance().single().money shouldBe 29100 + } + } + + test("the bought stack is announced on its own, so the open window can recount it") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, _) = fx.shopper() + + fx.buy(session, 5004, 5) + + val update = session.sent.filterIsInstance().single() + update.pokemon.frontSpriteId shouldBe 5004.toShort() + update.pokemon.backSpriteId shouldBe 5.toShort() + } + } + + test("refuses an item this clerk does not sell") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + + fx.buy(session, fx.items.idOf(Items.MASTER_BALL), 1) + + fx.money(charId) shouldBe 30000 + session.sent.shouldBeEmpty() + } + } + + test("refuses a buy the player cannot pay for") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + + fx.buy(session, 5017, 200) + + fx.held(charId, 5017) shouldBe 0 + fx.money(charId) shouldBe 30000 + } + } + + test("refuses a non-positive quantity") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + + fx.buy(session, 5017, 0) + fx.buy(session, 5017, -2) + + fx.money(charId) shouldBe 30000 + } + } + + test("selling pays half and reads the item out of the bag stack id") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + fx.buy(session, 5017, 4) + session.sent.clear() + + fx.sell(session, 5017, 2) + + fx.held(charId, 5017) shouldBe 2 + fx.money(charId) shouldBe 30000 - 1200 + 300 + session.sent + .filterIsInstance() + .single() + .pokemon + .backSpriteId shouldBe 2.toShort() + } + } + + test("refuses to sell more than the bag holds") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + fx.buy(session, 5017, 1) + + fx.sell(session, 5017, 2) + + fx.held(charId, 5017) shouldBe 1 + fx.money(charId) shouldBe 30000 - 300 + } + } + + test("ignores a sell with no shop open") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + fx.buy(session, 5017, 1) + session.attributes.remove(OPEN_SHOP) + session.sent.clear() + + fx.sell(session, 5017, 1) + + fx.held(charId, 5017) shouldBe 1 + session.sent.shouldBeEmpty() + } + } + + test("refuses to buy from a shelf the player has walked away from") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + session.state().mapId += 1 + + fx.buy(session, 5017, 1) + + fx.held(charId, 5017) shouldBe 0 + fx.money(charId) shouldBe 30000 + session.attributes[OPEN_SHOP].shouldBeNull() + } + } + + test("refuses to sell a key item, rather than deleting it for nothing") { + runTest { + val fx = ShopFixture(backgroundScope) + val (session, charId) = fx.shopper() + val townMap = fx.items.idOf(Items.TOWN_MAP) + fx.store.addItem(charId, townMap, 1) + session.sent.clear() + + fx.sell(session, townMap, 1) + + fx.held(charId, townMap) shouldBe 1 + fx.money(charId) shouldBe 30000 + session.sent.shouldBeEmpty() + } + } + }) diff --git a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/command/StoryResetTest.kt b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/command/StoryResetTest.kt index d85705d..0911a03 100644 --- a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/command/StoryResetTest.kt +++ b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/services/command/StoryResetTest.kt @@ -4,6 +4,7 @@ import de.fiereu.openmmo.common.CharacterPermissions import de.fiereu.openmmo.common.enums.CharacterGender import de.fiereu.openmmo.common.enums.PokemonContainer import de.fiereu.openmmo.common.enums.Region +import de.fiereu.openmmo.items.ItemRegistry import de.fiereu.openmmo.maps.MapManager import de.fiereu.openmmo.moves.MoveRegistry import de.fiereu.openmmo.net.game.packets.ChatMessagePacket @@ -49,6 +50,7 @@ class StoryResetTest : val interest = InterestManager() val species = SpeciesRegistry() val moves = MoveRegistry() + val items = ItemRegistry() return StoryCommand( characterStore = store, worldStateService = WorldStateService(), @@ -58,6 +60,7 @@ class StoryResetTest : WildMonFactory(species, moves, LearnsetRegistry(), EntityIdService()), species, moves, + items, ), warpService = WarpService( @@ -80,7 +83,9 @@ class StoryResetTest : speciesRegistry = species, moveRegistry = moves, trainers = TrainerRegistry(), + items = items, ), + items = items, ) } diff --git a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/Services.kt b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/Services.kt index cd04722..9f09659 100644 --- a/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/Services.kt +++ b/server.game/src/test/kotlin/de/fiereu/openmmo/server/game/testsupport/Services.kt @@ -1,5 +1,6 @@ package de.fiereu.openmmo.server.game.testsupport +import de.fiereu.openmmo.items.ItemRegistry import de.fiereu.openmmo.maps.MapManager import de.fiereu.openmmo.moves.MoveRegistry import de.fiereu.openmmo.pokemon.LearnsetRegistry @@ -23,6 +24,7 @@ import de.fiereu.openmmo.server.game.services.NpcService import de.fiereu.openmmo.server.game.services.PresenceService import de.fiereu.openmmo.server.game.services.ScriptMovementService import de.fiereu.openmmo.server.game.services.ScriptWarpService +import de.fiereu.openmmo.server.game.services.ShopService import de.fiereu.openmmo.server.game.services.StoryPlayerService import de.fiereu.openmmo.server.game.services.StoryService import de.fiereu.openmmo.server.game.services.WarpService @@ -77,16 +79,18 @@ fun scriptRunner( val species = SpeciesRegistry() val moves = MoveRegistry() val wildMons = WildMonFactory(species, moves, LearnsetRegistry(), EntityIdService()) + val items = ItemRegistry() return ScriptRunner( DialogService(), story, ScriptMovementService(mapManager, npcs, store), ScriptWarpService(mapManager, mapLoad, store, presence), - StoryPlayerService(store, wildMons, species, moves), + StoryPlayerService(store, wildMons, species, moves, items), battles, store, mapManager, MapEntryScripts(ScriptRegistry(emptyMap()), story), + ShopService(store, items), ) } @@ -105,5 +109,6 @@ private fun battleService(store: CharacterStore, interest: InterestManager): Bat speciesRegistry = species, moveRegistry = moves, trainers = TrainerRegistry(), + items = ItemRegistry(), ) }