Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -3,81 +3,83 @@ using Server.Network;
|
|||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class SolenHelper
|
||||
{
|
||||
public static void PackPicnicBasket( BaseCreature solen )
|
||||
{
|
||||
if ( 1 > Utility.Random( 100 ) )
|
||||
{
|
||||
PicnicBasket basket = new PicnicBasket();
|
||||
public class SolenHelper
|
||||
{
|
||||
public static void PackPicnicBasket(BaseCreature solen)
|
||||
{
|
||||
if (1 > Utility.Random(100))
|
||||
{
|
||||
PicnicBasket basket = new PicnicBasket();
|
||||
|
||||
basket.DropItem( new BeverageBottle( BeverageType.Wine ) );
|
||||
basket.DropItem( new CheeseWedge() );
|
||||
basket.DropItem(new BeverageBottle(BeverageType.Wine));
|
||||
basket.DropItem(new CheeseWedge());
|
||||
|
||||
solen.PackItem( basket );
|
||||
}
|
||||
}
|
||||
solen.PackItem(basket);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckRedFriendship( Mobile m )
|
||||
{
|
||||
if ( m is BaseCreature bc )
|
||||
{
|
||||
if ( bc.Controlled && bc.ControlMaster is PlayerMobile )
|
||||
return CheckRedFriendship( bc.ControlMaster );
|
||||
if ( bc.Summoned && bc.SummonMaster is PlayerMobile )
|
||||
return CheckRedFriendship( bc.SummonMaster );
|
||||
}
|
||||
public static bool CheckRedFriendship(Mobile m)
|
||||
{
|
||||
if (m is BaseCreature bc)
|
||||
{
|
||||
if (bc.Controlled && bc.ControlMaster is PlayerMobile)
|
||||
return CheckRedFriendship(bc.ControlMaster);
|
||||
if (bc.Summoned && bc.SummonMaster is PlayerMobile)
|
||||
return CheckRedFriendship(bc.SummonMaster);
|
||||
}
|
||||
|
||||
return m is PlayerMobile player && player.SolenFriendship == SolenFriendship.Red;
|
||||
}
|
||||
return m is PlayerMobile player && player.SolenFriendship == SolenFriendship.Red;
|
||||
}
|
||||
|
||||
public static bool CheckBlackFriendship( Mobile m )
|
||||
{
|
||||
if ( m is BaseCreature bc )
|
||||
{
|
||||
if ( bc.Controlled && bc.ControlMaster is PlayerMobile )
|
||||
return CheckBlackFriendship( bc.ControlMaster );
|
||||
if ( bc.Summoned && bc.SummonMaster is PlayerMobile )
|
||||
return CheckBlackFriendship( bc.SummonMaster );
|
||||
}
|
||||
public static bool CheckBlackFriendship(Mobile m)
|
||||
{
|
||||
if (m is BaseCreature bc)
|
||||
{
|
||||
if (bc.Controlled && bc.ControlMaster is PlayerMobile)
|
||||
return CheckBlackFriendship(bc.ControlMaster);
|
||||
if (bc.Summoned && bc.SummonMaster is PlayerMobile)
|
||||
return CheckBlackFriendship(bc.SummonMaster);
|
||||
}
|
||||
|
||||
return m is PlayerMobile player && player.SolenFriendship == SolenFriendship.Black;
|
||||
}
|
||||
return m is PlayerMobile player && player.SolenFriendship == SolenFriendship.Black;
|
||||
}
|
||||
|
||||
public static void OnRedDamage( Mobile from )
|
||||
{
|
||||
if ( from is BaseCreature bc )
|
||||
{
|
||||
if ( bc.Controlled && bc.ControlMaster is PlayerMobile )
|
||||
OnRedDamage( bc.ControlMaster );
|
||||
else if ( bc.Summoned && bc.SummonMaster is PlayerMobile )
|
||||
OnRedDamage( bc.SummonMaster );
|
||||
}
|
||||
public static void OnRedDamage(Mobile from)
|
||||
{
|
||||
if (from is BaseCreature bc)
|
||||
{
|
||||
if (bc.Controlled && bc.ControlMaster is PlayerMobile)
|
||||
OnRedDamage(bc.ControlMaster);
|
||||
else if (bc.Summoned && bc.SummonMaster is PlayerMobile)
|
||||
OnRedDamage(bc.SummonMaster);
|
||||
}
|
||||
|
||||
if ( from is PlayerMobile player && player.SolenFriendship == SolenFriendship.Red )
|
||||
{
|
||||
player.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1054103 ); // The solen revoke their friendship. You will now be considered an intruder.
|
||||
if (from is PlayerMobile player && player.SolenFriendship == SolenFriendship.Red)
|
||||
{
|
||||
player.LocalOverheadMessage(MessageType.Regular, 0x3B2,
|
||||
1054103); // The solen revoke their friendship. You will now be considered an intruder.
|
||||
|
||||
player.SolenFriendship = SolenFriendship.None;
|
||||
}
|
||||
}
|
||||
player.SolenFriendship = SolenFriendship.None;
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnBlackDamage( Mobile from )
|
||||
{
|
||||
if ( from is BaseCreature bc )
|
||||
{
|
||||
if ( bc.Controlled && bc.ControlMaster is PlayerMobile )
|
||||
OnBlackDamage( bc.ControlMaster );
|
||||
else if ( bc.Summoned && bc.SummonMaster is PlayerMobile )
|
||||
OnBlackDamage( bc.SummonMaster );
|
||||
}
|
||||
public static void OnBlackDamage(Mobile from)
|
||||
{
|
||||
if (from is BaseCreature bc)
|
||||
{
|
||||
if (bc.Controlled && bc.ControlMaster is PlayerMobile)
|
||||
OnBlackDamage(bc.ControlMaster);
|
||||
else if (bc.Summoned && bc.SummonMaster is PlayerMobile)
|
||||
OnBlackDamage(bc.SummonMaster);
|
||||
}
|
||||
|
||||
if ( from is PlayerMobile player && player.SolenFriendship == SolenFriendship.Black )
|
||||
{
|
||||
player.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1054103 ); // The solen revoke their friendship. You will now be considered an intruder.
|
||||
if (from is PlayerMobile player && player.SolenFriendship == SolenFriendship.Black)
|
||||
{
|
||||
player.LocalOverheadMessage(MessageType.Regular, 0x3B2,
|
||||
1054103); // The solen revoke their friendship. You will now be considered an intruder.
|
||||
|
||||
player.SolenFriendship = SolenFriendship.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.SolenFriendship = SolenFriendship.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue