Fixes implicit ternary expressions

This commit is contained in:
Kamron Batman 2018-09-14 14:56:48 -07:00
parent c85b0a740c
commit ff26dfa375
345 changed files with 1905 additions and 2336 deletions

View file

@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Ambitious
if ( redSolen )
return from is RedSolenQueen;
else
return from is BlackSolenQueen;
return from is BlackSolenQueen;
}
public override void OnKill( BaseCreature creature, Container corpse )

View file

@ -60,8 +60,7 @@ namespace Server.Engines.Quests.Collector
int index = (int)image;
if ( index >= 0 && index < m_Table.Length )
return m_Table[index];
else
return m_Table[0];
return m_Table[0];
}
public static ImageType[] RandomList( int count )

View file

@ -75,8 +75,7 @@ namespace Server.Engines.Quests.Collector
int index = Utility.Random( m_Names.Length );
if ( m_Names[index] == null )
return from.Name;
else
return m_Names[index];
return m_Names[index];
}
private const int m_Partial = 2;

View file

@ -217,11 +217,9 @@ namespace Server.Engines.Quests.Collector
{
return true;
}
else
{
bag.Delete();
return false;
}
bag.Delete();
return false;
}
public override void Serialize( GenericWriter writer )

View file

@ -321,14 +321,12 @@ namespace Server.Engines.Quests.Collector
{
return CaptureResponse.AlreadyDone;
}
else
{
m_Done[i] = true;
CheckCompletionStatus();
m_Done[i] = true;
return CaptureResponse.Valid;
}
CheckCompletionStatus();
return CaptureResponse.Valid;
}
}

View file

@ -26,20 +26,16 @@ namespace Server.Engines.Quests
{
return true;
}
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
else
{
from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
return false;
}
}
else
{
return ret;
from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
return false;
}
return ret;
}
public override bool DropToMobile( Mobile from, Mobile target, Point3D p )
@ -52,20 +48,16 @@ namespace Server.Engines.Quests
{
return true;
}
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
else
{
from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
return false;
}
}
else
{
return ret;
from.SendLocalizedMessage( 1049344 ); // You decide against trading the item. You still need it for your quest.
return false;
}
return ret;
}
public override bool DropToItem( Mobile from, Item target, Point3D p )
@ -78,15 +70,13 @@ namespace Server.Engines.Quests
{
return true;
}
else if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
if ( !(from is PlayerMobile) || CanDrop( (PlayerMobile)from ) )
{
return true;
}
else
{
from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
return false;
}
from.SendLocalizedMessage( 1049343 ); // You can only drop quest items into the top-most level of your backpack while you still need them for your quest.
return false;
}
return ret;
}

View file

@ -178,14 +178,12 @@ namespace Server.Engines.Quests.Necro
*/
return 1062058;
}
else // from well of tears
{
/* You have arrived at the well, but no longer have the scroll
/* You have arrived at the well, but no longer have the scroll
* of calling. Use Mardoth's teleporter to return to the
* Crystal Cave and fetch another scroll from the box.
*/
return 1060129;
}
return 1060129;
}
}

View file

