From 403e81b9eecb9a86bef5985425f81df577af7837 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 28 Feb 2018 18:09:58 -0500 Subject: Breaking redirect to implement a better system --- gamemode/npcsystem/sv_examplenpc.lua | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 gamemode/npcsystem/sv_examplenpc.lua (limited to 'gamemode/npcsystem') diff --git a/gamemode/npcsystem/sv_examplenpc.lua b/gamemode/npcsystem/sv_examplenpc.lua new file mode 100644 index 0000000..9e8f5ec --- /dev/null +++ b/gamemode/npcsystem/sv_examplenpc.lua @@ -0,0 +1,51 @@ +---An example item. +-- An item you can create a copy of as a starting point. This is the minimum needed for an item. Different inventories usually also require different fields and functions. +--@classmod npctbl + +local npc = {} + +---Stats for movement and health +npc.Stats = { + ["Vitality"] = 100, --Hitpoints + ["Accel"] = 25, --How quickly the monster can get up to speed? + ["Decel"] = 25, --How quickly the monster can stop? + ["Step"] = 8, --How high a stair can this monster climb? + ["Speed"] = 250 --How fast can this monster go? +} +--More navigation settings +npc.goaltolarance = 5 +npc.lookahead = 3 + +---Things that npc's drop. +-- Should be an array of tuples ("item name", %chance drop). +-- If you want more than 1 of an item to drop, you should have multiples items +-- +-- -- This NPC will always drop 1 Monster Meat, and has a 50% chance of dropping +-- -- 2 Monster Meat. +-- npc.Drops = { +-- {"Monster Meat", 100}, +-- {"Monster Meat", 50} +-- } +npc.Drops = { +} + +---Do special things on spawn. +-- If This monster needs to do anything special on spawn (for example, +-- a boss monster might trap players in the area untill it's defeated) +-- @optional +-- @tparam entity The monster that's spawning. +-- @treturn void +function npc.OnSpawn(ent) + +end + +---Do special things when damaged. +-- If this monster needs to do anything special when it gets dammaged +-- @optional +-- @tparam entity The monster that's being damaged +-- @tparam dmg The damange table +-- @treturn void +function npc.OnDammage(ent,dmg) + +end + -- cgit v1.2.3-70-g09d2