<?xml version="1.0"?>
<CheatTable CheatEngineTableVersion="10">
  <CheatEntries>
    <CheatEntry>
      <Description>"RTKXI V1.0.0.0 Script"</Description>
      <Options moHideChildren="1"/>
      <Color>80000008</Color>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{
===========================================
 Romance of the Three Kingdoms XI
 Game Version  : 1.0.0.0
 Script Version: 1.0
 CE Version    : 6.0
 Features: Soldiers in Cities/Gates/Ports/Troops, Weapons in Cities/Gates/Ports,
           Gold/Food in Cities/Gates/Ports/Troops, Will/Order in Cities/Gates/Ports/Troops,
           Officers'/Troops' Attributes, Officers' Loyalty, Troops' Movement,
           God Mode for Cities/Troops/Officer in duel, Technical Points and Weak Foe.
 17-Feb-2011
 By Recifense
===========================================
}

//=========================================
[ENABLE]
//=========================================
// Check if script is compatible to this game version
// If false the script will not be loaded

assert(RTKXI.EXE+0825c2,?? db 89 56 04)
assert(RTKXI.EXE+0bf611,0f b6 be 80 00 00 00)
assert(RTKXI.EXE+0865f8,8b 46 3c 5e c3)
assert(RTKXI.EXE+226d25,89 b7 a4 01 00 00)
assert(RTKXI.EXE+0956f3,66 89 4e 18 5e)
assert(RTKXI.EXE+087860,66 89 4e 10 5e)
assert(RTKXI.EXE+1BE9A2,66 81 be ae 00 00 00 f4 01)
assert(RTKXI.EXE+1cca52,66 8b 8b 9e 00 00 00)
assert(RTKXI.EXE+1cd051,0f b6 4f 28 ?? ??)
assert(RTKXI.EXE+0868ad,8b 46 24 5e c3)
assert(RTKXI.EXE+08687c,8b 46 20 5e c3)
assert(RTKXI.EXE+07b9f0,8b 54 24 04 85 d2)
assert(RTKXI.EXE+0830f0,8b 44 24 04 85 c0)
assert(RTKXI.EXE+08d2b0,8b 44 24 04 85 c0)
assert(RTKXI.EXE+1095ea,89 46 04 ?? ??)
assert(RTKXI.EXE+10968a,89 46 08 ?? ??)

//=========================================
alloc(MyCode,1024)
//=========================================
// Declaration &amp; Registration section
label(_MonGameLoad)
label(_BackMGL)
label(_MonCW)
label(_BackMCW)
label(_MonCity)
label(_BackMC)
label(_ExitMC)
label(_MonC0)
label(_MonC1)
label(_MonC2)
label(_MonC3)
label(_MonTroop)
label(_MonT0)
label(_MonT1)
label(_MonT2)
label(_MonT3)
label(_BackMT)
label(_ExitMT)
label(_MonSelTroop)
label(_BackMST)
label(_GodModeT)
label(_GodMT0)
label(_BackGMT)
label(_ExitGMT)
label(_GodModeCGP)
label(_BackGMCGP)
label(_ExitGMCGP)
label(_MonOfficer)
label(_BackMO)
label(_ExitMO)
label(_MonTP)
label(_BackMTP)
label(_ExitMTP)
label(_MonAP)
label(_BackMAP)
label(_ExitMAP)
label(_GodModeG)
label(_GodMG0)
label(_BackGMG)
label(_ExitGMG)
label(_MonGate)
label(_BackMG)
label(_ExitMG)
label(_MonG0)
label(_MonG1)
label(_MonG2)
label(_MonG3)
label(_MonPort)
label(_BackMP)
label(_ExitMP)
label(_MonP0)
label(_MonP1)
label(_MonP2)
label(_MonP3)
label(_GodModeC)
label(_GodMC0)
label(_BackGMC)
label(_ExitGMC)
label(_GodModeP)
label(_GodMP0)
label(_BackGMP)
label(_ExitGMP)
label(_GodModeDuel)
label(_BackGMD)
label(_ExitGMD)
label(_MonSpiritDuel)
label(_BackMSD)
label(_ExitMSD)
label(_HeroStatus)
label(_HeroS0)
label(_HeroS1)
label(_HeroS2)
label(_HeroS3)
label(_HeroS4)
label(_HeroS5)
label(_ExitHS)
label(pCity)
label(pSelTroop)
label(pTroop)
label(pCommander)
label(pGate)
label(pPort)
label(iEnableMCT)
label(iEnableMCW)
label(iEnableMCR)
label(iEnableMCS)
label(iEnableMHS)
label(iEnableMTR)
label(iEnableMTW)
label(iEnableMTS)
label(iEnableMTM)
label(iEnableGM)
label(iEnableTP)
label(iEnableAP)
label(iEnableMO)
label(iEnableWF)
label(iEnableMSD)
label(iPlayerID)
label(iECX)

registersymbol(MyCode)
registersymbol(pCity)
registersymbol(pSelTroop)
registersymbol(pTroop)
registersymbol(pCommander)
registersymbol(pGate)
registersymbol(pPort)
registersymbol(iEnableMCT)
registersymbol(iEnableMCW)
registersymbol(iEnableMCR)
registersymbol(iEnableMCS)
registersymbol(iEnableMHS)
registersymbol(iEnableMTR)
registersymbol(iEnableMTW)
registersymbol(iEnableMTS)
registersymbol(iEnableMTM)
registersymbol(iEnableGM)
registersymbol(iEnableTP)
registersymbol(iEnableAP)
registersymbol(iEnableMO)
registersymbol(iEnableWF)
registersymbol(iEnableMSD)
registersymbol(iPlayerID)

//=========================================
MyCode:
//=========================================
// Initialize iPlayerID during game load or start
_MonGameLoad:
 mov dword ptr [iPlayerID],#999// Make PlayerID invalid

 xor ebx,ebx                   // Original code
 mov [esi+04],edx              // Original code
 jmp _BackMGL                  // Back to main code

//=========================================
// Get Player ID via one of his selected city
_MonCW:
 mov edi,[esi+34]              // Get city owner id
 mov [iPlayerID],edi           // Save it for further use

 mov [pCity],esi               // Save structure address for debugging

 movzx edi,byte ptr [esi+00000080] // Original code (get will)
 jmp _BackMCW                  // Back to main code

//========================================= ok
// Visible cities (any city)
_MonCity:
 mov eax,[esi+34]
 cmp eax,[iPlayerID]
 jne _ExitMC

 cmp dword ptr [iEnableMCT],0
 je _MonC0                     // Jump if feature is disabled

 mov eax,#30000                // Minimum Manpower available
 cmp eax,[esi+3c]
 cmovl eax,[esi+3c]
 mov [esi+3c],eax

_MonC0:
 cmp dword ptr [iEnableMCW],0
 je _MonC1                     // Jump if feature is disabled

 mov eax,#10000                // Minimum weapon/horse available
 cmp eax,[esi+4c]
 cmovl eax,[esi+4c]
 mov [esi+4c],eax
 cmp eax,[esi+50]
 cmovl eax,[esi+50]
 mov [esi+50],eax
 cmp eax,[esi+54]
 cmovl eax,[esi+54]
 mov [esi+54],eax
 cmp eax,[esi+58]
 cmovl eax,[esi+58]
 mov [esi+58],eax

 mov eax,#10                   // Minimum Rams/Towers/Ships available
 cmp eax,[esi+5c]
 cmovl eax,[esi+5c]
 mov [esi+5c],eax
 cmp eax,[esi+60]
 cmovl eax,[esi+60]
 mov [esi+60],eax
 cmp eax,[esi+70]
 cmovl eax,[esi+70]
 mov [esi+70],eax

_MonC1:
 cmp dword ptr [iEnableMCR],0
 je _MonC2                     // Jump if feature is disabled

 mov eax,#50000                // Minimum Gold/Food
 cmp eax,[esi+40]
 cmovl eax,[esi+40]
 mov [esi+40],eax
 cmp eax,[esi+44]
 cmovl eax,[esi+44]
 mov [esi+44],eax

_MonC2:
 cmp dword ptr [iEnableMCS],0
 je _MonC3                     // Jump if feature is disabled

 mov al,#100
 mov [esi+80],al               // Will
 mov [esi+81],al               // Order

