2011-08-19 16:12:30 -06:00
|
|
|
mypos=engine.getmod("functions")
|
2011-08-20 14:13:14 -06:00
|
|
|
function DeathMsg(values)
|
2011-08-21 07:27:01 -06:00
|
|
|
local name
|
|
|
|
if WINDOWS then
|
|
|
|
name=engine.peek(values.edi,ptt_dfstring)
|
|
|
|
else
|
|
|
|
name=engine.peek(values.ebx,ptt_dfstring)
|
|
|
|
end
|
2011-08-20 14:13:14 -06:00
|
|
|
print(name:getval().." died")
|
|
|
|
end
|
2011-08-19 16:12:30 -06:00
|
|
|
if mypos then
|
|
|
|
print("Onfunction already installed")
|
2011-08-20 11:23:47 -06:00
|
|
|
--onfunction.patch(0x189dd6+offsets.base())
|
2011-08-19 16:12:30 -06:00
|
|
|
else
|
|
|
|
onfunction.install()
|
2011-08-20 16:46:16 -06:00
|
|
|
if WINDOWS then
|
|
|
|
onfunction.AddFunction(0x55499D+offsets.base(),"Move") --on creature move found with "watch mem=xcoord"
|
|
|
|
onfunction.AddFunction(0x275933+offsets.base(),"Die") --on creature death? found by watching dead flag then stepping until new function
|
|
|
|
else
|
2011-08-21 06:56:42 -06:00
|
|
|
--onfunction.AddFunction(0x0899be82+offsets.base(),"Move") -- found out by attaching watch...
|
|
|
|
onfunction.AddFunction(0x899befe+offsets.base(),"Move") -- found out by attaching watch...
|
2011-08-21 07:27:01 -06:00
|
|
|
onfunction.AddFunction(0x850eecd+offsets.base(),"Die") -- same
|
2011-08-20 16:46:16 -06:00
|
|
|
end
|
2011-08-20 14:13:14 -06:00
|
|
|
onfunction.SetCallback("Die",DeathMsg)
|
2011-08-20 16:46:16 -06:00
|
|
|
end
|