wait if your going to do that then add this as well.
function Adv_tools.Zombieressurect() --fix to zombism
repeat
local trgs=selectall()
for k,v in pairs(trgs) do
--indx=GetCreatureAtPos(v)
--indx=engine.peek(v,ptr_creature.ID)
print("Zombie:"..k)
v2=engine.peek(v,ptr_Creature.hurt1)
for i=0,v2:size()-1 do
v2:setval(i,1)
end
v2=engine.peek(v,ptr_Creature.hurt2)
v2.type=DWORD
for i=0,v2:size()-1 do
v2:setval(i,1)
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,false) -- alive!
flags:set(12,true) --zombie
flags:set(17,true)
flags:set(19,true)
engine.poke(v,ptr_Creature.flags,flags)
--engine.poke(v,ptr_Creature.legends,-1)
end
until r==7
end
function Adv_tools.carryEX() --have the pointer on the creature you want to hold on to.
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
indx=GetCreatureAtPos(getxyz())
print("grab person how? N S E W")
--repeat
r=io.stdin:read()
if r=="N" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)+1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="S" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
enty=engine.peek(vector:getval(0),ptr_Creature.y)-1
entx=engine.peek(vector:getval(0),ptr_Creature.x)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="W" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)-1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
elseif r=="E" then
repeat
flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
entx=engine.peek(vector:getval(0),ptr_Creature.x)+1
enty=engine.peek(vector:getval(0),ptr_Creature.y)
move=engine.peek(vector:getval(0),ptr_Creature.z)
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==true or flg2:get(1) ==true
end
--[[flg=engine.peek(vector:getval(0),ptr_Creature.flags)
flg2=engine.peek(vector:getval(indx),ptr_Creature.flags)
--print("how high?")
--entry=io.stdin:read()
--Crepos=engine.peek(vector:getval(0),ptr_Creature.x)+entx
move=engine.peek(vector:getval(0),ptr_Creature.z)
--print("W and E")
--entry=io.stdin:read()
move2=engine.peek(vector:getval(0),ptr_Creature.x)
--print("N and S")
--entry=io.stdin:read()
move3=engine.peek(vector:getval(0),ptr_Creature.y)
repeat
engine.poke(vector:getval(indx),ptr_Creature.z,move)
engine.poke(vector:getval(indx),ptr_Creature.x,entx)
engine.poke(vector:getval(indx),ptr_Creature.y,enty)
until flg:get(15) ==1 or flg2:get(1) ==1]]--
end
function selectdead()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,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)==true then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.deadwarp()
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectdead()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
func.PrintMessage3_(msg)
end
function selectcomp()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
lfollow=engine.peek(off,ptr_Creature.followID) -- get target creatures "now following ID"
if lfollow ~=0xFFFFFFFF then --if its set
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.compwarp() --teleport companions if you used Control Civ you might teleport your self aswell
func.PrintMessage2_(msg)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectcomp()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
end
function selectzombie()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,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(12)==true then --if undead in anyway...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.zomwarp() --teleport zombies
func.PrintMessage2_(msg)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
local tx,ty,tz
local trgs=selectzombie()
for k,v in pairs(trgs) do
tx,ty,tz=getxyz()
print("Warp to coords:"..tx.." "..ty.." "..tz)
engine.poke(v,ptr_Creature.x,tx)
engine.poke(v,ptr_Creature.y,ty)
engine.poke(v,ptr_Creature.z,tz)
end
end
function Adv_tools.fixwarp() --fixing the large invisible blocks that slows movement
local mapoffset=offsets.getEx("WorldData")--0x131C128+offsets.base()
local x=engine.peek(mapoffset+24,DWORD)
local y=engine.peek(mapoffset+28,DWORD)
local z=engine.peek(mapoffset+32,DWORD)
--vec=engine.peek(mapoffset,ptr_vector)
print("Blocks loaded:"..x.." "..y.." "..z)
print("Select type:")
print("1. All (SLOW)")
print("2. range (x0 x1 y0 y1 z0 z1)")
print("3. One block around pointer")
print("anything else- quit")
q=io.stdin:read()
n2=tonumber(q)
if n2==nil then return end
if n2>3 or n2<1 then return end
local xs,xe,ys,ye,zs,ze
if n2==1 then
xs=0
xe=x-1
ys=0
ye=y-1
zs=0
ze=z-1
elseif n2==2 then
print("enter x0:")
xs=tonumber(io.stdin:read())
print("enter x1:")
xe=tonumber(io.stdin:read())
print("enter y0:")
ys=tonumber(io.stdin:read())
print("enter y1:")
ye=tonumber(io.stdin:read())
print("enter z0:")
zs=tonumber(io.stdin:read())
print("enter z1:")
ze=tonumber(io.stdin:read())
function clamp(t,vmin,vmax)
if t> vmax then return vmax end
if t< vmin then return vmin end
return t
end
xs=clamp(xs,0,x-1)
ys=clamp(ys,0,y-1)
zs=clamp(zs,0,z-1)
xe=clamp(xe,xs,x-1)
ye=clamp(ye,ys,y-1)
ze=clamp(ze,zs,z-1)
else
xs,ys,zs=getxyz()
xs=math.floor(xs/16)
ys=math.floor(ys/16)
xe=xs
ye=ys
ze=zs
end
local xblocks=engine.peek(mapoffset,DWORD)
local flg=bit.bnot(bit.lshift(1,3))
for xx=xs,xe do
local yblocks=engine.peek(xblocks+xx*4,DWORD)
for yy=ys,ye do
local zblocks=engine.peek(yblocks+yy*4,DWORD)
for zz=zs,ze do
local myblock=engine.peek(zblocks+zz*4,DWORD)
if myblock~=0 then
for i=0,255 do
local ff=engine.peek(myblock+0x67c+i*4,DWORD)
ff=bit.band(ff,flg) --set 14 flag to 1
engine.poke(myblock+0x67c+i*4,DWORD,ff)
end
end
end
print("Blocks done:"..xx.." "..yy)
end
end
end
function selectciv()
local retvec={} --return vector (or a list)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector) --standart start
for i=0,vector:size()-1 do --check all creatures
local off
off=vector:getval(i)
local crciv=engine.peek(off,ptr_Creature.civ)
local curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
--[[local flags=engine.peek(off,ptr_Creature.flags)
if flags:get(1)==false then]]-- --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
end
function Adv_tools.ControlCiv2() --those who has the same civ number as the adventurer will become the adventurer's companion might need to run this again after you travel out for they stop being companions after you travel and need to reapply one more time.
--first three lines same as before (because we will need an offset of creature at location x,y,z)
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
leg=offsets.getEx("Legends")
legvec=engine.peek(leg,ptr_vector)
local trgs=selectciv()
for k,v in pairs(trgs) do
print("members:"..k)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
playerlegid=rum_tools.getlegendsid(vector:getval(0))
trglegid=rum_tools.getlegendsid(v)
trgid=engine.peek(vector:getval(0),ptr_Creature.ID) --get players ID
engine.poke(v,ptr_Creature.followID,trgid) -- if not just write the players ID.
engine.poke(legvec:getval(trglegid),ptr_legends2.follow,playerlegid)
end
end
function Adv_tools.Convert() --makes companions the same civ
myoff=offsets.getEx("AdvCreatureVec")
vector=engine.peek(myoff,ptr_vector)
--id=engine.peekd(offsets.getEx("CreaturePtr"))
--print(string.format("Vec:%d cr:%d",vector:size(),id))
local trgs=selectcomp()
for k,v in pairs(trgs) do
print("members:"..k)
off=v
crciv=engine.peek(off,ptr_Creature.civ)
curciv=engine.peek(vector:getval(0),ptr_Creature.civ)
if curciv==crciv then
print("Friendly")
--engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
engine.poke(off,ptr_Creature.flags,flg)
else
print("Enemy or Adventurer- making friendly")
engine.poke(off,ptr_Creature.civ,curciv)
flg=engine.peek(off,ptr_Creature.flags)
flg:set(17,false)
flg:set(19,false)
engine.poke(off,ptr_Creature.flags,flg)
end
end
end
Adv_tools.menu:add("?control civ?",Adv_tools.ControlCiv2)
Adv_tools.menu:add("Zombies fix",Adv_tools.Zombieressurect)
Adv_tools.menu:add("?carryex?",Adv_tools.carryEX)
Adv_tools.menu:add("arrange companions",Adv_tools.compwarp)
Adv_tools.menu:add("move zed",Adv_tools.zomwarp)
Adv_tools.menu:add("move souls",Adv_tools.deadwarp)
Adv_tools.menu:add("convert companions",Adv_tools.Convert)
note: the original headers where change from Rum_tools to Adv_tools for easier adding.