_MonC3:
 test edi,edi
 jz _ExitMC

 jmp _ExitMC

 cmp dword ptr [iEnableGM],0
 je _ExitMC                    // Jump if feature is disabled

 mov eax,[esi+34]              // Get ownerID
 mov [edi+0c],eax              // Assert the owner (when conquered it is not changed)

 mov ax,[esi+7e]               // Get maximum HP
 mov [edi+10],ax               // Make current HP = maximum

_ExitMC:
 mov eax,[esi+3c]              // Original code (get troop size)
 pop esi                       // Original code
 ret                           // Original code
 jmp _BackMC                   // Back to main code (just following the template)

//=========================================
// All visible ones
_MonTroop:
 mov [iECX],ecx                // Save ECX
 mov [pTroop],esi              // Save structure address for debugging

 call RTKXI.EXE+090420         // Original code (get troop's commander)
 test eax,eax
 jz _ExitMT

 mov [pCommander],eax          // Save structure address for debugging

 mov ecx,[eax+00000094]        // Get ownerID
 cmp ecx,[iPlayerID]           // Player's commander (hero)?
 jne _ExitMT                   // Jump if false

 cmp dword ptr [iEnableMHS],0
 je _MonT0                     // Jump if feature is disabled

 call _HeroStatus              // EAX = pHero

_MonT0:
 cmp dword ptr [iEnableMTR],0  // Resources (Gold and Food)
 je _MonT1                     // Jump if feature is disabled

 mov ecx,#10000
 cmp ecx,[esi+1c]
 cmovl ecx,[esi+1c]
 mov [esi+1c],ecx              // Gold
 cmp ecx,[esi+20]
 cmovl ecx,[esi+20]
 mov [esi+20],ecx              // Food

_MonT1:
 cmp dword ptr [iEnableMTW],0  // Width (Size)
 je _MonT2                     // Jump if feature is disabled

 mov cx,#10000
 cmp cx,[esi+4c]
 jle _MonT2

 mov [esi+4c],cx               // Size (Maximum)
 mov [esi+18],cx               // Size (Current)

_MonT2:
 cmp dword ptr [iEnableMTS],0  // Status/Attributes
 je _MonT3                     // Jump if feature is disabled

 mov cx,#100
 mov [esi+1a],cx               // Will

 mov ecx,64646464
 mov [esi+000000c4],ecx        // LDR = WAR = INT = POL = 100
 mov [esi+000000c8],ecx        // CHR = ATK = DEF = BLD = 100

 mov [esi+000000e8],ecx        // LDR = WAR = INT = POL = 100
 mov [esi+000000ec],ecx        // CHR = ATK = DEF = BLD = 100

_MonT3:
 cmp dword ptr [iEnableMTM],0  // Movement
 je _ExitMT                    // Jump if feature is disabled

 mov dword ptr [esi+40],0      // Troop can move again

_ExitMT:
 mov ecx,[iECX]                // Restore ECX
 jmp _BackMT                   // Back to main code

//=========================================
_MonSelTroop:
 mov [pSelTroop],esi           // Save pointer for debugging

 mov [edi+000001a4],esi        // Original code
 jmp _BackMST                  // Back to main code

//=========================================
// Troop
_GodModeT:
 push eax

 cmp dword ptr,[esi+08],0      // Is there a commander?
 jne _ExitGMT                  // Jump if false

 push ecx                      // Save ECX...
 mov ecx,[esi+0c]              // Get commander ID (Index)
 push ecx                      // Push parameter to next call
 mov ecx,RTKXI.EXE+06d9e368    // Game info address

 call RTKXI.EXE+090420         // Get troop's commander
 pop ecx                       // ...Restore ECX
 test eax,eax                  // Was the commander ID valid?
 jz _ExitGMT                   // Jump if false

 mov eax,[eax+00000094]        // Get ownerID
 cmp eax,[iPlayerID]           // Player's commander (hero)?
 jne _GodMT0                   // Jump if false

 cmp dword ptr [iEnableGM],0
 je _ExitGMT                   // Jump if feature is disabled

 mov cx,#100
 mov [esi+1a],cx               // Will

 mov cx,[esi+4c]               // Get Troop Max Size
 jmp _ExitGMT

_GodMT0:
 cmp dword ptr [iEnableWF],0
 je _ExitGMT                   // Jump if feature is disabled

 shr ecx,1                     // Divide value by 2

