Fixes more casting and other formatting issues.
This commit is contained in:
parent
03dd5f1926
commit
61937d9c97
67 changed files with 325 additions and 570 deletions
|
|
@ -27,12 +27,10 @@ namespace Server.Engines.MLQuests.Items
|
|||
return;
|
||||
}
|
||||
|
||||
MLQuestContext context;
|
||||
|
||||
if ( from is PlayerMobile && ( context = MLQuestSystem.GetContext( (PlayerMobile)from ) ) != null && context.BedlamAccess )
|
||||
if ( from is PlayerMobile mobile && MLQuestSystem.GetContext( mobile )?.BedlamAccess == true )
|
||||
{
|
||||
BaseCreature.TeleportPets( from, PointDest, MapDest );
|
||||
from.MoveToWorld( PointDest, MapDest );
|
||||
BaseCreature.TeleportPets( mobile, PointDest, MapDest );
|
||||
mobile.MoveToWorld( PointDest, MapDest );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,16 +24,12 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if ( pm == null || pm.Backpack == null )
|
||||
if ( !(from is PlayerMobile pm) || pm.Backpack == null )
|
||||
return;
|
||||
|
||||
if ( pm.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
MLQuestContext context = MLQuestSystem.GetContext( pm );
|
||||
|
||||
if ( context != null && context.IsDoingQuest( typeof( UnfadingMemoriesPartOne ) ) && pm.Backpack.FindItemByType( typeof( PrismaticAmber ), false ) == null )
|
||||
if ( MLQuestSystem.GetContext( pm )?.IsDoingQuest( typeof( UnfadingMemoriesPartOne ) ) == true && pm.Backpack.FindItemByType( typeof( PrismaticAmber ), false ) == null )
|
||||
{
|
||||
Item amber = new PrismaticAmber();
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ namespace Server.Engines.MLQuests.Items
|
|||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
else if ( !IsChildOf( from.Backpack ) )
|
||||
from.SendLocalizedMessage( 1042593 ); // That is not in your backpack.
|
||||
else if ( MLQuestSystem.Enabled && CanGiveMLQuest && from is PlayerMobile )
|
||||
MLQuestSystem.OnDoubleClick( this, (PlayerMobile)from );
|
||||
else if ( MLQuestSystem.Enabled && CanGiveMLQuest && from is PlayerMobile mobile )
|
||||
MLQuestSystem.OnDoubleClick( this, mobile );
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -133,8 +133,8 @@ namespace Server.Engines.MLQuests.Items
|
|||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
else if ( !IsChildOf( from.Backpack ) )
|
||||
from.SendLocalizedMessage( 1042593 ); // That is not in your backpack.
|
||||
else if ( MLQuestSystem.Enabled && CanGiveMLQuest && from is PlayerMobile )
|
||||
MLQuestSystem.OnDoubleClick( this, (PlayerMobile)from );
|
||||
else if ( MLQuestSystem.Enabled && CanGiveMLQuest && from is PlayerMobile mobile )
|
||||
MLQuestSystem.OnDoubleClick( this, mobile );
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
|
|||
|
|
@ -43,14 +43,18 @@ namespace Server.Engines.MLQuests.Items
|
|||
|
||||
public static void Enhance( Item loot )
|
||||
{
|
||||
if ( loot is BaseWeapon )
|
||||
BaseRunicTool.ApplyAttributesTo( (BaseWeapon)loot, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
else if ( loot is BaseArmor )
|
||||
BaseRunicTool.ApplyAttributesTo( (BaseArmor)loot, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
else if ( loot is BaseShield )
|
||||
BaseRunicTool.ApplyAttributesTo( (BaseShield)loot, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
else if ( loot is BaseJewel )
|
||||
BaseRunicTool.ApplyAttributesTo( (BaseJewel)loot, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
switch (loot)
|
||||
{
|
||||
case BaseWeapon weapon:
|
||||
BaseRunicTool.ApplyAttributesTo( weapon, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
break;
|
||||
case BaseArmor armor:
|
||||
BaseRunicTool.ApplyAttributesTo( armor, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
break;
|
||||
default:
|
||||
BaseRunicTool.ApplyAttributesTo((BaseJewel)loot, Utility.RandomMinMax( 1, 5 ), 10, 80 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,23 +51,19 @@ namespace Server.Engines.MLQuests.Items
|
|||
if (!base.CanTeleport(m))
|
||||
return false;
|
||||
|
||||
if (m_QuestType != null)
|
||||
{
|
||||
PlayerMobile pm = m as PlayerMobile;
|
||||
if (m_QuestType == null)
|
||||
return true;
|
||||
if (!(m is PlayerMobile pm))
|
||||
return false;
|
||||
|
||||
if (pm == null)
|
||||
return false;
|
||||
MLQuestContext context = MLQuestSystem.GetContext(pm);
|
||||
|
||||
MLQuestContext context = MLQuestSystem.GetContext(pm);
|
||||
if (context?.IsDoingQuest(m_QuestType) == true || context?.HasDoneQuest(m_QuestType) == true)
|
||||
return true;
|
||||
|
||||
if (context == null || (!context.IsDoingQuest(m_QuestType) && !context.HasDoneQuest(m_QuestType)))
|
||||
{
|
||||
TextDefinition.SendMessageTo(m, m_Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
TextDefinition.SendMessageTo(m, m_Message);
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
|
|
@ -169,7 +165,7 @@ namespace Server.Engines.MLQuests.Items
|
|||
{
|
||||
foreach (Item item in m.Items) // Check paperdoll
|
||||
{
|
||||
if (m_TicketType.IsAssignableFrom(item.GetType()))
|
||||
if (m_TicketType.IsInstanceOfType(item))
|
||||
{
|
||||
ticket = item;
|
||||
break;
|
||||
|
|
@ -183,8 +179,7 @@ namespace Server.Engines.MLQuests.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ticket is ITicket)
|
||||
((ITicket)ticket).OnTicketUsed(m);
|
||||
(ticket as ITicket)?.OnTicketUsed(m);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue