Fixes more casting

This commit is contained in:
Kamron Batman 2018-08-19 11:04:07 +08:00
parent 61937d9c97
commit e77d695684
91 changed files with 512 additions and 908 deletions

View file

@ -58,9 +58,7 @@ namespace Server.Engines.Quests.Hag
if ( qs is WitchApprenticeQuest )
{
FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;
if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.Whiskey )
if ( qs.FindObjective( typeof( FindIngredientObjective ) ) is FindIngredientObjective obj && !obj.Completed && obj.Ingredient == Ingredient.Whiskey )
{
PlaySound( Utility.RandomBool() ? 0x42E : 0x43F );
@ -71,10 +69,7 @@ namespace Server.Engines.Quests.Hag
{
obj.Complete();
if ( obj.BlackheartMet )
qs.AddConversation( new BlackheartPirateConversation( false ) );
else
qs.AddConversation( new BlackheartPirateConversation( true ) );
qs.AddConversation( new BlackheartPirateConversation( !obj.BlackheartMet ) );
}
else if ( !obj.BlackheartMet )
{

View file

@ -138,10 +138,10 @@ namespace Server.Engines.Quests.Hag
{
item = Loot.RandomArmorOrShieldOrJewelry();
if ( item is BaseArmor )
BaseRunicTool.ApplyAttributesTo( (BaseArmor)item, 2, 20, 30 );
else if ( item is BaseJewel )
BaseRunicTool.ApplyAttributesTo( (BaseJewel)item, 2, 20, 30 );
if ( item is BaseArmor armor )
BaseRunicTool.ApplyAttributesTo( armor, 2, 20, 30 );
else if ( item is BaseJewel jewel )
BaseRunicTool.ApplyAttributesTo( jewel, 2, 20, 30 );
}
else
{