UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

Life-Mana leech and speed

[IN DEVELOPMENT] Life-Mana leech and speed

Behavior on OSI: Hit Life/Mana Leech is dependant by weapon speed
Behavior on Demise: They are constant and capped to 50%
Supporting Documentation (URLs):
In OSI, the Wrath of the Dryad is so: http://uo.stratics.com/database/view.php?db_content=gameitem&id=946
In Demise, it's so: http://www.uoguide.com/Wrath_of_the_Dryad

Someone in Stratics forum did a calculation about and posted and published it in UOGuide page: http://www.uoguide.com/Hit_mana_leech (haven't found the stratics post about, though)

The formula would be (weapon speed in seconds * 2500) / (100 + SSI). It's halved if it's a ranged weapon.

Changes needed: Would be great to do some comparisons between that table and OSI.
Code:

Maybe it's needed to convert weapon speeds in seconds first... anyway it's a ML edit, so weapons and artifacts should maintain previous values for pre-ML cores.
 

MalGanis

Sorceror
Re: [VALIDATION NEEDED] Life-Mana leech and speed

I can confirm Wrath of the Dryad, however thats not true for crafted weapons. Maybe just for artifacts with life/mana leech?
 

Attachments

  • wrath.png
    wrath.png
    55.5 KB · Views: 365
  • crafter.png
    crafter.png
    55 KB · Views: 347
Re: [VALIDATION NEEDED] Life-Mana leech and speed

MalGanis;597609 said:
I can confirm Wrath of the Dryad, however thats not true for crafted weapons. Maybe just for artifacts with life/mana leech?

In your screenshot you provided a kryss that has 2s speed, that should be the minimum delay = max speed. What about a slower weapon?
 

MalGanis

Sorceror
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Crafted a few axes, and this is somewhat true:
 

Attachments

  • 1.PNG
    1.PNG
    51.5 KB · Views: 359
  • 2.PNG
    2.PNG
    51.9 KB · Views: 359
  • 3.PNG
    3.PNG
    48.1 KB · Views: 359
  • 4.PNG
    4.PNG
    40.5 KB · Views: 356
Re: [VALIDATION NEEDED] Life-Mana leech and speed

a little bump because, now that ML weapon speeds are in, it's safe to code for this.

I remember this is a ML feature and shouldn't affect pre-ML shards, although it would be good to tweak the serialize/deserialize to fix existing items. Some weapons could have a nice bump in HML-HLL :)
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Daedalus, I'd note that there's the OTHER side of this effect:
  • Behavior on OSI: Leech effects ALWAYS work on every hit, and the intensity is the percentage of damage leeched.
  • Behavior on Demise: Leech effects ALWAYS leech a fixed amount (100, 40, and 30% respectively for stamina, mana, and life) and the intensity is their chance to take effect.
I believe both of these came into play with the exact same publish on OSI, so they should BOTH be put in as the same report.
osd_daedalus;643688 said:
although it would be good to tweak the serialize/deserialize to fix existing items. Some weapons could have a nice bump in HML-HLL :)
Might it possibly be easier to skip the whole serialize/deserialize part, (which could be potentially messy) and simply re-code the way the line is displayed? As far as I can tell, this is how it appears to have been done on OSI; the underlying intensities are still exactly the same. (2-50, in increments of 2)

Hence, the only change needed would be to, I believe, baseweapon.cs, and only to the routines for displaying the "hit X leech" line, and to the actual leeching calculations.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Nottheking;644441 said:
Daedalus, I'd note that there's the OTHER side of this effect:
  • Behavior on OSI: Leech effects ALWAYS work on every hit, and the intensity is the percentage of damage leeched.
  • Behavior on Demise: Leech effects ALWAYS leech a fixed amount (100, 40, and 30% respectively for stamina, mana, and life) and the intensity is their chance to take effect.
I believe both of these came into play with the exact same publish on OSI, so they should BOTH be put in as the same report.
So you mean, there was a publish where in OSI the leeching is relative to the life/mana/stam the target has, and before that publish the leeching was exactly like Demise now?

