aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/npc/sv_huntingspawner.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-11-07 00:39:45 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-11-07 00:39:45 -0500
commit07593f0c983ac6b16161829b20ea6fde887fa7e9 (patch)
treea6ae199a547b6b2d7f7e937b8768f4c7bed85eae /gamemode/core/npc/sv_huntingspawner.lua
parent7bc4dbb94a1776729f95c319ef28f057ddcd170b (diff)
downloadartery-07593f0c983ac6b16161829b20ea6fde887fa7e9.tar.gz
artery-07593f0c983ac6b16161829b20ea6fde887fa7e9.tar.bz2
artery-07593f0c983ac6b16161829b20ea6fde887fa7e9.zip
Added luadoc comments for core\npc files
Only need to add comments to like half of them though.
Diffstat (limited to 'gamemode/core/npc/sv_huntingspawner.lua')
-rw-r--r--gamemode/core/npc/sv_huntingspawner.lua8
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)