View previous topic :: View next topic |
Author |
Message |
daninthemix Cheater Reputation: 0
Joined: 29 Jul 2013 Posts: 39
|
Posted: Mon Aug 31, 2020 11:21 am Post subject: How to multiply the value in a register? |
|
|
I have this code which deducts health from enemies when you attack them:
Code: | sub [rbx+000000B0],r14d |
I can modify it with a large value to produce one hit kills:
Code: | sub [rbx+000000B0],5000 |
But what I really want is to multiply the value of r14d, because I think that's the damage output of the currently held weapon.
How do you do that? I've tried:
Code: | sub [rbx+000000B0],[r14d x 8] |
But it won't compile.
Thanks
|
|
Back to top |
|
|
MMM-304 Expert Cheater Reputation: 0
Joined: 17 Aug 2020 Posts: 166 Location: Milkey Way
|
Posted: Mon Aug 31, 2020 7:18 pm Post subject: |
|
|
There are multiple ways u can make One Hit KIll these are a few
Code: | mov r14d,[rbx+B0] //r14d has max health value of enemy
sub [rbx+000000B0],r14d |
Other way (the simplest way)
But if your main objective is to make a multiplier then:
Code: | shl r14d,2 //multiplies r14d with 4
shl r14d,3 //multiplies r14d with 8
shl r14d,4 //multiplies r14d with 16 |
then you can do:
Code: | sub [rbx+000000B0],r14d |
but do note that this method will not be one hit kill.
Another way to make a multiplier:
Code: | imul r14d,r14d,5 //multiples r14d with 5 and stores the value in r14d
sub [rbx+000000B0],r14d |
|
|
Back to top |
|
|
daninthemix Cheater Reputation: 0
Joined: 29 Jul 2013 Posts: 39
|
Posted: Mon Aug 31, 2020 10:56 pm Post subject: |
|
|
Brilliant - thanks so much!
|
|
Back to top |
|
|
|