If yes, it's a thing that must be corrected. Same publish, so ML?

Nottheking;644441 said:
Might it possibly be easier to skip the whole serialize/deserialize part, (which could be potentially messy) and simply re-code the way the line is displayed? As far as I can tell, this is how it appears to have been done on OSI; the underlying intensities are still exactly the same. (2-50, in increments of 2)

Hence, the only change needed would be to, I believe, baseweapon.cs, and only to the routines for displaying the "hit X leech" line, and to the actual leeching calculations.

If you edit only the script, what will be happen is new items to have correct leeching values, and existing items carrying still previous values. If you want to correct properties of existing items/mobiles, playing with serialize/deserialize is the only way (for what I know)
 

WarUO

Sorceror
Re: [VALIDATION NEEDED] Life-Mana leech and speed

This is from the FoF-

5. Can you explain the recent leech changes?
John@EA "Wilki", Community Coordinator: The old method used your leech % as a chance for the effect to fire each time you swing. Each time the effect fired, you would get 40% of the post-resist damage inflicted back as mana, or 30% back as hit points.

The new method uses the leech % as the top end of a range. The amount of that 40% of mana (or 30% of life) that actually gets delivered is randomly determined -- from 0 to your leech %. This amount is added every time an attack hits.

The resulting effect is that the amount leeched over time will be less -- from a little bit less, for slower weapons, down to about half for fast ones. However, because it will deliver smaller amounts continuously, hopefully it will not feel like the ability has been nerfed dramatically.


This is the publish-

Hit Life Leech and Hit Mana Leech are now scaled to the swing speed of the weapon
Hit Life Leech and Hit Mana Leech are now half as effective on ranged weapons as they are on melee weapons

This took place during Publish 42 on Aug 15th 2006
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

WarUO;644897 said:
This is from the FoF-

5. Can you explain the recent leech changes?
John@EA "Wilki", Community Coordinator: The old method used your leech % as a chance for the effect to fire each time you swing. Each time the effect fired, you would get 40% of the post-resist damage inflicted back as mana, or 30% back as hit points.

The new method uses the leech % as the top end of a range. The amount of that 40% of mana (or 30% of life) that actually gets delivered is randomly determined -- from 0 to your leech %. This amount is added every time an attack hits.

The resulting effect is that the amount leeched over time will be less -- from a little bit less, for slower weapons, down to about half for fast ones. However, because it will deliver smaller amounts continuously, hopefully it will not feel like the ability has been nerfed dramatically.


This is the publish-

Hit Life Leech and Hit Mana Leech are now scaled to the swing speed of the weapon
Hit Life Leech and Hit Mana Leech are now half as effective on ranged weapons as they are on melee weapons

This took place during Publish 42 on Aug 15th 2006

so, if first it was "20% HML = 20% chance to leech 40% of the damage inflicted as mana", now is "20% HML = 100% chance to leech a random amount between 1% and 20%" right?

How this applies with wraith form, vampire form and curse weapon?
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

osd_daedalus;644830 said:
If yes, it's a thing that must be corrected. Same publish, so ML?
Yes. Fortunately, the entire thing can be run entirely under a "core.ML" check.

osd_daedalus;644830 said:
If you edit only the script, what will be happen is new items to have correct leeching values, and existing items carrying still previous values. If you want to correct properties of existing items/mobiles, playing with serialize/deserialize is the only way (for what I know)
That's what I'm getting at... As far as I've seen, on OSI, base leeching values have not changed. In other words, new items still roll a calculation of 2-50, in increments of 2. The only difference is that the display method, and functional method, changed. So instead of the "x" in "hit mana leech x%" showing the actual value serialized on the weapon, it instead reports a local variable that is DERIVED from the serialized intensity, combined with the speed, etc.

