From 1df3db57d325fbe799d85d8738089f745e7e46d5 Mon Sep 17 00:00:00 2001 From: wtclaude Date: Mon, 5 Oct 2026 22:36:29 -0500 Subject: [PATCH] feat(bridge): a Place NPCs step's "drop loot" switch (runicnpc stage 7) world.place with a profile takes dropLoot (D296): false spawns the NPCs with RunicNPC's {"loot":{"dropTable":false}} override, so they keep their corpse's start but roll no table. Absent or true, as before. runicnpc_api and RunicNpcApiNeeded are 6. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY --- overlay.toml | 4 ++-- overlay/oxide/plugins/RunicGateway.cs | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/overlay.toml b/overlay.toml index 18c7490..570b602 100644 --- a/overlay.toml +++ b/overlay.toml @@ -80,7 +80,7 @@ requires_plugins = ["Kits", "ZoneManager"] # ── The RunicNPC API the bridge needs ─────────────────────────────────────── # -# RunicNPC (docs/runicnpc/PLAN.md stages 4 to 6): the bridge's npc.* commands call +# RunicNPC (docs/runicnpc/PLAN.md stages 4 to 7): the bridge's npc.* commands call # RunicNPC's API and need at least this version of it. It MUST equal # `RunicNpcApiNeeded` in RunicGateway.cs; `node scripts/checkPlugin.js` holds the # two equal. The release copies it into manifest.json, and the installer's @@ -88,4 +88,4 @@ requires_plugins = ["Kits", "ZoneManager"] # # RunicNPC is optional to the bridge until its stage 9: without it every npc.* # command answers `runicnpc-missing`, and events place Rust's own scientists. -runicnpc_api = 5 +runicnpc_api = 6 diff --git a/overlay/oxide/plugins/RunicGateway.cs b/overlay/oxide/plugins/RunicGateway.cs index 870a237..e83d082 100644 --- a/overlay/oxide/plugins/RunicGateway.cs +++ b/overlay/oxide/plugins/RunicGateway.cs @@ -10371,9 +10371,10 @@ namespace Oxide.Plugins /// /// The RunicNPC API these commands call: 3 added placements from a website (D249), 4 the /// faction table and an event's escort, ally and tether (runicnpc stage 5), 5 bosses and - /// passive NPCs (runicnpc stage 6): a profile's `boss` and `use`, and the boss hooks. + /// passive NPCs (runicnpc stage 6): a profile's `boss` and `use`, and the boss hooks, 6 loot (runicnpc + /// stage 7): a profile's `loot`, and the `dropTable` override a Place NPCs step's switch sends. /// - private const int RunicNpcApiNeeded = 5; + private const int RunicNpcApiNeeded = 6; private Plugin RunicNpcPlugin() { @@ -10980,6 +10981,12 @@ namespace Oxide.Plugins string owner = "run:" + runId; var made = new List(); + // Runicnpc stage 7 (D296): the step's "drop loot" switch. Off, the NPCs keep their corpse's start + // but roll no loot table; on (or absent, a step older than the switch) they drop it as anywhere. + object dropLootValue; + bool dropLoot = !(cmd.TryGetValue("dropLoot", out dropLootValue) && dropLootValue is bool && !(bool)dropLootValue); + Newtonsoft.Json.Linq.JObject spawnOverrides = dropLoot ? null : Newtonsoft.Json.Linq.JObject.Parse("{\"loot\":{\"dropTable\":false}}"); + for (int i = 0; i < count; i++) { BasePlayer spawned = null; @@ -10997,7 +11004,7 @@ namespace Oxide.Plugins at.y = TerrainMeta.HeightMap.GetHeight(at); } - spawned = npc.Call("RunicNpc_Spawn", at, profile, owner, null) as BasePlayer; + spawned = npc.Call("RunicNpc_Spawn", at, profile, owner, spawnOverrides) as BasePlayer; } if (spawned == null) -- 2.49.1