diff options
Diffstat (limited to 'gamemode/core/npc/sv_huntingspawner.lua')
| -rw-r--r-- | gamemode/core/npc/sv_huntingspawner.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gamemode/core/npc/sv_huntingspawner.lua b/gamemode/core/npc/sv_huntingspawner.lua index 153b961..0fe4aa0 100644 --- a/gamemode/core/npc/sv_huntingspawner.lua +++ b/gamemode/core/npc/sv_huntingspawner.lua @@ -1,3 +1,7 @@ +---Lets huntable monsters drop loot! +-- Register what monsters drop what loot +--@module sv_huntingspawner.lua + --[[ This file spawns the huntable npc's in their zones. ]] @@ -95,6 +99,10 @@ hook.Add("Tick","occasionally_spawn_monsters",function() end) local external_drops = {} +---Register a monster's loot. +-- Register a table of loot to probability of dropping to a monster. Will warn if you try to register the same monster twice. An npc can define it's own drops, but if you're using npcs from elsewhere, use this function to tell the gamemode what to drop on each npc's death. +--@tparam string npcname The name of the npc to give loot to +--@tparam table tbl The table of {"item\_name"=number\_drop_chance}, drop chance should be in the range 0 < x <= 100. 100 is always drop, 0 is never drop. function o.RegisterDrops(npcname,tbl) if not external_drops[npcname] == nil then MsgC(Color(255,255,0),"WARNING: Tried to register 2 drop tables for " .. npcname) |
