Retrieve Physical or Magical Damage?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#21 Post by BlubBlab » Sat Jul 04, 2015 6:39 am

Here is something to add to your version:

Code: Select all

-- Apply tier bonus to damage and defence. Before stat and runes effects are added.
		if tier ~= 0 then
			if tier > 9 then
				if tmp.Effects[PDAM] then
					tmp.Effects[PDAM] = tmp.Effects[PDAM] + (tmp.Effects[PDAM]*0.05 * tier)
				elseif tmp.Effects[PDAM] then
					tmp.Effects[MDAM] = tmp.Effects[MDAM] + (tmp.Effects[MDAM]*0.05 * tier)
				elseif tmp.Effects[PDAM] then
				tmp.Effects[PDEF] = tmp.Effects[PDEF] + (tmp.Effects[PDEF]*0.05 * tier)
				elseif tmp.Effects[PDAM] then
					tmp.Effects[MDEF] = tmp.Effects[MDEF] + (tmp.Effects[MDEF]*0.05 * tier)
				end
			else
				if tmp.Effects[PDAM] then
					tmp.Effects[PDAM] = tmp.Effects[PDAM] + (tmp.Effects[PDAM]*0.1 * tier)
				elseif tmp.Effects[PDAM] then
					tmp.Effects[MDAM] = tmp.Effects[MDAM] + (tmp.Effects[MDAM]*0.1 * tier)
				elseif tmp.Effects[PDAM] then
				tmp.Effects[PDEF] = tmp.Effects[PDEF] + (tmp.Effects[PDEF]*0.1 * tier)
				elseif tmp.Effects[PDAM] then
					tmp.Effects[MDEF] = tmp.Effects[MDEF] + (tmp.Effects[MDEF]*0.1 * tier)
				end
			end
		end
from tier 10 to 11 the increase is only 5% and so on
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Retrieve Physical or Magical Damage?

#22 Post by rock5 » Sat Jul 04, 2015 1:46 pm

BlubBlab wrote:from tier 10 to 11 the increase is only 5% and so on
I didn't know that. Wouldn't that mean you would loose bonus when going from tier 9 to 10?

Is it just me or does that code look wrong? All the expressions are the same ie. if tmpEffects[PDAM] then.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#23 Post by BlubBlab » Sat Jul 04, 2015 3:44 pm

rock5 wrote:
BlubBlab wrote:from tier 10 to 11 the increase is only 5% and so on
I didn't know that. Wouldn't that mean you would loose bonus when going from tier 9 to 10?

Is it just me or does that code look wrong? All the expressions are the same ie. if tmpEffects[PDAM] then.
The expressions are the same what differ is the number at the end its your code.

Tier 10 was originally the maximum tier after that RW decided to make the new ones only with 5%. Something similar happened with the weapons since level 75 too.
unlike the ones before when you go from +12 to +13 you get only 5% instead of 10%. I think the whole thing about it is that people don't throw money out so easily.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Retrieve Physical or Magical Damage?

#24 Post by rock5 » Sun Jul 05, 2015 8:41 am

I'm just saying does the bonus apply to all levels or only levels 10 and above? The way you have written it if you have say an item with 1000 damage and tier 9 you would get
  • 1000 x 0.1 x 9 = 900 bonus
If your tier it to level 10 you would get
  • 1000 x 0.05 x 10 = 500 bonus
That just seems wrong.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#25 Post by BlubBlab » Sun Jul 05, 2015 11:14 am

rock5 wrote:I'm just saying does the bonus apply to all levels or only levels 10 and above? The way you have written it if you have say an item with 1000 damage and tier 9 you would get
  • 1000 x 0.1 x 9 = 900 bonus
If your tier it to level 10 you would get
  • 1000 x 0.05 x 10 = 500 bonus
That just seems wrong.
No not level, I mean tier that with the level is only for + of the weapons since level 75 that 2 things

1.)from tier 1 to 10 in each step 10% more , from tier 10 to 20 5% for each step.

2.)+ apply only to one dmg type peer weapon but also brings out additional stats which but I think this part is automatically taken care of by your function.

So far I understood your function in it is tier 0 is 1 and so on at least that was what printed out and the values were correct.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Retrieve Physical or Magical Damage?

#26 Post by rock5 » Sun Jul 05, 2015 11:45 am

BlubBlab wrote:1.)from tier 1 to 10 in each step 10% more , from tier 10 to 20 5% for each step.
That makes more sense. I believe you didn't have it programmed that way though. I can do it though. Just to be clear is tier 10 10% or 5%? This is what I have so far

Code: Select all

		-- Apply tier bonus to damage and defence. Before stat and runes effects are added.
		if tier ~= 0 then
			local tierTo10 = tier>10 and 10 or tier 
			local tierOver10 = tier>10 and (tier-10) or 0
			if tmp.Effects[PDAM] then  
				tmp.Effects[PDAM] = tmp.Effects[PDAM] + (tmp.Effects[PDAM]*0.1 * tierTo10) + (tmp.Effects[PDAM]*0.05 * tierOver10) 
			end
			if tmp.Effects[MDAM] then
				tmp.Effects[MDAM] = tmp.Effects[MDAM] + (tmp.Effects[MDAM]*0.1 * tierTo10) + (tmp.Effects[MDAM]*0.05 * tierOver10)
			end
			if tmp.Effects[PDEF] then
				tmp.Effects[PDEF] = tmp.Effects[PDEF] + (tmp.Effects[PDEF]*0.1 * tierTo10) + (tmp.Effects[PDEF]*0.05 * tierOver10) 
			end
			if tmp.Effects[MDEF] then
				tmp.Effects[MDEF] = tmp.Effects[MDEF] + (tmp.Effects[MDEF]*0.1 * tierTo10) + (tmp.Effects[MDEF]*0.05 * tierOver10) 
			end
		end
BlubBlab wrote:2.)+ apply only to one dmg type peer weapon but also brings out additional stats which but I think this part is automatically taken care of by your function.
I guess my code added the it to both damage types? Is it always obvious which it adds too. Eg. Are all Staves and wand add to magic damage and all other weapons add to physical damage?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#27 Post by BlubBlab » Sun Jul 05, 2015 11:40 pm

rock5 wrote:
BlubBlab wrote:1.)from tier 1 to 10 in each step 10% more , from tier 10 to 20 5% for each step.
That makes more sense. I believe you didn't have it programmed that way though. I can do it though. Just to be clear is tier 10 10% or 5%? This is what I have so far

Code: Select all

		-- Apply tier bonus to damage and defence. Before stat and runes effects are added.
		if tier ~= 0 then
			local tierTo10 = tier>10 and 10 or tier 
			local tierOver10 = tier>10 and (tier-10) or 0
			if tmp.Effects[PDAM] then  
				tmp.Effects[PDAM] = tmp.Effects[PDAM] + (tmp.Effects[PDAM]*0.1 * tierTo10) + (tmp.Effects[PDAM]*0.05 * tierOver10) 
			end
			if tmp.Effects[MDAM] then
				tmp.Effects[MDAM] = tmp.Effects[MDAM] + (tmp.Effects[MDAM]*0.1 * tierTo10) + (tmp.Effects[MDAM]*0.05 * tierOver10)
			end
			if tmp.Effects[PDEF] then
				tmp.Effects[PDEF] = tmp.Effects[PDEF] + (tmp.Effects[PDEF]*0.1 * tierTo10) + (tmp.Effects[PDEF]*0.05 * tierOver10) 
			end
			if tmp.Effects[MDEF] then
				tmp.Effects[MDEF] = tmp.Effects[MDEF] + (tmp.Effects[MDEF]*0.1 * tierTo10) + (tmp.Effects[MDEF]*0.05 * tierOver10) 
			end
		end
