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.

Honor virtue gain bug

hi,
i was looking through honor virtue code and found an issue (not tested at demise, tested on lastest runuo at home).

problem is that damage from poison is not added to total damage and it messes final calculation.
so if you honor mob and kill it mostly by poison (in ideal case deal only 1 damage another way) you get much more virtue points than you should have (possibly like 100k from one mob).

if you deal dmg only by poison there is a division by zero that leads to +Infinity points, ater conversion to int -2147483648, capped to 1 :)


Honor.cs, line 259
Code:
public void OnTargetDamaged( Mobile from, int amount )
{
    if ( m_FirstHit == FirstHit.NotDelivered )
        m_FirstHit = FirstHit.Delivered;
 
    if ( m_Poisoned )
    {
        m_HonorDamage += amount * 0.8;
        m_Poisoned = false; // Reset the flag
 
        return;
    }
 
    m_TotalDamage += amount;
...

should be
Code:
public void OnTargetDamaged( Mobile from, int amount )
{
    if ( m_FirstHit == FirstHit.NotDelivered )
        m_FirstHit = FirstHit.Delivered;
 
    m_TotalDamage += amount;
 
    if ( m_Poisoned )
    {
        m_HonorDamage += amount * 0.8;
        m_Poisoned = false; // Reset the flag
 
        return;
    }
...
 
I was not able to reproduce the exploit...

What I have done (as admin):
- honored a slime and attacked with a broadsword 100% physical. I got 2 points of Honor.
- honored a slime and attacked with a broadsword 100% poison. I still got 2 points of Honor.
- honored a slime and used Poison magic but it was immune so I switched to another creature

- honored a rat and attacked with a broadsword 100% poison. I got 1 point of Honor.
- honored a rat and used Poison spell and left it to die. I got 1 point of Honor.

May you tell me how to reproduce it?
 
-honor a rat
-hit it, less dmg is better (in ideal case for only 1 dmg)
-then use a poision spell and left it die
 
Thank you, now I was able to reproduce it:

- I made a dagger with min and max damage 1
- Honored a rat, attacked with the dagger, then casted Poison and left to die
I gained 5 points of Honor instead of 1.

I did the same after your patch and I gained 1 point of Honor. So yes, it is an active exploit it should be fixed.

I will post your patch in .patch format to make Eos' life easier. Thank you!
 

Attachments

  • Honor_SVN1083.patch
    648 bytes · Views: 5
Top