Beispiel #1
0
        public void Execute(Player player, string[] args)
        {
            if (player.HasSlot(3) && player.Inventory[3].ObjectId == "Forge Amulet")
            {
                List<string> advancedNames = new List<string>();
                List<string> itemNames = new List<string>();
                Combinations c = new Combinations();
                foreach (var i in c.advCombos)
                {
                    string addText = i.Value.Item1;
                    int requiredItemCount = i.Key.Length;
                    List<string> sList = i.Key.ToList();
                    foreach (var e in player.Inventory)
                    {
                        try
                        {
                            if (sList.Contains(e.ObjectId))
                                requiredItemCount--; sList.Remove(e.ObjectId);
                        }
                        catch { }
                    }
                    if (requiredItemCount <= 0 && i.Value.Item2 <= player.CurrentFame)
                        addText = "<b>" + addText + "</b>";

                    if (i.Value.Item3)
                        advancedNames.Add(addText);
                    else
                        itemNames.Add(addText);
                }

                player.Client.SendPacket(new TextBoxPacket()
                {
                    Title = "Forge List",
                    Message = "<u>ADVANCED COMBOS</u>\n" + string.Join(" | ", advancedNames.ToArray()) + "\n\n<u>REGULAR COMBOS</u>\n" + string.Join(" | ", itemNames.ToArray()),
                    Button1 = "Ok"
                });
            }
            else
            {
                List<string> itemNames = new List<string>();
                Combinations c = new Combinations();
                foreach (var i in c.combos)
                {
                    string addText = i.Value.Item1;
                    int requiredItemCount = i.Key.Length;
                    List<string> sList = i.Key.ToList();
                    foreach (var e in player.Inventory)
                    {
                        try
                        {
                            if (sList.Contains(e.ObjectId))
                                requiredItemCount--; sList.Remove(e.ObjectId);
                        }
                        catch { }
                    }
                    if (requiredItemCount <= 0 && i.Value.Item2 <= player.CurrentFame)
                        addText = "<b>" + addText + "</b>";

                    itemNames.Add(addText);
                }

                player.Client.SendPacket(new TextBoxPacket()
                {
                    Title = "Forge List",
                    Message = string.Join(" | ", itemNames.ToArray()),
                    Button1 = "Ok"
                });
            }
        }
Beispiel #2
0
        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 = "[P] " + 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 = "[HDev] " + psr.Account.Name; break;
                case 6:
                    Name = "[CM] " + psr.Account.Name; break;
                case 7:
                    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;
        }
Beispiel #3
0
        public Player(Client client)
            : base((short)client.Character.ObjectType, client.Random)
        {
            this.client = client;
            statsMgr = new StatsManager(this);
            nName = client.Account.Name;
            AccountId = client.Account.AccountId;
            Level = client.Character.Level;
            Experience = client.Character.Exp;
            ExperienceGoal = GetExpGoal(client.Character.Level);
            Stars = GetStars(); //Temporary (until pub server)
            Texture1 = client.Character.Tex1;
            Texture2 = client.Character.Tex2;
            Credits = client.Account.Credits;
            NameChosen = client.Account.NameChosen;
            CurrentFame = client.Account.Stats.Fame;
            Fame = client.Character.CurrentFame;
            var state = client.Account.Stats.ClassStates.SingleOrDefault(_ => _.ObjectType == ObjectType);
            if (state != null)
                FameGoal = GetFameGoal(state.BestFame);
            else
                FameGoal = GetFameGoal(0);
            Glowing = false;
            Guild = client.Account.Guild.Name;
            GuildRank = client.Account.Guild.Rank;
            if (client.Character.HitPoints <= 0)
            {
                HP = client.Character.MaxHitPoints;
                client.Character.HitPoints = client.Character.MaxHitPoints;
            }
            else
                HP = client.Character.HitPoints;
            MP = client.Character.MagicPoints;
            ConditionEffects = 0;
            OxygenBar = 100;

            Decision = 0;
            combs = new Combinations();
            price = new Prices();

            Locked = client.Account.Locked != null ? client.Account.Locked : new List<int>();
            Ignored = client.Account.Ignored != null ? client.Account.Ignored : new List<int>();
            using (var db = new Database())
            {
                Locked = db.getLockeds(this.AccountId);
                Ignored = db.getIgnoreds(this.AccountId);
            }

            Inventory = client.Character.Equipment.Select(_ => _ == -1 ? null : (XmlDatas.ItemDescs.ContainsKey(_) ? XmlDatas.ItemDescs[_] : null)).ToArray();
            SlotTypes = Utils.FromCommaSepString32(XmlDatas.TypeToElement[ObjectType].Element("SlotTypes").Value);
            Stats = new int[]
            {
                client.Character.MaxHitPoints,
                client.Character.MaxMagicPoints,
                client.Character.Attack,
                client.Character.Defense,
                client.Character.Speed,
                client.Character.HpRegen,
                client.Character.MpRegen,
                client.Character.Dexterity,
            };

            Pet = null;
        }
