|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
Join Date: Jul 2008
Age: 31
Posts: 35
|
Items show durability when you mouse over them. When durability reaches 0, it no longer shows durability. Once it stops showing its durability, it never breaks. Weapn (and armor) will continue to show overhead "your equipement is serverely damaged" but it will go on forever.
I found this in Baseweapon.... I've no idea how to alter it to make it so A. Duribility will always show, even if 0 B. Item will break if not fixed and continued to be used Code:
if ( Core.AOS && m_AosWeaponAttributes.SelfRepair > Utility.Random( 10 ) )
{
HitPoints += 2;
}
else
{
if ( m_Hits > 0 )
{
--HitPoints;
}
else if ( m_MaxHits > 1 )
{
--MaxHitPoints;
if ( Parent is Mobile )
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
}
else
{
Delete();
}
}
To me, it looks like it should work, but, I am like "King Noob" when it comes to fixing, writing, or evaluating scripts lol Any ideas? |
|
|
|
|
|
#2 (permalink) | |
|
Forum Novice
Join Date: Sep 2007
Posts: 367
|
Quote:
The code looks fine to me... but maybe this will help? Code:
if ( Core.AOS && m_AosWeaponAttributes.SelfRepair > Utility.Random( 10 ) )
{
HitPoints += 2;
}
else
{
if ( m_Hits > 0 )
{
--HitPoints;
}
else if ( m_MaxHits >= 1 )
{
--MaxHitPoints;
if ( Parent is Mobile )
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
}
else if ( m_MaxHits < 1 )
{
Delete();
}
}
Displaying info is also in baseweapon under a different method. See if you can find where it's adding info to a list. Edit... now that I think about it... there may be some code somewhere that disallows MaxHits from going under 1. So, you may need to find that and change it where the MaxHits method resides. Last edited by Tassyon T; 08-24-2008 at 10:30 PM. |
|
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
|
the item does eventually break if you props the item the max his will show the max dur and the item hits shoes what it is basicly what happens say you have a item that has 255 dur it goes to 0 and shows no more well it counts down from there -255 -254 -253 to 0 again at 0 the item will break
|
|
|
|
|
|
#6 (permalink) |
|
Forum Novice
|
ok i lied lol i get into this and i know i wont get to sleep
i found this i tghink this is where its at and ita all math wont be somehting easy to fix HTML Code:
public virtual void UnscaleDurability()
{
int scale = 100 + GetDurabilityBonus();
m_Hits = ((m_Hits * 100) + (scale - 1)) / scale;
m_MaxHits = ((m_MaxHits * 100) + (scale - 1)) / scale;
InvalidateProperties();
}
public virtual void ScaleDurability()
{
int scale = 100 + GetDurabilityBonus();
m_Hits = ((m_Hits * scale) + 99) / 100;
m_MaxHits = ((m_MaxHits * scale) + 99) / 100;
InvalidateProperties();
}
ok so basicly you have to do the math just a math update you always do the stuff in the () first then do whats outside this i believe is where it is all computed hope it helps ya out with out doing all the math you could just lower the durability on the item per say 127 or 128 which is about half of 255 so they are actually getting 255 out of the item but that will be up to you |
|
|
|
|
|
#7 (permalink) |
|
Forum Master
|
it never goes negative
the way it works (origional code is fine) is hits goes to 0 once there - each time it is "damaged" it will loose 1 point from max dura so if starting at 255 - will cound down 255 more "damages" untill then it is 0 also then it will break it does not count into negative numbers if you want it to go faster when it hits 0 hp so it break sooner then modify this line: --MaxHitPoints; to something like this: MaxHitPoints -= 20; if (MaxHitpoints < 0) MaxHitPoints = 0; and it will lower the max dura by 20 points at a time giving them basicaly 13 more "dammages" instead of 255
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|