items={} --> first lets make a menu table items.menu=MakeMenu() function items.dest() myoff=offsets.getEx("Items") -- first find out where "item vector" is vector=engine.peek(myoff,ptr_vector) -- get list of items for i=0,vector:size()-1 do --look at each item flg=engine.peek(vector:getval(i),ptr_item.flags) flg:set(17,1) engine.poke(vector:getval(i),ptr_item.flags,flg) end end function items.eggs() myoff=offsets.getEx("Items") -- first find out where "item vector" is vector=engine.peek(myoff,ptr_vector) -- get list of items for i=0,vector:size()-1 do --look at each item rti=engine.peek(vector:getval(i),ptr_item.RTI) if ptr_item.getname(nil,rti)=="item_eggst" then egg=engine.peek(vector:getval(i),ptr_subitems["item_eggst"]) egg.isfertile=1 egg.hatchtime=0xffffff --egg.race=123 -- change race for fun times engine.poke(vector:getval(i),ptr_subitems["item_eggst"],egg) end end end function editFlags(offset) while true do flags=engine.peek(offset,ptr_item.flags) for i=0,8*8-1 do if flags:get(i) then print(i.." is true") else print(i.." is false") end end print(" enter number to switch flag or not a number to quit:") q=tonumber(io.stdin:read()) if q==nil then return end flags:flip(q) engine.poke(offset,ptr_item.flags,flags) end end function editCovering(offset) off=engine.peek(offset,ptr_item.ptr_covering) if off == 0 then print("No coverings found.") end vec=engine.peek(off,ptr_vector) print("Covering list:") for i=0,vec:size()-1 do cov=engine.peek(vec:getval(i),ptr_cover) print(string.format("%d. mat=%d submat=%d state=%d",i,cov.mat,cov.submat,cov.state)) end print("To edit type number:") q=tonumber(io.stdin:read()) if q==nil then return end if q>=vec:size() or q<0 then return end off=vec:getval(q) cov=engine.peek(off,ptr_cover) print("Enter mat:") q=tonumber(io.stdin:read()) if q==nil then q=0xffff end print("Enter submat:") v=tonumber(io.stdin:read()) if v==nil then v=0xffff end print("Enter state:") y=tonumber(io.stdin:read()) if y==nil then y=0 end cov.mat=q cov.submat=v cov.state=y engine.poke(off,ptr_cover,cov) end function editMaterial(offset) print("Mat id 0 to 18 is in normal materials (inorganic, amber etc...) after that creature mat (with submat2 being race)") print("from 219 with submat2=0xffffffff (type not a number) it reads legends id, from 419 submat2 means plant id") print("Probably submat is not used :? ") mat=engine.peek(offset,ptr_item.mat) submat=engine.peek(offset,ptr_item.submat) submat2=engine.peek(offset,ptr_item.submat2) lid=engine.peek(offset,ptr_item.legendid) print(string.format("Now is mat=%d, submat=%d submat2=%d legend id=%d",mat,submat,submat2,lid)) print("Enter mat:") q=tonumber(io.stdin:read()) if q==nil then return end print("Enter submat:") v=tonumber(io.stdin:read()) if v==nil then v=0xffff end print("Enter submat2:") z=tonumber(io.stdin:read()) if z==nil then z=0xffffffff end print("Enter legendid:") y=tonumber(io.stdin:read()) if y==nil then y=0xffffffff end engine.poke(offset,ptr_item.mat,q) engine.poke(offset,ptr_item.submat,v) engine.poke(offset,ptr_item.legendid,y) engine.poke(offset,ptr_item.submat2,z) print("Done") end function items.select() myoff=offsets.getEx("Items") vector=engine.peek(myoff,ptr_vector) tx,ty,tz=getxyz() T={} for i=0,vector:size()-1 do --this finds all item offsets that are on pointer itoff=vector:getval(i) x=engine.peek(itoff,ptr_item.x) y=engine.peek(itoff,ptr_item.y) z=engine.peek(itoff,ptr_item.z) if x==tx and y==ty and z==tz then table.insert(T,itoff) end end print("Items under cursor:") i=1 for _,v in pairs(T) do RTI=engine.peek(v,ptr_item.RTI) print(i..". "..ptr_item.getname(nil,RTI)) i=i+1 end print("Type number to edit or 'q' to exit") while true do q=io.stdin:read() if q=='q' then return end if tonumber(q) ~=nil and tonumber(q)