fix: Optimizes TextDefinition to eliminate allocations. Removes TextDefinition ctor. (#1221)

### BREAKING CHANGE ###
The constructor for `TextDefinition` has been removed. Instead use `TextDefinition.Of()` or cast the integer/string to TextDefinition.
This commit is contained in:
Kamron Batman 2022-10-30 16:53:23 -07:00 • committed by GitHub
parent 213b7025af
commit 910e06767b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 790 additions and 722 deletions

View file

@ -0,0 +1,30 @@
using System;
using Xunit;
namespace Server.Tests;
public class TextDefinitionTests
{
[Theory]
[InlineData(10345, "", "#10345")]
[InlineData(0, "Hello", "Hello")]
[InlineData(10345, "Hello", "#10345")]
public void TestTextDefinitionToString(int a1, string a2, string expected)
{
Assert.Equal(expected, TextDefinition.Of(a1, a2).ToString());
}
[Theory]
[InlineData(10345, "", 10345, "", true)]
[InlineData(10345, "", 0, "Hello", false)]
[InlineData(0, "Hello", 0, "Hello", true)]
[InlineData(0, "Hello", 0, "hello", false)]
[InlineData(10345, "Hello", 10345, "Goodbye", true)]
[InlineData(10345, "Hello", 10510, "Hello", false)]
public void TestTextDefinitionIsEqual(int a1, string a2, int b1, string b2, bool isEqual)
{
var a = TextDefinition.Of(a1, a2);
var b = TextDefinition.Of(b1, b2);
Assert.Equal(isEqual, a.Equals(b));
}
}

View file

@ -112,17 +112,16 @@ public struct Point2D
} }
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider) public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider provider)
{ => destination.TryWrite(provider, $"({m_X}, {m_Y})", out charsWritten);
return destination.TryWrite(provider, $"({m_X}, {m_Y})", out charsWritten);
}
public override string ToString() { public override string ToString() {
// Maximum number of characters that are needed to represent this: // Maximum number of characters that are needed to represent this:
// 4 characters for (, ) // 4 characters for (, )
// Up to 11 characters to represent each integer // Up to 11 characters to represent each integer
Span<char> span = stackalloc char[4+11*2]; const int maxLength = 4 + 11 * 2;
this.TryFormat(span, out var charsWritten, null, null); Span<char> span = stackalloc char[maxLength];
return span.Slice(0, charsWritten).ToString(); TryFormat(span, out var charsWritten, null, null);
return span[..charsWritten].ToString();
} }
public string ToString(string format, IFormatProvider formatProvider) public string ToString(string format, IFormatProvider formatProvider)
@ -131,5 +130,4 @@ public struct Point2D
// default ToString implementation. // default ToString implementation.
return ToString(); return ToString();
} }
} }

View file

@ -24,8 +24,8 @@ namespace Server.Json
public override TextDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => public override TextDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
reader.TokenType switch reader.TokenType switch
{ {
JsonTokenType.String => new TextDefinition(reader.GetString()), JsonTokenType.String => TextDefinition.Of(reader.GetString()),
JsonTokenType.Number => new TextDefinition(reader.GetInt32()), JsonTokenType.Number => TextDefinition.Of(reader.GetInt32()),
_ => throw new JsonException("TextDefinition value must be an integer or string") _ => throw new JsonException("TextDefinition value must be an integer or string")
}; };

View file

@ -124,9 +124,9 @@ public interface IGenericReader
{ {
return ReadEncodedInt() switch return ReadEncodedInt() switch
{ {
0 => new TextDefinition(), 0 => TextDefinition.Empty,
1 => new TextDefinition(ReadEncodedInt()), 1 => ReadEncodedInt(),
2 => new TextDefinition(ReadString()), 2 => ReadString(),
_ => null _ => null
}; };
} }

View file

@ -13,17 +13,31 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
*************************************************************************/ *************************************************************************/
using System;
using System.Runtime.CompilerServices;
namespace Server; namespace Server;
[Parsable] [Parsable]
[PropertyObject] [PropertyObject]
public class TextDefinition public class TextDefinition : IEquatable<object>, IEquatable<TextDefinition>
{ {
public TextDefinition(string text) : this(0, text) public static readonly TextDefinition Empty = new();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TextDefinition Of(int number) => Of(number, null);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TextDefinition Of(string text) => Of(0, text);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TextDefinition Of(int number, string text) => new(number, text);
private TextDefinition()
{ {
} }
public TextDefinition(int number = 0, string text = null) private TextDefinition(int number, string text)
{ {
Number = number; Number = number;
String = text; String = text;
@ -45,9 +59,9 @@ public class TextDefinition
public string GetValue() => Number > 0 ? Number.ToString() : String ?? ""; public string GetValue() => Number > 0 ? Number.ToString() : String ?? "";
public static implicit operator TextDefinition(int v) => new(v); public static implicit operator TextDefinition(int v) => Of(v);
public static implicit operator TextDefinition(string s) => new(s); public static implicit operator TextDefinition(string s) => Of(s);
public static implicit operator int(TextDefinition m) => m?.Number ?? 0; public static implicit operator int(TextDefinition m) => m?.Number ?? 0;
@ -60,6 +74,48 @@ public class TextDefinition
return null; return null;
} }
return Utility.ToInt32(value, out var i) ? new TextDefinition(i) : new TextDefinition(value); return Utility.ToInt32(value, out var i) ? Of(i) : Of(value);
}
public void Deconstruct(out int number, out string s)
{
if (Number > 0)
{
number = Number;
s = null;
}
else
{
number = 0;
s = String;
} }
} }
public override bool Equals(object obj) => Equals(obj as TextDefinition);
public bool Equals(TextDefinition other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
if (Number > 0 || other.Number > 0)
{
return Number == other.Number;
}
return String == other.String;
}
public override int GetHashCode() => Number > 0 ? HashCode.Combine(Number) : HashCode.Combine(String);
public static bool operator ==(TextDefinition left, TextDefinition right) => Equals(left, right);
public static bool operator !=(TextDefinition left, TextDefinition right) => !Equals(left, right);
}

View file

@ -50,7 +50,7 @@ namespace Server.Engines.Craft
public abstract SkillName MainSkill { get; } public abstract SkillName MainSkill { get; }
public virtual TextDefinition GumpTitle => 0; public virtual TextDefinition GumpTitle => TextDefinition.Empty;
public virtual CraftECA ECA => CraftECA.ChanceMinusSixty; public virtual CraftECA ECA => CraftECA.ChanceMinusSixty;

View file

@ -33,7 +33,7 @@ public class Recipe
public int ID { get; } public int ID { get; }
public TextDefinition TextDefinition => _td ??= new TextDefinition(CraftItem.NameNumber, CraftItem.NameString); public TextDefinition TextDefinition => _td ??= TextDefinition.Of(CraftItem.NameNumber, CraftItem.NameString);
public static void Initialize() public static void Initialize()
{ {

View file

@ -18,7 +18,7 @@ public class DefAlchemy : CraftSystem
public override SkillName MainSkill => SkillName.Alchemy; public override SkillName MainSkill => SkillName.Alchemy;
public override TextDefinition GumpTitle => 1044001; public override TextDefinition GumpTitle { get; } = 1044001;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -19,7 +19,7 @@ public class DefBlacksmithy : CraftSystem
public override SkillName MainSkill => SkillName.Blacksmith; public override SkillName MainSkill => SkillName.Blacksmith;
public override TextDefinition GumpTitle => 1044002; public override TextDefinition GumpTitle { get; } = 1044002;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -16,7 +16,7 @@ public class DefBowFletching : CraftSystem
public override SkillName MainSkill => SkillName.Fletching; public override SkillName MainSkill => SkillName.Fletching;
public override TextDefinition GumpTitle => 1044006; public override TextDefinition GumpTitle { get; } = 1044006;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -16,7 +16,7 @@ public class DefCarpentry : CraftSystem
public override SkillName MainSkill => SkillName.Carpentry; public override SkillName MainSkill => SkillName.Carpentry;
public override TextDefinition GumpTitle => 1044004; public override TextDefinition GumpTitle { get; } = 1044004;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -16,7 +16,7 @@ public class DefCartography : CraftSystem
public override SkillName MainSkill => SkillName.Cartography; public override SkillName MainSkill => SkillName.Cartography;
public override TextDefinition GumpTitle => 1044008; public override TextDefinition GumpTitle { get; } = 1044008;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -16,7 +16,7 @@ public class DefCooking : CraftSystem
public override SkillName MainSkill => SkillName.Cooking; public override SkillName MainSkill => SkillName.Cooking;
public override TextDefinition GumpTitle => 1044003; public override TextDefinition GumpTitle { get; } = 1044003;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -17,7 +17,7 @@ public class DefGlassblowing : CraftSystem
public override SkillName MainSkill => SkillName.Alchemy; public override SkillName MainSkill => SkillName.Alchemy;
public override TextDefinition GumpTitle => 1044622; public override TextDefinition GumpTitle { get; } = 1044622;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -36,7 +36,7 @@ public class DefInscription : CraftSystem
public override SkillName MainSkill => SkillName.Inscribe; public override SkillName MainSkill => SkillName.Inscribe;
public override TextDefinition GumpTitle => 1044009; public override TextDefinition GumpTitle { get; } = 1044009;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -17,7 +17,7 @@ public class DefMasonry : CraftSystem
public override SkillName MainSkill => SkillName.Carpentry; public override SkillName MainSkill => SkillName.Carpentry;
public override TextDefinition GumpTitle => 1044500; public override TextDefinition GumpTitle { get; } = 1044500;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -24,7 +24,7 @@ public class DefTailoring : CraftSystem
public override SkillName MainSkill => SkillName.Tailoring; public override SkillName MainSkill => SkillName.Tailoring;
public override TextDefinition GumpTitle => 1044005; // Tailoring Menu public override TextDefinition GumpTitle { get; } = 1044005; // Tailoring Menu
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -32,7 +32,7 @@ public class DefTinkering : CraftSystem
public override SkillName MainSkill => SkillName.Tinkering; public override SkillName MainSkill => SkillName.Tinkering;
public override TextDefinition GumpTitle => 1044007; public override TextDefinition GumpTitle { get; } = 1044007;
public static CraftSystem CraftSystem { get; private set; } public static CraftSystem CraftSystem { get; private set; }

View file

@ -42,44 +42,44 @@ namespace Server.Factions
new( new(
SkillName.Inscribe, SkillName.Inscribe,
90.0, 90.0,
new TextDefinition(1060773, "Scribe"), 1060773, // Scribe
new TextDefinition(1011468, "SCRIBE"), 1011468, // SCRIBE
new TextDefinition(1010121, "You now have the faction title of scribe") 1010121 // You now have the faction title of scribe
), ),
new( new(
SkillName.Carpentry, SkillName.Carpentry,
90.0, 90.0,
new TextDefinition(1060774, "Carpenter"), 1060774, // Carpenter
new TextDefinition(1011469, "CARPENTER"), 1011469, // CARPENTER
new TextDefinition(1010122, "You now have the faction title of carpenter") 1010122 // You now have the faction title of carpenter
), ),
new( new(
SkillName.Tinkering, SkillName.Tinkering,
90.0, 90.0,
new TextDefinition(1022984, "Tinker"), 1022984, // Tinker
new TextDefinition(1011470, "TINKER"), 1011470, // TINKER
new TextDefinition(1010123, "You now have the faction title of tinker") 1010123 // You now have the faction title of tinker
), ),
new( new(
SkillName.Blacksmith, SkillName.Blacksmith,
90.0, 90.0,
new TextDefinition(1023016, "Blacksmith"), 1023016, // Blacksmith
new TextDefinition(1011471, "BLACKSMITH"), 1011471, // BLACKSMITH
new TextDefinition(1010124, "You now have the faction title of blacksmith") 1010124 // You now have the faction title of blacksmith
), ),
new( new(
SkillName.Fletching, SkillName.Fletching,
90.0, 90.0,
new TextDefinition(1023022, "Bowyer"), 1023022, // Bowyer
new TextDefinition(1011472, "BOWYER"), 1011472, // BOWYER
new TextDefinition(1010125, "You now have the faction title of Bowyer") 1010125 // You now have the faction title of Bowyer
), ),
new( new(
SkillName.Tailoring, SkillName.Tailoring,
90.0, 90.0,
new TextDefinition(1022982, "Tailor"), 1022982, // Tailor
new TextDefinition(1018300, "TAILOR"), 1018300, // TAILOR
new TextDefinition(1042162, "You now have the faction title of Tailor") 1042162 // You now have the faction title of Tailor
) )
}; };

View file