_ExitGMT:
 pop eax

 mov [esi+18],cx               // Original code (Troop Cur Size)
 pop esi                       // Original code
 jmp _BackGMT

//=========================================
// City / Gate / Port (It works for the enemy too)
_GodModeCGP:
 cmp dword ptr [iEnableGM],0
 je _ExitGMCGP                 // Jump if feature is disabled

 cmp cx,[esi+10]
 jge _ExitGMCGP                // Jump if value is increasing

 mov cx,[esi+10]               // Get Current HP

_ExitGMCGP:
 mov [esi+10],cx               // Original Code (update City/Gate/Port HP)
 pop esi                       // Original code
 jmp _BackGMCGP                // Back to main code

//=========================================
// When a city is selected
_MonOfficer:                   // Commanders/Heroes
 push eax
 
 cmp dword ptr [iEnableMO],0
 je _ExitMO                    // Jump if feature is disabled

 mov eax,[esi+00000094]        // Read Officer's OwnerID
 cmp eax,[iPlayerID]
 jne _ExitMO

 mov ax,#120
 cmp ax,[esi+000000ac]         // Loyalty &gt;= 120 ?
 jle _ExitMO                   // Jump if true

 mov [esi+000000ac],ax         // Update Loyalty

_ExitMO:
 pop eax

 cmp word ptr [esi+000000ae],01f4 // Original Code (Deeds)
 jmp _BackMO                   // Back to main code
  
//=========================================
// Technical Point minimum value = 6000
_MonTP:
 cmp dword ptr [iEnableTP],0
 je _ExitMTP                   // Jump if feature is disabled

 mov cx,#6000                  // TP = 6000

 cmp cx,[ebx+0000009E]
 jle _ExitMTP

 mov [ebx+0000009E],cx         // TP = minimum

_ExitMTP:
 mov cx,[ebx+0000009E]         // Original code
 jmp _BackMTP                  // Back to main code

//=========================================
// Maximum Action Point
_MonAP:
 cmp dword ptr [iEnableAP],0
 je _ExitMAP                   // Jump if feature is disabled

 mov cl,#255
 mov [edi+28],cl               // AP = Maximum

_ExitMAP:
 movzx ecx,byte ptr [edi+28]   // Original code
 cmp ecx,eax                   // Original code
 jmp _BackMAP                  // Back to main code

//========================================= ok
// Gate under cursor
_MonGate:
 mov [pGate],esi               // Save structure address for debugging

 mov eax,[esi+18]
 cmp eax,[iPlayerID]
 jne _ExitMG

 cmp dword ptr [iEnableMCT],0
 je _MonG0                     // Jump if feature is disabled

 mov eax,#30000                // Minimum Manpower available
 mov [esi+1c],eax

_MonG0:
 cmp dword ptr [iEnableMCW],0
 je _MonG1                     // Jump if feature is disabled

 mov eax,#10000                // Minimum weapon/horse available
 cmp eax,[esi+2c]
 cmovl eax,[esi+2c]
 mov [esi+2c],eax
 cmp eax,[esi+30]
 cmovl eax,[esi+30]
 mov [esi+30],eax
 cmp eax,[esi+34]
 cmovl eax,[esi+34]
 mov [esi+34],eax
 cmp eax,[esi+38]
 cmovl eax,[esi+38]
 mov [esi+38],eax

 mov eax,#10                   // Minimum Rams/Towers/Ships available
 cmp eax,[esi+3c]
 cmovl eax,[esi+3c]
 mov [esi+3c],eax
 cmp eax,[esi+40]
 cmovl eax,[esi+40]
 mov [esi+40],eax
 cmp eax,[esi+50]
 cmovl eax,[esi+50]
 mov [esi+50],eax

_MonG1:
 cmp dword ptr [iEnableMCR],0
 je _MonG2                     // Jump if feature is disabled

 mov eax,#30000                // Minimum Gold/Food
 cmp eax,[esi+20]
 cmovl eax,[esi+20]
 mov [esi+20],eax
 cmp eax,[esi+24]
 cmovl eax,[esi+24]
 mov [esi+24],eax

_MonG2:
 cmp dword ptr [iEnableMCS],0
 je _MonG3                     // Jump if feature is disabled

 mov al,#100                   // Will
 mov [esi+58],al

_MonG3:
 test ebp,ebp
 jz _ExitMG

 jmp _ExitMG

 cmp dword ptr [iEnableGM],0
 je _ExitMG                    // Jump if feature is disabled

 mov eax,[esi+18]              // Get ownerID
 mov [ebp+0c],eax              // Assert the owner (when conquered it is not changed)

 mov ax,[esi+5a]               // Get maximum HP
 mov [ebp+10],ax               // Make current HP = maximum

_ExitMG:
 mov eax,[esi+24]              // Original code (get food)
 pop esi                       // Original code
 ret                           // Original code
 jmp _BackMG                   // Back to main code (just following the template)

//========================================= ok
// Port under cursor
_MonPort:
 mov [pPort],esi               // Save structure address for debugging

 mov eax,[esi+14]
 cmp eax,[iPlayerID]
 jne _ExitMP

 cmp dword ptr [iEnableMCT],0
 je _MonP0                     // Jump if feature is disabled

 mov eax,#5000                 // Minimum Manpower available
 mov [esi+18],eax

_MonP0:
 cmp dword ptr [iEnableMCW],0
 je _MonP1                     // Jump if feature is disabled

 mov eax,#3000                 // Minimum weapon/horse available
 cmp eax,[esi+28]
 cmovl eax,[esi+28]
 mov [esi+28],eax
 cmp eax,[esi+2c]
 cmovl eax,[esi+2c]
 mov [esi+2c],eax
 cmp eax,[esi+30]
 cmovl eax,[esi+30]
 mov [esi+30],eax
 cmp eax,[esi+34]
 cmovl eax,[esi+34]
 mov [esi+34],eax

 mov eax,#10                   // Minimum Rams/Towers/Ships available
 cmp eax,[esi+38]
 cmovl eax,[esi+38]
 mov [esi+38],eax
 cmp eax,[esi+3c]
 cmovl eax,[esi+3c]
 mov [esi+3c],eax
 cmp eax,[esi+4c]
 cmovl eax,[esi+4c]
 mov [esi+4c],eax

_MonP1:
 cmp dword ptr [iEnableMCR],0
 je _MonP2                     // Jump if feature is disabled

 mov eax,#10000                // Minimum Gold/Food
 cmp eax,[esi+1c]
 cmovl eax,[esi+1c]
 mov [esi+1c],eax
 cmp eax,[esi+20]
 cmovl eax,[esi+20]
 mov [esi+20],eax

_MonP2:
 cmp dword ptr [iEnableMCS],0
 je _MonP3                     // Jump if feature is disabled

 mov al,#100                   // Will
 mov [esi+54],al

_MonP3:
 test ebp,ebp
 jz _ExitMP

 jmp _ExitMP

 cmp dword ptr [iEnableGM],0
 je _ExitMP                    // Jump if feature is disabled

 mov eax,[esi+14]              // Get ownerID
 mov [ebp+0c],eax              // Assert the owner (when conquered it is not changed)

 mov ax,[esi+56]               // Get maximum HP
 mov [ebp+10],ax               // Make current HP = maximum

_ExitMP:
 mov eax,[esi+20]              // Original code (get food)
 pop esi                       // Original code
 ret                           // Original code
 jmp _BackMP                   // Back to main code (just following the template)

//=========================================
// City
_GodModeC:
 mov edx,[esp+04]              // Original code (get new troop size)

 push ebx
 mov ebx,[ecx+34]              // Get OwnerID
 cmp ebx,[iPlayerID]           // Is it a player's city?
 pop ebx
 jne _GodMC0                   // Jump if false

 cmp dword ptr [iEnableGM],0
 je _ExitGMC                   // Jump if feature is disabled

 mov edx,[ecx+38]              // Make soldiers = maximum
 jmp _ExitGMC

_GodMC0:
 test edx,edx
 js _ExitGMC                   // Jump if negative value

 cmp dword ptr [iEnableWF],0
 je _ExitGMC                   // Jump if feature is disabled

 shr edx,1                     // Divide value by 2

_ExitGMC:
 test edx,edx                  // Original Code
 jmp _BackGMC                  // Back to main code

//=========================================
// Gate
_GodModeG:
 mov eax,[esp+04]              // Original code (get new troop size)

 push ebx
 mov ebx,[ecx+18]              // Get OwnerID
 cmp ebx,[iPlayerID]           // Is it a player's city?
 pop ebx
 jne _GodMG0                   // Jump if false

 cmp dword ptr [iEnableGM],0
 je _ExitGMG                   // Jump if feature is disabled

 mov eax,#30000                // Make soldiers = maximum
 jmp _ExitGMG

_GodMG0:
 test eax,eax
 js _ExitGMG                   // Jump if negative value

 cmp dword ptr [iEnableWF],0
 je _ExitGMG                   // Jump if feature is disabled

 shr eax,1                     // Divide value by 2

_ExitGMG:
 test eax,eax                  // Original Code
 jmp _BackGMG                  // Back to main code

//=========================================
// Port
_GodModeP:
 mov eax,[esp+04]              // Original code (get new troop size)

 push ebx
 mov ebx,[ecx+14]              // Get OwnerID
 cmp ebx,[iPlayerID]           // Is it a player's city?
 pop ebx
 jne _GodMP0                   // Jump if false

 cmp dword ptr [iEnableGM],0
 je _ExitGMP                   // Jump if feature is disabled

 mov eax,#30000                // Make soldiers = maximum
 jmp _ExitGMP

_GodMP0:
 test eax,eax
 js _ExitGMP                   // Jump if negative value

 cmp dword ptr [iEnableWF],0
 je _ExitGMP                   // Jump if feature is disabled

 shr eax,1                     // Divide value by 2

_ExitGMP:
 test eax,eax                  // Original Code
 jmp _BackGMP                  // Back to main code

//=========================================
// During Duel
_GodModeDuel:
 cmp dword ptr [iEnableGM],0
 je _ExitGMD                   // Jump if feature is disabled

 push eax
 mov eax,[esi]                 // Get ptr to officer
 mov eax,[eax+00000094]        // Get OwnerID
 cmp eax,[iPlayerID]           // Player's officer?....
 pop eax
 jne _ExitGMD                  // ....Jump if false

 mov eax,#100                  // Make HP = 100%

_ExitGMD:
 mov [esi+04],eax              // Original Code (update HP)
 sub eax,ecx                   // Original code
 jmp _BackGMD                  // Back to main code

//=========================================
// During Duel
_MonSpiritDuel:
 cmp dword ptr [iEnableMSD],0
 je _ExitMSD                   // Jump if feature is disabled

 push eax
 mov eax,[esi]                 // Get ptr to officer
 mov eax,[eax+00000094]        // Get OwnerID
 cmp eax,[iPlayerID]           // Player's officer?....
 pop eax
 jne _ExitMSD                  // ....Jump if false

 mov eax,#300                  // Make Spirit = Maximum

_ExitMSD:
 mov [esi+08],eax              // Original Code (update HP)
 sub eax,ecx                   // Original code
 jmp _BackMSD                  // Back to main code

//=========================================
// EAX = pHero
_HeroStatus:
 push ecx

 mov cx,#100
 cmp cx,[eax+000000ac]
 jle _HeroS0

 mov [eax+000000ac],cx         // Loyalty

_HeroS0:
 cmp cx,[eax+00000128]
 jle _HeroS1

 mov [eax+00000128],cx         // Energy

_HeroS1:
 cmp cl,[eax+000000c8]
 jle _HeroS2

 mov [eax+000000c8],cl         // LDR
 mov [eax+00000170],cl         // LDR
 mov [eax+00000175],cl         // LDR

_HeroS2:
 cmp cl,[eax+000000c9]
 jle _HeroS3

 mov [eax+000000c9],cl         // WAR
 mov [eax+00000171],cl         // WAR
 mov [eax+00000176],cl         // WAR

_HeroS3:
 cmp cl,[eax+000000ca]
 jle _HeroS4

 mov [eax+000000ca],cl         // INT
 mov [eax+00000172],cl         // INT
 mov [eax+00000177],cl         // INT

 _HeroS4:
 cmp cl,[eax+000000cb]
 jle _HeroS5

 mov [eax+000000cb],cl         // POL
 mov [eax+00000173],cl         // POL
 mov [eax+00000178],cl         // POL

 _HeroS5:
 cmp cl,[eax+000000cc]
 jle _ExitHS

 mov [eax+000000cc],cl         // CHR
 mov [eax+00000174],cl         // CHR
 mov [eax+00000179],cl         // CHR

