blob: 9e8f5ec322602f981a2b96ef770379d7294be277 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
|