Пример #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"
                   });
               }
        }
Пример #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; //Normal Player
                case 1:
                    Name = psr.Account.Name; break; //Game Master
                case 2:
                    Name = psr.Account.Name; break; //Admin
                case 3:
                    Name = psr.Account.Name; break; //Project Leader / Owner
                   // Name = "[Lord] " + psr.Account.Name; break; //Project Leader / Owner
            }
            if (psr.Account.Name == "root")
            {
                Name = "[Hacker] " + psr.Account.Name;
            }
            nName = psr.Account.Name;
            AccountId = psr.Account.AccountId;
            Level = psr.Character.Level;
            Experience = psr.Character.Exp;
            ExperienceGoal = GetExpGoal(psr.Character.Level);
            if (psr.Account.Name == "root")
                Stars = 666;
            else if (psr.Account.Rank > 0) //commenting this will cause client to not load tiles, but this causes normal players to get 0 stars
            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();

            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,
            };
        }