@ -22,25 +22,26 @@ namespace Server.Engines.Quests.Necro
qs.AddConversation( new RadarConversation() );
return true;
}
else if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
if ( qs.IsObjectiveInProgress( typeof( FindCrystalCaveObjective ) ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
else if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
if ( qs.IsObjectiveInProgress( typeof( FindCityOfLightObjective ) ) )
{
loc = new Point3D( 1091, 519, -90 );
map = Map.Malas;
return true;
}
else if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
if ( qs.IsObjectiveInProgress( typeof( ReturnToCrystalCaveObjective ) ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;
return true;
}
else if ( DarkTidesQuest.HasLostCallingScroll( player ) )
if ( DarkTidesQuest.HasLostCallingScroll( player ) )
{
loc = new Point3D( 1194, 521, -90 );
map = Map.Malas;

View file

@ -382,14 +382,12 @@ namespace Server.Engines.Quests.Necro
*/
return 1060131;
}
else
{
/* Although you were slain by the cowardly paladin,
/* Although you were slain by the cowardly paladin,
* you managed to complete the rite of calling as
* instructed. Return to Mardoth.
*/
return 1060132;
}
return 1060132;
}
}

View file

@ -64,11 +64,9 @@ namespace Server.Engines.Quests.Samurai
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Cursed Soul.
return 1063040;
}
else
{
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Young Ronin.
return 1063041;
}
// You have just gained some <a href="?ForceTopic45">Karma</a> for killing a Young Ronin.
return 1063041;
}
}
@ -119,9 +117,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063045;
}
else
{
/* It is good that you rid the land of those dishonorable Samurai.
/* It is good that you rid the land of those dishonorable Samurai.
* Perhaps they will learn a greater lesson in death.<BR><BR>
*
* I have placed a reward in your pack.<BR><BR>
@ -129,8 +126,7 @@ namespace Server.Engines.Quests.Samurai
* The second trial will test your courage. You only have to follow
* the yellow path to see what awaits you.
*/
return 1063046;
}
return 1063046;
}
}
@ -201,9 +197,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063060;
}
else
{
/* Fear remains in your eyes but you have learned that not all is
/* Fear remains in your eyes but you have learned that not all is
* what it appears to be. <BR><BR>
*
* You must have known the dragon would slay you instantly.
@ -217,8 +212,7 @@ namespace Server.Engines.Quests.Samurai
*
* The next trial will test your benevolence. You only have to walk the blue path.
*/
return 1063059;
}
return 1063059;
}
}
@ -313,9 +307,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063071;
}
else
{
/* You showed respect by helping another out while allowing the gypsy
/* You showed respect by helping another out while allowing the gypsy
* what little dignity she has left. <BR><BR>
*
* Now she will be able to feed herself and gain enough energy to walk
@ -330,8 +323,7 @@ namespace Server.Engines.Quests.Samurai
* prove yourself again. <BR><BR>Please retrieve my katana from the
* treasure room and return it to me.
*/
return 1063070;
}
return 1063070;
}
}
@ -412,9 +404,8 @@ namespace Server.Engines.Quests.Samurai
*/
return 1063077;
}
else
{
/* Thank you for returning this sword to me and leaving the remaining
/* Thank you for returning this sword to me and leaving the remaining
* treasure alone. <BR><BR>
*
* Your training is nearly complete. Before you have your final trial,
@ -422,8 +413,7 @@ namespace Server.Engines.Quests.Samurai
*
* Go into the Altar Room and light a candle for them. Afterwards, return to me.
*/
return 1063076;
}
return 1063076;
}
}

View file

@ -19,9 +19,8 @@ namespace Server.Engines.Quests.Matriarch
*/
return 1054081;
}
else
{
/* <I>The Solen Matriarch smiles as she eats the seed you offered.</I><BR><BR>
/* <I>The Solen Matriarch smiles as she eats the seed you offered.</I><BR><BR>
*
* Thank you for that seed. It was quite delicious. <BR><BR>
*
@ -29,8 +28,7 @@ namespace Server.Engines.Quests.Matriarch
* another task at the moment. Perhaps you should finish whatever is occupying
* your attention at the moment and return to me once you're done.
*/
return 1054079;
}
return 1054079;
}
}
@ -133,9 +131,8 @@ namespace Server.Engines.Quests.Matriarch
*/
return 1054097;
}
else
{
/* <I>The Solen Matriarch listens as you report the completion of your
/* <I>The Solen Matriarch listens as you report the completion of your
* tasks to her.</I><BR><BR>
*
* I give you my thanks for your help, and I will gladly make you a friend of my
@ -149,8 +146,7 @@ namespace Server.Engines.Quests.Matriarch
* I will also give you some gold for assisting me and my colony, but first let's
* take care of your zoogi fungus.
*/
return 1054096;
}
return 1054096;
}
}

View file

@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Matriarch
if ( redSolen )
return from is BlackSolenInfiltratorWarrior || from is BlackSolenInfiltratorQueen;
else
return from is RedSolenInfiltratorWarrior || from is RedSolenInfiltratorQueen;
return from is RedSolenInfiltratorWarrior || from is RedSolenInfiltratorQueen;
}
public override void OnKill( BaseCreature creature, Container corpse )

View file

