public Player(ClientProcessor psr)
: base((short)psr.Character.ObjectType, psr.Random)
{
this.psr = psr;
statsMgr = new StatsManager(this);
switch(psr.Account.Rank) {
case 0:
Name = psr.Account.Name; break;
case 1:
Name = "[Donator] " + psr.Account.Name; break;
case 2:
Name = "[Helper] " + psr.Account.Name; break;
case 3:
Name = "[GM] " + psr.Account.Name; break;
case 4:
Name = "[Dev] " + psr.Account.Name; break;
case 5:
Name = "[HGM] " + psr.Account.Name; break;
case 6:
Name = "[HDDev] " + psr.Account.Name; break;
case 7:
Name = "[HCDev] " + psr.Account.Name; break;
case 8:
Name = "[Founder] " + psr.Account.Name; break;
}
nName = psr.Account.Name;
AccountId = psr.Account.AccountId;
Level = psr.Character.Level;
Experience = psr.Character.Exp;
ExperienceGoal = GetExpGoal(psr.Character.Level);
if (psr.Account.Rank > 2)
Stars = 75;
else if (psr.Account.Rank > 1)
Stars = 60;
else
Stars = GetStars(); //Temporary (until pub server)
Texture1 = psr.Character.Tex1;
Texture2 = psr.Character.Tex2;
Credits = psr.Account.Credits;
NameChosen = psr.Account.NameChosen;
CurrentFame = psr.Account.Stats.Fame;
Fame = psr.Character.CurrentFame;
var state = psr.Account.Stats.ClassStates.SingleOrDefault(_ => _.ObjectType == ObjectType);
if (state != null)
FameGoal = GetFameGoal(state.BestFame);
else
FameGoal = GetFameGoal(0);
Glowing = false;
Guild = psr.Account.Guild.Name;
GuildRank = psr.Account.Guild.Rank;
if (psr.Character.HitPoints <= 0)
{
HP = psr.Character.MaxHitPoints;
psr.Character.HitPoints = psr.Character.MaxHitPoints;
}
else
HP = psr.Character.HitPoints;
MP = psr.Character.MagicPoints;
ConditionEffects = 0;
OxygenBar = 100;
Decision = 0;
combs = new Combinations();
price = new Prices();
Locked = psr.Account.Locked != null ? psr.Account.Locked : new List<int>();
Ignored = psr.Account.Ignored != null ? psr.Account.Ignored : new List<int>();
using (Database dbx = new Database())
{
Locked = dbx.getLockeds(this.AccountId);
Ignored = dbx.getIgnoreds(this.AccountId);
}
Inventory = psr.Character.Equipment.Select(_ => _ == -1 ? null : (XmlDatas.ItemDescs.ContainsKey(_) ? XmlDatas.ItemDescs[_] : null)).ToArray();
SlotTypes = Utils.FromCommaSepString32(XmlDatas.TypeToElement[ObjectType].Element("SlotTypes").Value);
Stats = new int[]
{
psr.Character.MaxHitPoints,
psr.Character.MaxMagicPoints,
psr.Character.Attack,
psr.Character.Defense,
psr.Character.Speed,
psr.Character.HpRegen,
psr.Character.MpRegen,
psr.Character.Dexterity,
};
Pet = null;
}