 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Tue Jun 25, 2013 7:55 am Post subject: |
|
|
I bet it's because towers don't do damage equal to your max hp, but damage equal to your remaining hp, in which case the following script should work:
Code: | {
===========================================
Spellforce - Platinum Edition
Game Version : 1.54.75000
Script Version: 3.0
CE Version : 6.2
GodMode
Edited from Recifense's table
===========================================
}
[enable]
//=========================================
alloc(MyCode,1024)
//=========================================
aobscan(aobGodMode,66 89 41 06 5b 59 c2 04 00)
//=========================================
// Declaration section
label(pGodMode)
label(_GodMode)
label(_BackGM)
label(_ExitGM)
registersymbol(pGodMode)
MyCode:
//=========================================
_GodMode:
cmp byte ptr [ecx-26],01 // Player's unit ?
jne _ExitGM
cmp ax, word [ecx] //hp+damage = max HP ?
jne _ExitGM
sub eax,edx // undo the previous add eax,edx if the player is receiving damage equal or greater than his max hp
_ExitGM:
mov [ecx+06],ax // Original code
pop ebx // Original code
jmp _BackGM // Back to main code
//=========================================
//SpellForce.exe+454890:
aobGodMode:
pGodMode:
jmp _GodMode
_BackGM:
//=========================================
// Original Codes
[disable]
//SpellForce.exe+454890:
pGodMode:
mov [ecx+06],ax
pop ebx
unregistersymbol(pGodMode)
dealloc(MyCode) | This inevitably means that if you have 10 remaining hp and a random mod hits you for 10 dmg, you won't die.
Last edited by Gniarf on Tue Jun 25, 2013 1:07 pm; edited 1 time in total |
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Tue Jun 25, 2013 8:15 am Post subject: |
|
|
It depends what he exactly wants: protect from towers ALWAYS - your script
Or, protect from towers only if unit have more than 90% of max health,
weak (damaged by other enemies) units can still die:
Code: |
(partial AA script)
cvtsi2ss xmm0,edx // damage
movsx ebx, word [ecx]
cvtsi2ss xmm1,ebx // max HP
mulss xmm1, dword ptr [percent]
comiss xmm0,xmm1 // damage < (90% max HP) ?
jl _ExitGM
sub eax,edx
_ExitGM: |
ALT+A - protect from towers (if unit has less than 90% HP, it will be destroyed)
ALT+Q - disable option
Description: |
|
 Download |
Filename: |
Spellforce, protect from towers.CT |
Filesize: |
4.19 KB |
Downloaded: |
1788 Time(s) |
_________________
|
|
Back to top |
|
 |
Jacusiek Advanced Cheater
Reputation: 0
Joined: 24 Jan 2011 Posts: 81
|
Posted: Tue Jun 25, 2013 11:40 am Post subject: |
|
|
Thanks Gniarf, I'm for 99,999% sure it is working good.
@mgr.inz.Player: I wanted ALWAYS to have protection, so this time Gniarf's script was better (You had to missunderstood me when I explained You the script, I wanted to have)
Anyway, thank You both for help!
@Edit: Still one problem: When I put separate script with Your God Mod and activate it, I cannot activate the rest of the table Recifense made, and when I activate the rest of the table, I cannot activate Your God Mod. How to fix it?
|
|
Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Tue Jun 25, 2013 1:07 pm Post subject: |
|
|
Jacusiek wrote: | @Edit: Still one problem: When I put separate script with Your God Mod and activate it, I cannot activate the rest of the table Recifense made, and when I activate the rest of the table, I cannot activate Your God Mod. How to fix it? | If you want to use other features from Recifense's table, it is easier to simply patch his godmodes rather than using "my" pair of scripts with his table.
You said earlier " how to make it separate from the original God Mode?", but I don't understand why you want to separate the godmode if you're still using his table?
The fixes you have to apply to Recifense's table are:
Code: | aobMonHP:
pMonHP:
jmp _MonHP <- replace by //jmp _MonHP
_BackMH: | (this is one of the many ways to disable the _MonHP hack)
and replace the godmode function:
Code: | //=========================================
_GodMode:
cmp dword ptr [iEnableMH],0
je _ExitGM // Jump if feature is disabled
cmp byte ptr [ecx-26],01 // Player's unit ?
jne _ExitGM
cmp ax, word [ecx] //hp+damage = max HP ?
jne _ExitGM
sub eax,edx // undo the previous add eax,edx if the player is receiving damage equal or greater than his max hp
_ExitGM:
mov [ecx+06],ax // Original code
pop ebx // Original code
jmp _BackGM // Back to main code
//========================================= | for the 1 hit kills.
|
|
Back to top |
|
 |
Jacusiek Advanced Cheater
Reputation: 0
Joined: 24 Jan 2011 Posts: 81
|
Posted: Tue Jun 25, 2013 3:15 pm Post subject: |
|
|
By saying "separate" I mean:
- Script:
* God Mode A (normal)
* God Mode B (towers)
* Resources
* Other scripts
I tried to do:
- Script
* God Moda A
* something...
- God Mode B
and that didn't work. So I would like to have God Mode B in the same script, but I also want to have normal God Mode, I tried to unite them, that's what I done:
http://wklej.to/tVH9k - I added GodModeZ, ExitGMZ, HPZ, etc. (the letter Z means that is the new God Mode). When I activate Your God Mode, it works, but the normal one doesn't want to work.
|
|
Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Tue Jun 25, 2013 11:46 pm Post subject: |
|
|
Here, I separated godmode A (normal godmode for all units), B (building godmode) and Z (protection against 1 hit kills). Activating both godmode A and Z disables godmode A.
If you try to learn from what I've done, well, "j** short" is just my personal fancy, "j**" alone works the same way but just takes 3 more bytes and can make longer (>128 bytes) jumps.
Description: |
|
 Download |
Filename: |
SpellForce.CT |
Filesize: |
13.47 KB |
Downloaded: |
1888 Time(s) |
Last edited by Gniarf on Wed Jun 26, 2013 5:14 am; edited 2 times in total |
|
Back to top |
|
 |
Jacusiek Advanced Cheater
Reputation: 0
Joined: 24 Jan 2011 Posts: 81
|
Posted: Wed Jun 26, 2013 4:50 am Post subject: |
|
|
God Mode for units isn't working as it should. Before, it was working like this: I didn't lose any HP, but now it's working, that I lose HP, but my regeneration is very very big (always regenerate to my max HP). I prefer first God Mode, because sometimes when monsters are fast enough, they can still kill me, before my HP will regenerate.
@Edit: I've made some changes:
1. I deleted lines (at MonHP):
Code: | cmp dword ptr [iEnableGodmodeZ],0
jne short _ExitMH // MonHP is disabled if Godmode Z is used
|
and replaced je with jmp (in MonHP):
Code: | cmp dword ptr [iEnableMH],0
jmp short _ExitMH // Jump if feature is disabled
|
And I made that GodModeZ is total God Mode for units, and GodModeA is protection against Tower. I'm magician . Anyway, I'm very glad, You helped me
|
|
Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Wed Jun 26, 2013 5:15 am Post subject: |
|
|
Yeah that was a stupid mistake on my part. I just updated the ct above, see how it's supposed to be fixed.
|
|
Back to top |
|
 |
Jacusiek Advanced Cheater
Reputation: 0
Joined: 24 Jan 2011 Posts: 81
|
Posted: Wed Jun 26, 2013 6:07 am Post subject: |
|
|
I was able to fix it anyway, but thanks again. The script is working finally.
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|