hey Deon I just finish working on a werewolf/nightcreature code for you.
function adv_tools.lycanressurect()
repeat -- remove this and until for the chance of not wanting to
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Werewolf:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,0)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,0)
end
engine.peek(v,ptr_Creature.civ)
engine.poke(v,ptr_Creature.civ,-1)
engine.poke(v,ptr_Creature.bloodlvl,60000) --give blood
engine.poke(v,ptr_Creature.bleedlvl,24) --stop some bleeding...
local flags=engine.peek(v,ptr_Creature.flags)
flags:set(1,0) -- alive!
flags:set(12,0) --zombie
flags:set(17,1)
flags:set(19,1)
engine.poke(v,ptr_Creature.flags,flags)
engine.poke(v,ptr_Creature.race,151)
end
until r==7
end
function selectall()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff+16,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==1 and flags:get(12)==0 then --if dead and not undead so that you don't have spawn killing zombies...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
Though I can't seem to figure out how to add in a means of if killed by a werewolf the victim is turn into one as of yet. also best to use change race then change adventure in tools to find the race number for WEREWOLF first before running this code. I just found out that 151 is not the universal number for werewolf in vanilla and got blood gnats.