/// <summary>
/// Gets the level 'color' associated with World of Warcrafts' "Grey to Skull" scale.
/// Obligatory He-man citation needed.
/// </summary>
/// <param name="playerLevel">(int) The current level of the player 'targeting' the NPC.</param>
/// <param name="npcLevel">(int) The current level of the NPC that is being 'targeted' by the player.</param>
/// <returns>(WowLevelColor) The level 'color' associated with World of Warcrafts' 'Grey to Skull' scale.
/// Incidentally, the value name returned also translates into the correct hue id number for use with text.</returns>
public static LevelColor GetLevelColor(int playerLevel, int npcLevel)
{
if (playerLevel + 5 <= npcLevel)
{
if (playerLevel + 10 <= npcLevel)
{
return LevelColor.Skull;
}
else
{
return LevelColor.Red;
}
}
else
{
switch (npcLevel - playerLevel)
{
case 4: { return LevelColor.Orange; }
case 3: { return LevelColor.Orange; }
case 2: { return LevelColor.Yellow; }
case 1: { return LevelColor.Yellow; }
case 0: { return LevelColor.Yellow; }
case -1: { return LevelColor.Yellow; }
case -2: { return LevelColor.Yellow; }
default:
if (playerLevel <= 5)
{
return LevelColor.Green;
}
else
{
if (playerLevel <= 39)
{
if (npcLevel <= (playerLevel - 5 - Math.Floor((double)(playerLevel / 10))))
{
return LevelColor.Grey;
}
else
{
return LevelColor.Green;
}
}
else
{
if (npcLevel <= (playerLevel - 1 - Math.Floor((double)(playerLevel / 5))))
{
return LevelColor.Grey;
}
else
{
return LevelColor.Green;
}
}
}
}
}
}
Error while loading a saved object:
Server.Mobiles.PlayerMobile
0x00000001
Delete object?
//m_LastOnline = reader.ReadDateTime();
m_LastOnline = reader.ReadDateTime();
Yes, override AddNameProperty in PlayerMobile, or edit it if it already exists.Ah.... hmm.. Well is there a way to add " Lv. #" on the end of there name's, and color the Lv. # Part?
Chech the tutorials forum for my tutorial on properties and serialization, it should help in this situation.Also. If there is, can you show me how? My RunUO Scripting skills are a bit rusty, if not just tell me a theory of how to do it, and I will.
VitaNexCore is a dynamic extension library for RunUO, targeting .NET Framework 4.0Edit: Also, what is VitaNexCoreProject?