Code cleanup (#195)
This commit is contained in:
parent
b476bcfd24
commit
0926b5abaa
86 changed files with 740 additions and 1635 deletions
|
|
@ -179,10 +179,7 @@ namespace Server.Engines.Chat
|
|||
}
|
||||
}
|
||||
|
||||
password = password?.Trim();
|
||||
|
||||
if (password?.Length == 0)
|
||||
password = null;
|
||||
password = password?.Trim().IsNullOrDefault(null);
|
||||
|
||||
Channel joined = Channel.FindChannelByName(name);
|
||||
|
||||
|
|
@ -216,10 +213,7 @@ namespace Server.Engines.Chat
|
|||
name = param;
|
||||
}
|
||||
|
||||
password = password?.Trim();
|
||||
|
||||
if (password?.Length == 0)
|
||||
password = null;
|
||||
password = password?.Trim().IsNullOrDefault(null);
|
||||
|
||||
Channel.AddChannel(name, password).AddUser(from, password);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,13 +96,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public Tournament Tournament => m_Tournament;
|
||||
|
||||
private bool CantDoAnything(Mobile mob)
|
||||
{
|
||||
if (m_EventGame != null)
|
||||
return m_EventGame.CantDoAnything(mob);
|
||||
|
||||
return false;
|
||||
}
|
||||
private bool CantDoAnything(Mobile mob) => m_EventGame?.CantDoAnything(mob) == true;
|
||||
|
||||
public static bool IsFreeConsume(Mobile mob)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -215,14 +215,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
int zdiff = myLoc.Z - m.Z;
|
||||
|
||||
if (zdiff < 0)
|
||||
return false;
|
||||
if (zdiff < 12)
|
||||
return true;
|
||||
if (zdiff < 16)
|
||||
return Utility.RandomBool(); // 50% chance
|
||||
|
||||
return false;
|
||||
return zdiff >= 0 && (zdiff < 12 || zdiff < 16 && Utility.RandomBool());
|
||||
}
|
||||
|
||||
private void DoAnim(Point3D start, Point3D end, Map map)
|
||||
|
|
@ -1648,12 +1641,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
for (int i = 0; i < teams.Count; ++i)
|
||||
{
|
||||
TrophyRank rank = TrophyRank.Bronze;
|
||||
|
||||
if (i == 0)
|
||||
rank = TrophyRank.Gold;
|
||||
else if (i == 1)
|
||||
rank = TrophyRank.Silver;
|
||||
TrophyRank rank = i switch
|
||||
{
|
||||
0 => TrophyRank.Gold,
|
||||
1 => TrophyRank.Silver,
|
||||
_ => TrophyRank.Bronze
|
||||
};
|
||||
|
||||
BRPlayerInfo leader = teams[i].Leader;
|
||||
|
||||
|
|
@ -1747,7 +1740,8 @@ namespace Server.Engines.ConPVP
|
|||
p.Players[j].Eliminated = true;
|
||||
}
|
||||
|
||||
m_Context.Finish(m_Context.Participants[winner.TeamID]);
|
||||
if (winner != null)
|
||||
m_Context.Finish(m_Context.Participants[winner.TeamID]);
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
|
|
|
|||
|
|
@ -170,10 +170,8 @@ namespace Server.Engines.ConPVP
|
|||
return 50;
|
||||
if (xp >= 2500)
|
||||
return 10 + (xp - 2500) / 500;
|
||||
if (xp < 0)
|
||||
xp = 0;
|
||||
|
||||
return m_ShortLevels[xp / 100];
|
||||
return m_ShortLevels[Math.Max(xp, 0) / 100];
|
||||
}
|
||||
|
||||
public static void GetLevelInfo(int level, out int xpBase, out int xpAdvance)
|
||||
|
|
|
|||
|
|
@ -78,10 +78,7 @@ namespace Server.Engines.ConPVP
|
|||
sb.Append(mob.Name);
|
||||
}
|
||||
|
||||
if (sb.Length == 0)
|
||||
return "Empty";
|
||||
|
||||
return sb.ToString();
|
||||
return sb.Length == 0 ? "Empty" : sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,24 +149,14 @@ namespace Server.Engines.ConPVP
|
|||
public int ParticipantsPerMatch
|
||||
{
|
||||
get => m_ParticipantsPerMatch;
|
||||
set
|
||||
{
|
||||
if (value < 2) value = 2;
|
||||
else if (value > 10) value = 10;
|
||||
m_ParticipantsPerMatch = value;
|
||||
}
|
||||
set => m_ParticipantsPerMatch = Math.Clamp(value, 2, 10);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int PlayersPerParticipant
|
||||
{
|
||||
get => m_PlayersPerParticipant;
|
||||
set
|
||||
{
|
||||
if (value < 1) value = 1;
|
||||
else if (value > 10) value = 10;
|
||||
m_PlayersPerParticipant = value;
|
||||
}
|
||||
set => m_PlayersPerParticipant = Math.Clamp(value, 1, 10);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
|
|
|
|||
|
|
@ -74,10 +74,7 @@ namespace Server.Engines.ConPVP
|
|||
sb.Append(mob.Name);
|
||||
}
|
||||
|
||||
if (sb.Length == 0)
|
||||
return "Empty";
|
||||
|
||||
return sb.ToString();
|
||||
return sb.Length == 0 ? "Empty" : sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,4 +100,4 @@ namespace Server.Engines.ConPVP
|
|||
AddLog("Match lost.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,10 +137,7 @@ namespace Server.Engines.Craft
|
|||
for (int i = 0; i < m_CraftItem.Skills.Count; i++)
|
||||
{
|
||||
CraftSkill skill = m_CraftItem.Skills[i];
|
||||
double minSkill = skill.MinSkill;
|
||||
|
||||
if (minSkill < 0)
|
||||
minSkill = 0;
|
||||
double minSkill = Math.Max(skill.MinSkill, 0);
|
||||
|
||||
AddHtmlLocalized(170, 132 + i * 20, 200, 18, AosSkillBonuses.GetLabel(skill.SkillToMake), LabelColor);
|
||||
AddLabel(430, 132 + i * 20, LabelHue, $"{minSkill:F1}");
|
||||
|
|
@ -156,25 +153,16 @@ namespace Server.Engines.Craft
|
|||
|
||||
double chance = m_CraftItem.GetSuccessChance(m_From, resIndex > -1 ? res.GetAt(resIndex).ItemType : null,
|
||||
m_CraftSystem, false, out _);
|
||||
double excepChance = m_CraftItem.GetExceptionalChance(m_CraftSystem, chance, m_From);
|
||||
|
||||
if (chance < 0.0)
|
||||
chance = 0.0;
|
||||
else if (chance > 1.0)
|
||||
chance = 1.0;
|
||||
|
||||
AddHtmlLocalized(170, 80, 250, 18, 1044057, LabelColor); // Success Chance:
|
||||
AddLabel(430, 80, LabelHue, $"{chance * 100:F1}%");
|
||||
AddLabel(430, 80, LabelHue, $"{Math.Clamp(chance, 0, 1) * 100:F1}%");
|
||||
|
||||
if (m_ShowExceptionalChance)
|
||||
{
|
||||
if (excepChance < 0.0)
|
||||
excepChance = 0.0;
|
||||
else if (excepChance > 1.0)
|
||||
excepChance = 1.0;
|
||||
double exceptChance = Math.Clamp(m_CraftItem.GetExceptionalChance(m_CraftSystem, chance, m_From), 0, 1.0);
|
||||
|
||||
AddHtmlLocalized(170, 100, 250, 18, 1044058, 32767); // Exceptional Chance:
|
||||
AddLabel(430, 100, LabelHue, $"{excepChance * 100:F1}%");
|
||||
AddLabel(430, 100, LabelHue, $"{exceptChance * 100:F1}%");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -647,23 +647,11 @@ namespace Server.Engines.Craft
|
|||
chance = chance * 0.5 - 0.1;
|
||||
break;
|
||||
case CraftECA.ChanceMinusSixtyToFourtyFive:
|
||||
{
|
||||
double offset = 0.60 - (from.Skills[system.MainSkill].Value - 95.0) * 0.03;
|
||||
|
||||
if (offset < 0.45)
|
||||
offset = 0.45;
|
||||
else if (offset > 0.60)
|
||||
offset = 0.60;
|
||||
|
||||
chance -= offset;
|
||||
break;
|
||||
}
|
||||
chance -= Math.Clamp(0.60 - (from.Skills[system.MainSkill].Value - 95.0) * 0.03, 0.45, 0.60);
|
||||
break;
|
||||
}
|
||||
|
||||
if (chance > 0)
|
||||
return chance + bonus;
|
||||
|
||||
return chance;
|
||||
return chance > 0 ? chance + bonus : chance;
|
||||
}
|
||||
|
||||
public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality,
|
||||
|
|
|
|||
|
|
@ -254,12 +254,7 @@ namespace Server.Engines.Doom
|
|||
if (playerCount == 0 && Region != null)
|
||||
playerCount = Region.GetPlayerCount();
|
||||
|
||||
int count = (playerCount + PlayersPerSpawn - 1) / PlayersPerSpawn;
|
||||
|
||||
if (count < 1)
|
||||
count = 1;
|
||||
|
||||
return count;
|
||||
return Math.Max((playerCount + PlayersPerSpawn - 1) / PlayersPerSpawn, 1);
|
||||
}
|
||||
|
||||
public virtual void ClearCreatures()
|
||||
|
|
|
|||
|
|
@ -138,8 +138,7 @@ namespace Server.Factions
|
|||
2 => "You are bold, {0}, for one of the meager {1}. Leave now, lest you be taught the taste of dirt.",
|
||||
3 => "Your presence here is an insult, {0}. Be gone now, knave.",
|
||||
4 => "Dost thou wish to be hung by your toes, {0}? Nay? Then come no closer.",
|
||||
5 => "Hey, {0}. Yeah, you. Get out of here before I beat you with a stick.",
|
||||
_ => null
|
||||
_ => "Hey, {0}. Yeah, you. Get out of here before I beat you with a stick." // 5
|
||||
};
|
||||
|
||||
Faction faction = Faction.Find(m);
|
||||
|
|
@ -177,8 +176,7 @@ namespace Server.Factions
|
|||
{
|
||||
ReactionType.Ignore => faction.Definition.GuardIgnore,
|
||||
ReactionType.Warn => faction.Definition.GuardWarn,
|
||||
ReactionType.Attack => faction.Definition.GuardAttack,
|
||||
_ => null
|
||||
_ => faction.Definition.GuardAttack // ReactionType.Attack
|
||||
};
|
||||
|
||||
if (def != null && def.Number > 0)
|
||||
|
|
|
|||
|
|
@ -206,14 +206,11 @@ namespace Server.Factions
|
|||
|
||||
public Spell RandomOffenseSpell()
|
||||
{
|
||||
int maxCircle = (int)((m_Guard.Skills.Magery.Value + 20.0) / (100.0 / 7.0));
|
||||
|
||||
if (maxCircle < 1)
|
||||
maxCircle = 1;
|
||||
int maxCircle = Math.Max((int)((m_Guard.Skills.Magery.Value + 20.0) / (100.0 / 7.0)), 1);
|
||||
|
||||
return Utility.Random(maxCircle * 2) switch
|
||||
{
|
||||
0 => (Spell)new MagicArrowSpell(m_Guard),
|
||||
0 => new MagicArrowSpell(m_Guard),
|
||||
1 => new MagicArrowSpell(m_Guard),
|
||||
2 => new HarmSpell(m_Guard),
|
||||
3 => new HarmSpell(m_Guard),
|
||||
|
|
|
|||
|
|
@ -128,11 +128,11 @@ namespace Server.Engines.MLQuests.Items
|
|||
case 1:
|
||||
AddRecipe(DefAlchemy.CraftSystem);
|
||||
break;
|
||||
// TODO
|
||||
// case 2: AddNonArtifactRecipe( DefTailoring.CraftSystem ); break;
|
||||
// case 3: AddNonArtifactRecipe( DefBlacksmithy.CraftSystem ); break;
|
||||
// case 4: AddNonArtifactRecipe( DefCarpentry.CraftSystem ); break;
|
||||
// case 5: AddNonArtifactRecipe( DefBowFletching.CraftSystem ); break;
|
||||
// TODO
|
||||
// case 2: AddNonArtifactRecipe( DefTailoring.CraftSystem ); break;
|
||||
// case 3: AddNonArtifactRecipe( DefBlacksmithy.CraftSystem ); break;
|
||||
// case 4: AddNonArtifactRecipe( DefCarpentry.CraftSystem ); break;
|
||||
// case 5: AddNonArtifactRecipe( DefBowFletching.CraftSystem ); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -221,4 +221,4 @@ namespace Server.Engines.MLQuests.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,39 +8,21 @@
|
|||
Hue = Utility.RandomBrightHue();
|
||||
DropItem(new TinkerTools());
|
||||
|
||||
switch (Utility.Random(10))
|
||||
{
|
||||
case 0:
|
||||
DropItem(new Springs(3));
|
||||
break;
|
||||
case 1:
|
||||
DropItem(new Axle(3));
|
||||
break;
|
||||
case 2:
|
||||
DropItem(new Hinge(3));
|
||||
break;
|
||||
case 3:
|
||||
DropItem(new Key());
|
||||
break;
|
||||
case 4:
|
||||
DropItem(new Scissors());
|
||||
break;
|
||||
case 5:
|
||||
DropItem(new BarrelTap(3));
|
||||
break;
|
||||
case 6:
|
||||
DropItem(new BarrelHoops());
|
||||
break;
|
||||
case 7:
|
||||
DropItem(new Gears(3));
|
||||
break;
|
||||
case 8:
|
||||
DropItem(new Lockpick(3));
|
||||
break;
|
||||
case 9:
|
||||
DropItem(new ClockFrame(3));
|
||||
break;
|
||||
}
|
||||
DropItem(
|
||||
Utility.Random(10) switch
|
||||
{
|
||||
0 => new Springs(3),
|
||||
1 => new Axle(3),
|
||||
2 => new Hinge(3),
|
||||
3 => new Key(),
|
||||
4 => new Scissors(),
|
||||
5 => new BarrelTap(3),
|
||||
6 => new BarrelHoops(),
|
||||
7 => new Gears(3),
|
||||
8 => new Lockpick(3),
|
||||
_ => new ClockFrame(3) // 9
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public NibbetSatchel(Serial serial)
|
||||
|
|
@ -62,4 +44,4 @@
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ namespace Server.Engines.MLQuests.Items
|
|||
1 => Loot.RandomArmor(false, true),
|
||||
2 => Loot.RandomRangedWeapon(false, true),
|
||||
3 => Loot.RandomJewelry(),
|
||||
4 => Loot.RandomHat(false),
|
||||
_ => null
|
||||
_ => Loot.RandomHat(false) // 4
|
||||
};
|
||||
|
||||
if (loot == null)
|
||||
|
|
@ -189,4 +188,4 @@ namespace Server.Engines.MLQuests.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,13 +113,7 @@ namespace Server.Engines.Plants
|
|||
get => m_Water;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_Water = 0;
|
||||
else if (value > 4)
|
||||
m_Water = 4;
|
||||
else
|
||||
m_Water = value;
|
||||
|
||||
m_Water = Math.Clamp(value, 0, 4);
|
||||
Plant.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -132,12 +126,7 @@ namespace Server.Engines.Plants
|
|||
if (m_Hits == value)
|
||||
return;
|
||||
|
||||
if (value < 0)
|
||||
m_Hits = 0;
|
||||
else if (value > MaxHits)
|
||||
m_Hits = MaxHits;
|
||||
else
|
||||
m_Hits = value;
|
||||
m_Hits = Math.Clamp(value, 0, MaxHits);
|
||||
|
||||
if (m_Hits == 0)
|
||||
Plant.Die();
|
||||
|
|
@ -158,66 +147,32 @@ namespace Server.Engines.Plants
|
|||
return PlantHealth.Dying;
|
||||
if (perc < 66)
|
||||
return PlantHealth.Wilted;
|
||||
if (perc < 100)
|
||||
return PlantHealth.Healthy;
|
||||
return PlantHealth.Vibrant;
|
||||
return perc < 100 ? PlantHealth.Healthy : PlantHealth.Vibrant;
|
||||
}
|
||||
}
|
||||
|
||||
public int Infestation
|
||||
{
|
||||
get => m_Infestation;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_Infestation = 0;
|
||||
else if (value > 2)
|
||||
m_Infestation = 2;
|
||||
else
|
||||
m_Infestation = value;
|
||||
}
|
||||
set => m_Infestation = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public int Fungus
|
||||
{
|
||||
get => m_Fungus;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_Fungus = 0;
|
||||
else if (value > 2)
|
||||
m_Fungus = 2;
|
||||
else
|
||||
m_Fungus = value;
|
||||
}
|
||||
set => m_Fungus = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public int Poison
|
||||
{
|
||||
get => m_Poison;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_Poison = 0;
|
||||
else if (value > 2)
|
||||
m_Poison = 2;
|
||||
else
|
||||
m_Poison = value;
|
||||
}
|
||||
set => m_Poison = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public int Disease
|
||||
{
|
||||
get => m_Disease;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_Disease = 0;
|
||||
else if (value > 2)
|
||||
m_Disease = 2;
|
||||
else
|
||||
m_Disease = value;
|
||||
}
|
||||
set => m_Disease = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public bool IsFullPoisonPotion => m_PoisonPotion >= 2;
|
||||
|
|
@ -225,15 +180,7 @@ namespace Server.Engines.Plants
|
|||
public int PoisonPotion
|
||||
{
|
||||
get => m_PoisonPotion;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_PoisonPotion = 0;
|
||||
else if (value > 2)
|
||||
m_PoisonPotion = 2;
|
||||
else
|
||||
m_PoisonPotion = value;
|
||||
}
|
||||
set => m_PoisonPotion = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public bool IsFullCurePotion => m_CurePotion >= 2;
|
||||
|
|
@ -241,15 +188,7 @@ namespace Server.Engines.Plants
|
|||
public int CurePotion
|
||||
{
|
||||
get => m_CurePotion;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_CurePotion = 0;
|
||||
else if (value > 2)
|
||||
m_CurePotion = 2;
|
||||
else
|
||||
m_CurePotion = value;
|
||||
}
|
||||
set => m_CurePotion = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public bool IsFullHealPotion => m_HealPotion >= 2;
|
||||
|
|
@ -257,15 +196,7 @@ namespace Server.Engines.Plants
|
|||
public int HealPotion
|
||||
{
|
||||
get => m_HealPotion;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_HealPotion = 0;
|
||||
else if (value > 2)
|
||||
m_HealPotion = 2;
|
||||
else
|
||||
m_HealPotion = value;
|
||||
}
|
||||
set => m_HealPotion = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public bool IsFullStrengthPotion => m_StrengthPotion >= 2;
|
||||
|
|
@ -273,15 +204,7 @@ namespace Server.Engines.Plants
|
|||
public int StrengthPotion
|
||||
{
|
||||
get => m_StrengthPotion;
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
m_StrengthPotion = 0;
|
||||
else if (value > 2)
|
||||
m_StrengthPotion = 2;
|
||||
else
|
||||
m_StrengthPotion = value;
|
||||
}
|
||||
set => m_StrengthPotion = Math.Clamp(value, 0, 2);
|
||||
}
|
||||
|
||||
public bool HasMaladies => Infestation > 0 || Fungus > 0 || Poison > 0 || Disease > 0 || Water != 2;
|
||||
|
|
@ -292,23 +215,13 @@ namespace Server.Engines.Plants
|
|||
|
||||
public PlantType SeedType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Pollinated)
|
||||
return m_SeedType;
|
||||
return Plant.PlantType;
|
||||
}
|
||||
get => Pollinated ? m_SeedType : Plant.PlantType;
|
||||
set => m_SeedType = value;
|
||||
}
|
||||
|
||||
public PlantHue SeedHue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Pollinated)
|
||||
return m_SeedHue;
|
||||
return Plant.PlantHue;
|
||||
}
|
||||
get => Pollinated ? m_SeedHue : Plant.PlantHue;
|
||||
set => m_SeedHue = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ namespace Server.Engines.Quests
|
|||
return false;
|
||||
}
|
||||
|
||||
doneQuests.RemoveAt(i--);
|
||||
doneQuests.RemoveAt(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -444,18 +444,7 @@ namespace Server.Engines.Quests
|
|||
if (Utility.RandomBool())
|
||||
who.Animate(17, 7, 1, true, false, 0);
|
||||
else
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
who.Animate(32, 7, 1, true, false, 0);
|
||||
break;
|
||||
case 1:
|
||||
who.Animate(33, 7, 1, true, false, 0);
|
||||
break;
|
||||
case 2:
|
||||
who.Animate(34, 7, 1, true, false, 0);
|
||||
break;
|
||||
}
|
||||
who.Animate(32 + Utility.Random(3), 7, 1, true, false, 0);
|
||||
|
||||
who.Direction = who.GetDirectionTo(to);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,18 +27,14 @@ namespace Server.Engines.Quests.Ninja
|
|||
Items[i].Delete();
|
||||
|
||||
for (int i = 0; i < 75; i++)
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
DropItem(new GoldBracelet());
|
||||
break;
|
||||
case 1:
|
||||
DropItem(new GoldRing());
|
||||
break;
|
||||
case 2:
|
||||
DropItem(Loot.RandomGem());
|
||||
break;
|
||||
}
|
||||
DropItem(
|
||||
Utility.Random(10) switch
|
||||
{
|
||||
0 => new GoldBracelet(),
|
||||
1 => new GoldRing(),
|
||||
_ => Loot.RandomGem() // 2
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
@ -133,4 +129,4 @@ namespace Server.Engines.Quests.Ninja
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,18 +27,14 @@ namespace Server.Engines.Quests.Samurai
|
|||
Items[i].Delete();
|
||||
|
||||
for (int i = 0; i < 75; i++)
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
DropItem(new GoldBracelet());
|
||||
break;
|
||||
case 1:
|
||||
DropItem(new GoldRing());
|
||||
break;
|
||||
case 2:
|
||||
DropItem(Loot.RandomGem());
|
||||
break;
|
||||
}
|
||||
DropItem(
|
||||
Utility.Random(10) switch
|
||||
{
|
||||
0 => new GoldBracelet(),
|
||||
1 => new GoldRing(),
|
||||
_ => Loot.RandomGem() // 2
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) => false;
|
||||
|
|
|
|||
|
|
@ -31,39 +31,18 @@ namespace Server.Engines.Quests.Samurai
|
|||
Fame = 200;
|
||||
Karma = -200;
|
||||
|
||||
switch (Utility.Random(10))
|
||||
{
|
||||
case 0:
|
||||
PackItem(new LeftArm());
|
||||
break;
|
||||
case 1:
|
||||
PackItem(new RightArm());
|
||||
break;
|
||||
case 2:
|
||||
PackItem(new Torso());
|
||||
break;
|
||||
case 3:
|
||||
PackItem(new Bone());
|
||||
break;
|
||||
case 4:
|
||||
PackItem(new RibCage());
|
||||
break;
|
||||
case 5:
|
||||
PackItem(new RibCage());
|
||||
break;
|
||||
case 6:
|
||||
PackItem(new BonePile());
|
||||
break;
|
||||
case 7:
|
||||
PackItem(new BonePile());
|
||||
break;
|
||||
case 8:
|
||||
PackItem(new BonePile());
|
||||
break;
|
||||
case 9:
|
||||
PackItem(new BonePile());
|
||||
break;
|
||||
}
|
||||
PackItem(
|
||||
Utility.Random(10) switch
|
||||
{
|
||||
0 => new LeftArm(),
|
||||
1 => new RightArm(),
|
||||
2 => new Torso(),
|
||||
3 => new Bone(),
|
||||
4 => new RibCage(),
|
||||
5 => new RibCage(),
|
||||
_ => new BonePile() // 6-9
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public CursedSoul(Serial serial) : base(serial)
|
||||
|
|
@ -87,4 +66,4 @@ namespace Server.Engines.Quests.Samurai
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,44 +35,33 @@ namespace Server.Engines.Quests.Samurai
|
|||
AddItem(new LeatherHiroSode());
|
||||
AddItem(new SamuraiTabi(Utility.RandomNondyedHue()));
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new StuddedHaidate());
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new PlateSuneate());
|
||||
break;
|
||||
default:
|
||||
AddItem(new LeatherSuneate());
|
||||
break;
|
||||
}
|
||||
AddItem(
|
||||
Utility.Random(3) switch
|
||||
{
|
||||
0 => new StuddedHaidate(),
|
||||
1 => new PlateSuneate(),
|
||||
_ => new LeatherSuneate()
|
||||
}
|
||||
);
|
||||
|
||||
switch (Utility.Random(4))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new DecorativePlateKabuto());
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new ChainHatsuburi());
|
||||
break;
|
||||
case 2:
|
||||
AddItem(new LightPlateJingasa());
|
||||
break;
|
||||
default:
|
||||
AddItem(new LeatherJingasa());
|
||||
break;
|
||||
}
|
||||
AddItem(
|
||||
Utility.Random(4) switch
|
||||
{
|
||||
0 => new DecorativePlateKabuto(),
|
||||
1 => new ChainHatsuburi(),
|
||||
2 => new LightPlateJingasa(),
|
||||
_ => new LeatherJingasa()
|
||||
}
|
||||
);
|
||||
|
||||
var weapon = Utility.Random(3) switch
|
||||
{
|
||||
0 => (Item)new NoDachi(),
|
||||
1 => new Lajatang(),
|
||||
_ => new Wakizashi()
|
||||
};
|
||||
|
||||
weapon.Movable = false;
|
||||
AddItem(weapon);
|
||||
AddItem(
|
||||
Utility.Random(3) switch
|
||||
{
|
||||
0 => new NoDachi{Movable = false},
|
||||
1 => new Lajatang{Movable = false},
|
||||
_ => new Wakizashi{Movable = false}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public override void OnTalk(PlayerMobile player, bool contextMenu)
|
||||
|
|
@ -93,4 +82,4 @@ namespace Server.Engines.Quests.Samurai
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,18 +24,14 @@ namespace Server.Engines.Quests.Samurai
|
|||
|
||||
AddItem(new Bandana(Utility.RandomNondyedHue()));
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new Tessen());
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new Kama());
|
||||
break;
|
||||
default:
|
||||
AddItem(new Lajatang());
|
||||
break;
|
||||
}
|
||||
AddItem(
|
||||
Utility.Random(3) switch
|
||||
{
|
||||
0 => new Tessen(),
|
||||
1 => new Kama(),
|
||||
_ => new Lajatang()
|
||||
}
|
||||
);
|
||||
|
||||
SetSkill(SkillName.Swords, 50.0);
|
||||
SetSkill(SkillName.Tactics, 50.0);
|
||||
|
|
@ -64,4 +60,4 @@ namespace Server.Engines.Quests.Samurai
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,33 +21,25 @@ namespace Server.Engines.Quests.Samurai
|
|||
AddItem(new LeatherHiroSode());
|
||||
AddItem(new SamuraiTabi());
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new StuddedHaidate());
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new PlateSuneate());
|
||||
break;
|
||||
default:
|
||||
AddItem(new LeatherSuneate());
|
||||
break;
|
||||
}
|
||||
AddItem(
|
||||
Utility.Random(3) switch
|
||||
{
|
||||
0 => new StuddedHaidate(),
|
||||
1 => new PlateSuneate(),
|
||||
_ => new LeatherSuneate()
|
||||
}
|
||||
);
|
||||
|
||||
AddItem(new Bandana(Utility.RandomNondyedHue()));
|
||||
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
AddItem(new NoDachi());
|
||||
break;
|
||||
case 1:
|
||||
AddItem(new Lajatang());
|
||||
break;
|
||||
default:
|
||||
AddItem(new Wakizashi());
|
||||
break;
|
||||
}
|
||||
AddItem(
|
||||
Utility.Random(3) switch
|
||||
{
|
||||
0 => new NoDachi(),
|
||||
1 => new Lajatang(),
|
||||
_ => new Wakizashi()
|
||||
}
|
||||
);
|
||||
|
||||
SetSkill(SkillName.Swords, 50.0);
|
||||
SetSkill(SkillName.Tactics, 50.0);
|
||||
|
|
@ -76,4 +68,4 @@ namespace Server.Engines.Quests.Samurai
|
|||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,12 +95,7 @@ namespace Server.Engines.VeteranRewards
|
|||
{
|
||||
TimeSpan totalTime = DateTime.UtcNow - acct.Created;
|
||||
|
||||
int level = (int)(totalTime.TotalDays / RewardInterval.TotalDays);
|
||||
|
||||
if (level < 0)
|
||||
level = 0;
|
||||
|
||||
return level;
|
||||
return Math.Max((int)(totalTime.TotalDays / RewardInterval.TotalDays), 0);
|
||||
}
|
||||
|
||||
public static bool HasHalfLevel(Mobile mob)
|
||||
|
|
@ -473,10 +468,7 @@ namespace Server.Engines.VeteranRewards
|
|||
if (m.SkillsCap == 7000 || m.SkillsCap == 7050 || m.SkillsCap == 7100 ||
|
||||
m.SkillsCap == 7150 || m.SkillsCap == 7200)
|
||||
{
|
||||
if (level > 4)
|
||||
level = 4;
|
||||
else if (level < 0)
|
||||
level = 0;
|
||||
level = Math.Clamp(level, 0, 4);
|
||||
|
||||
if (SkillCapRewards)
|
||||
m.SkillsCap = 7000 + level * 50;
|
||||
|
|
|
|||
|
|
@ -342,14 +342,12 @@ namespace Server
|
|||
targetFame / 100.0 * (m_HonorDamage / m_TotalDamage); // Initial honor gain is 100th of the monsters honor
|
||||
|
||||
if (m_HonorDamage == m_TotalDamage && m_FirstHit == FirstHit.Granted)
|
||||
dGain = dGain * 1.5; // honor gain is increased alot more if the combat was fully honorable
|
||||
dGain *= 1.5; // honor gain is increased alot more if the combat was fully honorable
|
||||
else
|
||||
dGain = dGain * 0.9;
|
||||
dGain *= 0.9;
|
||||
|
||||
int gain = Math.Min((int)dGain, 200);
|
||||
|
||||
if (gain < 1)
|
||||
gain = 1; // Minimum gain of 1 honor when the honor is under the monsters fame
|
||||
// Minimum gain of 1 honor when the honor is under the monsters fame
|
||||
int gain = Math.Clamp((int)dGain, 1, 200);
|
||||
|
||||
if (VirtueHelper.IsHighestPath(Source, VirtueName.Honor))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue