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

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

just for readibility (RunUO devs insist on the fact is better a line of code more to improve it):

instead to use
Code:
if ( Core.AOS && !Core.ML ) [COLOR=Red]{statement 1}[/COLOR]
if ( Core.ML ) [COLOR=Red]{statement 2}[/COLOR]
I think is better
Code:
 if (Core.ML) [COLOR=Red]{statement 2}[/COLOR]
else if (Core.AOS)[COLOR=Red] {statement 1}[/COLOR]
If you like, I can try to implement your code in a patch file, but I'd like also to add the "other" code, for the new values.

Nottheking;646561 said:
[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.

What else returns HML/HLL rather than weapons? According to your calculations, you need a weapon with more than 4s speed to have more than 100%. Now, on all of mace weapons, the slowest weapon is the war mace that has 4s (so it should return 100%). Slower weapons are archery ones, like bow (4.25s), but it's leeching is halved.

It's testable: craft in OSI lots of war maces and find the maximum intensity+speed bonus. I expect it's 100.

About bows... before or after? Go craft lots of runic heavy crossbows (5s) and see if the maximum percentage is 50% or 62-63% (the real value should be 62.5%)
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

osd_daedalus;646862 said:
just for readibility (RunUO devs insist on the fact is better a line of code more to improve it):

instead to use
The reason why I wrote it that way... Is because I didn't show the context. Leeching is done as part of a relatively lengthy "if (core.AOS)" statement, which INCLUDES the final actual application of leeching, as well as the outright declaration of the "leech" variables. Hence, unless we want to entirely re-write that whole section of the script, the ML leech has to go there, and they have to be segregated in some way. (to make sure that they're both mutually exclusive)

I suppose a superior alternative is to cut the first one to simply "if (!core.ML)," since looking over it again, this is already part of an "if (core.AOS)" so we needn't be redundant.

Yeah, I'll eventually make it into a patch myself; I wanted to finish this part up, and then also see how it handles displaying the line on mouse-over.

osd_daedalus;646862 said:
What else returns HML/HLL rather than weapons?
Nothing, as far as I know.

osd_daedalus;646862 said:
According to your calculations, you need a weapon with more than 4s speed to have more than 100%. Now, on all of mace weapons, the slowest weapon is the war mace that has 4s (so it should return 100%). Slower weapons are archery ones, like bow (4.25s), but it's leeching is halved.

It's testable: craft in OSI lots of war maces and find the maximum intensity+speed bonus. I expect it's 100.
Yeah, my question wasn't on the existence of a cap. The Breath of the Dead is outright verification. It already had 100% "Hit Life Leech," which, given its speed (3s without any SSI) should've netted it 150% instead.

Merely, I was wondering about the same question you immediately posed afterward:

osd_daedalus;646862 said:
About bows... before or after? Go craft lots of runic heavy crossbows (5s) and see if the maximum percentage is 50% or 62-63% (the real value should be 62.5%)
Yeah, that's what I suggested. The value will be 62%, since the game round the values down (hence why the Wrath of the Dryad has 81%) Likewise, the Yumi/Crossbow, as well as the Bow, can all reach that too.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Finally got the current SVN, though I'm still figuring out how to use TSVN to edit scripts/safe .DIFFs. Currently, what I've got for the functional side of the leeching looks like this:
Code:
if ( Core.AOS )
{
 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 ) ) ) );
  /* HitLeechHits% maximum amount of damage leeched as hit points, with modification from weapon speed */

  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 ) ) ) );
  /* HitLeechMana% maximum amount of damage leeched as mana, with modification from weapon speed */
 }
 else
 {
  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
 }
}
Now all that's left is to figure out how the cliloc/mouseover gump is handled here, and then put it into a .DIFF file for testing.
 
Re: [VALIDATION NEEDED] Life-Mana leech and speed

Okay, made a .Patch file of what's present so far. What it does/does not do:
  • DOES change the way leeching is done; Functionally, should work as per OSI. This includes both the adjustment of values according to weapon speed/range, as well as making every hit leech a variable amount of health/mana.
  • DOES NOT change anything visual. On mouse-over of a weapon you will get the "old" leech value, that is NOT adjusted by weapon speed. At face value, this means the number you see there is meaningless.
