This is a terrible snippet as the npc class does a lot more than this...with the help of several other files. I've really come to dislike the one event handler per event per mod. It is making my life difficult or it another case of me being dense again...LUA is *really* not my forte. :/
Code: Select all
function npc:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
Lua not having dedicated class keyword (even as syntax sugar like javascript does) makes this a pain sometimes.