@ -54,9 +54,8 @@ namespace Server.Engines.Quests.Matriarch
*/
return 1054083;
}
else
{
/* <I>The Solen Matriarch smiles happily as she eats the seed you offered.</I><BR><BR>
/* <I>The Solen Matriarch smiles happily as she eats the seed you offered.</I><BR><BR>
*
* I think you for that seed. I was quite delicious. So full of flavor.<BR><BR>
*
@ -79,8 +78,7 @@ namespace Server.Engines.Quests.Matriarch
*
* Will you accept my offer?
*/
return 1054082;
}
return 1054082;
}
}
@ -128,8 +126,7 @@ namespace Server.Engines.Quests.Matriarch
{
if ( redSolen )
return player.SolenFriendship == SolenFriendship.Red;
else
return player.SolenFriendship == SolenFriendship.Black;
return player.SolenFriendship == SolenFriendship.Black;
}
public static bool GiveRewardTo( PlayerMobile player )
@ -141,11 +138,9 @@ namespace Server.Engines.Quests.Matriarch
player.SendLocalizedMessage( 1054076 ); // You have been given some gold.
return true;
}
else
{
gold.Delete();
return false;
}
gold.Delete();
return false;
}
}
}

View file

@ -46,8 +46,7 @@ namespace Server.Engines.Quests.Naturalist
{
if ( id >= 0 && id < m_Areas.Length )
return m_Areas[id];
else
return null;
return null;
}
private bool m_Special;

View file

@ -38,8 +38,7 @@ namespace Server.Engines.Quests.Zento
{
if ( m.Quest == null )
return 3;
else
return -1;
return -1;
}
public override void OnTalk( PlayerMobile player, bool contextMenu )

View file

@ -139,16 +139,14 @@ namespace Server.Engines.Quests.Doom
foundLoc = true;
break;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
dragon.MoveToWorld( new Point3D( x, y, z ), map );
foundLoc = true;
break;
}
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
dragon.MoveToWorld( new Point3D( x, y, z ), map );
foundLoc = true;
break;
}
}

View file

@ -65,10 +65,9 @@ namespace Server.Engines.Quests.Doom
if ( fame < 1500 )
return Utility.Dice( 2, 5, -1 );
else if ( fame < 20000 )
if ( fame < 20000 )
return Utility.Dice( 2, 4, 8 );
else
return 50;
return 50;
}
public TheSummoningQuest( Victoria victoria, PlayerMobile from ) : base( from )

View file