BlubBlab wrote:2.)+ apply only to one dmg type peer weapon but also brings out additional stats which but I think this part is automatically taken care of by your function.
I guess my code added the it to both damage types? Is it always obvious which it adds too. Eg. Are all Staves and wand add to magic damage and all other weapons add to physical damage?
When I print out a tier1 item which tier it has I got 0 ....so I thought it count from 0(1) to 9(10).
yeah tier 10 is 10%

I suspect that only wooden weapons have increased MDMG and the rest PDMG but like I said the function will take care of it.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Retrieve Physical or Magical Damage?

#28 Post by rock5 » Mon Jul 06, 2015 3:13 am

Ok. I had to do a bit of experimentation to remind myself how it works. The calculation we use works but it gives the difference in tier not the tier itself. Which is what we want anyway. If an item has a base tier of 3 and we tier it to 5 then our calculations will yield a value of 2 and so we apply the bonus twice. Although I highly suspect the /16 in the calculation is wrong. I suspect it should be /32.

Code: Select all

		local quality, tier = math.modf ( plusQuality / 32 );
		tier = tier * 32 - 10;
As 16 you wouldn't be able to raise the tier more than 6 levels. As 32 you would be able to raise the tier 22 levels. The maximum mana stone is tier 20 so the highest tier increase is 19 levels ( assuming a tier 1 item). So 32 works.

I still can't get values to match though. It could be a problem with StatRating addon. It might be out of date but Item Preview addon yields similar results. It looks like it's the plus value specifically not working. I'll keep working on it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: Retrieve Physical or Magical Damage?

#29 Post by BlubBlab » Sun Jul 12, 2015 8:04 am

I tries that it seems on that address there also the numbers of the runslots as bit flags because every item I have with 1 slot is + 32
Edit:
I guess the solution because I have no purpose for the slots I do it quick and dirty

Code: Select all

local slots = 0;
		if( plus >= 256)then
			plus = plus -256;
			slots = slots + 1;
		end
		if( plus >= 128)then
			plus = plus - 128
			slots = slots + 1;
		end
		if( plus >= 64)then
			plus = plus - 64;
			slots = slots + 1;
		end
		if( plus >= 32)then
			plus = plus - 32;
			slots = slots + 1;
		end
Which would mean either this structure is 2 bytes or 256 is somewhere else but the rest is very clear:

2^0,2^1,2^3,2^4, bits are for plus level which means total plus is max 31 with this data structure, 2^5, 2^6, 2^7 and maybe 2^8 are the (empty) slots on the gear.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Retrieve Physical or Magical Damage?

#30 Post by rock5 » Mon Jul 13, 2015 1:38 am

Ah, so that's what it is, the number of runes slots. Yes that is useless.

Looks a bit wrong. The first 5 bits are for the plus which range from 0 to 31. The 3 remaining bits are for the slots. That's 32,64 and 128.

The way I would do it is to use the modf function again like I did with the tier and quality.

Code: Select all

slot, plus = math.modf(memoryReadUByte(getProc(), item.Address + 0x17)/32)
plus=plus*32
Of course we don't need the slots so the easiest way would be to use the modulo % like I've been doing.

Code: Select all

local plus = memoryReadUByte(getProc(), item.Address + 0x17)%32
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: Retrieve Physical or Magical Damage?

#31 Post by beanybabe » Mon Jul 20, 2015 11:29 am

I was reading in the mm forum and someone was trying to retrieve hp and other stats from memory. it made me wonder does rom caculate your hp damage and other state every time you move or does it do it when you change gear and store it in memory some where.

I have been wanting a way to see instant changes in stats when gear is changed. If it updates on gear change there should be the values stored some place. Has anyone every checked for this?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Retrieve Physical or Magical Damage?

#32 Post by rock5 » Mon Jul 20, 2015 11:46 am

I think the player hp is updated every time player:update() is run (or player:updateHP() ) so it should be updating all the time. Well, as soon as you leave the waypoint where you put on the new gear, it should do an update.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests