Skip to content

Add missing drop tables and combat definitions - #1146

Merged
GregHib merged 16 commits into
GregHib:mainfrom
HarleyGilpin:feat/add-drop-tables
Aug 7, 2026
Merged

Add missing drop tables and combat definitions#1146
GregHib merged 16 commits into
GregHib:mainfrom
HarleyGilpin:feat/add-drop-tables

Conversation

@HarleyGilpin

@HarleyGilpin HarleyGilpin commented Aug 7, 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.

Aggression & poison (2011 wiki)

194 spawned NPCs marked hunt_mode = "cowardly" (level-checked aggression) 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. Stronghold of Player Safety muggers excluded (not aggressive, source in toml comment). The Kill rat with range test pins npc.huntMode = "" since giant rats are aggressive and now charge the shooter mid-test.

Combat animations & sounds

The combat definitions authored in this branch initially had no attack/defend/death anims. 114 of 149 now have them, 266 animation + 57 sound entries added beside each combat definition, with per-style attack anims where the source distinguishes magic/ranged. The remaining 35 post-2009 definitions were since filled: real anim ids where reference data existed (chaos dwogre, ogre chieftain, soul wars avatars, blood reaver, ancient mage/ranger, luminescent icefiend, Temple Trekking shadows' shared death anim) and species-appropriate reuse of existing void anims for the rest (quest humans → human, elite dark ranger → archer, trolls, rock crab, demon, dagannoth, ghost, scarab). Only baby tanglefoot and the three cursed Ivory zogre bosses remain bare — no source data exists in any reference.

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.


Continues #1143 - that PR could not be reopened after the branch was recreated

HarleyGilpin and others added 15 commits August 6, 2026 11:46
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.
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.
Remove the 718 equipment stat config keys - the cache already contains
these params via DefinitionsParameterConverter so config duplication
is unnecessary.

Wiki 'aggressive' means aggressive with a combat level check, which is
hunt_mode "cowardly"; reserve "aggressive" for npcs that attack
regardless of level. All 194 added hunt modes flipped to cowardly.

Stronghold of Player Safety muggers are the exception among muggers
and are not aggressive; removed with source comment.
114 combat definitions authored earlier in this branch had no
attack/defend/death animations. Ported from 2009scape's
npc_configs.json (rev 530 data; animation ids are stable across
revisions for pre-existing content - goblin's ported defend/death
ids match void's hand-authored entries exactly). 266 animation and
57 sound entries added next to each combat definition, including
per-style attack anims where the source distinguishes magic/ranged.

35 definitions remain without animations: post-2009 content absent
from the source (blood reaver, elite dark warriors, cursed ivory
bosses, Temple Trekking shadows).
114 combat definitions authored earlier in this branch had no
attack/defend/death animations. (ported from rev 530 data; animation ids are stable across
revisions for pre-existing content - goblin's ported defend/death
ids match void's hand-authored entries exactly). 266 animation and
57 sound entries added next to each combat definition, including
per-style attack anims where the source distinguishes magic/ranged.

35 definitions remain without animations: blood reaver, elite dark warriors, cursed ivory
bosses, Temple Trekking shadows

@GregHib GregHib left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a quick scan and looks good, if there's any issues they can be resolved over time

@GregHib
GregHib merged commit c1ec96d into GregHib:main Aug 7, 2026
2 checks passed
@HarleyGilpin

HarleyGilpin commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Closes #1141

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.

2 participants