More casting fixes
This commit is contained in:
parent
f211efc3bd
commit
20a80ea2f3
40 changed files with 125 additions and 211 deletions
|
|
@ -176,7 +176,7 @@ namespace Server
|
|||
|
||||
if ( reflectPhys != 0 )
|
||||
{
|
||||
if ( @from is ExodusMinion minion && minion.FieldActive || @from is ExodusOverseer overseer && overseer.FieldActive )
|
||||
if ( from is ExodusMinion minion && minion.FieldActive || from is ExodusOverseer overseer && overseer.FieldActive )
|
||||
{
|
||||
from.FixedParticles( 0x376A, 20, 10, 0x2530, EffectLayer.Waist );
|
||||
from.PlaySound( 0x2F4 );
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ namespace Server.Guilds
|
|||
|
||||
from.SendGump( new PropertiesGump( from, g ) );
|
||||
|
||||
if ( NewGuildSystem && from.AccessLevel >= AccessLevel.GameMaster && @from is PlayerMobile pm )
|
||||
if ( NewGuildSystem && from.AccessLevel >= AccessLevel.GameMaster && from is PlayerMobile pm )
|
||||
pm.SendGump( new GuildInfoGump( pm, g ) );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Server.Misc
|
|||
{
|
||||
case 0x002A: // *i resign from my guild*
|
||||
{
|
||||
((Guild)@from.Guild)?.RemoveMember( @from );
|
||||
((Guild)from.Guild)?.RemoveMember( from );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ namespace Server.Misc
|
|||
}
|
||||
case 0x0035: // i renounce my young player status*
|
||||
{
|
||||
if ( @from is PlayerMobile mobile && mobile.Young && !mobile.HasGump( typeof( RenounceYoungGump ) ) )
|
||||
if ( from is PlayerMobile mobile && mobile.Young && !mobile.HasGump( typeof( RenounceYoungGump ) ) )
|
||||
{
|
||||
mobile.SendGump( new RenounceYoungGump() );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ namespace Server.Misc
|
|||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if ( @from.Guild is Guild guild )
|
||||
if ( from.Guild is Guild guild )
|
||||
{
|
||||
bool locations = pvSrc.ReadByte() != 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace Server
|
|||
|
||||
public static bool CheckML( Mobile from, bool message = true)
|
||||
{
|
||||
if ( @from?.NetState == null )
|
||||
if ( from?.NetState == null )
|
||||
return false;
|
||||
|
||||
if ( from.NetState.SupportsExpansion( Expansion.ML ) )
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace Server.Misc
|
|||
PlayerMobile pmFrom = from as PlayerMobile;
|
||||
PlayerMobile pmTarg = target as PlayerMobile;
|
||||
|
||||
if ( pmFrom == null && @from is BaseCreature bcFrom )
|
||||
if ( pmFrom == null && from is BaseCreature bcFrom )
|
||||
{
|
||||
if ( bcFrom.Summoned )
|
||||
pmFrom = bcFrom.SummonMaster as PlayerMobile;
|
||||
|
|
@ -103,7 +103,7 @@ namespace Server.Misc
|
|||
if ( (pmFrom?.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg?.DuelContext != null && pmTarg.DuelContext.Started) )
|
||||
return false;
|
||||
|
||||
if ( @from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
|
||||
if ( from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
|
||||
return false;
|
||||
|
||||
sz = target.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
|
||||
|
|
@ -137,7 +137,7 @@ namespace Server.Misc
|
|||
if ( pmFrom?.Young == true || pmTarg?.Young == true )
|
||||
return false; // Young players cannot perform beneficial actions towards older players
|
||||
|
||||
if ( @from.Guild is Guild fromGuild && target.Guild is Guild targetGuild && (targetGuild == fromGuild || fromGuild.IsAlly( targetGuild )) )
|
||||
if ( from.Guild is Guild fromGuild && target.Guild is Guild targetGuild && (targetGuild == fromGuild || fromGuild.IsAlly( targetGuild )) )
|
||||
return true; // Guild members can be beneficial
|
||||
|
||||
return CheckBeneficialStatus( GetGuildStatus( from ), GetGuildStatus( target ) );
|
||||
|
|
@ -153,7 +153,7 @@ namespace Server.Misc
|
|||
PlayerMobile pmTarg = target as PlayerMobile;
|
||||
BaseCreature bcTarg = target as BaseCreature;
|
||||
|
||||
if ( pmFrom == null && @from is BaseCreature bcFrom && bcFrom.Summoned )
|
||||
if ( pmFrom == null && from is BaseCreature bcFrom && bcFrom.Summoned )
|
||||
pmFrom = bcFrom.SummonMaster as PlayerMobile;
|
||||
|
||||
if ( pmTarg == null && bcTarg?.Summoned == true )
|
||||
|
|
@ -177,7 +177,7 @@ namespace Server.Misc
|
|||
if ( (pmFrom?.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg?.DuelContext != null && pmTarg.DuelContext.Started) )
|
||||
return false;
|
||||
|
||||
if ( @from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
|
||||
if ( from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) is SafeZone sz /*&& sz.IsDisabled()*/ )
|
||||
return false;
|
||||
|
||||
sz = target.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
|
||||
|
|
@ -191,7 +191,7 @@ namespace Server.Misc
|
|||
if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
|
||||
return true; // In felucca, anything goes
|
||||
|
||||
if ( !from.Player && !(@from is BaseCreature bc && bc.GetMaster() != null && bc.GetMaster().AccessLevel == AccessLevel.Player ) )
|
||||
if ( !from.Player && !(from is BaseCreature bc && bc.GetMaster() != null && bc.GetMaster().AccessLevel == AccessLevel.Player ) )
|
||||
{
|
||||
if ( !CheckAggressor( from.Aggressors, target ) && !CheckAggressed( from.Aggressed, target ) && pmTarg?.CheckYoungProtection( from ) == true )
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Server.Misc
|
|||
|
||||
int points =(int)(from.Skills[SkillName.Focus].Value * 0.1);
|
||||
|
||||
if ( (@from is BaseCreature creature && creature.IsParagon) || from is Leviathan )
|
||||
if ( (from is BaseCreature creature && creature.IsParagon) || from is Leviathan )
|
||||
points += 40;
|
||||
|
||||
int cappedPoints = AosAttributes.GetValue( from, AosAttribute.RegenStam );
|
||||
|
|
@ -137,7 +137,7 @@ namespace Server.Misc
|
|||
|
||||
double totalPoints = focusPoints + medPoints + (from.Meditating ? (medPoints > 13.0 ? 13.0 : medPoints) : 0.0);
|
||||
|
||||
if ( (@from is BaseCreature creature && creature.IsParagon) || from is Leviathan )
|
||||
if ( (from is BaseCreature creature && creature.IsParagon) || from is Leviathan )
|
||||
totalPoints += 40;
|
||||
|
||||
int cappedPoints = AosAttributes.GetValue( from, AosAttribute.RegenMana );
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ namespace Server.Misc
|
|||
if ( gc < 0.01 )
|
||||
gc = 0.01;
|
||||
|
||||
if ( @from is BaseCreature creature && creature.Controlled )
|
||||
if ( from is BaseCreature creature && creature.Controlled )
|
||||
gc *= 2;
|
||||
|
||||
if ( from.Alive && ( ( gc >= Utility.RandomDouble() && AllowGain( from, skill, amObj ) ) || skill.Base < 10.0 ) )
|
||||
|
|
@ -183,7 +183,7 @@ namespace Server.Misc
|
|||
if ( Core.AOS && Faction.InSkillLoss( from ) ) //Changed some time between the introduction of AoS and SE.
|
||||
return false;
|
||||
|
||||
if ( AntiMacroCode && @from is PlayerMobile mobile && UseAntiMacro[skill.Info.SkillID] )
|
||||
if ( AntiMacroCode && from is PlayerMobile mobile && UseAntiMacro[skill.Info.SkillID] )
|
||||
return mobile.AntiMacroCheck( skill, obj );
|
||||
|
||||
return true;
|
||||
|
|
@ -196,7 +196,7 @@ namespace Server.Misc
|
|||
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
return;
|
||||
|
||||
if ( @from is BaseCreature creature && creature.IsDeadPet )
|
||||
if ( from is BaseCreature creature && creature.IsDeadPet )
|
||||
return;
|
||||
|
||||
if ( skill.SkillName == SkillName.Focus && from is BaseCreature )
|
||||
|
|
@ -227,7 +227,7 @@ namespace Server.Misc
|
|||
|
||||
#region Scroll of Alacrity
|
||||
|
||||
if ( @from is PlayerMobile pm && skill.SkillName == pm.AcceleratedSkill && pm.AcceleratedStart > DateTime.UtcNow )
|
||||
if ( from is PlayerMobile pm && skill.SkillName == pm.AcceleratedSkill && pm.AcceleratedStart > DateTime.UtcNow )
|
||||
toGain *= Utility.RandomMinMax(2, 5);
|
||||
#endregion
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ namespace Server.Misc
|
|||
|
||||
public static bool CanRaise( Mobile from, Stat stat )
|
||||
{
|
||||
if ( !(@from is BaseCreature creature && creature.Controlled) )
|
||||
if ( !(from is BaseCreature creature && creature.Controlled) )
|
||||
{
|
||||
if ( from.RawStatTotal >= from.StatCap )
|
||||
return false;
|
||||
|
|
@ -343,7 +343,7 @@ namespace Server.Misc
|
|||
{
|
||||
case Stat.Str:
|
||||
{
|
||||
if ( @from is BaseCreature creature && creature.Controlled ) {
|
||||
if ( from is BaseCreature creature && creature.Controlled ) {
|
||||
if ( (creature.LastStrGain + m_PetStatGainDelay) >= DateTime.UtcNow )
|
||||
return;
|
||||
}
|
||||
|
|
@ -355,7 +355,7 @@ namespace Server.Misc
|
|||
}
|
||||
case Stat.Dex:
|
||||
{
|
||||
if ( @from is BaseCreature creature && creature.Controlled ) {
|
||||
if ( from is BaseCreature creature && creature.Controlled ) {
|
||||
if ( (creature.LastDexGain + m_PetStatGainDelay) >= DateTime.UtcNow )
|
||||
return;
|
||||
}
|
||||
|
|
@ -367,7 +367,7 @@ namespace Server.Misc
|
|||
}
|
||||
case Stat.Int:
|
||||
{
|
||||
if ( @from is BaseCreature creature && creature.Controlled ) {
|
||||
if ( from is BaseCreature creature && creature.Controlled ) {
|
||||
if ( (creature.LastIntGain + m_PetStatGainDelay) >= DateTime.UtcNow )
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ namespace Server.Misc
|
|||
return;
|
||||
}
|
||||
|
||||
if ( @from is PlayerMobile pm )
|
||||
if ( from is PlayerMobile pm )
|
||||
{
|
||||
int amt = ( pm.Mounted ? 48 : 16 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue