Fixes for Last Moved (#194)
This commit is contained in:
parent
3a081d5322
commit
b476bcfd24
28 changed files with 155 additions and 398 deletions
|
|
@ -39,20 +39,7 @@ namespace Server.Engines.Chat
|
|||
public string Password
|
||||
{
|
||||
get => m_Password;
|
||||
set
|
||||
{
|
||||
string newValue = null;
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
newValue = value.Trim();
|
||||
|
||||
if (string.IsNullOrEmpty(newValue))
|
||||
newValue = null;
|
||||
}
|
||||
|
||||
m_Password = newValue;
|
||||
}
|
||||
set => m_Password = value?.Trim().IsNullOrDefault(null);
|
||||
}
|
||||
|
||||
public bool VoiceRestricted
|
||||
|
|
|
|||
|
|
@ -239,12 +239,9 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if (m_Counter >= m_Hill.ScoreInterval)
|
||||
{
|
||||
string hill = m_Hill.Name;
|
||||
string hill = m_Hill.Name.IsNullOrDefault("the hill");
|
||||
string king = m_Hill.King.Name ?? "";
|
||||
|
||||
if (string.IsNullOrEmpty(hill))
|
||||
hill = "the hill";
|
||||
|
||||
m_Hill.Game.Alert("{0} ({1}) is king of {2}!", king, ti.Name, hill);
|
||||
|
||||
m_Hill.PublicOverheadMessage(MessageType.Regular, 0x0481, false, "Capture!");
|
||||
|
|
|
|||
|
|
@ -33,11 +33,10 @@ namespace Server
|
|||
{
|
||||
int v = from.Virtues.GetValue((int)virtue);
|
||||
int vl;
|
||||
int vmax = GetMaxAmount(virtue);
|
||||
|
||||
if (v < 4000)
|
||||
vl = 0;
|
||||
else if (v >= vmax)
|
||||
else if (v >= GetMaxAmount(virtue))
|
||||
vl = 3;
|
||||
else
|
||||
vl = (v + 9999) / 10000;
|
||||
|
|
@ -45,16 +44,13 @@ namespace Server
|
|||
return (VirtueLevel)vl;
|
||||
}
|
||||
|
||||
public static int GetMaxAmount(VirtueName virtue)
|
||||
{
|
||||
if (virtue == VirtueName.Honor)
|
||||
return 20000;
|
||||
|
||||
if (virtue == VirtueName.Sacrifice)
|
||||
return 22000;
|
||||
|
||||
return 21000;
|
||||
}
|
||||
public static int GetMaxAmount(VirtueName virtue) =>
|
||||
virtue switch
|
||||
{
|
||||
VirtueName.Honor => 20000,
|
||||
VirtueName.Sacrifice => 22000,
|
||||
_ => 21000
|
||||
};
|
||||
|
||||
public static bool Award(Mobile from, VirtueName virtue, int amount, ref bool gainedPath)
|
||||
{
|
||||
|
|
@ -142,4 +138,4 @@ namespace Server
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,17 +54,14 @@ namespace Server.Guilds
|
|||
|
||||
AddImageTiled(65, 196, 480, 4, 0x238D);
|
||||
|
||||
string s = guild.Charter;
|
||||
if (string.IsNullOrEmpty(s))
|
||||
s = "The guild leader has not yet set the guild charter.";
|
||||
string s = guild.Charter.IsNullOrDefault("The guild leader has not yet set the guild charter.");
|
||||
|
||||
AddHtml(65, 216, 480, 80, s, true, true);
|
||||
if (isLeader)
|
||||
AddButton(40, 251, 0x4B9, 0x4BA, 4); // Charter Edit button
|
||||
|
||||
s = guild.Website;
|
||||
if (string.IsNullOrEmpty(s))
|
||||
s = "Guild website not yet set.";
|
||||
s = guild.Website.IsNullOrDefault("Guild website not yet set.");
|
||||
|
||||
AddHtml(65, 306, 480, 30, s, true);
|
||||
if (isLeader)
|
||||
AddButton(40, 313, 0x4B9, 0x4BA, 5); // Website Edit button
|
||||
|
|
|
|||
|
|
@ -545,10 +545,7 @@ namespace Server.Items
|
|||
toKill.RemoveAt(kill);
|
||||
|
||||
amount -= 1;
|
||||
LiveCreatures -= 1;
|
||||
|
||||
if (LiveCreatures < 0)
|
||||
LiveCreatures = 0;
|
||||
LiveCreatures = Math.Max(LiveCreatures - 1, 0);
|
||||
|
||||
Events.Add(1074366); // An unfortunate accident has left a creature floating upside-down. It is starting to smell.
|
||||
}
|
||||
|
|
@ -598,8 +595,8 @@ namespace Server.Items
|
|||
if (OptimalState && LiveCreatures < MaxLiveCreatures)
|
||||
if (Utility.RandomDouble() < 0.005 * LiveCreatures)
|
||||
{
|
||||
BaseFish fish = null;
|
||||
int message = 0;
|
||||
BaseFish fish;
|
||||
int message;
|
||||
|
||||
switch (Utility.Random(6))
|
||||
{
|
||||
|
|
@ -745,7 +742,7 @@ namespace Server.Items
|
|||
|
||||
public virtual bool RemoveItem(Mobile from, int at)
|
||||
{
|
||||
if (at < 0 && at >= Items.Count)
|
||||
if (at < 0 || at >= Items.Count)
|
||||
return false;
|
||||
|
||||
Item item = Items[at];
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ namespace Server.Engines.Mahjong
|
|||
int hand = tile.Dimensions.GetHandArea();
|
||||
|
||||
if (hand < 0 || players.IsPublic(hand) || players.GetPlayer(hand) == to ||
|
||||
(game.SpectatorVision && players.IsSpectator(to)))
|
||||
game.SpectatorVision && players.IsSpectator(to))
|
||||
Stream.Write((byte)tile.Value);
|
||||
else
|
||||
Stream.Write((byte)0);
|
||||
|
|
@ -176,7 +176,7 @@ namespace Server.Engines.Mahjong
|
|||
int hand = tile.Dimensions.GetHandArea();
|
||||
|
||||
if (hand < 0 || players.IsPublic(hand) || players.GetPlayer(hand) == to ||
|
||||
(game.SpectatorVision && players.IsSpectator(to)))
|
||||
game.SpectatorVision && players.IsSpectator(to))
|
||||
Stream.Write((byte)tile.Value);
|
||||
else
|
||||
Stream.Write((byte)0);
|
||||
|
|
@ -206,4 +206,4 @@ namespace Server.Engines.Mahjong
|
|||
Stream.Write((byte)0x1A);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -368,12 +368,7 @@ namespace Server.Items
|
|||
|
||||
from.Send(new PlaySound(0x42, GetWorldLocation()));
|
||||
|
||||
string desc = rune.Description;
|
||||
|
||||
if (desc == null || (desc = desc.Trim()).Length == 0)
|
||||
desc = "(indescript)";
|
||||
|
||||
from.SendMessage(desc);
|
||||
from.SendMessage(rune.Description?.Trim().IsNullOrDefault("(indescript)"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,10 +138,7 @@ namespace Server.Items
|
|||
|
||||
check = m.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (check is BaseTool && check != tool && !(check is AncientSmithyHammer))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return !(check is BaseTool) || check == tool || check is AncientSmithyHammer;
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
|
|
@ -159,16 +156,11 @@ namespace Server.Items
|
|||
|
||||
int num = system.CanCraft(from, this, null);
|
||||
|
||||
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
{
|
||||
// Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
if (num > 0 && (num != 1044267 || !Core.SE))
|
||||
from.SendLocalizedMessage(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftContext context = system.GetContext(from);
|
||||
|
||||
from.SendGump(new CraftGump(from, system, this, null));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,10 +31,7 @@ namespace Server.Regions
|
|||
|
||||
BankBox bank = from.FindBankNoCreate();
|
||||
|
||||
if (bank != null && ContainsDeed(bank))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return bank != null && ContainsDeed(bank);
|
||||
}
|
||||
|
||||
private bool ContainsDeed(Container cont)
|
||||
|
|
@ -53,4 +50,4 @@ namespace Server.Regions
|
|||
return base.OnTarget(m, t, o);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,13 +68,7 @@ namespace Server.Items
|
|||
get => m_Charges;
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
m_Charges = Math.Clamp(value, 0, MaxCharges);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -85,13 +79,7 @@ namespace Server.Items
|
|||
get => m_Recharges;
|
||||
set
|
||||
{
|
||||
if (value > MaxRecharges)
|
||||
m_Recharges = MaxRecharges;
|
||||
else if (value < 0)
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
m_Recharges = Math.Clamp(value, 0, MaxRecharges);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -278,4 +266,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.ConPVP;
|
||||
using Server.Mobiles;
|
||||
|
|
@ -61,13 +62,7 @@ namespace Server.Items
|
|||
get => m_Charges;
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
m_Charges = Math.Clamp(value, 0, MaxCharges);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -78,13 +73,7 @@ namespace Server.Items
|
|||
get => m_Recharges;
|
||||
set
|
||||
{
|
||||
if (value > MaxRecharges)
|
||||
m_Recharges = MaxRecharges;
|
||||
else if (value < 0)
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
m_Recharges = Math.Clamp(value, 0, MaxRecharges);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -100,17 +89,13 @@ namespace Server.Items
|
|||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1054131,
|
||||
m_Charges + (PetName.Length == 0
|
||||
? "\t "
|
||||
: $"\t{PetName}")); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
$"{m_Charges}\t{PetName.IsNullOrDefault(" ")}"); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from, 1054131,
|
||||
m_Charges + (PetName.Length == 0
|
||||
? "\t "
|
||||
: $"\t{PetName}")); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
$"{m_Charges}\t{PetName.IsNullOrDefault(" ")}"); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
|
|
@ -415,13 +400,8 @@ namespace Server.Items
|
|||
Disturb(DisturbType.Hurt, false);
|
||||
}
|
||||
|
||||
public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable)
|
||||
{
|
||||
if (type == DisturbType.EquipRequest || type == DisturbType.UseRequest /* || type == DisturbType.Hurt*/)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable) =>
|
||||
type != DisturbType.EquipRequest && type != DisturbType.UseRequest;
|
||||
|
||||
public override void DoHurtFizzle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,13 +63,7 @@ namespace Server.Items
|
|||
get => m_Charges;
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
m_Charges = Math.Clamp(value, 0, MaxCharges);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -80,13 +74,7 @@ namespace Server.Items
|
|||
get => m_Recharges;
|
||||
set
|
||||
{
|
||||
if (value > MaxRecharges)
|
||||
m_Recharges = MaxRecharges;
|
||||
else if (value < 0)
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
m_Recharges = Math.Clamp(value, 0, MaxRecharges);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
|
@ -102,17 +90,13 @@ namespace Server.Items
|
|||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1054000,
|
||||
m_Charges + (m_Inscription.Length == 0
|
||||
? "\t "
|
||||
: $" :\t{m_Inscription}")); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
$"{m_Charges}\t{m_Inscription.IsNullOrDefault(" ")}"); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from, 1054000,
|
||||
m_Charges + (m_Inscription.Length == 0
|
||||
? "\t "
|
||||
: $" :\t{m_Inscription}")); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
$"{m_Charges}\t{m_Inscription.IsNullOrDefault(" ")}"); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ namespace Server.Items
|
|||
|
||||
protected virtual bool CheckUse(Mobile from)
|
||||
{
|
||||
DateTime now = DateTime.UtcNow;
|
||||
// DateTime now = DateTime.UtcNow;
|
||||
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -171,10 +171,7 @@ namespace Server.Misc
|
|||
if (from.Meditating)
|
||||
rate *= 0.5;
|
||||
|
||||
if (rate < 0.5)
|
||||
rate = 0.5;
|
||||
else if (rate > 7.0)
|
||||
rate = 7.0;
|
||||
rate = Math.Clamp(rate, 0.5, 7.0);
|
||||
}
|
||||
|
||||
return TimeSpan.FromSeconds(rate);
|
||||
|
|
|
|||
|
|
@ -1553,7 +1553,7 @@ namespace Server.Mobiles
|
|||
else if (TransferItem.IsInCombat(m_Mobile))
|
||||
{
|
||||
from.SendMessage("You may not transfer a pet that has recently been in combat.");
|
||||
to.SendMessage("The pet may not be transfered to you because it has recently been in combat.");
|
||||
to.SendMessage("The pet may not be transferred to you because it has recently been in combat.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2596,7 +2596,7 @@ namespace Server.Mobiles
|
|||
else if (accepted && IsInCombat(m_Creature))
|
||||
{
|
||||
from.SendMessage("You may not transfer a pet that has recently been in combat.");
|
||||
to.SendMessage("The pet may not be transfered to you because it has recently been in combat.");
|
||||
to.SendMessage("The pet may not be transferred to you because it has recently been in combat.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -695,22 +695,16 @@ namespace Server.Mobiles
|
|||
public override int GetMinResistance(ResistanceType type)
|
||||
{
|
||||
int magicResist = (int)(Skills.MagicResist.Value * 10);
|
||||
int min = int.MinValue;
|
||||
int min;
|
||||
|
||||
if (magicResist >= 1000)
|
||||
min = 40 + (magicResist - 1000) / 50;
|
||||
else if (magicResist >= 400)
|
||||
min = (magicResist - 400) / 15;
|
||||
else
|
||||
min = int.MinValue;
|
||||
|
||||
if (min > MaxPlayerResistance)
|
||||
min = MaxPlayerResistance;
|
||||
|
||||
int baseMin = base.GetMinResistance(type);
|
||||
|
||||
if (min < baseMin)
|
||||
min = baseMin;
|
||||
|
||||
return min;
|
||||
return Math.Clamp(min, base.GetMinResistance(type), MaxPlayerResistance);
|
||||
}
|
||||
|
||||
public override void OnManaChange(int oldValue)
|
||||
|
|
@ -1612,27 +1606,17 @@ namespace Server.Mobiles
|
|||
m_NoRecursion = false;
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (m is BaseCreature creature && !creature.Controlled)
|
||||
return !Alive || !creature.Alive || IsDeadBondedPet || creature.IsDeadBondedPet ||
|
||||
Hidden && AccessLevel > AccessLevel.Player;
|
||||
public override bool OnMoveOver(Mobile m) =>
|
||||
m is BaseCreature creature && !creature.Controlled
|
||||
? !Alive || !creature.Alive || IsDeadBondedPet || creature.IsDeadBondedPet ||
|
||||
Hidden && AccessLevel > AccessLevel.Player
|
||||
: Region.IsPartOf<SafeZone>() && m is PlayerMobile pm &&
|
||||
(pm.DuelContext == null || pm.DuelPlayer == null || !pm.DuelContext.Started || pm.DuelContext.Finished ||
|
||||
pm.DuelPlayer.Eliminated) || base.OnMoveOver(m);
|
||||
|
||||
if (Region.IsPartOf<SafeZone>() && m is PlayerMobile pm)
|
||||
if (pm.DuelContext == null || pm.DuelPlayer == null || !pm.DuelContext.Started || pm.DuelContext.Finished ||
|
||||
pm.DuelPlayer.Eliminated)
|
||||
return true;
|
||||
|
||||
return base.OnMoveOver(m);
|
||||
}
|
||||
|
||||
public override bool CheckShove(Mobile shoved)
|
||||
{
|
||||
if (m_IgnoreMobiles || TransformationSpellHelper.UnderTransformation(shoved, typeof(WraithFormSpell)))
|
||||
return true;
|
||||
|
||||
return base.CheckShove(shoved);
|
||||
}
|
||||
public override bool CheckShove(Mobile shoved) =>
|
||||
m_IgnoreMobiles || TransformationSpellHelper.UnderTransformation(shoved, typeof(WraithFormSpell)) ||
|
||||
base.CheckShove(shoved);
|
||||
|
||||
protected override void OnMapChange(Map oldMap)
|
||||
{
|
||||
|
|
@ -3210,10 +3194,7 @@ namespace Server.Mobiles
|
|||
if (item.Layer == Layer.Mount)
|
||||
return false;
|
||||
|
||||
if (item.LootType == LootType.Blessed || item.LootType == LootType.Newbied || item.BlessedFor == this)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return item.LootType != LootType.Blessed && item.LootType != LootType.Newbied && item.BlessedFor != this;
|
||||
}
|
||||
|
||||
private void ToggleItemInsurance_Callback(Mobile from, object obj)
|
||||
|
|
@ -3694,13 +3675,8 @@ namespace Server.Mobiles
|
|||
return result;
|
||||
}
|
||||
|
||||
public override bool CheckPoisonImmunity(Mobile from, Poison poison)
|
||||
{
|
||||
if (Young && (DuelContext?.Started != true || DuelContext.Finished))
|
||||
return true;
|
||||
|
||||
return base.CheckPoisonImmunity(from, poison);
|
||||
}
|
||||
public override bool CheckPoisonImmunity(Mobile from, Poison poison) =>
|
||||
Young && (DuelContext?.Started != true || DuelContext.Finished) || base.CheckPoisonImmunity(from, poison);
|
||||
|
||||
public override void OnPoisonImmunity(Mobile from, Poison poison)
|
||||
{
|
||||
|
|
@ -3997,13 +3973,7 @@ namespace Server.Mobiles
|
|||
|
||||
public override string ApplyNameSuffix(string suffix)
|
||||
{
|
||||
if (Young)
|
||||
{
|
||||
if (suffix.Length == 0)
|
||||
suffix = "(Young)";
|
||||
else
|
||||
suffix = $"{suffix} (Young)";
|
||||
}
|
||||
if (Young) suffix = suffix.Length == 0 ? "(Young)" : $"{suffix} (Young)";
|
||||
|
||||
if (EthicPlayer != null)
|
||||
{
|
||||
|
|
@ -4020,10 +3990,7 @@ namespace Server.Mobiles
|
|||
if (faction != null)
|
||||
{
|
||||
string adjunct = $"[{faction.Definition.Abbreviation}]";
|
||||
if (suffix.Length == 0)
|
||||
suffix = adjunct;
|
||||
else
|
||||
suffix = $"{suffix} {adjunct}";
|
||||
suffix = suffix.Length == 0 ? adjunct : $"{suffix} {adjunct}";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -838,23 +838,14 @@ namespace Server.Mobiles
|
|||
if (vi == null)
|
||||
return;
|
||||
|
||||
string name;
|
||||
if (!string.IsNullOrEmpty(item.Name))
|
||||
name = item.Name;
|
||||
else
|
||||
name = $"#{item.LabelNumber}";
|
||||
string name = item.Name.IsNullOrDefault($"#{item.LabelNumber}");
|
||||
|
||||
from.SendLocalizedMessage(1043303, name); // Type in a price and description for ~1_ITEM~ (ESC=not for sale)
|
||||
from.Prompt = new VendorPricePrompt(this, vi);
|
||||
}
|
||||
|
||||
public override bool AllowEquipFrom(Mobile from)
|
||||
{
|
||||
if (BaseHouse.NewVendorSystem && IsOwner(from))
|
||||
return true;
|
||||
|
||||
return base.AllowEquipFrom(from);
|
||||
}
|
||||
public override bool AllowEquipFrom(Mobile from) =>
|
||||
BaseHouse.NewVendorSystem && IsOwner(from) || base.AllowEquipFrom(from);
|
||||
|
||||
public override bool CheckNonlocalLift(Mobile from, Item item)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,12 +35,7 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
if (weap.MaxHitPoints != 0)
|
||||
{
|
||||
int hp = (int)(weap.HitPoints / (double)weap.MaxHitPoints * 10);
|
||||
|
||||
if (hp < 0)
|
||||
hp = 0;
|
||||
else if (hp > 9)
|
||||
hp = 9;
|
||||
int hp = Math.Clamp((int)(weap.HitPoints / (double)weap.MaxHitPoints * 10), 0, 9);
|
||||
|
||||
from.SendLocalizedMessage(1038285 + hp);
|
||||
}
|
||||
|
|
@ -52,20 +47,6 @@ namespace Server.SkillHandlers
|
|||
damage = 0;
|
||||
else
|
||||
damage = (int)Math.Ceiling(Math.Min(damage, 30) / 5.0);
|
||||
/*
|
||||
else if (damage < 6)
|
||||
damage = 1;
|
||||
else if (damage < 11)
|
||||
damage = 2;
|
||||
else if (damage < 16)
|
||||
damage = 3;
|
||||
else if (damage < 21)
|
||||
damage = 4;
|
||||
else if (damage < 26)
|
||||
damage = 5;
|
||||
else
|
||||
damage = 6;
|
||||
* */
|
||||
|
||||
WeaponType type = weap.Type;
|
||||
|
||||
|
|
@ -94,35 +75,12 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
if (arm.MaxHitPoints != 0)
|
||||
{
|
||||
int hp = (int)(arm.HitPoints / (double)arm.MaxHitPoints * 10);
|
||||
|
||||
if (hp < 0)
|
||||
hp = 0;
|
||||
else if (hp > 9)
|
||||
hp = 9;
|
||||
int hp = Math.Clamp((int)(arm.HitPoints / (double)arm.MaxHitPoints * 10), 0, 9);
|
||||
|
||||
from.SendLocalizedMessage(1038285 + hp);
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1038295 + (int)Math.Ceiling(Math.Min(arm.ArmorRating, 35) / 5.0));
|
||||
/*
|
||||
if (arm.ArmorRating < 1)
|
||||
from.SendLocalizedMessage( 1038295 ); // This armor offers no defense against attackers.
|
||||
else if (arm.ArmorRating < 6)
|
||||
from.SendLocalizedMessage( 1038296 ); // This armor provides almost no protection.
|
||||
else if (arm.ArmorRating < 11)
|
||||
from.SendLocalizedMessage( 1038297 ); // This armor provides very little protection.
|
||||
else if (arm.ArmorRating < 16)
|
||||
from.SendLocalizedMessage( 1038298 ); // This armor offers some protection against blows.
|
||||
else if (arm.ArmorRating < 21)
|
||||
from.SendLocalizedMessage( 1038299 ); // This armor serves as sturdy protection.
|
||||
else if (arm.ArmorRating < 26)
|
||||
from.SendLocalizedMessage( 1038300 ); // This armor is a superior defense against attack.
|
||||
else if (arm.ArmorRating < 31)
|
||||
from.SendLocalizedMessage( 1038301 ); // This armor offers excellent protection.
|
||||
else
|
||||
from.SendLocalizedMessage( 1038302 ); // This armor is superbly crafted to provide maximum protection.
|
||||
* */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -251,12 +251,7 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
if (toSteal.Stackable && toSteal.Amount > 1)
|
||||
{
|
||||
int maxAmount = (int)(m_Thief.Skills.Stealing.Value / 10.0 / toSteal.Weight);
|
||||
|
||||
if (maxAmount < 1)
|
||||
maxAmount = 1;
|
||||
else if (maxAmount > toSteal.Amount)
|
||||
maxAmount = toSteal.Amount;
|
||||
int maxAmount = Math.Clamp((int)(m_Thief.Skills.Stealing.Value / 10.0 / toSteal.Weight), 1, toSteal.Amount);
|
||||
|
||||
int amount = Utility.RandomMinMax(1, maxAmount);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace Server.Spells
|
|||
{
|
||||
if (m.Skills[MoveSkill].Value < RequiredSkill)
|
||||
{
|
||||
string args = $"{RequiredSkill.ToString("F1")}\t{MoveSkill.ToString()}\t ";
|
||||
string args = $"{RequiredSkill:F1}\t{MoveSkill.ToString()}\t ";
|
||||
m.SendLocalizedMessage(1063013,
|
||||
args); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Server.Spells.Mysticism
|
|||
if (Caster.Skills[CastSkill].Value < RequiredSkill)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1063013,
|
||||
$"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
|
||||
$"{RequiredSkill:F1}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -75,4 +75,4 @@ namespace Server.Spells.Mysticism
|
|||
|
||||
public static double GetBoostSkill(Mobile m) => Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Server.Spells.Ninjitsu
|
|||
|
||||
if (Caster.Skills[CastSkill].Value < RequiredSkill)
|
||||
{
|
||||
string args = $"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t ";
|
||||
string args = $"{RequiredSkill:F1}\t{CastSkill.ToString()}\t ";
|
||||
Caster.SendLocalizedMessage(1063013,
|
||||
args); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue