Skip to content

Add missing drop tables and combat definitions - #1143

Open
HarleyGilpin wants to merge 9 commits into
GregHib:mainfrom
HarleyGilpin:feat/add-drop-tables
Open

Add missing drop tables and combat definitions#1143
HarleyGilpin wants to merge 9 commits into
GregHib:mainfrom
HarleyGilpin:feat/add-drop-tables

Conversation

@HarleyGilpin

@HarleyGilpin HarleyGilpin commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What changed?

  • Closes the gap between attackable NPCs and their config coverage: drop tables first, then combat definitions and stats.
  • NPCs that are not currently spawned in-game have been untouched, we will add them later as we implement them.

Drop tables

Before this branch, 577 spawned NPCs (938 total) resolved no drop table at kill time and died to nothing; ~30 NPC families with tables were missing their charm drops.

  • Charm sub-tables for ~35 families (goblin, cow, skeleton, zombie, hill giant, hobgoblin, guards, demons, KBD, gargoyle, nechryael, tzhaar, wolves, spiders...). Rates computed from runescape.wiki charm log data (Module:Data/<npc>) at 1/100000 precision, matching the existing bat/scorpion table format; cave slime, outlaw, rockslug, unicorn and tzhaar fall back to rounded community rates where no charm log exists. KBD drops charms four at a time (amount = 4).
  • 124 new drop tables generated from RuneScape wiki page revisions dated Jan–Mar 2011 (era-accurate for rev 634). Rarity words map to: very common ~1/5, common ~1/16, uncommon ~1/32, rare ~1/171, very rare ~1/512 on roll = 1024.
  • 577 NPC defs wired to tables: 169 to existing tables they should have pointed at (e.g. green_dragon_1-4 dropped nothing because clones don't inherit the implicit string-id table match), 19 to bones, 63 to empty for NPCs that legitimately drop nothing.
  • Removes hobgoblins.drops.toml, a stale duplicate of hobgoblin/hobgoblin.drops.toml.

Combat definitions & stats

An NPC whose combat_def doesn't resolve never swings, never retaliates, and plays no defend/death animation (Attack.kt:52, Combat.kt:146). 681 spawned NPCs were in that state; 304 also had no hitpoints.

  • 468 NPCs wired to existing combat definitions by species (Guard variants → guard, skeletons by wielded weapon → skeleton_sword_shield/skeleton_mace_shield, etc.).
  • Stats for 336 NPCs (hitpoints, att/str/def/mage/range, attack_bonus, max_hit_<style>, ×10 lifepoints scale) from OSRS wiki Monster Examine data, filtered per-version to monsters released before March 2007 so values match rev 634 (e.g. Bandit's 2002 level-22 version is used, its 2014 level-130 version is rejected). Only absent keys are filled — no existing values touched.
  • 106 minimal combat definitions authored from the same data (attack_speed + target_hit with correct offense style and max hit). Attack anims intentionally omitted until cache anim ids are sourced — an omitted anim is a silent no-op, so these NPCs now fight correctly but without bespoke animations.
  • Fixes five pre-existing dangling combat_def values (bear_cub, king_scorpion, zombie_dragging, tzhar_ket typo, gardener).
  • Second pass for post-2007 content the OSRS wiki can't cover, using runescape.wiki December 2011 revisions (Scabaras dungeon, gnoeals, mutated bloodveld, ancient warriors, warped creatures, cursed ivory bosses): 41 more combat definitions and stats for ~65 NPCs. 2011 infoboxes carry LP/style/speed/max hit directly on the lifepoints scale; att/str/def levels were never published pre-EoC, so they are derived by reversing the standard formulas (rune-server: (503+) NPC Combat Numbers Explained): strength from max hit (P = (max/10 − 0.5)·10 − 9, zero equipment bonus as the 634 cache lacks npc equipment stats), then defence from combat level (DEF = 4·(CB − S) − HP, S = 0.325·(att+str) melee / 0.4875·level ranged/magic). Verified against existing guard data. NPCs with no published max hit use a combined estimate instead.

Equipment stats (718 cache)

The 718 cache stores npc equipment stats in definition params (keys 0-9, unavailable in 634 defs). Since npc ids are stable between revisions for pre-718 content, per-style defence bonuses (stab/slash/crush/magic/range_defence, consumed by accuracy rolls in Equipment.kt:149) and attack_bonus are applied to 848 combat NPCs, previously every npc defence bonus in the codebase was implicitly zero, so monsters had no style weaknesses. Verified against known values (cow −21 all styles, guard 24/14/19/4/16). Only absent keys added; clone variants inherit from their base.

Aggression & poison (2011 wiki)

196 spawned NPCs marked hunt_mode = "aggressive" per December 2011 wiki infoboxes (only where no hunt_mode existed; explicit disables untouched, conditional aggression skipped). Seven combat definitions gain impact_poison with wiki start damage (ancient mage 88, frog 68, sea snake hatchling 50, spinolyp 20, big snake 10, confusion beast 2), ten poisonous species already had it. The Kill rat with range test pins npc.huntMode = "" since giant rats are aggressive and now charge the shooter mid-test.

Verification

  • Zero unresolved drop_table/combat_def references; combat def loader hard-fails on unknown keys at boot and boot passes.
  • WorldTest boot green; combat suites (CombatTest, CombatMovementTest) and engine drop table tests pass.
  • Cache audit: spawned NPCs missing drop tables 577 → 0; missing combat definitions 681 → 0; missing hitpoints 304 → 0.

Compared against rsmod reference: 38 NPC families had no charm drops.
Rates from runescape.wiki charm logs (Module:Data/<npc>) at 1/100000
precision; cave slime, outlaw, rockslug, unicorn and tzhaar use rsmod
rates as no charm log exists. KBD drops charms four at a time.

- add charm-only tables for spider, deadly red spider and wolves,
  which previously dropped nothing
- wrap cave_bug, rockslug and tzhaar tables in type = "all" to
  support charm rolls
- remove hobgoblins.drops.toml, stale duplicate of
  hobgoblin/hobgoblin.drops.toml
Clones don't inherit the implicit string-id drop table match, so
numbered variants like green_dragon_1-4 dropped nothing despite the
base table existing. Also wire bones-only droppers matched against
the rsmod reference (entrana/monastery monks, skeleton warlock,
Kolodion).
468 npcs wired to existing combat definitions by species; without one
an npc never swings, retaliates or plays defend/death anims. Stats
for 336 npcs (hitpoints, levels, attack_bonus, max hits at x10
lifepoints scale) taken from OSRS wiki Monster Examine data, filtered
to monsters released before March 2007 so values match rev 634.
106 minimal combat definitions authored from the same data for
families with no existing definition; attack anims omitted until
cache anim ids are sourced.

Also fixes five pre-existing dangling combat_def values (bear_cub,
king_scorpion, zombie_dragging, tzhar_ket typo, gardener).

Spawned npcs missing combat definitions: 681 -> 69; missing
hitpoints: 304 -> 131. Remainder is post-2007 content with no OSRS
source.
@HarleyGilpin HarleyGilpin changed the title Add missing drop tables Add missing drop tables and combat definitions Aug 6, 2026
Second pass using runescape.wiki December 2011 revisions for post-2007
content the OSRS wiki can't cover (Scabaras dungeon, gnoeals, mutated
bloodveld, ancient warriors, warped creatures, cursed ivory bosses).
2011 infoboxes carry LP, attack style, speed and max hit directly on
the lifepoints scale; att/str/def are estimated from the combat level
formula (x = (cb - 0.25*hp) / 0.9) as pre-EoC stat levels were never
published.

41 combat definitions authored, ~65 npcs given stats, plus manual
wires for stragglers: new archer ranged definition, fremennik
citizens and customs officers to man, rock troll to ice_troll,
The Kendal to bear, lava monster to fire_elemental.

Spawned npcs missing combat definitions: 681 -> 0; missing
hitpoints: 304 -> 0.
Replaces the uniform att=str=def estimate with the standard reversal:
strength from max hit (P = (max/10 - 0.5) * 10 - 9, zero equipment
bonus since rev 634 lacks npc equipment stats in the cache), then
defence from combat level (DEF = 4 * (CB - S) - HP with
S = 0.325 * (att + str) for melee, 0.4875 * level for ranged/magic;
magic attackers assume def = mage). Verified against existing guard
data (str 18, max hit 30, level 21). NPCs with no published max hit
keep the previous combined estimate.

Ref: rune-server.org/threads/698651 (503+) NPC Combat Numbers
The 718 cache stores npc equipment stats in definition params
(keys 0-9: attack and defence bonuses per style) which rev 634
definitions lack. Ids are stable between revisions for pre-718
content, so the bonuses apply directly: per-style defences
(stab/slash/crush/magic/range_defence, read by accuracy rolls in
Equipment.kt) and attack_bonus for 848 combat npcs. Previously every
npc defence bonus was implicitly zero, so monsters had no style
weaknesses. Only absent keys are added; clone variants inherit from
their base rather than repeating values.

Verified against known values: cow -21 all styles, guard 24/14/19/4/16.
196 spawned npcs marked hunt_mode = "aggressive" per December 2011
wiki infoboxes (only where no hunt_mode was configured; explicit
disables untouched, conditional aggression skipped). Seven combat
definitions gain impact_poison with wiki start damage: ancient mage
88, frog 68, sea snake hatchling 50, spinolyp 20, big snake 10,
confusion beast 2. Ten poisonous species already had it.

Kill rat with range test pinned npc.huntMode = "" as giant rats
are aggressive and now charge the shooter mid-test.
@HarleyGilpin
HarleyGilpin force-pushed the feat/add-drop-tables branch from 368a041 to e0659fb Compare August 7, 2026 04:16
@M1krofin

M1krofin commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hello, i noticed that muggers have aggresive again source: https://www.youtube.com/watch?v=iWUsTvMLQtY and https://www.youtube.com/watch?v=wQndhUKbV-w muggers in player safety dungeon are not aggressive towards to player. They are only muggers in game that does not have aggressive I think. (I should have put the source in the .toml file my bad :( ) Overall really good job on other things, you are putting the hours in! ❤️

@GregHib

GregHib commented Aug 7, 2026

Copy link
Copy Markdown
Owner

previously every npc defence bonus in the codebase was implicitly zero, so monsters had no style weaknesses

The params are taken from 718 (See DefinitionsParameterConverter) and are already in the cache so aren't needed in config files.

196 spawned NPCs marked hunt_mode = "aggressive" per December 2011 wiki infoboxes (only where no hunt_mode existed; explicit disables untouched, conditional aggression skipped).

Aggressive in the wiki is actually hunt_mode "cowardly", "aggressive" is equivalent to aggressive regardless of combat level - which most npcs are not, and the wiki doesn't specify which-is-which.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants