Faction.ClearSkillLoss now returns true or false indicating if the player was actually under skill loss
Refactored some gump methods to account for the respective core changes
This commit is contained in:
parent
6095f152cf
commit
51345e02a0
4 changed files with 18 additions and 41 deletions
|
|
@ -900,12 +900,13 @@ namespace Server.Factions
|
|||
ClearSkillLoss( (Mobile) state );
|
||||
}
|
||||
|
||||
public static void ClearSkillLoss( Mobile mob )
|
||||
public static bool ClearSkillLoss( Mobile mob )
|
||||
{
|
||||
SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];
|
||||
|
||||
if ( context == null )
|
||||
return;
|
||||
if ( context == null ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_SkillLoss.Remove( mob );
|
||||
|
||||
|
|
@ -915,6 +916,8 @@ namespace Server.Factions
|
|||
mob.RemoveSkillMod( (SkillMod) mods[i] );
|
||||
|
||||
context.m_Timer.Stop();
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -33,18 +33,7 @@ namespace Server.Factions
|
|||
|
||||
public static bool Exists( Mobile mob )
|
||||
{
|
||||
NetState ns = mob.NetState;
|
||||
|
||||
if ( ns == null )
|
||||
return false;
|
||||
|
||||
for ( int i = 0; i < ns.Gumps.Count; ++i )
|
||||
{
|
||||
if ( ns.Gumps[i] is FactionGump )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return ( mob.FindGump( typeof( FactionGump ) ) != null );
|
||||
}
|
||||
|
||||
public void AddHtmlText( int x, int y, int width, int height, TextDefinition text, bool back, bool scroll )
|
||||
|
|
|
|||
|
|
@ -237,19 +237,13 @@ namespace Server.Items
|
|||
{
|
||||
NetState ns = toCheck.NetState;
|
||||
|
||||
if ( ns == null )
|
||||
return false;
|
||||
if ( ns != null ) {
|
||||
foreach ( Gump gump in ns.Gumps ) {
|
||||
RunebookGump bookGump = gump as RunebookGump;
|
||||
|
||||
List<Gump> gumps = ns.Gumps;
|
||||
|
||||
for ( int i = 0; i < gumps.Count; ++i )
|
||||
{
|
||||
if ( gumps[i] is RunebookGump )
|
||||
{
|
||||
RunebookGump gump = (RunebookGump)gumps[i];
|
||||
|
||||
if ( gump.Book == this )
|
||||
if ( bookGump != null && bookGump.Book == this ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1079,21 +1079,12 @@ namespace Server.Mobiles
|
|||
|
||||
if ( ns != null )
|
||||
{
|
||||
List<Gump> gumps = ns.Gumps;
|
||||
|
||||
for ( int i = 0; i < gumps.Count; ++i )
|
||||
{
|
||||
if ( gumps[i] is ResurrectGump )
|
||||
{
|
||||
if ( Alive )
|
||||
{
|
||||
CloseGump( typeof( ResurrectGump ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
SendLocalizedMessage( 500111 ); // You are frozen and cannot move.
|
||||
return false;
|
||||
}
|
||||
if ( HasGump( typeof( ResurrectGump ) ) ) {
|
||||
if ( Alive ) {
|
||||
CloseGump( typeof( ResurrectGump ) );
|
||||
} else {
|
||||
SendLocalizedMessage( 500111 ); // You are frozen and cannot move.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue