okay here's a fresh batch of item functions that a personal necromancer would love.
sadly
code]function itemghostwarptest(off) --this will take the item(from voodoo2) that triggered it and teleport all ghosts to it's coordinates. usefullness depends on what you do to the ghosts.
--[[if itoff==nil then
itoff=selectstatue3()
end]]--
local myoff=offsets.getEx("AdvCreatureVec")
local vector=engine.peek(myoff,ptr_vector)
--local indx=0
local sx,sy,sz
local curoff=vector:getval(0)
local trgs=selectghost()
for t,b in pairs(trgs) do
ix=engine.peek(off,ptr_item.x)
iy=engine.peek(off,ptr_item.y)
iz=engine.peek(off,ptr_item.z)
sx=engine.peek(b,ptr_Creature.x)
sy=engine.peek(b,ptr_Creature.y)
sz=engine.peek(b,ptr_Creature.z)
--r=io.stdin:read()
local tx,ty,tz
tx=ix
ty=iy
tz=iz
engine.poke(b,ptr_Creature.x,tx)
engine.poke(b,ptr_Creature.y,ty)
engine.poke(b,ptr_Creature.z,tz)
local flags=engine.peek(b,ptr_Creature.flags)
engine.poke(b,ptr_Creature.flags,flags)
end
end
function itemcompwarptest(off) --a code set up to teleport companions to places you want them to be, like on the roof, several feet into lava, or with you so they don't end up chasing off for some hard to kill animal during a raid
--[[if itoff==nil then
itoff=selectstatue3()
end]]--
local myoff=offsets.getEx("AdvCreatureVec")
local vector=engine.peek(myoff,ptr_vector)
--local indx=0
local sx,sy,sz
local curoff=vector:getval(0)
local trgs=selectcomp()
for t,b in pairs(trgs) do
ix=engine.peek(off,ptr_item.x)
iy=engine.peek(off,ptr_item.y)
iz=engine.peek(off,ptr_item.z)
sx=engine.peek(b,ptr_Creature.x)
sy=engine.peek(b,ptr_Creature.y)
sz=engine.peek(b,ptr_Creature.z)
--r=io.stdin:read()
local tx,ty,tz
tx=ix
ty=iy
tz=iz
engine.poke(b,ptr_Creature.x,tx)
engine.poke(b,ptr_Creature.y,ty)
engine.poke(b,ptr_Creature.z,tz)
local flags=engine.peek(b,ptr_Creature.flags)
engine.poke(b,ptr_Creature.flags,flags)
end
end
function selectghost()
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(76)==true then --if dead ...
table.insert(retvec,off)--... add it to return vector
end
end
return retvec --return the "return vector" :)
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
I might get started working on two way teleporters or the kind that warps folks if they walk over it.