<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="31">
  <Forms>
    <UDF1 Class="TCEForm" Encoding="Ascii85">rBusq)=ArR+vZ*LODZgYP2},z+,A]xP1FTVny3+ijhX-w8+uHLc$Bdxj3-UPlHcJUSg:5R317emF!uP-L:,+h?i^Y_d,zbQzSF:6jRw6VW7O(P7=0_(PkT:N9L7Tbpy4whlThg2YV_V]3w-Ys:84@1,E-p2u!wvDu8-JE?7Ee^NgzV}yJmE{nIJ62yK856I,Q;xO1+8hE}75v4rK]#dujUjsgZ1rENQDf7lOrBL6ke}AUCJ:G7Dj0.U[9BSXU;nPA?O_?4A@j?u$Z9Ouv-MHqDWDeaQph8bT/oLpLCzo(W=YQ(40(OfzW+d7;A!Do_2bimXNt)m=z0ntJin9y4z9tX5CVA/(]lxX[R#:^dv]5o(0@2/*+}bQopaFnrpko/CiCH54lf1_BDEMgxSlrOghDu34Kc?r[64kSMdqYi9M(sB)J-bT)Sez[3E]5;@YwgRQ:RC:al$bkUCkSZZiD/.l}b.3S=THN15}sXd$$N*v4PESk+*aHpbfMVq*0K+Ssct@(CU6nsa4tDuSN5Z@f2*6Jeuj6=8lR!*v=jxwAwf9fc36+RF*+,PIHIwf.UCPN_!h?-$()8R]!B!W=:AZ_fqYEH%!oE,U8n_LQlzuTTM+?@?:k[Cwz1,IehNZQ%[2r{j07JBgnjQ#9*Q}gm{*jy-v*BfJBtZM6s%igy:u3wN=4dM={H1${]Vfrd-?7JQeziL+G!@b)q^z]kKUwBKoRr%PF0dg/5FklHu2SjuC1_FAVI1Je$6+kR,S)Q)H*0Vfq*0Rw_,Im;}A6ruRUwqXOGNrF]=.5C=/L2F9XA=Wf-F(I8hCP{2nM]fJ$$GP]??4a9-qw{JGO^sT[FDC_pwvwRTK4m!$9F4w%exhe!fB$q#AHCrcK#-rqx.8=(#x:3RVp?y?]h=^sG.8</UDF1>
  </Forms>
  <CheatEntries>
    <CheatEntry>
      <ID>63</ID>
      <Description>"computers"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>F38</Offset>
        <Offset>ED4</Offset>
        <Offset>424</Offset>
        <Offset>4D4</Offset>
        <Offset>28</Offset>
        <Offset>98</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>64</ID>
      <Description>"demolition"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>738</Offset>
        <Offset>9D4</Offset>
        <Offset>824</Offset>
        <Offset>4D4</Offset>
        <Offset>28</Offset>
        <Offset>98</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>69</ID>
      <Description>"electronics"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>B38</Offset>
        <Offset>4D4</Offset>
        <Offset>8A0</Offset>
        <Offset>4BC</Offset>
        <Offset>AC</Offset>
        <Offset>A84</Offset>
        <Offset>10</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>65</ID>
      <Description>"environmental"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>338</Offset>
        <Offset>ED4</Offset>
        <Offset>B80</Offset>
        <Offset>4D4</Offset>
        <Offset>118</Offset>
        <Offset>A84</Offset>
        <Offset>10</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>62</ID>
      <Description>"heavy weapons"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>338</Offset>
        <Offset>ED4</Offset>
        <Offset>424</Offset>
        <Offset>4D4</Offset>
        <Offset>28</Offset>
        <Offset>98</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>68</ID>
      <Description>"lockpicking"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>F38</Offset>
        <Offset>4D4</Offset>
        <Offset>9B4</Offset>
        <Offset>4BC</Offset>
        <Offset>AC</Offset>
        <Offset>A84</Offset>
        <Offset>10</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>73</ID>
      <Description>"lowtech weapons"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>B38</Offset>
        <Offset>4D4</Offset>
        <Offset>28</Offset>
        <Offset>98</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>66</ID>
      <Description>"medicine"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>338</Offset>
        <Offset>9D4</Offset>
        <Offset>BAC</Offset>
        <Offset>4D4</Offset>
        <Offset>118</Offset>
        <Offset>A84</Offset>
        <Offset>10</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>72</ID>
      <Description>"pistols"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>F38</Offset>
        <Offset>ED4</Offset>
        <Offset>9D4</Offset>
        <Offset>7A4</Offset>
        <Offset>4BC</Offset>
        <Offset>118</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>70</ID>
      <Description>"rifles"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>738</Offset>
        <Offset>4D4</Offset>
        <Offset>0</Offset>
        <Offset>4BC</Offset>
        <Offset>28</Offset>
        <Offset>98</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>67</ID>
      <Description>"swimming"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>738</Offset>
        <Offset>9D4</Offset>
        <Offset>BAC</Offset>
        <Offset>4D4</Offset>
        <Offset>118</Offset>
        <Offset>A84</Offset>
        <Offset>10</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>76</ID>
      <Description>"start points"</Description>
      <VariableType>4 Bytes</VariableType>
      <Address>"DeusEx.DLL"+0002702C</Address>
      <Offsets>
        <Offset>9BC</Offset>
        <Offset>ED4</Offset>
        <Offset>9FC</Offset>
        <Offset>4BC</Offset>
        <Offset>28</Offset>
        <Offset>98</Offset>
        <Offset>38</Offset>
      </Offsets>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <LuaScript>addresslist=getAddressList()
getAutoAttachList().add("DeusEx.exe")
getAutoAttachList().add("deusex.exe")
local default_min = 25
local default_max = 200
local values = {}

function IsSkill(name)
         return name ~= "start points" and name ~= "skill points" and name ~= "old skill points" and name ~= "old start points"
end

function RandomizeValue(a)
         name = a.Description
         if a.Active == true then
            print("skipping " .. name .. " because it's activated/frozen")
            -- https://wiki.cheatengine.org/index.php?title=Lua:Class:MemoryRecord
            return
         end
         local props = GetValueProps(name)
         local min = props.min / 100
         local max = props.max / 100
         local percent = min + math.random() * ( max-min )

         for i=0, 2, 1 do
             name = a.Description
             local addr = a.getCurrentAddress()
             addr = addr + ( i * 4 )
             local oldvalue = readInteger(addr)
             local value = oldvalue * percent
             value = math.floor(value)
             if IsSkill(name) then
                name = name .. " " .. (i+1)
             end
             print("Changing " .. name .. " (" .. addr .. ") from " .. oldvalue .. " to " .. value .. " (" .. (percent*100) .. "%)")
             writeInteger(addr, value)
             if not IsSkill(name) then
                break
             end
         end
end

function UDF1_CEButton1Click(sender)
         print("\n\n\nrandomizing!")
         local seed = os.time()
         if UDF1.seed.Text ~= '' then
            seed = UDF1.seed.Text
         else
             UDF1.seed.Text = seed
         end
         math.randomseed( seed )
         for i=0, addresslist.getCount()-1 , 1 do
                  local addr = addresslist.getMemoryRecord(i)
                  a, b = pcall( function() RandomizeValue(addr) end )
                  if a == false then
                     print(b)
                  end
         end
end

function GetValueProps(name)
         if values[name] ~= nil then
            return values[name]
         else
             if IsSkill(name) then
                values[name] = { min = default_min, max = default_max }
             else
                 values[name] = { min = 100, max = 100 }
             end
             return values[name]
         end
end

UDF1.values.Items.Clear()
UDF1.values.Items.Add("All Skills")
UDF1.values.Text = "All Skills"
UDF1.Min.Position = 50
UDF1.Max.Position = 200
for i=0, addresslist.getCount()-1 , 1 do
    addr = addresslist.getMemoryRecord(i)
    if addr.Active==false then
       UDF1.values.Items.Add(addr.Description)
    end
end

UDF1.Show()

function UDF1_valuesChange(sender)
         local props = GetValueProps(sender.Text)
         local min = props.min
         local max = props.max
         UDF1.Min.Position = min
         UDF1.Max.Position = max
end

function UpdateProp(sender, name)
         local props = GetValueProps(name)
         if UDF1.Min.Position &gt; UDF1.Max.Position then
            if sender == UDF1.Min then
               UDF1.Max.Position = UDF1.Min.Position
            else
                UDF1.Min.Position = UDF1.Max.Position
            end
         end

         props.min = UDF1.Min.Position
         props.max = UDF1.Max.Position
         values[UDF1.values.Text] = props

         UDF1.MinLabel.Caption = "Min: " .. props.min .. "%"
         UDF1.MaxLabel.Caption = "Max: " .. props.max .. "%"
end

function MinMaxChange(sender)
         local name = UDF1.values.Text
         UpdateProp(sender, name)
         if name == "All Skills" then
            for i=0, addresslist.getCount()-1 , 1 do
                addr = addresslist.getMemoryRecord(i)
                name = addr.Description
                if IsSkill(name) then
                   UpdateProp(sender, name)
                end
            end
         end
end

function UDF1_FormClose(sender)
         closeCE()
         return caFree --Possible options: caHide, caFree, caMinimize, caNone
end

</LuaScript>
</CheatTable>