@ -64,7 +64,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049088;
}
else if ( System.From.Profession == 2 ) // magician
if ( System.From.Profession == 2 ) // magician
{
/* <I>Uzeraan greets you as you approach...</I><BR><BR>
*
@ -95,9 +96,7 @@ namespace Server.Engines.Quests.Haven
*/
return 1049386;
}
else
{
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
/* <I>Uzeraan nods at you with approval and begins to speak...</I><BR><BR>
*
* Now that you are ready, let me give you your first task.<BR><BR>
*
@ -120,8 +119,7 @@ namespace Server.Engines.Quests.Haven
*
* Good luck young Paladin!
*/
return 1060388;
}
return 1060388;
}
}
@ -180,9 +178,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049387;
}
else
{
/* <I>You give your report to Uzeraan and after a while,
/* <I>You give your report to Uzeraan and after a while,
* he begins to speak...</I><BR><BR>
*
* Your report is grim, but all hope is not lost! It has become apparent
@ -208,8 +205,7 @@ namespace Server.Engines.Quests.Haven
* and <a href="?ForceTopic76">Healing</a> <a href="?ForceTopic74">potions</a>
* to help you out along the way. Good luck.
*/
return 1049119;
}
return 1049119;
}
}
@ -265,9 +261,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1060749;
}
else
{
/* <I>Schmendrick barely pays you any attention as you approach him. His
/* <I>Schmendrick barely pays you any attention as you approach him. His
* mind seems to be occupied with something else. You explain to him that
* you came for the scroll of power and after a long while he begins to speak,
* but apparently still not giving you his full attention...</I><BR><BR>
@ -284,8 +279,7 @@ namespace Server.Engines.Quests.Haven
* <I>Schmendrick goes back to his work and you seem to completely fade from his
* awareness...
*/
return 1049322;
}
return 1049322;
}
}
@ -370,9 +364,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049388;
}
else
{
/* <I>Uzeraan takes the dirt from you and smiles...<BR><BR></I>
/* <I>Uzeraan takes the dirt from you and smiles...<BR><BR></I>
*
* Wonderful! I knew I could count on you. As a token of my appreciation
* I've given you a bag with some bandages as well as some healing potions.
@ -392,8 +385,7 @@ namespace Server.Engines.Quests.Haven
*
* Good luck!
*/
return 1049329;
}
return 1049329;
}
}
@ -440,9 +432,8 @@ namespace Server.Engines.Quests.Haven
+ "<BR>"
+ "Return here when you have found a <I>Daemon Bone</I>.";
}
else
{
/* <I>You hand Uzeraan the Vial of Blood, which he hastily accepts...</I><BR><BR>
/* <I>You hand Uzeraan the Vial of Blood, which he hastily accepts...</I><BR><BR>
*
* Excellent work! Only one reagent remains and the spell is complete!
* The final requirement is a <I>Daemon Bone</I>, which will not be as easily
@ -459,8 +450,7 @@ namespace Server.Engines.Quests.Haven
*
* Return here when you have found a <I>Daemon Bone</I>.
*/
return 1049333;
}
return 1049333;
}
}
@ -479,8 +469,7 @@ namespace Server.Engines.Quests.Haven
{
if ( System.From.Profession == 5 ) // paladin
return m_InfoPaladin;
else
return m_Info;
return m_Info;
}
}
@ -550,9 +539,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049377;
}
else
{
/* You've lost the scroll? Argh! I will have to try and re-construct
/* You've lost the scroll? Argh! I will have to try and re-construct
* the scroll from memory. Bring me a blank scroll, which you can
* <a href = "?ForceTopic33">purchase from the mage shop</a> just
* <a href = "?ForceTopic13">East</a> of Uzeraan's mansion in Haven.<BR><BR>
@ -561,8 +549,7 @@ namespace Server.Engines.Quests.Haven
*
* When you return, be sure to hand me the scroll (drag and drop).
*/
return 1049345;
}
return 1049345;
}
}
@ -609,9 +596,8 @@ namespace Server.Engines.Quests.Haven
*/
return 1049374;
}
else
{
/* You've lost the dirt I gave you?<BR><BR>
/* You've lost the dirt I gave you?<BR><BR>
*
* My, my, my... What ever shall we do now?<BR><BR>
*
@ -628,8 +614,7 @@ namespace Server.Engines.Quests.Haven
*
* Good luck.<BR><BR>
*/
return 1049359;
}
return 1049359;
}
}

View file

@ -23,22 +23,23 @@ namespace Server.Engines.Quests.Haven
map = Map.Trammel;
return true;
}
else if ( qs.IsObjectiveInProgress( typeof( FindDryadObjective ) )
|| UzeraanTurmoilQuest.HasLostFertileDirt( player ) )
if ( qs.IsObjectiveInProgress( typeof( FindDryadObjective ) )
|| UzeraanTurmoilQuest.HasLostFertileDirt( player ) )
{
loc = new Point3D( 3557, 2690, 2 );
map = Map.Trammel;
return true;
}
else if ( player.Profession != 5 // paladin
&& ( qs.IsObjectiveInProgress( typeof( GetDaemonBoneObjective ) )
|| UzeraanTurmoilQuest.HasLostDaemonBone( player ) ) )
if ( player.Profession != 5 // paladin
&& ( qs.IsObjectiveInProgress( typeof( GetDaemonBoneObjective ) )
|| UzeraanTurmoilQuest.HasLostDaemonBone( player ) ) )
{
loc = new Point3D( 3422, 2653, 48 );
map = Map.Trammel;
return true;
}
else if ( qs.IsObjectiveInProgress( typeof( CashBankCheckObjective ) ) )
if ( qs.IsObjectiveInProgress( typeof( CashBankCheckObjective ) ) )
{
loc = new Point3D( 3624, 2610, 0 );
map = Map.Trammel;

View file

@ -97,12 +97,10 @@ namespace Server.Engines.Quests.Haven
from.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory.
return false;
}
else
{
dropped.Consume();
from.SendLocalizedMessage( 1049346 ); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product.
return dropped.Deleted;
}
dropped.Consume();
from.SendLocalizedMessage( 1049346 ); // Schmendrick scribbles on the scroll for a few moments and hands you the finished product.
return dropped.Deleted;
}
return base.OnDragDrop( from, dropped );