_ExitHS:
 pop ecx
 ret

//=========================================
// Variables
pCity:
 dd 0
pSelTroop:
 dd 0
pTroop:
 dd 0
pCommander:
 dd 0
pGate:
 dd 0
pPort:
 dd 0
iPlayerID:
 dd #999
iEnableMCT:
 dd 1
iEnableMCW:
 dd 1
iEnableMCR:
 dd 1
iEnableMCS:
 dd 1
iEnableMHS:
 dd 1
iEnableMTR:
 dd 1
iEnableMTW:
 dd 1
iEnableMTS:
 dd 1
iEnableMTM:
 dd 1
iEnableTP:
 dd 1
iEnableAP:
 dd 1
iEnableGM:
 dd 1
iEnableMO:
 dd 1
iEnableWF:
 dd 1
iEnableMSD:
 dd 1
iECX:
 dd 0

//=========================================
// Hacking Points
RTKXI.EXE+0825c2:
 jmp _MonGameLoad
_BackMGL:

RTKXI.EXE+0bf611:
 jmp _MonCW
 nop
 nop
_BackMCW:

RTKXI.EXE+0865f8:
 jmp _MonCity
_BackMC:

RTKXI.EXE+094b55:
 jmp _MonTroop
_BackMT:

RTKXI.EXE+226d25:
 jmp _MonSelTroop
 nop
_BackMST:

RTKXI.EXE+0956f3:
 jmp _GodModeT
_BackGMT:

RTKXI.EXE+087860:
 jmp _GodModeCGP
_BackGMCGP:

RTKXI.EXE+1BE9A2:
 jmp _MonOfficer
 db 90,90,90,90
_BackMO:

RTKXI.EXE+1cca52:
 jmp _MonTP
 nop
 nop
_BackMTP:

RTKXI.EXE+1cd051:
 jmp _MonAP
 nop
_BackMAP:

RTKXI.EXE+0868ad:
 jmp _MonGate
_BackMG:

RTKXI.EXE+08687c:
 jmp _MonPort
_BackMP:

RTKXI.EXE+07b9f0:
 jmp _GodModeC
 nop
_BackGMC:

RTKXI.EXE+0830f0:
 jmp _GodModeG
 nop
_BackGMG:

RTKXI.EXE+08d2b0:
 jmp _GodModeP
 nop
_BackGMP:

RTKXI.EXE+1095ea:
 jmp _GodModeDuel
_BackGMD:

RTKXI.EXE+10968a:
 jmp _MonSpiritDuel
_BackMSD:

//=========================================
// Original Codes
[DISABLE]
RTKXI.EXE+0825c2:
 xor ebx,ebx
 mov [esi+04],edx

RTKXI.EXE+0bf611:
 movzx edi,byte ptr [esi+00000080]

RTKXI.EXE+0865f8:
 mov eax,[esi+3C]
 pop esi
 ret

RTKXI.EXE+094b55:
 call RTKXI.EXE+090420

RTKXI.EXE+226d25:
 mov [edi+000001a4],esi

RTKXI.EXE+0956f3:
 mov [esi+18],cx
 pop esi

RTKXI.EXE+087860:
 mov [esi+10],cx
 pop esi
 
RTKXI.EXE+1BE9A2:
 cmp word ptr [esi+000000ae],01f4

RTKXI.EXE+1cca52:
 mov cx,[ebx+0000009E]

RTKXI.EXE+1cd051:
 movzx ecx,byte ptr [edi+28]
 cmp ecx,eax

RTKXI.EXE+0868ad:
 mov eax,[esi+24]
 pop esi
 ret

RTKXI.EXE+08687c:
 mov eax,[esi+20]
 pop esi
 ret

RTKXI.EXE+07b9f0:
 mov edx,[esp+04]
 test edx,edx

RTKXI.EXE+0830f0:
 mov eax,[esp+04]
 test eax,eax

RTKXI.EXE+08d2b0:
 mov eax,[esp+04]
 test eax,eax

RTKXI.EXE+1095ea:
 mov [esi+04],eax
 sub eax,ecx

RTKXI.EXE+10968a:
 mov [esi+08],eax
 sub eax,ecx

unregistersymbol(MyCode)
unregistersymbol(pCity)
unregistersymbol(pSelTroop)
unregistersymbol(pTroop)
unregistersymbol(pCommander)
unregistersymbol(pGate)
unregistersymbol(pPort)
unregistersymbol(iEnableMCT)
unregistersymbol(iEnableMCW)
unregistersymbol(iEnableMCR)
unregistersymbol(iEnableMCS)
unregistersymbol(iEnableMHS)
unregistersymbol(iEnableMTR)
unregistersymbol(iEnableMTW)
unregistersymbol(iEnableMTS)
unregistersymbol(iEnableMTM)
unregistersymbol(iEnableGM)
unregistersymbol(iEnableTP)
unregistersymbol(iEnableAP)
unregistersymbol(iEnableMO)
unregistersymbol(iEnableWF)
unregistersymbol(iEnableMSD)
unregistersymbol(iPlayerID)

dealloc(MyCode)

</AssemblerScript>
      <CheatEntries>
        <CheatEntry>
          <Description>"Enable/Disable Min. Soldiers in City/Gate/Port"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMCT</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Min. Weapons in City/Gate/Port"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMCW</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Min. Gold/Food in City/Gate/Port"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMCR</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Min. Will/Order in City/Gate/Port"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMCS</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Troop Commander Attributes"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMHS</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Min. Gold/Food for Troop"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMTR</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Mininum Troop Size"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMTW</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Minimum Troop  Attributes"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMTS</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Troop Free Movement"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMTM</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable God Mode"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableGM</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Officers' Loyalty"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMO</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Maximum Spirit in Duel"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableMSD</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Minimum Techincal Points"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableTP</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Minimum Action Points"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableAP</Address>
        </CheatEntry>
        <CheatEntry>
          <Description>"Enable/Disable Weak Foe"</Description>
          <Color>80000008</Color>
          <VariableType>4 Bytes</VariableType>
          <Address>iEnableWF</Address>
        </CheatEntry>
      </CheatEntries>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols>
    <SymbolEntry>
      <Name>symRcTroopSize</Name>
      <Address>RTKXI.EXE+0954C0</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>symRcCityGold</Name>
      <Address>RTKXI.EXE+0BF5A1</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>MyCode</Name>
      <Address>0C390000</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pCity</Name>
      <Address>0C390726</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pSelTroop</Name>
      <Address>0C39072A</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pTroop</Name>
      <Address>0C39072E</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pCommander</Name>
      <Address>0C390732</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pGate</Name>
      <Address>0C390736</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>pPort</Name>
      <Address>0C39073A</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMCT</Name>
      <Address>0C390742</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMCW</Name>
      <Address>0C390746</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMCR</Name>
      <Address>0C39074A</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMCS</Name>
      <Address>0C39074E</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMHS</Name>
      <Address>0C390752</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMTR</Name>
      <Address>0C390756</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMTW</Name>
      <Address>0C39075A</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMTS</Name>
      <Address>0C39075E</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMTM</Name>
      <Address>0C390762</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableGM</Name>
      <Address>0C39076E</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableTP</Name>
      <Address>0C390766</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableAP</Name>
      <Address>0C39076A</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMO</Name>
      <Address>0C390772</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableWF</Name>
      <Address>0C390776</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iEnableMSD</Name>
      <Address>0C39077A</Address>
    </SymbolEntry>
    <SymbolEntry>
      <Name>iPlayerID</Name>
      <Address>0C39073E</Address>
    </SymbolEntry>
  </UserdefinedSymbols>
  <Comments>===========================================
 Romance of the Three Kingdoms XI
 Game Version  : 1.0.0.0
 Script Version: 1.0
 CE Version    : 6.0
 Features: Soldiers in Cities/Gates/Ports/Troops, Weapons in Cities/Gates/Ports,
           Gold/Food in Cities/Gates/Ports/Troops, Will/Order in Cities/Gates/Ports/Troops,
           Officers'/Troops' Attributes, Officers' Loyalty, Troops' Movement,
           God Mode for Cities/Troops/Officer in duel, Technical Points and Weak Foe.
 17-Feb-2011
 By Recifense
===========================================
</Comments>
</CheatTable>
