feat(bridge): a Place NPCs step's "drop loot" switch (runicnpc stage 7)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 8s

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-10-05 22:36:29 -05:00
parent 0792564ffe
commit 1df3db57d3
2 changed files with 12 additions and 5 deletions

View File

@@ -10371,9 +10371,10 @@ namespace Oxide.Plugins
/// <summary>
/// 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.
/// </summary>
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<WorldEntry>();
// 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)