bala1412
Member
- ServUO Version
- Publish 57
- Ultima Expansion
- Endless Journey
public override void OnDamage(int amount, Mobile from, bool willKill)
{
int disruptThreshold;
if (!Core.AOS)
{
disruptThreshold = 0;
}
else if (from != null && from.Player)
{
disruptThreshold = 19;
}
else
{
disruptThreshold = 26;
}
if (Core.SA)
{
disruptThreshold += Dex / 12;
}
if (amount > disruptThreshold)
{
BandageContext c = BandageContext.GetContext(this);
if (c != null)
{
c.Slip();
}
}
if (Confidence.IsRegenerating(this))
{
Confidence.StopRegenerating(this);
}
if (m_ReceivedHonorContext != null)
{
m_ReceivedHonorContext.OnTargetDamaged(from, amount);
}
if (m_SentHonorContext != null)
{
m_SentHonorContext.OnSourceDamaged(from, amount);
}
if (willKill && from is PlayerMobile)
{
Timer.DelayCall(TimeSpan.FromSeconds(10), ((PlayerMobile)@from).RecoverAmmo);
}
#region Mondain's Legacy
if (InvisibilityPotion.HasTimer(this))
{
InvisibilityPotion.Iterrupt(this);
}
#endregion
UndertakersStaff.TryRemoveTimer(this);
base.OnDamage(amount, from, willKill);
}
I have a question about the onamage method on playermobile.cs , for example
Adding this.Mana -=10; method reduces mana by 10 each time the player is damaged. Conversely, adding this.Mana +=10; has the proper effect of restoring mana by 10 each time the player is damaged. The problem is: this.Hits +=10; adding this method or this.Hits -=10; did not decrease or recover player hp when adding this method. I don't think the method related to hp works. Maybe it's just me or I tried all the other methods, but it didn't work. Can you help if it's just me or what's causing this?#endregion
UndertakersStaff.TryRemoveTimer(this);
this.Mana -= 10;
base.OnDamage(amount, from, willKill);