View file

@ -119,10 +119,8 @@ namespace Server.Engines.Quests.Haven
default: return 5;
}
}
else
{
return 5;
}
return 5;
}
}
@ -132,8 +130,7 @@ namespace Server.Engines.Quests.Haven
{
if ( m_Step == KillHordeMinionsStep.LearnKarma && HasBeenRead )
return true;
else
return base.Completed;
return base.Completed;
}
}
@ -414,14 +411,12 @@ namespace Server.Engines.Quests.Haven
*/
return 1060755;
}
else
{
/* Use Uzeraan's teleporter to get to the Haunted graveyard.<BR><BR>
/* Use Uzeraan's teleporter to get to the Haunted graveyard.<BR><BR>
*
* Slay the undead until you find a <I>Daemon Bone</I>.
*/
return 1049362;
}
return 1049362;
}
}

View file

@ -193,9 +193,8 @@ namespace Server.Engines.Quests.Hag
*/
return 1055059;
}
else
{
/* <I>Captain Blackheart looks up from polishing his cutlass, glaring at
/* <I>Captain Blackheart looks up from polishing his cutlass, glaring at
* you with red-rimmed eyes.</I><BR><BR>
*
* Well, well. Lookit the wee little deck swabby. Aren't ye a cute lil'
@ -215,14 +214,12 @@ namespace Server.Engines.Quests.Hag
* <I>The drunken pirate captain leans back in his chair, taking another gulp of
* his drink before he starts in on another bawdy pirate song.</I>
*/
return 1055057;
}
return 1055057;
}
else
if ( m_Drunken )
{
if ( m_Drunken )
{
/* <I>The inebriated pirate looks up at you with a wry grin.</I><BR><BR>
/* <I>The inebriated pirate looks up at you with a wry grin.</I><BR><BR>
*
* Well hello again, me little matey. I see ye have a belly full of rotgut
* in ye. I bet ye think you're a right hero, ready te face the world. But
@ -238,11 +235,10 @@ namespace Server.Engines.Quests.Hag
* <I>Captain Blackheart shoves you aside, banging his cutlass against the
* table as he calls to the waitress for another round.</I>
*/
return 1055056;
}
else
{
/* <I>Captain Blackheart looks up from his drink, almost tipping over
return 1055056;
}
/* <I>Captain Blackheart looks up from his drink, almost tipping over
* his chair as he looks you up and down.</I><BR><BR>
*
* You again? I thought I told ye te get lost? Go on with ye! Ye ain't
@ -255,9 +251,7 @@ namespace Server.Engines.Quests.Hag
* <I>The inebriated pirate bolts back another mug of ale and brushes you
* off with a wave of his hand.</I>
*/
return 1055058;
}
}
return 1055058;
}
}
@ -319,9 +313,8 @@ namespace Server.Engines.Quests.Hag
*/
return 1055054;
}
else
{
/* <I>The drunken pirate, Captain Blackheart, looks up from his bottle
/* <I>The drunken pirate, Captain Blackheart, looks up from his bottle
* of whiskey with a pleased expression.</I><BR><BR>
*
* Well looky here! I didn't think a landlubber like yourself had the pirate
@ -341,8 +334,7 @@ namespace Server.Engines.Quests.Hag
* <I>Captain Blackheart hands you a jug of his famous Whiskey. You think it best
* to return it to the Hag, rather than drink any of the noxious swill.</I>
*/
return 1055011;
}
return 1055011;
}
}

View file

@ -63,8 +63,7 @@ namespace Server.Engines.Quests.Hag
if ( index >= 0 && index < m_Table.Length )
return m_Table[index];
else
return m_Table[0];
return m_Table[0];
}
public static Ingredient RandomIngredient( Ingredient[] oldIngredients )

View file

@ -297,15 +297,13 @@ namespace Server.Engines.Quests.Hag
return 1055045;
}
}
else
{
/* You are still attempting to obtain a jug of Captain Blackheart's
/* You are still attempting to obtain a jug of Captain Blackheart's
* Whiskey, but the drunkard Captain refuses to share his unique brew.
* You must prove your worthiness as a pirate to Blackheart before he'll
* offer you a jug.
*/
return 1055055;
}
return 1055055;
}
}