@ -42,8 +42,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
10, 10,
new TextDefinition(1011549, "POTION BOTTLE VENDOR"), 1011549, // POTION BOTTLE VENDOR
new TextDefinition(1011544, "Buy Potion Bottle Vendor") 1011544 // Buy Potion Bottle Vendor
), ),
new( new(
typeof(FactionBoardVendor), typeof(FactionBoardVendor),
@ -51,8 +51,8 @@ namespace Server.Factions
3000, 3000,
500, 500,
10, 10,
new TextDefinition(1011552, "WOOD VENDOR"), 1011552, // WOOD VENDOR
new TextDefinition(1011545, "Buy Wooden Board Vendor") 1011545 // Buy Wooden Board Vendor
), ),
new( new(
typeof(FactionOreVendor), typeof(FactionOreVendor),
@ -60,8 +60,8 @@ namespace Server.Factions
3000, 3000,
500, 500,
10, 10,
new TextDefinition(1011553, "IRON ORE VENDOR"), 1011553, // IRON ORE VENDOR
new TextDefinition(1011546, "Buy Iron Ore Vendor") 1011546 // Buy Iron Ore Vendor
), ),
new( new(
typeof(FactionReagentVendor), typeof(FactionReagentVendor),
@ -69,8 +69,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
10, 10,
new TextDefinition(1011554, "REAGENT VENDOR"), 1011554, // REAGENT VENDOR
new TextDefinition(1011547, "Buy Reagent Vendor") 1011547 // Buy Reagent Vendor
), ),
new( new(
typeof(FactionHorseVendor), typeof(FactionHorseVendor),
@ -78,8 +78,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
1, 1,
new TextDefinition(1011556, "HORSE BREEDER"), 1011556, // HORSE BREEDER
new TextDefinition(1011555, "Buy Horse Breeder") 1011555 // Buy Horse Breeder
) )
}; };
} }

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class CouncilOfMages : Faction public class CouncilOfMages : Faction
{ {
public CouncilOfMages() public CouncilOfMages()
@ -18,25 +18,25 @@ namespace Server.Factions
"Council of Mages", "Council of Mages",
"council", "council",
"CoM", "CoM",
new TextDefinition(1011535, "COUNCIL OF MAGES"), 1011535, // COUNCIL OF MAGES
new TextDefinition(1060770, "Council of Mages faction"), 1060770, // Council of Mages faction
new TextDefinition(1011422, "<center>COUNCIL OF MAGES</center>"), 1011422, // <center>COUNCIL OF MAGES</center>
new TextDefinition( /*
* The council of Mages have their roots in the city of Moonglow, where
* they once convened. They began as a small movement, dedicated to
* calling forth the Stranger, who saved the lands once before. A
* series of war and murders and misbegotten trials by those loyal to
* Lord British has caused the group to take up the banner of war.
*/
1011449, 1011449,
"The council of Mages have their roots in the city of Moonglow, where " + 1011455, // This city is controlled by the Council of Mages.
"they once convened. They began as a small movement, dedicated to " + 1042253, // This sigil has been corrupted by the Council of Mages
"calling forth the Stranger, who saved the lands once before. A " + 1041044, // The faction signup stone for the Council of Mages
"series of war and murders and misbegotten trials by those loyal to " + 1041382, // The Faction Stone of the Council of Mages
"Lord British has caused the group to take up the banner of war." 1011464, // : Council of Mages
), 1005187, // Members of the Council of Mages will now be ignored.
new TextDefinition(1011455, "This city is controlled by the Council of Mages."), 1005188, // Members of the Council of Mages will now be warned to leave.
new TextDefinition(1042253, "This sigil has been corrupted by the Council of Mages"), 1005189, // Members of the Council of Mages will now be beaten with a stick.
new TextDefinition(1041044, "The faction signup stone for the Council of Mages"),
new TextDefinition(1041382, "The Faction Stone of the Council of Mages"),
new TextDefinition(1011464, ": Council of Mages"),
new TextDefinition(1005187, "Members of the Council of Mages will now be ignored."),
new TextDefinition(1005188, "Members of the Council of Mages will now be warned to leave."),
new TextDefinition(1005189, "Members of the Council of Mages will now be beaten with a stick."),
// Moonglow // Moonglow
new StrongholdDefinition( new StrongholdDefinition(
new[] new[]
@ -82,16 +82,16 @@ namespace Server.Factions
} ), */ } ), */
new[] new[]
{ {
new RankDefinition(10, 991, 8, new TextDefinition(1060789, "Inquisitor of the Council")), new RankDefinition(10, 991, 8, 1060789), // Inquisitor of the Council
new RankDefinition(9, 950, 7, new TextDefinition(1060788, "Archon of Principle")), new RankDefinition(9, 950, 7, 1060788), // Archon of Principle
new RankDefinition(8, 900, 6, new TextDefinition(1060787, "Luminary")), new RankDefinition(8, 900, 6, 1060787), // Luminary
new RankDefinition(7, 800, 6, new TextDefinition(1060787, "Luminary")), new RankDefinition(7, 800, 6, 1060787), // Luminary
new RankDefinition(6, 700, 5, new TextDefinition(1060786, "Diviner")), new RankDefinition(6, 700, 5, 1060786), // Diviner
new RankDefinition(5, 600, 5, new TextDefinition(1060786, "Diviner")), new RankDefinition(5, 600, 5, 1060786), // Diviner
new RankDefinition(4, 500, 5, new TextDefinition(1060786, "Diviner")), new RankDefinition(4, 500, 5, 1060786), // Diviner
new RankDefinition(3, 400, 4, new TextDefinition(1060785, "Mystic")), new RankDefinition(3, 400, 4, 1060785), // Mystic
new RankDefinition(2, 200, 4, new TextDefinition(1060785, "Mystic")), new RankDefinition(2, 200, 4, 1060785), // Mystic
new RankDefinition(1, 0, 4, new TextDefinition(1060785, "Mystic")) new RankDefinition(1, 0, 4, 1060785) // Mystic
}, },
new[] new[]
{ {
@ -101,8 +101,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
10, 10,
new TextDefinition(1011526, "HENCHMAN"), 1011526, // HENCHMAN
new TextDefinition(1011510, "Hire Henchman") 1011510 // Hire Henchman
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionMercenary), typeof(FactionMercenary),
@ -110,8 +110,8 @@ namespace Server.Factions
6000, 6000,
2000, 2000,
10, 10,
new TextDefinition(1011527, "MERCENARY"), 1011527, // MERCENARY
new TextDefinition(1011511, "Hire Mercenary") 1011511 // Hire Mercenary
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionSorceress), typeof(FactionSorceress),
@ -119,8 +119,8 @@ namespace Server.Factions
7000, 7000,
3000, 3000,
10, 10,
new TextDefinition(1011507, "SORCERESS"), 1011507, // SORCERESS
new TextDefinition(1011501, "Hire Sorceress") 1011501 // Hire Sorceress
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionWizard), typeof(FactionWizard),
@ -128,8 +128,8 @@ namespace Server.Factions
8000, 8000,
4000, 4000,
10, 10,
new TextDefinition(1011508, "ELDER WIZARD"), 1011508, // ELDER WIZARD
new TextDefinition(1011502, "Hire Elder Wizard") 1011502 // Hire Elder Wizard
) )
} }
); );
@ -137,4 +137,3 @@ namespace Server.Factions
public static Faction Instance { get; private set; } public static Faction Instance { get; private set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Minax : Faction public class Minax : Faction
{ {
public Minax() public Minax()
@ -18,26 +18,26 @@ namespace Server.Factions
"Minax", "Minax",
"minax", "minax",
"Min", "Min",
new TextDefinition(1011534, "MINAX"), 1011534, // MINAX
new TextDefinition(1060769, "Minax faction"), 1060769, // Minax faction
new TextDefinition(1011421, "<center>FOLLOWERS OF MINAX</center>"), 1011421, // <center>FOLLOWERS OF MINAX</center>
new TextDefinition( /*
* The followers of Minax have taken control in the old lands,
* and intend to hold it for as long as they can. Allying themselves
* with orcs, headless, gazers, trolls, and other beasts, they seek
* revenge against Lord British, for slights both real and imagined,
* though some of the followers wish only to wreak havoc on the
* unsuspecting populace."
*/
1011448, 1011448,
"The followers of Minax have taken control in the old lands, " + 1011453, // This city is controlled by Minax.
"and intend to hold it for as long as they can. Allying themselves " + 1042252, // This sigil has been corrupted by the Followers of Minax
"with orcs, headless, gazers, trolls, and other beasts, they seek " + 1041043, // The faction signup stone for the Followers of Minax
"revenge against Lord British, for slights both real and imagined, " + 1041381, // The Faction Stone of Minax
"though some of the followers wish only to wreak havoc on the " + 1011463, // : Minax
"unsuspecting populace." 1005190, // Followers of Minax will now be ignored.
), 1005191, // Followers of Minax will now be told to go away.
new TextDefinition(1011453, "This city is controlled by Minax."), 1005192, // Followers of Minax will now be hanged by their toes.
new TextDefinition(1042252, "This sigil has been corrupted by the Followers of Minax"),
new TextDefinition(1041043, "The faction signup stone for the Followers of Minax"),
new TextDefinition(1041381, "The Faction Stone of Minax"),
new TextDefinition(1011463, ": Minax"),
new TextDefinition(1005190, "Followers of Minax will now be ignored."),
new TextDefinition(1005191, "Followers of Minax will now be told to go away."),
new TextDefinition(1005192, "Followers of Minax will now be hanged by their toes."),
new StrongholdDefinition( new StrongholdDefinition(
new[] new[]
{ {
@ -59,16 +59,16 @@ namespace Server.Factions
), ),
new[] new[]
{ {
new RankDefinition(10, 991, 8, new TextDefinition(1060784, "Avenger of Mondain")), new RankDefinition(10, 991, 8, 1060784), // Avenger of Mondain
new RankDefinition(9, 950, 7, new TextDefinition(1060783, "Dread Knight")), new RankDefinition(9, 950, 7, 1060783), // Dread Knight
new RankDefinition(8, 900, 6, new TextDefinition(1060782, "Warlord")), new RankDefinition(8, 900, 6, 1060782), // Warlord
new RankDefinition(7, 800, 6, new TextDefinition(1060782, "Warlord")), new RankDefinition(7, 800, 6, 1060782), // Warlord
new RankDefinition(6, 700, 5, new TextDefinition(1060781, "Executioner")), new RankDefinition(6, 700, 5, 1060781), // Executioner
new RankDefinition(5, 600, 5, new TextDefinition(1060781, "Executioner")), new RankDefinition(5, 600, 5, 1060781), // Executioner
new RankDefinition(4, 500, 5, new TextDefinition(1060781, "Executioner")), new RankDefinition(4, 500, 5, 1060781), // Executioner
new RankDefinition(3, 400, 4, new TextDefinition(1060780, "Defiler")), new RankDefinition(3, 400, 4, 1060780), // Defiler
new RankDefinition(2, 200, 4, new TextDefinition(1060780, "Defiler")), new RankDefinition(2, 200, 4, 1060780), // Defiler
new RankDefinition(1, 0, 4, new TextDefinition(1060780, "Defiler")) new RankDefinition(1, 0, 4, 1060780) // Defiler
}, },
new[] new[]
{ {
@ -78,8 +78,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
10, 10,
new TextDefinition(1011526, "HENCHMAN"), 1011526, // HENCHMAN
new TextDefinition(1011510, "Hire Henchman") 1011510 // Hire Henchman
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionMercenary), typeof(FactionMercenary),
@ -87,8 +87,8 @@ namespace Server.Factions
6000, 6000,
2000, 2000,
10, 10,
new TextDefinition(1011527, "MERCENARY"), 1011527, // MERCENARY
new TextDefinition(1011511, "Hire Mercenary") 1011511 // Hire Mercenary
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionBerserker), typeof(FactionBerserker),
@ -96,8 +96,8 @@ namespace Server.Factions
7000, 7000,
3000, 3000,
10, 10,
new TextDefinition(1011505, "BERSERKER"), 1011505, // BERSERKER
new TextDefinition(1011499, "Hire Berserker") 1011499 // Hire Berserker
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionDragoon), typeof(FactionDragoon),
@ -105,8 +105,8 @@ namespace Server.Factions
8000, 8000,
4000, 4000,
10, 10,
new TextDefinition(1011506, "DRAGOON"), 1011506, // DRAGOON
new TextDefinition(1011500, "Hire Dragoon") 1011500 // Hire Dragoon
) )
} }
); );
@ -114,4 +114,3 @@ namespace Server.Factions
public static Faction Instance { get; private set; } public static Faction Instance { get; private set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Shadowlords : Faction public class Shadowlords : Faction
{ {
public Shadowlords() public Shadowlords()
@ -18,25 +18,25 @@ namespace Server.Factions
"Shadowlords", "Shadowlords",
"shadow", "shadow",
"SL", "SL",
new TextDefinition(1011537, "SHADOWLORDS"), 1011537, // SHADOWLORDS
new TextDefinition(1060772, "Shadowlords faction"), 1060772, // Shadowlords faction
new TextDefinition(1011424, "<center>SHADES OF DARKNESS</center>"), 1011424, // <center>SHADES OF DARKNESS</center>
new TextDefinition( /*
* The Shadow Lords are a faction that has sprung up within the ranks of
* Minax. Comprised mostly of undead and those who would seek to be
* necromancers, they pose a threat to both the sides of good and evil.
* Their plans have disrupted the hold Minax has over Felucca, and their
* ultimate goal is to destroy all life.
*/
1011451, 1011451,
"The Shadow Lords are a faction that has sprung up within the ranks of " + 1011456, // This city is controlled by the Shadow Lords.
"Minax. Comprised mostly of undead and those who would seek to be " + 1042255, // This sigil has been corrupted by the Shadowlords
"necromancers, they pose a threat to both the sides of good and evil. " + 1041046, // The faction signup stone for the Shadowlords
"Their plans have disrupted the hold Minax has over Felucca, and their " + 1041384, // The Faction Stone of the Shadowlords
"ultimate goal is to destroy all life." 1011466, // : Shadowlords
), 1005184, // Minions of the Shadowlords will now be ignored.
new TextDefinition(1011456, "This city is controlled by the Shadow Lords."), 1005185, // Minions of the Shadowlords will now be warned of their impending deaths.
new TextDefinition(1042255, "This sigil has been corrupted by the Shadowlords"), 1005186, // Minions of the Shadowlords will now be attacked at will.
new TextDefinition(1041046, "The faction signup stone for the Shadowlords"),
new TextDefinition(1041384, "The Faction Stone of the Shadowlords"),
new TextDefinition(1011466, ": Shadowlords"),
new TextDefinition(1005184, "Minions of the Shadowlords will now be ignored."),
new TextDefinition(1005185, "Minions of the Shadowlords will now be warned of their impending deaths."),
new TextDefinition(1005186, "Minions of the Shadowlords will now be attacked at will."),
new StrongholdDefinition( new StrongholdDefinition(
new[] new[]
{ {
@ -59,16 +59,16 @@ namespace Server.Factions
), ),
new[] new[]
{ {
new RankDefinition(10, 991, 8, new TextDefinition(1060799, "Purveyor of Darkness")), new RankDefinition(10, 991, 8, 1060799), // Purveyor of Darkness
new RankDefinition(9, 950, 7, new TextDefinition(1060798, "Agent of Evil")), new RankDefinition(9, 950, 7, 1060798), // Agent of Evil
new RankDefinition(8, 900, 6, new TextDefinition(1060797, "Bringer of Sorrow")), new RankDefinition(8, 900, 6, 1060797), // Bringer of Sorrow
new RankDefinition(7, 800, 6, new TextDefinition(1060797, "Bringer of Sorrow")), new RankDefinition(7, 800, 6, 1060797), // Bringer of Sorrow
new RankDefinition(6, 700, 5, new TextDefinition(1060796, "Keeper of Lies")), new RankDefinition(6, 700, 5, 1060796), // Keeper of Lies
new RankDefinition(5, 600, 5, new TextDefinition(1060796, "Keeper of Lies")), new RankDefinition(5, 600, 5, 1060796), // Keeper of Lies
new RankDefinition(4, 500, 5, new TextDefinition(1060796, "Keeper of Lies")), new RankDefinition(4, 500, 5, 1060796), // Keeper of Lies
new RankDefinition(3, 400, 4, new TextDefinition(1060795, "Servant")), new RankDefinition(3, 400, 4, 1060795), // Servant
new RankDefinition(2, 200, 4, new TextDefinition(1060795, "Servant")), new RankDefinition(2, 200, 4, 1060795), // Servant
new RankDefinition(1, 0, 4, new TextDefinition(1060795, "Servant")) new RankDefinition(1, 0, 4, 1060795) // Servant
}, },
new[] new[]
{ {
@ -78,8 +78,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
10, 10,
new TextDefinition(1011526, "HENCHMAN"), 1011526, // HENCHMAN
new TextDefinition(1011510, "Hire Henchman") 1011510 // Hire Henchman
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionMercenary), typeof(FactionMercenary),
@ -87,8 +87,8 @@ namespace Server.Factions
6000, 6000,
2000, 2000,
10, 10,
new TextDefinition(1011527, "MERCENARY"), 1011527, // MERCENARY
new TextDefinition(1011511, "Hire Mercenary") 1011511 // Hire Mercenary
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionDeathKnight), typeof(FactionDeathKnight),
@ -96,8 +96,8 @@ namespace Server.Factions
7000, 7000,
3000, 3000,
10, 10,
new TextDefinition(1011512, "DEATH KNIGHT"), 1011512, // DEATH KNIGHT
new TextDefinition(1011503, "Hire Death Knight") 1011503 // Hire Death Knight
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionNecromancer), typeof(FactionNecromancer),
@ -105,8 +105,8 @@ namespace Server.Factions
8000, 8000,
4000, 4000,
10, 10,
new TextDefinition(1011513, "SHADOW MAGE"), 1011513, // SHADOW MAGE
new TextDefinition(1011504, "Hire Shadow Mage") 1011504 // Hire Shadow Mage
) )
} }
); );
@ -114,4 +114,3 @@ namespace Server.Factions
public static Faction Instance { get; private set; } public static Faction Instance { get; private set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class TrueBritannians : Faction public class TrueBritannians : Faction
{ {
public TrueBritannians() public TrueBritannians()
@ -18,25 +18,25 @@ namespace Server.Factions
"True Britannians", "True Britannians",
"true", "true",
"TB", "TB",
new TextDefinition(1011536, "LORD BRITISH"), 1011536, // LORD BRITISH
new TextDefinition(1060771, "True Britannians faction"), 1060771, // True Britannians faction
new TextDefinition(1011423, "<center>TRUE BRITANNIANS</center>"), 1011423, // <center>TRUE BRITANNIANS</center>
new TextDefinition( /*
* True Britannians are loyal to the throne of Lord British. They refuse
* to give up their homelands to the vile Minax, and detest the Shadowlords
* for their evil ways. In addition, the Council of Mages threatens the
* existence of their ruler, and as such they have armed themselves, and
* prepare for war with all.
*/
1011450, 1011450,
"True Britannians are loyal to the throne of Lord British. They refuse " + 1011454, // This city is controlled by Lord British.
"to give up their homelands to the vile Minax, and detest the Shadowlords " + 1042254, // This sigil has been corrupted by the True Britannians
"for their evil ways. In addition, the Council of Mages threatens the " + 1041045, // The faction signup stone for the True Britannians
"existence of their ruler, and as such they have armed themselves, and " + 1041383, // The Faction Stone of the True Britannians
"prepare for war with all." 1011465, // : True Britannians
), 1005181, // Followers of Lord British will now be ignored.
new TextDefinition(1011454, "This city is controlled by Lord British."), 1005182, // Followers of Lord British will now be warned of their impending doom.
new TextDefinition(1042254, "This sigil has been corrupted by the True Britannians"), 1005183, // Followers of Lord British will now be attacked on sight.
new TextDefinition(1041045, "The faction signup stone for the True Britannians"),
new TextDefinition(1041383, "The Faction Stone of the True Britannians"),
new TextDefinition(1011465, ": True Britannians"),
new TextDefinition(1005181, "Followers of Lord British will now be ignored."),
new TextDefinition(1005182, "Followers of Lord British will now be warned of their impending doom."),
new TextDefinition(1005183, "Followers of Lord British will now be attacked on sight."),
new StrongholdDefinition( new StrongholdDefinition(
new[] new[]
{ {
@ -64,16 +64,16 @@ namespace Server.Factions
), ),
new[] new[]
{ {
new RankDefinition(10, 991, 8, new TextDefinition(1060794, "Knight of the Codex")), new RankDefinition(10, 991, 8, 1060794), // Knight of the Codex
new RankDefinition(9, 950, 7, new TextDefinition(1060793, "Knight of Virtue")), new RankDefinition(9, 950, 7, 1060793), // Knight of Virtue
new RankDefinition(8, 900, 6, new TextDefinition(1060792, "Crusader")), new RankDefinition(8, 900, 6, 1060792), // Crusader
new RankDefinition(7, 800, 6, new TextDefinition(1060792, "Crusader")), new RankDefinition(7, 800, 6, 1060792), // Crusader
new RankDefinition(6, 700, 5, new TextDefinition(1060791, "Sentinel")), new RankDefinition(6, 700, 5, 1060791), // Sentinel
new RankDefinition(5, 600, 5, new TextDefinition(1060791, "Sentinel")), new RankDefinition(5, 600, 5, 1060791), // Sentinel
new RankDefinition(4, 500, 5, new TextDefinition(1060791, "Sentinel")), new RankDefinition(4, 500, 5, 1060791), // Sentinel
new RankDefinition(3, 400, 4, new TextDefinition(1060790, "Defender")), new RankDefinition(3, 400, 4, 1060790), // Defender
new RankDefinition(2, 200, 4, new TextDefinition(1060790, "Defender")), new RankDefinition(2, 200, 4, 1060790), // Defender
new RankDefinition(1, 0, 4, new TextDefinition(1060790, "Defender")) new RankDefinition(1, 0, 4, 1060790), // Defender
}, },
new[] new[]
{ {
@ -83,8 +83,8 @@ namespace Server.Factions
5000, 5000,
1000, 1000,
10, 10,
new TextDefinition(1011526, "HENCHMAN"), 1011526, // HENCHMAN
new TextDefinition(1011510, "Hire Henchman") 1011510 // Hire Henchman
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionMercenary), typeof(FactionMercenary),
@ -92,8 +92,8 @@ namespace Server.Factions
6000, 6000,
2000, 2000,
10, 10,
new TextDefinition(1011527, "MERCENARY"), 1011527, // MERCENARY
new TextDefinition(1011511, "Hire Mercenary") 1011511 // Hire Mercenary
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionKnight), typeof(FactionKnight),
@ -101,8 +101,8 @@ namespace Server.Factions
7000, 7000,
3000, 3000,
10, 10,
new TextDefinition(1011528, "KNIGHT"), 1011528, // KNIGHT
new TextDefinition(1011497, "Hire Knight") 1011497 // Hire Knight
), ),
new GuardDefinition( new GuardDefinition(
typeof(FactionPaladin), typeof(FactionPaladin),
@ -110,8 +110,8 @@ namespace Server.Factions
8000, 8000,
4000, 4000,
10, 10,
new TextDefinition(1011529, "PALADIN"), 1011529, // PALADIN
new TextDefinition(1011498, "Hire Paladin") 1011498 // Hire Paladin
) )
} }
); );
@ -119,4 +119,3 @@ namespace Server.Factions
public static Faction Instance { get; private set; } public static Faction Instance { get; private set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Britain : Town public class Britain : Town
{ {
public Britain() => public Britain() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x1869, 0x1869,
"Britain", "Britain",
"Britain", "Britain",
new TextDefinition(1011433, "BRITAIN"), 1011433, // BRITAIN
new TextDefinition(1011561, "TOWN STONE FOR BRITAIN"), 1011561, // TOWN STONE FOR BRITAIN
new TextDefinition(1041034, "The Faction Sigil Monolith of Britain"), 1041034, // The Faction Sigil Monolith of Britain
new TextDefinition(1041404, "The Faction Town Sigil Monolith of Britain"), 1041404, // The Faction Town Sigil Monolith of Britain
new TextDefinition(1041413, "Faction Town Stone of Britain"), 1041413, // Faction Town Stone of Britain
new TextDefinition(1041395, "Faction Town Sigil of Britain"), 1041395, // Faction Town Sigil of Britain
new TextDefinition(1041386, "Corrupted Faction Town Sigil of Britain"), 1041386, // Corrupted Faction Town Sigil of Britain
new Point3D(1592, 1680, 10), new Point3D(1592, 1680, 10),
new Point3D(1588, 1676, 10) new Point3D(1588, 1676, 10)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Magincia : Town public class Magincia : Town
{ {
public Magincia() => public Magincia() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x1870, 0x1870,
"Magincia", "Magincia",
"Magincia", "Magincia",
new TextDefinition(1011440, "MAGINCIA"), 1011440, // MAGINCIA
new TextDefinition(1011568, "TOWN STONE FOR MAGINCIA"), 1011568, // TOWN STONE FOR MAGINCIA
new TextDefinition(1041041, "The Faction Sigil Monolith of Magincia"), 1041041, // The Faction Sigil Monolith of Magincia
new TextDefinition(1041411, "The Faction Town Sigil Monolith of Magincia"), 1041411, // The Faction Town Sigil Monolith of Magincia
new TextDefinition(1041420, "Faction Town Stone of Magincia"), 1041420, // Faction Town Stone of Magincia
new TextDefinition(1041402, "Faction Town Sigil of Magincia"), 1041402, // Faction Town Sigil of Magincia
new TextDefinition(1041393, "Corrupted Faction Town Sigil of Magincia"), 1041393, // Corrupted Faction Town Sigil of Magincia
new Point3D(3714, 2235, 20), new Point3D(3714, 2235, 20),
new Point3D(3712, 2230, 20) new Point3D(3712, 2230, 20)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Minoc : Town public class Minoc : Town
{ {
public Minoc() => public Minoc() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x186B, 0x186B,
"Minoc", "Minoc",
"Minoc", "Minoc",
new TextDefinition(1011437, "MINOC"), 1011437, // MINOC
new TextDefinition(1011564, "TOWN STONE FOR MINOC"), 1011564, // TOWN STONE FOR MINOC
new TextDefinition(1041036, "The Faction Sigil Monolith of Minoc"), 1041036, // The Faction Sigil Monolith of Minoc
new TextDefinition(1041406, "The Faction Town Sigil Monolith Minoc"), 1041406, // The Faction Town Sigil Monolith Minoc
new TextDefinition(1041415, "Faction Town Stone of Minoc"), 1041415, // Faction Town Stone of Minoc
new TextDefinition(1041397, "Faction Town Sigil of Minoc"), 1041397, // Faction Town Sigil of Minoc
new TextDefinition(1041388, "Corrupted Faction Town Sigil of Minoc"), 1041388, // Corrupted Faction Town Sigil of Minoc
new Point3D(2471, 439, 15), new Point3D(2471, 439, 15),
new Point3D(2469, 445, 15) new Point3D(2469, 445, 15)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Moonglow : Town public class Moonglow : Town
{ {
public Moonglow() => public Moonglow() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x186C, 0x186C,
"Moonglow", "Moonglow",
"Moonglow", "Moonglow",
new TextDefinition(1011435, "MOONGLOW"), 1011435, // MOONGLOW
new TextDefinition(1011563, "TOWN STONE FOR MOONGLOW"), 1011563, // TOWN STONE FOR MOONGLOW
new TextDefinition(1041037, "The Faction Sigil Monolith of Moonglow"), 1041037, // The Faction Sigil Monolith of Moonglow
new TextDefinition(1041407, "The Faction Town Sigil Monolith of Moonglow"), 1041407, // The Faction Town Sigil Monolith of Moonglow
new TextDefinition(1041416, "Faction Town Stone of Moonglow"), 1041416, // Faction Town Stone of Moonglow
new TextDefinition(1041398, "Faction Town Sigil of Moonglow"), 1041398, // Faction Town Sigil of Moonglow
new TextDefinition(1041389, "Corrupted Faction Town Sigil of Moonglow"), 1041389, // Corrupted Faction Town Sigil of Moonglow
new Point3D(4436, 1083, 0), new Point3D(4436, 1083, 0),
new Point3D(4432, 1086, 0) new Point3D(4432, 1086, 0)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class SkaraBrae : Town public class SkaraBrae : Town
{ {
public SkaraBrae() => public SkaraBrae() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x186F, 0x186F,
"Skara Brae", "Skara Brae",
"Skara Brae", "Skara Brae",
new TextDefinition(1011439, "SKARA BRAE"), 1011439, // SKARA BRAE
new TextDefinition(1011567, "TOWN STONE FOR SKARA BRAE"), 1011567, // TOWN STONE FOR SKARA BRAE
new TextDefinition(1041040, "The Faction Sigil Monolith of Skara Brae"), 1041040, // The Faction Sigil Monolith of Skara Brae
new TextDefinition(1041410, "The Faction Town Sigil Monolith of Skara Brae"), 1041410, // The Faction Town Sigil Monolith of Skara Brae
new TextDefinition(1041419, "Faction Town Stone of Skara Brae"), 1041419, // Faction Town Stone of Skara Brae
new TextDefinition(1041401, "Faction Town Sigil of Skara Brae"), 1041401, // Faction Town Sigil of Skara Brae
new TextDefinition(1041392, "Corrupted Faction Town Sigil of Skara Brae"), 1041392, // Corrupted Faction Town Sigil of Skara Brae
new Point3D(576, 2200, 0), new Point3D(576, 2200, 0),
new Point3D(572, 2196, 0) new Point3D(572, 2196, 0)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Trinsic : Town public class Trinsic : Town
{ {
public Trinsic() => public Trinsic() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x186A, 0x186A,
"Trinsic", "Trinsic",
"Trinsic", "Trinsic",
new TextDefinition(1011434, "TRINSIC"), 1011434, // TRINSIC
new TextDefinition(1011562, "TOWN STONE FOR TRINSIC"), 1011562, // TOWN STONE FOR TRINSIC
new TextDefinition(1041035, "The Faction Sigil Monolith of Trinsic"), 1041035, // The Faction Sigil Monolith of Trinsic
new TextDefinition(1041405, "The Faction Town Sigil Monolith of Trinsic"), 1041405, // The Faction Town Sigil Monolith of Trinsic
new TextDefinition(1041414, "Faction Town Stone of Trinsic"), 1041414, // Faction Town Stone of Trinsic
new TextDefinition(1041396, "Faction Town Sigil of Trinsic"), 1041396, // Faction Town Sigil of Trinsic
new TextDefinition(1041387, "Corrupted Faction Town Sigil of Trinsic"), 1041387, // Corrupted Faction Town Sigil of Trinsic
new Point3D(1914, 2717, 20), new Point3D(1914, 2717, 20),
new Point3D(1909, 2720, 20) new Point3D(1909, 2720, 20)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Vesper : Town public class Vesper : Town
{ {
public Vesper() => public Vesper() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x186E, 0x186E,
"Vesper", "Vesper",
"Vesper", "Vesper",
new TextDefinition(1016413, "VESPER"), 1016413, // VESPER
new TextDefinition(1011566, "TOWN STONE FOR VESPER"), 1011566, // TOWN STONE FOR VESPER
new TextDefinition(1041039, "The Faction Sigil Monolith of Vesper"), 1041039, // The Faction Sigil Monolith of Vesper
new TextDefinition(1041409, "The Faction Town Sigil Monolith of Vesper"), 1041409, // The Faction Town Sigil Monolith of Vesper
new TextDefinition(1041418, "Faction Town Stone of Vesper"), 1041418, // Faction Town Stone of Vesper
new TextDefinition(1041400, "Faction Town Sigil of Vesper"), 1041400, // Faction Town Sigil of Vesper
new TextDefinition(1041391, "Corrupted Faction Town Sigil of Vesper"), 1041391, // Corrupted Faction Town Sigil of Vesper
new Point3D(2982, 818, 0), new Point3D(2982, 818, 0),
new Point3D(2985, 821, 0) new Point3D(2985, 821, 0)
); );
} }
}

View file

@ -1,5 +1,5 @@
namespace Server.Factions namespace Server.Factions;
{
public class Yew : Town public class Yew : Town
{ {
public Yew() => public Yew() =>
@ -9,15 +9,14 @@ namespace Server.Factions
0x186D, 0x186D,
"Yew", "Yew",
"Yew", "Yew",
new TextDefinition(1011438, "YEW"), 1011438, // YEW
new TextDefinition(1011565, "TOWN STONE FOR YEW"), 1011565, // TOWN STONE FOR YEW
new TextDefinition(1041038, "The Faction Sigil Monolith of Yew"), 1041038, // The Faction Sigil Monolith of Yew
new TextDefinition(1041408, "The Faction Town Sigil Monolith of Yew"), 1041408, // The Faction Town Sigil Monolith of Yew
new TextDefinition(1041417, "Faction Town Stone of Yew"), 1041417, // Faction Town Stone of Yew
new TextDefinition(1041399, "Faction Town Sigil of Yew"), 1041399, // Faction Town Sigil of Yew
new TextDefinition(1041390, "Corrupted Faction Town Sigil of Yew"), 1041390, // Corrupted Faction Town Sigil of Yew
new Point3D(548, 979, 0), new Point3D(548, 979, 0),
new Point3D(542, 980, 0) new Point3D(542, 980, 0)
); );
} }
}

View file

@ -12,13 +12,14 @@ namespace Server.Engines.MLQuests.Definitions
{ {
Activated = true; Activated = true;
Title = 1075392; // Honest Beggar Title = 1075392; // Honest Beggar
Description = // Beg pardon, sir. I mean, madam. Uh, can I ask a favor of you? I found this jeweled ring. Most people would sell it and keep the money, but not me. I ain't never stole nothing, and I ain't about to start. I tried to take it over to Brit castle, figgerin' it must belong to some highborn lady, but the guards threw me out. You look like they might let you pass. Will you take the ring over there and see if you can find the owner?
1075393; // Beg pardon, sir. I mean, madam. Uh, can I ask a favor of you? I found this jeweled ring. Most people would sell it and keep the money, but not me. I ain't never stole nothing, and I ain't about to start. I tried to take it over to Brit castle, figgerin' it must belong to some highborn lady, but the guards threw me out. You look like they might let you pass. Will you take the ring over there and see if you can find the owner?
Description = 1075393;
RefusalMessage = 1075395; // I see. Too good to help an honest beggar like me, eh? RefusalMessage = 1075395; // I see. Too good to help an honest beggar like me, eh?
InProgressMessage = // A jewel like this must be worth a lot, so it must belong to some noble or another. I would show it around the castle. Someone's bound to recognize it.
1075396; // A jewel like this must be worth a lot, so it must belong to some noble or another. I would show it around the castle. Someone's bound to recognize it. InProgressMessage = 1075396;
CompletionMessage = // Didst thou find my ring? I thank thee very much! It is an old ring, and a gift from my husband. I was most distraught when I realized it was missing.
1075397; // Didst thou find my ring? I thank thee very much! It is an old ring, and a gift from my husband. I was most distraught when I realized it was missing. CompletionMessage = 1075397;
CompletionNotice = CompletionNoticeShort; CompletionNotice = CompletionNoticeShort;
Objectives.Add(new DeliverObjective(typeof(ReginasRing), 1, "Regina's Ring", typeof(Regina))); Objectives.Add(new DeliverObjective(typeof(ReginasRing), 1, "Regina's Ring", typeof(Regina)));

View file

@ -17,17 +17,16 @@ namespace Server.Engines.MLQuests
public class MLQuest public class MLQuest
{ {
public static readonly TextDefinition // You've completed a quest! Don't forget to collect your reward.
CompletionNoticeDefault = public static TextDefinition CompletionNoticeDefault = 1072273;
new(1072273); // You've completed a quest! Don't forget to collect your reward.
public static readonly TextDefinition CompletionNoticeShort = new(1046258); // Your quest is complete. public static TextDefinition CompletionNoticeShort = 1046258; // Your quest is complete.
public static readonly TextDefinition // Your quest is complete. Return for your reward.
CompletionNoticeShortReturn = new(1073775); // Your quest is complete. Return for your reward. public static TextDefinition CompletionNoticeShortReturn = 1073775;
public static readonly TextDefinition // You obtained what you seek, now receive your reward.
CompletionNoticeCraft = new(1073967); // You obtained what you seek, now receive your reward. public static TextDefinition CompletionNoticeCraft = 1073967;
public MLQuest() public MLQuest()
{ {

View file

@ -5,8 +5,7 @@ namespace Server.Engines.MLQuests.Rewards
{ {
public class DummyReward : BaseReward public class DummyReward : BaseReward
{ {
public DummyReward(TextDefinition name) public DummyReward(TextDefinition name) : base(name)
: base(name)
{ {
} }

View file

@ -41,8 +41,7 @@ namespace Server.Engines.MLQuests.Rewards
private readonly Type m_Type; private readonly Type m_Type;
public ItemReward(TextDefinition name = null, Type type = null, int amount = 1) public ItemReward(TextDefinition name = null, Type type = null, int amount = 1) : base(name)
: base(name)
{ {
m_Type = type; m_Type = type;
m_Amount = amount; m_Amount = amount;

View file

@ -70,9 +70,7 @@ namespace Server.Guilds
defs[0] = name; defs[0] = name;
defs[1] = pm.GuildRank.Name; defs[1] = pm.GuildRank.Name;
defs[2] = pm.NetState != null defs[2] = pm.NetState != null ? 1063015 : pm.LastOnline.ToString("yyyy-MM-dd");
? new TextDefinition(1063015)
: new TextDefinition(pm.LastOnline.ToString("yyyy-MM-dd"));
defs[3] = pm.GuildTitle ?? ""; defs[3] = pm.GuildTitle ?? "";
return defs; return defs;
@ -151,8 +149,8 @@ namespace Server.Guilds
{ {
pm.SendLocalizedMessage(1063051, targ.Name); // ~1_val~ is already a member of a guild. pm.SendLocalizedMessage(1063051, targ.Name); // ~1_val~ is already a member of a guild.
} }
else if (targ.HasGump<BaseGuildGump>() || targ.HasGump<CreateGuildGump>() // TODO: Check message if CreateGuildGump Open
) // TODO: Check message if CreateGuildGump Open else if (targ.HasGump<BaseGuildGump>() || targ.HasGump<CreateGuildGump>())
{ {
pm.SendLocalizedMessage(1063052, targ.Name); // ~1_val~ is currently considering another guild invitation. pm.SendLocalizedMessage(1063052, targ.Name); // ~1_val~ is currently considering another guild invitation.
} }

View file

@ -122,11 +122,11 @@ public partial class SoulstoneFragmentToken : PromotionalToken
{ {
} }
public override TextDefinition ItemGumpName => 1070999; // <center>Soulstone Fragment</center> public override TextDefinition ItemGumpName { get; } = 1070999; // <center>Soulstone Fragment</center>
public override TextDefinition ItemName => 1071000; // soulstone fragment public override TextDefinition ItemName { get; } = 1071000; // soulstone fragment
// A soulstone fragment has been created in your bank box. // A soulstone fragment has been created in your bank box.
public override TextDefinition ItemReceiveMessage => 1070976; public override TextDefinition ItemReceiveMessage { get; } = 1070976;
public override Item CreateItemFor(Mobile from) => public override Item CreateItemFor(Mobile from) =>
from?.Account != null ? new SoulstoneFragment(from.Account.ToString()) : null; from?.Account != null ? new SoulstoneFragment(from.Account.ToString()) : null;

View file

@ -17,7 +17,7 @@ namespace Server.Spells
public virtual SkillName MoveSkill => SkillName.Bushido; public virtual SkillName MoveSkill => SkillName.Bushido;
public virtual double RequiredSkill => 0.0; public virtual double RequiredSkill => 0.0;
public virtual TextDefinition AbilityMessage => 0; public virtual TextDefinition AbilityMessage => TextDefinition.Empty;
public virtual bool BlockedByAnimalForm => true; public virtual bool BlockedByAnimalForm => true;
public virtual bool DelayedContext => false; public virtual bool DelayedContext => false;

View file

@ -10,8 +10,8 @@ namespace Server.Spells.Bushido
public override int BaseMana => 0; public override int BaseMana => 0;
public override double RequiredSkill => 25.0; public override double RequiredSkill => 25.0;
public override TextDefinition AbilityMessage => // You better kill your enemy with your next hit or you'll be rather sorry...
new(1063122); // You better kill your enemy with your next hit or you'll be rather sorry... public override TextDefinition AbilityMessage { get; } = 1063122;
public override double GetDamageScalar(Mobile attacker, Mobile defender) => public override double GetDamageScalar(Mobile attacker, Mobile defender) =>
// TODO: 20 -> Perfection // TODO: 20 -> Perfection

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Bushido
public override int BaseMana => 5; public override int BaseMana => 5;
public override double RequiredSkill => 50.0; public override double RequiredSkill => 50.0;
public override TextDefinition AbilityMessage => new(1063167); // You prepare to strike quickly. public override TextDefinition AbilityMessage { get; } = 1063167; // You prepare to strike quickly.
public override bool DelayedContext => true; public override bool DelayedContext => true;

View file

@ -7,8 +7,8 @@ namespace Server.Spells.Bushido
public override int BaseMana => 10; public override int BaseMana => 10;
public override double RequiredSkill => 70.0; public override double RequiredSkill => 70.0;
public override TextDefinition AbilityMessage => // You prepare to strike two enemies with one blow.
new(1070757); // You prepare to strike two enemies with one blow. public override TextDefinition AbilityMessage { get; } = 1070757;
public override void OnHit(Mobile attacker, Mobile defender, int damage) public override void OnHit(Mobile attacker, Mobile defender, int damage)
{ {

View file

@ -8,8 +8,8 @@ namespace Server.Spells.Ninjitsu
public override int BaseMana => 30; public override int BaseMana => 30;
public override double RequiredSkill => Core.ML ? 40.0 : 20.0; public override double RequiredSkill => Core.ML ? 40.0 : 20.0;
public override TextDefinition AbilityMessage => // You prepare to Backstab your opponent.
new(1063089); // You prepare to Backstab your opponent. public override TextDefinition AbilityMessage { get; } = 1063089;
public override bool ValidatesDuringHit => false; public override bool ValidatesDuringHit => false;

View file

@ -13,8 +13,8 @@ namespace Server.Spells.Ninjitsu
public override int BaseMana => 30; public override int BaseMana => 30;
public override double RequiredSkill => 85.0; public override double RequiredSkill => 85.0;
public override TextDefinition AbilityMessage => // You prepare to hit your opponent with a Death Strike.
new(1063091); // You prepare to hit your opponent with a Death Strike. public override TextDefinition AbilityMessage { get; } = 1063091;
public override double GetDamageScalar(Mobile attacker, Mobile defender) => 0.5; public override double GetDamageScalar(Mobile attacker, Mobile defender) => 0.5;

View file

@ -7,8 +7,8 @@ namespace Server.Spells.Ninjitsu
public override int BaseMana => Core.ML ? 10 : 20; public override int BaseMana => Core.ML ? 10 : 20;
public override double RequiredSkill => Core.ML ? 30.0 : 60; public override double RequiredSkill => Core.ML ? 30.0 : 60;
public override TextDefinition AbilityMessage => // You prepare to focus all of your abilities into your next strike.
new(1063095); // You prepare to focus all of your abilities into your next strike. public override TextDefinition AbilityMessage { get; } = 1063095;
public override bool Validate(Mobile from) public override bool Validate(Mobile from)
{ {

View file

@ -11,8 +11,8 @@ namespace Server.Spells.Ninjitsu
public override int BaseMana => 25; public override int BaseMana => 25;
public override double RequiredSkill => 80.0; public override double RequiredSkill => 80.0;
public override TextDefinition AbilityMessage => // Your Ki Attack must be complete within 2 seconds for the damage bonus!
new(1063099); // Your Ki Attack must be complete within 2 seconds for the damage bonus! public override TextDefinition AbilityMessage { get; } = 1063099;
public override void OnUse(Mobile from) public override void OnUse(Mobile from)
{ {

View file

@ -11,7 +11,7 @@ namespace Server.Spells.Ninjitsu
public override int BaseMana => 20; public override int BaseMana => 20;
public override double RequiredSkill => Core.ML ? 60.0 : 30.0; public override double RequiredSkill => Core.ML ? 60.0 : 30.0;
public override TextDefinition AbilityMessage => new(1063128); // You prepare to surprise your prey. public override TextDefinition AbilityMessage { get; } = 1063128; // You prepare to surprise your prey.
public override bool ValidatesDuringHit => false; public override bool ValidatesDuringHit => false;

View file

@ -31,7 +31,7 @@ namespace Server.Items
[CommandProperty(AccessLevel.GameMaster)] [CommandProperty(AccessLevel.GameMaster)]
public int StrengthBonus { get; set; } public int StrengthBonus { get; set; }
public override TextDefinition InvalidTransferMessage => 1073480; // Your arcane focus disappears. public override TextDefinition InvalidTransferMessage { get; } = 1073480; // Your arcane focus disappears.
public override bool Nontransferable => true; public override bool Nontransferable => true;
public override void GetProperties(IPropertyList list) public override void GetProperties(IPropertyList list)

View file

@ -29,7 +29,7 @@ namespace Server.Items
public override bool Nontransferable => true; public override bool Nontransferable => true;
public virtual TextDefinition InvalidTransferMessage => null; public virtual TextDefinition InvalidTransferMessage => TextDefinition.Empty;
public override void HandleInvalidTransfer(Mobile from) public override void HandleInvalidTransfer(Mobile from)
{ {