Obviously, there still remains a few more things to be seen... Some things need validation, but once validated, I can add them in:
  • Question: Is the cap for bows 50%? Or is the "100% cap" (seen on some weapons like the BotD) applied AFTER the halving for bows?
    How to Test: Go on OSI, and use bowcraft runics to create a lot of heavy crossbows. You should be able to hit as high as 62% if there's no 50% cap.
  • Question: When stacking the leech from buffs, (like Curse Weapon, Wraith Form, and Vampiric Embrace) can you exceed 100% leeching? Or is there a cap that doesn't allow you to leech more damage than you dealt?
    How to Test: On OSI, get any weapon with >50% life leech. Use Vampiric Embrace and/or Curse Weapon, and test on a target you will deal full damage against, counting how much you're healed vs. what damage the target takes. Repeat for mana leeching using Wraith Form and a very high mana leech weapon.
 

Attachments

  • Leechfixfunctional.patch
    1.9 KB · Views: 2

jaasso

Knight
Re: [IN DEVELOPMENT] Life-Mana leech and speed

will the intensities on leeches on weapons made before this patch is implemented stay the way they are? (in other words is it stupid to craft slow weapons at the moment)
 

Yoshiro

Wanderer
Re: [IN DEVELOPMENT] Life-Mana leech and speed

They will just convert the intesities with the old system from what i have read.
 
Re: [IN DEVELOPMENT] Life-Mana leech and speed

I'd note that unfortunately, I don't feel QUITE confident proceeding ahead with this patch unless I get some more things verified as per OSI; Personally, I'm in the camp of "don't patch it unless we're sure EVERY part is per OSI," instead of the "patch it as long as it's more OSI-like than what exists, and gets at least one thing right."
jaasso;652526 said:
will the intensities on leeches on weapons made before this patch is implemented stay the way they are? (in other words is it stupid to craft slow weapons at the moment)
The tentative patch I have will not even require a new intensity range. I.e, the underlying, invisible "property" will still be 2-50. It will just show up differently, and also function differently.

In other words, with the patch implemented, the changes will take effect instantly, with all existing weapons automatically functioning in the new manner, with updated values. (so, for instance, there will be no "pre-patch bows;" they will all be nerfed by default as soon as the patch comes online)
 
Re: [IN DEVELOPMENT] Life-Mana leech and speed

Okay, since I've had no further updates on validating some of this stuff on OSI, I've made the following assumptions:
  • The property cap on bows applies AFTER the halving. In other words, you can craft/loot ranged weapons with leech values above 50%.
  • I'm also assuming you CAN'T gain more health/mana than you dealt in damage. This was not really even a question prior to ML, since the leeches were flat. But now they can readily go past their previous values. (side-effect: staff with arbitrarily high spirit speak values can no longer leech insane amounts with non-spell attacks in Wraith Form)
In total, this is what I can say about the patch, and what it does:
  • This ONLY makes edits to BaseWeapon.cs.
  • This does not need any serialization/deserialization changes. It works the moment you load up the shard with it, and likewise, a shard owner can revert the code, and all weapons will work as they did before the patch.
  • The underlying "property" is not changed at all. My examination of the documentation provided demonstrated that this is what OSI did; the [props number is still a number between 2-50. (likewise, this means that staff modding items need not calculate the "reasonable" cap for an effect; just enter in 50 and it'll always get it)
  • Life/Mana leech effects should now be random, and always apply if the weapon has them. The possible range is based on the underlying property value, and scaled down with faster weapons. Ranged weapons have the strength halved further. This number cannot exceed 100.
  • On mouse-over, the info given should reflect the new value, just like it does on OSI. Likewise, this number cannot exceed 100.
  • Both mana and life leech TOTALS (i.e, item mods, buffs, etc, combined) are now capped to 100. Otherwise, one could easily gain 170% life from the damage dealt. (combining a 100% life leech weapon, Vampiric Embrace, and Curse Weapon; before, these would always yield a max of 100%)
If there's no more validation needed, this thread can now be moved to [Testing]. Things to look for in tests:
  • Craft a lot of both ranged and melee weapons, to observe that the numbers given are correct. A 0-SSI 2.0s weapon should cap at 40%, for instance.
  • Use an admin account to [props these items, and check their underlying property intensities, and double-check that the amount displayed is correct for the formula posted at the top of the thread.
  • Check all the artifacts with life/mana leech to see that the values they report are correct as per OSI.
  • Use these weapons on monsters. Preferably, try to nullify your own mana/health regen, and check how much you gain versus the amount of damage you deal.
  • Combine these weapons with other things that add life/mana leeching, like Wraith Form, Vampiric Embrace, and Curse Weapon. See if the numbers come out right, and if the cap works; properly, you shouldn't leech more than you deal.
And now, the patch file itself, built on SVN 434.
 

Attachments

  • LeechFixv1.patch
    3.5 KB · Views: 5
Re: [IN DEVELOPMENT] Life-Mana leech and speed

Again, in case it got lost in the above post, this thread can now be moved to [testing]. I took the conservative approach in any uncertainties, so if we later discover something isn't perfect, (such as if leeching CAN go above 100% on OSI) it can be re-visited without a problem.
 

uome

Bug Hunter
Re: [TESTING] Life-Mana leech and speed

Compinling error. :(
Code:
Errors:
 + Items/Weapons/BaseWeapon.cs:
    CS0103: Line 1578: The name 'm_MlSpeed' does not exist in the current contex
t
    CS0117: Line 1578: 'Server.AosWeaponAttributes' does not contain a definitio
n for 'WeaponSpeed'
    CS0103: Line 1582: The name 'm_MlSpeed' does not exist in the current contex
t
    CS0117: Line 1582: 'Server.AosWeaponAttributes' does not contain a definitio
n for 'WeaponSpeed'
    CS0103: Line 3185: The name 'core' does not exist in the current context
    CS0103: Line 3186: The name 'm_MlSpeed' does not exist in the current contex
t
    CS0117: Line 3186: 'Server.AosWeaponAttributes' does not contain a definitio
n for 'WeaponSpeed'
    CS0103: Line 3203: The name 'core' does not exist in the current context
    CS0103: Line 3204: The name 'm_MlSpeed' does not exist in the current contex
t
    CS0117: Line 3204: 'Server.AosWeaponAttributes' does not contain a definitio
n for 'WeaponSpeed'
Scripts: One or more scripts failed to compile or no script files were found.
 
Re: [TESTING] Life-Mana leech and speed

Shoot, was afraid I might've messed up on that... Specifically on handling the weapon speed variables. (which I notice are the source of all the compiler errors) I'll admit I wasn't quite certain I was doing it the right way. And since I still can't get RunUO to work for me, I couldn't even compile it myself.

I'll have to give it another look-over and see how I should change it.
 
Re: [IN DEVLOPMENT] Life-Mana leech and speed

Okay, I think the solution... Would be to change all of the highlighted lines to simply say "speed." :p

I'll test this shortly, and if it lets me compile it, I'll throw it up and we can try this again.

(edit: Ah, I also was careless in dealing with fetching the weapon's speed; I'll get that, too.)

(double edit: WTH? I didn't realize that it's taking issue to my "Core.ML" arguments, when it had no problem with any of the others...)

(tripple edit: Got the previous problems with SSI fixed... Now to figure out why it's not accepting the same **** global variables that work everywhere else in the script...)
 
Re: [IN DEVLOPMENT] Life-Mana leech and speed

Okay, after a bit of hair-pulling and feeling like an idiot afterwards, I fixed the issue. IMO, the result is a tad messier, but it should work.

(immediate test result: apparently, all life leech weapons show up as "hit life leech 0%" Not sure if they FUNCTION or not... Also, it APPEARS that it prevents attacks whatsoever, strangely enough)
 

Attachments

  • LeechFixv2.patch
    3.8 KB · Views: 3
Re: [IN DEVLOPMENT] Life-Mana leech and speed

Okay, after spending some more time testing, it appears that the two "halves" (the visual and functional ones ones) have the respective effects:
  • All weapons with "Hit Life Leech" and "Hit Mana Leech" always show up with a value of "0%." (i.e, "Hit Life Leech 0%")
  • For some reason, anything and everything can't attack.
Obviously, neither half is what was desired... And I'm not even sure how such results are plausible. I'd appreciate if someone can try "testing" this patch and confirming that both of the problems are present. For now, I'll have to resort to trying to isolate exactly what's causing the problem; given my own issues with running RunUO at home, this could take a while.
 

atdp

Sorceror
Re: [IN DEVLOPMENT] Life-Mana leech and speed

Corrected little mistake and updated for 518
 

Attachments

  • LeechFixv2a.patch
    4.7 KB · Views: 7

Athena

Account Terminated
Re: [TESTING-TC] Life-Mana leech and speed

Setting this back to development, you get the leeching sound etc, but no actual leeching is taking place.
 

Kraz

AssistUO Developer
Is Nottheking scripting?
I've scripted this months ago.
Today I'll get a SVN copy to merge and upload patch files if you need a coder, of course testers are needed.
 
... still awaiting for the uploading of the script of months ago :p

But seriously, I think I have missed something... is this still valid?
 
Top