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.

[SVN] Wraith Form Mana Leech

Status
Not open for further replies.

psz

Administrator
[SVN] Wraith Form Mana Leech

Behavior on Demise: When cast, a % of the damage will be mana damage and mana leech
Behavior on OSI: When, damage and a % of life will recharge the attacker's mana
Supporting Documentation (URLs): See Below
Changes needed: Needs Verification/Testing first
Code (optional): None ATM


osd_daedalus;551798 said:
About the mana leech of wraith form:

Spells/Base/Spellhelper.cs at line 939 say:

Code:
        public static void DoLeech( int damageGiven, Mobile from, Mobile target )
        {
            TransformContext context = TransformationSpellHelper.GetContext( from );
            if ( context != null && context.Type == typeof( WraithFormSpell ) )
            {
                int wraithLeech = ( 5 + (int)( ( 15 * from.Skills.SpiritSpeak.Value ) / 100 ) ); // Wraith form gives 5-20% mana leech
                int manaLeech = AOS.Scale( damageGiven, wraithLeech );
                if ( manaLeech != 0 )
                {
                    // Mana leeched by the Wraith Form spell is actually stolen, not just leeched.
                    target.Mana -= manaLeech;
                    from.Mana += manaLeech;
                    from.PlaySound( 0x44D );
                    //from.SendMessage(String.Format("You Leeched {0} Mana", manaLeech));
                }
            }
        }
Pratically, mana leech is not "I take your mana and add a percent of it to me", but "I do damage and a % of life will recharge my mana".

It's funny, thinking about it, you also "steal" enemy mana also :)

As you read, it's implemented now like "I damage you, a % of the damage will be also your mana damage and my mana leech". So, what runs the mana leech is NOT the mana of enemy, but life.

Pratically, if the monster has 0 mana, you still leech mana because it's the life to be converted in it.

If we really want to "fix" this, we should code something like "if the enemy mana is < to the % of mana leeching/stealing, then get the mana the enemy has, put it to 0 and give him to the player".
Like, if monster has 100 mana and you do 100 damage with 20% HML, the monster lose 20 mana and you gain 20 mana (actual)

Maybe we could make something like "if monster has 10 mana and you do 100 damage with 20% ML... oh he has not 20 mana... bring the 10 mana to 0 and give the player 10 mana instead of 20".

As you read, it's always damage-related. If it was mana-related, you could do a 1 damage to a creature with 1000 mana and leech 200 mana, then 160 mana (800/100 x 20), and so on.

Maybe in that script, the "stealing mana" adding was not good idea.

In UOGuide I read in Wraith Form
At Gm (100 Spirit Speak) it leeches 20% of the damage you do to the target
and in HML:
On every successful hit you will leech 0 to X percent mana of (Damage done * 0.4) - X being the Hit Mana Leech value on your weapon
Also Stratics talk always as Damage converted (HML weapon = chance to leech 40% of damage in mana)

So... what is in RunUO is correct :eek:

Let's do this: I signal to look in OSI to new Wraith Leech behaviours, before set it to Invalid. Ok? ;)
 
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

You should test in OSI if a hit suffered by someone with Hit Mana Leech / Wraith Form damages mana.

If yes, it's OK and this bugreport is invalid
If not, the fix is easy.

I don't get if it was coded to "steal" mana for theory or because it was tested in OSI time ago. I don't know if a fix would be expansion-dependant.
 
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

Finally, after so much months, I tested it in OSI with a soul seeker (HML/HSL/HHL), in wraith form and both against a guy I have found there (and pwned me with a rising colossus that also purged my wraith form... ah, SA...)

I attacked him multiple times but he never lost mana. Stamina is lost but I believe it's for the melee damage rather the HSL effect. Then I went in wraith form (GM necro and SS) and tried both melee and painspike and various magery spells on him, like fireball, lightning...

In no one case he lost mana.

This let me think the HML just converts some damage in mana, but won't cause a true leech, with an associated mana damage to the target.

In this case, the part "target.Mana -= manaLeech;" is not valid.
 
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

and this is the fix.
The whole thing is so stupid IMHO I wanted just to comment the entire thing out, instead of delete it.
 

Attachments

  • leechfix.patch
    738 bytes · Views: 10

Gisela

Bug Hunter
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

Why would you comment it out? That's why why have version control :)
 
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

Gisela;695181 said:
Why would you comment it out? That's why why have version control :)

it seemed so illogical a leech shouldn't work as a true "leech", I have thought many shard admins would prefer to keep the original way. Since many of them don't know either what is a version control (this thread makes me think it's really so), maybe a "uncomment here!" flag would help them... :)
 

Esqarrouth

Wanderer
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

its been like this since aos, but yes illogical.

i remember the good old days when i thought having a 57 dmg ai hitting %50 mana leech hammer pick would own all the mages :p
 

Gisela

Bug Hunter
Re: [VALIDATION NEEDED] Wraith Form Mana Leech

osd_daedalus;695188 said:
it seemed so illogical a leech shouldn't work as a true "leech", I have thought many shard admins would prefer to keep the original way. Since many of them don't know either what is a version control (this thread makes me think it's really so), maybe a "uncomment here!" flag would help them... :)
Hm, maybe it's time to start collecting options in a single config file. That way they can enable/disable stuff like that more easily.

e: by the way have I mentioned how awesome it is that you have commit access? You actually add log messages! :p
 

giamba80

Sorceror
Re: [TESTING-TC] Wraith Form Mana Leech

Hello!

Me and daedalus test that at demise TC and seems that attacking with an hit mana leech weapon the target don't gain in mana :)
--------------------------------------------------------------------------------
Legolas B@D Blue Apple Digits Proud and Glory (sometimes)
 
Re: [TESTING-TC] Wraith Form Mana Leech

giamba80;703354 said:
Hello!

Me and daedalus test that at demise TC and seems that attacking with an hit mana leech weapon the target don't gain in mana :)
--------------------------------------------------------------------------------

don't lose in mana you wanted to say :p
 

Xavier

Account Terminated
Re: [READY] Wraith Form Mana Leech

added a very small performance cleanup in this SpellHelper.DoLeech() function.
 

Xavier

Account Terminated
Re: [READY] Wraith Form Mana Leech

Its not your code I changed, its your code that made me look here.

Theres no point in checking if context is null 2x, and theres no point in checking the second if statement if the first was true. Like I said, very small cleanup.
 
Status
Not open for further replies.
Top