Add persistent instance visits and validate sleeping spaces
clang PCH / build (push) Canceled after 0s
GCC PCH / build (push) Canceled after 0s

This commit is contained in:
Nico committed 2026-10-27 20:10:13 +01:00
1 parent 440c53acd7
commit e18a416bf4
22 files changed
+1631 -41

No files matched your search

@@ -0,0 +1,16 @@
-- Same database/transaction as characters.health and saved instance position.
CREATE TABLE IF NOT EXISTS vcore_adventure_instance_visit (
character_guid int unsigned NOT NULL,
location_key varchar(100) NOT NULL,
entry_trigger int unsigned NOT NULL,
exit_trigger int unsigned NOT NULL,
instance_map int unsigned NOT NULL,
instance_id int unsigned NOT NULL DEFAULT 0,
block_end bigint unsigned NOT NULL,
prepare_until bigint unsigned NOT NULL DEFAULT 0,
phase tinyint unsigned NOT NULL,
loss_percent tinyint unsigned NOT NULL,
injury_applied tinyint unsigned NOT NULL DEFAULT 0,
schedule tinyint unsigned NOT NULL DEFAULT 0,
PRIMARY KEY(character_guid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -0,0 +1,30 @@
-- Native outside entrance aliases only. Instance interiors stay graph nodes.
CREATE TABLE IF NOT EXISTS vcore_adventure_instance (
location_key varchar(100) NOT NULL,
entry_trigger int unsigned NOT NULL,
exit_trigger int unsigned NOT NULL DEFAULT 0 COMMENT '0: native exit discovery, separate exit preferred',
enabled tinyint unsigned NOT NULL DEFAULT 1,
PRIMARY KEY(location_key), UNIQUE KEY(entry_trigger)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT IGNORE INTO vcore_clientless_world_point
(point_key,category,map,position_x,position_y,position_z,orientation,enabled,comment)
SELECT CONCAT('instance_visit_at_',a.ID),'instance_entrance',w.map,
w.position_x,w.position_y,w.position_z,w.orientation,1,
CONCAT('Native instance entrance: ',a.Name)
FROM areatrigger_teleport a
JOIN instance_template i ON i.map=a.target_map
JOIN vcore_clientless_travel_node n ON n.node_key=CONCAT('portal_at_',a.ID,'_source') AND n.enabled=1
JOIN vcore_clientless_world_point w ON w.point_key=n.world_point_key AND w.enabled=1
LEFT JOIN instance_template inside_source ON inside_source.map=w.map
WHERE inside_source.map IS NULL;
INSERT IGNORE INTO vcore_adventure_location (point_key,display_name,source_type,source_id)
SELECT CONCAT('instance_visit_at_',a.ID),a.Name,'instance_entrance',a.ID
FROM areatrigger_teleport a
JOIN vcore_clientless_world_point w ON w.point_key=CONCAT('instance_visit_at_',a.ID) AND w.category='instance_entrance';
INSERT IGNORE INTO vcore_adventure_instance(location_key,entry_trigger)
SELECT point_key,source_id FROM vcore_adventure_location WHERE source_type='instance_entrance';
INSERT IGNORE INTO vcore_adventure_location_intent(category,intent,weight)
VALUES ('instance_entrance','instance',5);
-- Other intent/category weights and existing plans are deliberately preserved.