Beispiel #4
0
        public Player(ClientProcessor psr)
            : base((short)psr.Character.ObjectType, psr.Random)
        {
            this.psr = psr;
            statsMgr = new StatsManager(this);
            nName = psr.Account.Name;
            AccountId = psr.Account.AccountId;
            switch (psr.Account.Rank)
            {
                case 0:
                    Name = psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 1:
                    Name = "[Donator] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 2:
                    Name = "[VIP] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 3:
                    Name = "[Trial GM] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 4:
                    Name = "[Tester] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 5:
                    Name = "[GM] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 6:
                    Name = "[QA] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 7:
                    Name = "[Dev] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 8:
                    Name = "[CM] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 9:
                    Name = "[Head QA] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 10:
                    Name = "[Head Dev] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
                case 11:
                    Name = "[Founder] " + psr.Account.Tags + " " + psr.Account.Name;
                    break;
            }
            Level = psr.Character.Level;
            Experience = psr.Character.Exp;
            ExperienceGoal = GetExpGoal(psr.Character.Level);
            if (psr.Account.Rank > 2)
                Stars = 95;
            else if (psr.Account.Rank > 1)
                Stars = 90;
            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);
            FameGoal = GetFameGoal(state != null ? state.BestFame : 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 ?? new List<int>();
            Ignored = psr.Account.Ignored ?? new List<int>();
            Commands = psr.Account.Commands ?? new List<string>();
            try
            {
                using (var dbx = new Database())
                {
                    Locked = dbx.GetLockeds(AccountId);
                    Ignored = dbx.GetIgnoreds(AccountId);
                    Commands = dbx.GetCommands(AccountId);

                    dbx.Dispose();
                }

                List<string> BrokenCommands = new List<string>(new string[] { "vanish" });

                List<string> TestingCommands = new List<string>(new string[] { "" });

                List<string> BuySellCommands = new List<string>(new string[] { "buy", "sell" });
                List<string> GuildCommands = new List<string>(new string[] { "g", "invite" });
                List<string> BanCommands = new List<string>(new string[] { "ban", "unban", "warn", "ip", "ipban" });
                List<string> StatCommands = new List<string>(new string[] { "hp", "mp", "att", "def", "vit", "wis", "dex", "spd", "stars", "level", "fame" });

                List<string> PlayerCommands = new List<string>(new string[] { "tutorial", "name", "visit", "who", "swho", "pause", "afk", "getquest", "teleport", "tell", "group", "solo", "shop", "commands", "stats", "arenas", "leaderboard", "gleaderboard", "forge", "forgelist", "yes", "no", "say", "server", "stats", "p", "bp", "nothing" });
                List<string> VIPCommands = new List<string>(new string[] { "d" });
                List<string> TrialGMCommands = new List<string>(new string[] { "give", "god", "addeff", "remeff", "tq", "visitBP", "grave", "summon", "arena", "closerealm" });
                List<string> GMCommands = new List<string>(new string[] { "ban", "unban", "kill", "kick", "message", "announce" }); GMCommands.AddRange(TrialGMCommands); GMCommands.AddRange(BanCommands); GMCommands.AddRange(StatCommands);
                List<string> QACommands = new List<string>(new string[] { "tq", "visitBP", "grave", "kick", "summon", "message", "spawn", "announce", "setpiece" });
                List<string> DevCommands = new List<string>(new string[] { "killall", "killallx", "spawn", "restart", "osay" }); DevCommands.AddRange(GMCommands);
                List<string> CMCommands = new List<string>(new string[] { "rename", "grank", "setguild" }); CMCommands.AddRange(DevCommands);
                List<string> HeadQACommands = new List<string>(new string[] { "" }); HeadQACommands.AddRange(CMCommands);
                //List<string> HeadDevCommands = new List<string>(new string[] { "" }); HeadDevCommands.AddRange(HeadQAdCommands);
                List<string> FounderCommands = new List<string>(new string[] { "" });

                var t = typeof(ICommand);

                foreach (var i in t.Assembly.GetTypes())
                {
                    if (t.IsAssignableFrom(i) && i != t)
                    {
                        var instance = (ICommand)Activator.CreateInstance(i);
                        FounderCommands.Add(instance.Command);
                    }
                }
                switch (psr.Account.Rank)
                {
                    default:
                        break;
                    case 2:
                        Commands.AddRange(VIPCommands);
                        break;
                    case 3:
                        Commands.AddRange(TrialGMCommands);
                        break;
                    case 4:
                        Commands.AddRange(TestingCommands);
                        break;
                    case 5:
                        Commands.AddRange(GMCommands);
                        break;
                    case 6:
                        Commands.AddRange(QACommands);
                        break;
                    case 7:
                        Commands.AddRange(DevCommands);
                        break;
                    case 8:
                        Commands.AddRange(CMCommands);
                        break;
                    case 9:
                        Commands.AddRange(HeadQACommands);
                        break;
                    case 10:
                        //Commands.AddRange(HeadDevCommands);
                        break;

                    case 11:
                        Commands.AddRange(FounderCommands);
                        Commands.Add("visitBP");
                        break;
                }
                Commands.AddRange(PlayerCommands);
                Commands.AddRange(GuildCommands);
                Commands.AddRange(BuySellCommands);

                Commands = Commands.Distinct().ToList();
                #region Donator bundles //will do later
                List<string> Bundle1Commands = new List<string>(new string[] { "" });
                List<string> Bundle2Commands = new List<string>(new string[] { "" });
                List<string> Bundle3Commands = new List<string>(new string[] { "" });
                List<string> Bundle4Commands = new List<string>(new string[] { "" });
                #endregion

            }
            catch
            {
            }

            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[]
            {
                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;
        }
        public Player(ClientProcessor psr)
            : base((short) psr.Character.ObjectType, psr.Random)
        {
            this.psr = psr;
            statsMgr = new StatsManager(this);
            nName = psr.Account.Name;
            AccountId = psr.Account.AccountId;
            switch (psr.Account.Rank)
            {
                case 0:
                    Name = psr.Account.Name; break;
                case 1:
                    Name = "[Player] " + psr.Account.Name; break;
                case 2:
                    Name = "[Member] " + psr.Account.Name; break;
                case 3:
                    Name = "[Helper] " + psr.Account.Name; break;
                case 4:
                    Name = "[GM] " + psr.Account.Name; break;
                case 5:
                    Name = "[Spriter] " + psr.Account.Name; break;
                case 6:
                    Name = "[VIP " + psr.Account.Name; break;
                case 7:
                    Name = "[Tester] " + psr.Account.Name; break;
                case 8:
                    Name = "[Security] " + psr.Account.Name; break;
                case 9:
                    Name = "[Crazy] " + psr.Account.Name; break;
                case 10:
                    Name = "[QA] " + psr.Account.Name; break;
                case 11:
                    Name = "[Dev] " + psr.Account.Name; break;
                case 12:
                    Name = "[Admin] " + psr.Account.Name; break;
                case 13:
                    Name = "[HDev] " + psr.Account.Name; break;
                case 14:
                    Name = "[Friend] " + psr.Account.Name; break;
                case 15:
                    Name = "[Swag] " + psr.Account.Name; break;
                case 16:
                    Name = "[Super Donator] " + psr.Account.Name; break;
                case 17:
                    Name = "[Epic VIP] " + psr.Account.Name; break;
                case 18:
                    Name = "[Head-Admin] " + psr.Account.Name; break;
                case 19:
                    Name = "[CM] " + psr.Account.Name; break;
                case 20:
                    Name = "[Co-Owner]" + psr.Account.Name; break;
                case 21:
                    Name = "[Owner] " + psr.Account.Name; break;
                case 22:
                    Name = "[Super-Founder] " + psr.Account.Name; break;
                case 23:
                    Name = "[Head-Owner] " + psr.Account.Name; break;
            }
            //            if (psr.Account.Name == "Lucifer" || psr.Account.Name == "Luciferus" || psr.Account.Name == "HaseoAura")
            if (psr.Account.Name == "HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
            {
                Name = "[Super Founder] " + psr.Account.Name;
            }
            if (AccountId == 1)
            {
                Name = "[Owner] " + psr.Account.Name;
            }
            Level = psr.Character.Level;
            Experience = psr.Character.Exp;
            ExperienceGoal = GetExpGoal(psr.Character.Level);
            //            if (psr.Account.Name == "Dragonlord3344" || psr.Account.Name == "HaseoAura" || psr.Account.Name == "Lucifer")
            if (psr.Account.Name == "NOOOOOOOOOOOOOOOOOOOOO" || psr.Account.Name == "REJECTEDDDDDDDDDDDDDDDDDD")
                Stars = 1337;
            else if (psr.Account.Rank > 14)
                Stars = 666;
            else if (psr.Account.Rank > 12)
                Stars = 69;
            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);
            FameGoal = GetFameGoal(state != null ? state.BestFame : 0);
            Glowing = true;
            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 ?? new List<int>();
            Ignored = psr.Account.Ignored ?? new List<int>();
            try
            {
                using (var dbx = new Database())
                {
                    Locked = dbx.GetLockeds(AccountId);
                    Ignored = dbx.GetIgnoreds(AccountId);

                    dbx.Dispose();
                }
            }
            catch
            {
            }

            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[]
            {
                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;
        }