<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="16">
  <CheatEntries>
    <CheatEntry>
      <ID>121</ID>
      <Description>"Spellforce Platinum Edition Script (AOB) JK"</Description>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>[ENABLE]
//=========================================
alloc(MyCode,1024)
//=========================================

aobscan(aobGodMode,66 89 41 06 5b 59 c2 04 00)
label(pGodMode)
registersymbol(pGodMode)

label(_GodMode)
label(_BackGM)
label(_ExitGM)


label(protectFromTowers)
registersymbol(protectFromTowers)

label(percent)

//=========================================
MyCode:
//=========================================
_GodMode:
 pushfd
 cmp dword ptr [protectFromTowers],0
 je _ExitGM                     // Jump if feature is disabled

 cmp byte ptr [ecx-26],01       // Player's unit ?
 jne _ExitGM

 cvtsi2ss xmm0,edx              // damage
 movsx ebx, word [ecx]
 cvtsi2ss xmm1,ebx              // max HP
 mulss xmm1, dword ptr [percent]

 comiss xmm0,xmm1               // damage &lt;  (90% max HP) ?
 jl _ExitGM

 sub eax,edx

_ExitGM:
 popfd
 mov [ecx+06],ax                // Original code
 pop ebx                        // Original code
 jmp _BackGM                    // Back to main code
protectFromTowers:
 dd 0
percent:
 dd (float)0.90

//SpellForce.exe+454890:
aobGodMode:
pGodMode:
 jmp _GodMode
_BackGM:

//=========================================
// Original Codes
[DISABLE]
//SpellForce.exe+454890:
pGodMode:
 mov [ecx+06],ax
 pop ebx

unregistersymbol(pGodMode)
unregistersymbol(protectFromTowers)
dealloc(MyCode)
</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <ID>130</ID>
          <Description>"Protect From Towers"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>protectFromTowers</Address>
          <Hotkeys>
            <Hotkey>
              <Action>Set Value</Action>
              <Keys>
                <Key>18</Key>
                <Key>65</Key>
              </Keys>
              <Value>1</Value>
              <ID>0</ID>
            </Hotkey>
            <Hotkey>
              <Action>Set Value</Action>
              <Keys>
                <Key>18</Key>
                <Key>81</Key>
              </Keys>
              <Value>0</Value>
              <ID>1</ID>
            </Hotkey>
          </Hotkeys>
        </CheatEntry>
        <CheatEntry>
          <ID>131</ID>
          <Description>"if unit has less than 90% HP, it will be destroyed"</Description>
          <Color>80000008</Color>
          <GroupHeader>1</GroupHeader>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <Comments>===========================================
 Game Title    : Spellforce - Platinum Edition
 Game Version  : 1.54.75000 (steam)
 Game Sponsor  : MySelf (via Steam)
 Proces Name   : SpellForce.exe
 Script Version: 1.0
 CE Version    : 6.2
 Release date  : 19-Dec-2012
 Author        : Recifense
 History:
 01-Aug-10: First Release
 19-Aug-12: Adapted to new template and added minimum gold.
 Features:
 - God Mode (for player's units and buildings) [1]
 - Unlimited Mana                              [2]
 - Minimum Resources (RTS)                     [3]
 - Quick Level Up (One level per kill)         [4]
 - Unlimited Points (this could invalidate the character)
 - Minimum Gold                                [5]
 - pointers
===========================================
[1] That's it;
[2] Player's characters;
[3] The existing resources will have a mnimum value (4000);
[4] That's it. Each kill, a level up;
[5] Gold will be set to a minimum value. It will work only when a change occurs in the inventory, including money.
===========================================
HOTKEYS:
CTRL+Home   = Enable  all cheats (but level up);
CTRL+End    = Disable all cheats (but level up);
CTRL+PageUp   = Enable  Quick Level Up
CTRL+PageDown = Disable Quick Level Up
===========================================
Cheers!
</Comments>
</CheatTable>