Hence, what I was saying (I'll try to code this to show it, to be honest) is that there's no need for serialization, since NEW weapons after the patch will STILL roll 2-50 for their intensities. That part of the script won't be touched. What will are the parts that display item properties on mouse-over, and the subroutine that actually handles the internal functioning of hit leech effects.

Unless either of those two things are actually serialized into an object when created, there should be no need for a serialize-deserialize subroutine. Of course, while I don't think those are copied, they COULD be... Even though it makes little sense to me, since that seems like it'd notably increase memory usage.

osd_daedalus;645179 said:
How this applies with wraith form, vampire form and curse weapon?
AFAIK, the change has no effect on them, since all of the above, as I recall, always applied leeching to each and every hit.
 

Yoshiro

Wanderer
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Daedalus, I'd note that there's the OTHER side of this effect:
  • Behavior on OSI: Leech effects ALWAYS work on every hit, and the intensity is the percentage of damage leeched.
  • Behavior on Demise: Leech effects ALWAYS leech a fixed amount (100, 40, and 30% respectively for stamina, mana, and life) and the intensity is their chance to take effect.
I believe both of these came into play with the exact same publish on OSI, so they should BOTH be put in as the same report.

Publish 42 never mentions anything about Hit stamina Leech, could _Need_ confirmation about that part too.

http://www.uoguide.com/Publish_42
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Yoshiro;645649 said:
Publish 42 never mentions anything about Hit stamina Leech, could _Need_ confirmation about that part too.

http://www.uoguide.com/Publish_42
Yeah, that would need a bit of confirmation. I forgot to mention that I didn't recall what it did either, other than some mention that it was handled differently. All I recall being mentioned (on a more detailed report on the publish) was that the displayed value, I think, was un-altered for stamina leech.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

I understand about waqht you say about serialize/deserialize. Yes, for the part "way to leech" it's not requested an adding in them, but to tweak percentages for... let's say from 50% to 87% on many existing items in game, it is necessary to do it.

About HSL, I believe it's not touched, since, as you can see by MalGanis' screenshots, it's not influenced by the percentage bump. On 3.25s weapons, the maximum HSL looks like still 50% instead of 87%, so I believe HSL still works in the old way (unless another publish changed it but those screenies were taken at pub 57)
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

osd_daedalus;645719 said:
but to tweak percentages for... let's say from 50% to 87% on many existing items in game, it is necessary to do it.
I guess this is where we obviously don't have things fully clear in what we're talking about... As I was saying, what it looked like to me is that on OSI, all items still spawn with an "intensity" of 2-50. The actual, in-code intensities aren't changed, just how the script interprets them.

Basically, what I'm saying is that I believe, if you could [props a 3.25s weapon on OSI that claimed "87% hit life leech" on mouse-over, the actual mod you'd see would be entered as a 50, not an 87.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

So, what I have thought is not exact...

let's redefine things again:

before: 20% HML = 20% chance to leech 40% of damage as mana
now : 20% HML = 20% chance to leech 2-50% of damage as mana

but the FoF says:

The new method uses the leech % as the top end of a range. The amount of that 40% of mana (or 30% of life) that actually gets delivered is randomly determined -- from 0 to your leech %. This amount is added every time an attack hits.


so, what is the truth?
20% HML = 100% chance to leech 2-50% of damage as mana?
20% HML = 20% to leech 2-20% of damage as mana?

I still don't get it, sorry :(
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

osd_daedalus;645960 said:
I still don't get it, sorry :(
Actually, it's neither; this is the correct result:

20% HML = 100% chance to leech 1-20% of damage as mana.

Since I don't have the SVN that includes the revised timer, (all I have is the last main website publish of RUO, from earlier this month) I can't simply show you a .DIFF that will have this all. However, I'll try to explain it by demonstrating the code I was going to insert; I dunno what the new speed variable is, so I'm just going to use the term "MLspeed"
  • First, we have the Demise current, AOS code:
    Code:
    if ( Core.AOS )
    {
      if ( (int)(m_AosWeaponAttributes.HitLeechMana * propertyBonus) > Utility.Random( 100 ) )
      manaLeech += 40; // HitLeechMana% chance to leech 40% of damage as mana
    }
  • Next, we have what I propose:
    Code:
    if ( Core.ML )
    {
      if ( (int)(m_AosWeaponAttributes.HitLeechMana * propertyBonus) > 0 )
      manaLeech += Utility.RandomMinMax(1, (int)( ( (m_MLspeed * 2500) / (100 + m_AosWeaponAttributes.WeaponSpeed) ) * propertyBonus) );
    }
Again, as for the names of each variable used:
  • propertyBonus - local variable, the existing "legacy" HML property/its intensity. Spawns as a range of 2-50. This whole proposed script is designed so that zero mucking with this is necessary.
  • manaLeech - This is the outright percentage of mana drained. e.g, Wraith Form directly adds to this attribute specifically.
  • MLspeed - My own invented name for the ML swing speed, in the "3.25 second" style format. (as opposed to AosSpeed, which was in that strange numeric format with bigger being faster)
  • WeaponSpeed - This is the SSI property, and its intensity.
It's a relatively straightforward change. It's broken down into both the chance and effect:
  • Instead of checking to see if Utility.Random( 100 ) can yield a lower number than the HML intensity to work, we simply check that the intensity is greater than zero. Hence, if it's there at all, it activates.
  • Instead of having a fixed "percentage of damage" amount, this is instead done through a Utility.RandomMinMax call, with a minimum of 1 and a maximum of the new, adjusted leech value, using the formula posted at the top of the thread.
The end result is that we get Mondain's Legacy leeching, without having to change ANYTHING else. No need to modify existing items, or to even create a new property variable. It simply changes the outright function of HML to work differently if the core is ML.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Nottheking;645982 said:
Actually, it's neither; this is the correct result:

20% HML = 100% chance to leech 1-20% of damage as mana.

Acknowledged, but what about this statement then?
Nottheking;645885 said:
I guess this is where we obviously don't have things fully clear in what we're talking about... As I was saying, what it looked like to me is that on OSI, all items still spawn with an "intensity" of 2-50. The actual, in-code intensities aren't changed, just how the script interprets them.

For the rest, at a glance looks like OK. It's just to make a patch and to test (also with pre-patch and post-patch weapons). Just looks like it misses the halved leeching for ranged weapons... and oh, the same also for hit life leech.
 

Yoshiro

Wanderer
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Nottheking;645982 said:
Actually, it's neither; this is the correct result:

20% HML = 100% chance to leech 1-20% of damage as mana.

Hmm, So does this mean minimum mana leeched "on hitting" blow is 1 or 0?
Would be nice with Confirmation on this part aswell.

Best way to test on a untrained char to raise Spellweaving and cast Natures fury. Have a fast weapon or any wep with low HML being 100% Physical.

PS: Be sure the blow lands! Good thing is to lock Tactics and Anatomy at 0 to not do any necessary damage. Elf char would be best for 0% Focus aswell so you dont have 0.3 regen as Human.
I would test this if i could but no EA account. Be sure to wear 1 non-meddable armor aswell to make your manaregen worse.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

[edit]I just realized that the formula given above is for the MAXIMUM mana leech. So I'd have to adjust it, since it currently gives a result 50 times what it should. It also should have a cap at 100, so that needs to be added as well.

Also, another thing should be validated... Can you get higher than 50% leech value on a bow? We need to know if the 100% cap is applied before or after the halving for ranged weapons.

osd_daedalus;646219 said:
Acknowledged, but what about this statement then?
The intensity != the leeching, simply put. The "Intensity" is the number a staff member would see if they used [props on the weapon; remember that those numbers in the properties don't always directly translate to the in-game results, like SSI, DI, slayers, etc. (or, of course, the old hit leeches, where the [props intensity had no bearing on the leeched amount at all)

In the script, the intensity is "propertyBonus." From all evidence I've seen, it still uses the old intensity ranges. If it was changed to be, say, 1-100, then you'd be able to loot random SLOW weapons that had an intensity of only 2 or perhaps 1, when under 2-50 they'd always come in fixed intervals that'd round, so that there'd only be a maximum of 25 available intensities for a given weapon speed+SSI, which is what the screenshots I see are suggesting. To go over each weapon:
  • Wrath of the Dryad - 50 prop * 1.625 = 81 leech. (this shows us that the value is "integerized" and hence always rounded down, since the formula tells us it'd get 81.25)
  • Kryss - 42 prop * 0.8 = 33 leech.
  • Two-Handed Axe #1 - 48 & 50 prop * 1.75 = 84 mana & 87 health leech.
  • Two-Handed Axe #2 - 42 prop * 1.34... = 57 leech.
  • Two-Handed Axe #3 - 50 prop * 1.75 = 87 leech.
  • Two-Handed Axe #4 - 44 prop * 1.75 = 77 leech.
Basically, this is so consistent enough that I'd consider it outright validation: the underlying interior "property" is still always divisible by 2, and always ranges from 2-50. So if an OSI GM were to [props those weapons screencapped in this thread, they'd get the "prop" numbers I mentioned, not the actual numbers shown on mouse-over.

osd_daedalus;646219 said:
For the rest, at a glance looks like OK. It's just to make a patch and to test (also with pre-patch and post-patch weapons). Just looks like it misses the halved leeching for ranged weapons... and oh, the same also for hit life leech.
Yeah, I realized last night I forgot to include the halving for ranged weapons; what I gave was basically just an explanation/proof of concept, since I was still fiddling with TortoiseSVN so I had the CORRECT script file to work with.

Yoshiro;646359 said:
Hmm, So does this mean minimum mana leeched "on hitting" blow is 1 or 0?
Would be nice with Confirmation on this part aswell.
I THINK that it's zero; I wasn't looking at the thread when I wrote it, and couldn't properly remember what was said in the FoF that WarUO linked.

Personally, I'd take the word of FoF above my random thought-making at times when I'm exhausted, though I suppose it couldn't hurt to double-check.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Currently, I don't yet have this readied as a patch file, but here's the code I've written so far, presented for visual evaluation. Again, I need to verify that I have the RIGHT name for the ML weapon speed variable. But I think everything else is in order. It covers the entire functional side of fixing this; it handles the alteration of leeching for both hits and mana based on weapon speed, randomness, always applying, etc. It does not cover the change in mouse-over appearance. I didn't get to that yet.
Code:
if ( Core.AOS && !Core.ML )
{
  if ( (int)(m_AosWeaponAttributes.HitLeechHits * propertyBonus) > Utility.Random( 100 ) )
  lifeLeech += 30; // HitLeechHits% chance to leech 30% of damage as hit points

  if ( (int)(m_AosWeaponAttributes.HitLeechMana * propertyBonus) > Utility.Random( 100 ) )
  manaLeech += 40; // HitLeechMana% chance to leech 40% of damage as mana
}

if ( Core.ML )
{
  if ( (int)(m_AosWeaponAttributes.HitLeechHits * propertyBonus) > 0 )
  manaLeech += Utility.RandomMinMax(1, Math.Min( 100, (int)( ( (m_MLspeed * 50) / (100 + m_AosWeaponAttributes.WeaponSpeed) ) * propertyBonus / ( this is BaseRanged ? 2 : 1 ) ) ) );

  if ( (int)(m_AosWeaponAttributes.HitLeechMana * propertyBonus) > 0 )
  manaLeech += Utility.RandomMinMax(1, Math.Min( 100, (int)( ( (m_MLspeed * 50) / (100 + m_AosWeaponAttributes.WeaponSpeed) ) * propertyBonus / ( this is BaseRanged ? 2 : 1 ) ) ) );
}
What potentially could still use validation is a check to see if ranged weapon leech amounts can exceed 50% or not. If someone can test, simply craft runic bows that have a swing rate of slower than 4 seconds. If it doesn't have SSI, you should be able to reach the following amounts on the following weapons:
  • Bow - 53%
  • Crossbow & Yumi - 56%
  • Heavy Crossbow - 62%
 
Top