mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
docs(gacha): clarify G1-GG vs ZZ configuration to prevent client crashes (#175)
The G1-GG gacha code path (PR #150) included example data in comments that used non-zero item_type/item_number/item_quantity on entry_type=100 rows. Users copying these values for ZZ servers caused client crashes because the ZZ client interprets those fields as material requirements. - Replace unclear PR #150 comment with explicit WARNING against using G1-GG example values for ZZ servers - Add gacha configuration guide header to GachaDemo.sql explaining the 3-table system, entry types, and item type codes - Add Mega Potion example showing correct way to add custom items - Reference Enumerations.md for the full item type list
This commit is contained in:
@@ -1,5 +1,32 @@
|
||||
BEGIN;
|
||||
|
||||
-- =============================================================================
|
||||
-- Gacha Configuration Guide (G10+ / ZZ clients)
|
||||
-- =============================================================================
|
||||
--
|
||||
-- Gacha uses THREE tables:
|
||||
-- gacha_shop — defines the gacha lottery (name, banners, type)
|
||||
-- gacha_entries — defines roll costs (entry_type 0/1/...) and reward pool (entry_type 100)
|
||||
-- gacha_items — defines the actual items awarded for each reward entry
|
||||
--
|
||||
-- Entry types:
|
||||
-- 0, 1, 2, ... = Roll cost tiers. item_type/item_number/item_quantity define the currency
|
||||
-- and amount to deduct. "rolls" = how many random draws this tier gives.
|
||||
-- 100 = Reward pool entry. The client draws from these when rolling.
|
||||
-- For G10+/ZZ: item_type, item_number, item_quantity MUST be 0.
|
||||
-- The actual reward items are defined in gacha_items (linked by entry ID).
|
||||
-- "weight" controls draw probability; "rarity" sets the display star rating.
|
||||
--
|
||||
-- Item types in gacha_items (see Enumerations.md for the full list):
|
||||
-- 0 = Legs, 1 = Head, 2 = Chest, 3 = Arms, 4 = Waist,
|
||||
-- 5 = Melee weapon, 6 = Ranged weapon, 7 = Consumable item,
|
||||
-- 8 = Furniture, 10 = Zenny, 17 = N Points, 19 = Gacha Koban, ...
|
||||
--
|
||||
-- WARNING: For G1–GG clients, gacha works differently — rewards are defined
|
||||
-- directly in gacha_entries and gacha_items is NOT used. Do not mix the two
|
||||
-- formats. See handlers_shop.go for the G1–GG code path.
|
||||
-- =============================================================================
|
||||
|
||||
-- Start Normal Demo
|
||||
INSERT INTO gacha_shop (min_gr, min_hr, name, url_banner, url_feature, url_thumbnail, wide, recommended, gacha_type, hidden)
|
||||
VALUES (0, 0, 'Normal Demo',
|
||||
@@ -31,6 +58,14 @@ INSERT INTO gacha_entries (gacha_id, entry_type, item_type, item_number, item_qu
|
||||
VALUES ((SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1), 100, 0, 0, 0, 10, 2, 0, 0, 0);
|
||||
INSERT INTO gacha_items (entry_id, item_type, item_id, quantity)
|
||||
VALUES ((SELECT id FROM gacha_entries ORDER BY id DESC LIMIT 1), 10, 3, 0);
|
||||
|
||||
-- Example: adding a consumable item (Mega Potion, item_id=8) as a gacha reward.
|
||||
-- Note: for entry_type=100, item_type/item_number/item_quantity in gacha_entries
|
||||
-- MUST remain 0 for G10+/ZZ clients. The reward is defined only in gacha_items.
|
||||
INSERT INTO gacha_entries (gacha_id, entry_type, item_type, item_number, item_quantity, weight, rarity, rolls, daily_limit, frontier_points)
|
||||
VALUES ((SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1), 100, 0, 0, 0, 50, 1, 0, 0, 0);
|
||||
INSERT INTO gacha_items (entry_id, item_type, item_id, quantity)
|
||||
VALUES ((SELECT id FROM gacha_entries ORDER BY id DESC LIMIT 1), 7, 8, 1);
|
||||
-- End Normal Demo
|
||||
|
||||
-- Start Step-Up Demo
|
||||
|
||||
Reference in New Issue
Block a user