Пример #1
0
        public int BlackImbue(Equipment Item, ref ImbueStat stat, ImbueItem imbueitem, int success)
        {
            int value = (int)(Item.RequiredLevel) + imbueitem.IncreaseValue;
            value += (int)(((value * 0.1) * Item.Plus) + ((imbueitem.ImbueChance / 5) * Item.Plus));
            value *= success;

            if (Item is Hand)
            {
                Item.Damage += (short)value;
                stat = ImbueStat.Damage;
            }
            if (Item is Cape)
            {
                if (Item.Damage > 0 && Item.Defence > 0)
                {
                    Item.Defence += (short)value;
                    Item.Damage += (short)value;
                    stat = ImbueStat.DefenseAndDamage;
                }
                else
                {
                    Item.Defence += (short)value;
                    stat = ImbueStat.Defense;
                }
            }
            if (Item is Head)
            {
                Item.AttackRating += (short)value;
                stat = ImbueStat.AttackRating;
            }
            if (Item is Body)
            {
                Item.Defence += (short)value;
                stat = ImbueStat.Defense;
            }
            if (Item is Feet)
            {
                value = (int)(Math.Round((double)(value / 50))) + 1;
                Item.Critical += (short)value;
                stat = ImbueStat.CriticalHit;
            }
            if (Item is Ring)
            {
                Item.IncMaxLife += (short)value;
                stat = ImbueStat.MaxLife;
            }
            if (Item is Necklace)
            {
                Item.IncMaxMana += (short)value;
                stat = ImbueStat.MaxMana;
            }

            return value;
        }
Пример #2
0
        public EquipmentViewModel(Entities.Equipment equipment)
        {
            ItemCapacity = equipment.ItemCapacity;
            ItemCount    = equipment.GetItemCount();

            var items = equipment.EquipmentItems
                        .OrderBy(i => i.ProductID)
                        .ThenBy(i => i.Quality)
                        .ToList();


            foreach (var item in items)
            {
                Items.Add(
                    new EquipmentItemViewModel(item)
                    );
            }
        }
Пример #3
0
 public CompanyEquipmentViewModel(Company company, Entities.Equipment equipment)
     : base(equipment)
 {
     Info = new CompanyInfoViewModel(company);
 }
Пример #4
0
 public static byte[] SendImbueMessage(ImbueError error, ImbueStat stat, int value, Equipment item)
 {
     Packet p = new Packet(5);
     p.WriteByte((byte)error); // Error message
     p.WriteByte((byte)stat); // Stat
     p.WriteInt(value);
     p.WriteHexString("00");
     p.WriteShort(item.ReferenceID);
     p.WriteByte(item.Plus);
     p.WriteByte(item.Slvl);
     return p.GetWrittenBuffer(PacketIds.SendImbueMessage);
 }
Пример #5
0
 public HouseChestViewModel(House house, Entities.Equipment citizenEquipment, HouseChest chest, HouseRights houseRights)
 {
     Info             = new HouseInfoViewModel(house, houseRights);
     CitizenEquipment = new EquipmentViewModel(citizenEquipment);
     ChestEquipment   = new EquipmentViewModel(chest);
 }
Пример #6
0
        public List<Equipment> GetVisuals()
        {
            bool[] equip = new bool[9];
            List<Equipment> equips = new List<Equipment>();
            List<Equipment> Equipments = GetAllEquips();

            for (int i = 0; i < 9; i++)
            {
                if (!equip[i])
                {
                    Equipment temp = new Equipment();
                    temp.Slot = (byte)i;
                    temp.VisualID = 0;
                    temp.Plus = 0;
                    temp.Slvl = 0;
                    temp.RequiredClass = 0;
                    equips.Add(temp);
                }
            }

            foreach (Equipment i in Equipments)
            {
                if (i != null)
                {
                    equips.RemoveAt(i.Slot);
                    equips.Insert(i.Slot, i);
                    equip[i.Slot] = true;
                }
            }

            return equips;
        }
Пример #7
0
        public int WhiteImbue(Equipment Item, ref ImbueStat stat, ImbueItem imbueitem)
        {
            int value = (int)(Item.RequiredLevel);
            value += (int)(((value * 0.1) * Item.Slvl) + ((imbueitem.ImbueChance / 5) * Item.Slvl));

            List<ImbueStat> WhiteStats = new List<ImbueStat>();
            WhiteStats.Add(ImbueStat.Damage);
            WhiteStats.Add(ImbueStat.Defense);
            WhiteStats.Add(ImbueStat.AttackRating);
            WhiteStats.Add(ImbueStat.MaxLife);
            WhiteStats.Add(ImbueStat.MaxMana);
            WhiteStats.Add(ImbueStat.LifeReg);
            WhiteStats.Add(ImbueStat.ManaReg);
            WhiteStats.Add(ImbueStat.CriticalHit);

            if (Item is Cape)
            {
                WhiteStats.Remove(ImbueStat.Damage);
                WhiteStats.Remove(ImbueStat.Defense);
            }
            if (Item is Hand)
            {
                Hand weapon = Item as Hand;
                WhiteStats.Remove(weapon.NotWithWhite);
            }
            if (Item is Head)
            {
                Head hat = Item as Head;
                WhiteStats.Remove(hat.NotWithWhite);
            }
            if (Item is Body)
            {
                Body armor = Item as Body;
                WhiteStats.Remove(armor.NotWithWhite);
            }
            if (Item is Ring)
            {
                Ring ring = Item as Ring;
                value *= (int)2.94;
            }
            if (Item is Necklace)
            {
                Necklace neck = Item as Necklace;
                value *= (int)1.85;
            }

            if (imbueitem.ImbueData == 0)
            {
                int randomStat = Random.Next(0, WhiteStats.Count);
                stat = WhiteStats[randomStat];
            }
            else
            {
                switch (imbueitem.ImbueData)
                {
                    case 2:
                        stat = ImbueStat.Damage;
                        break;
                    case 3:
                        stat = ImbueStat.Defense;
                        break;

                    case 4:
                        stat = ImbueStat.AttackRating;
                        break;

                    case 5:
                        stat = ImbueStat.CriticalHit;
                        break;

                    case 6:
                        stat = ImbueStat.MaxLife;
                        break;

                    case 7:
                        stat = ImbueStat.MaxMana;
                        break;

                    case 8:
                        stat = ImbueStat.LifeReg;
                        break;

                    case 9:
                        stat = ImbueStat.ManaReg;
                        break;

                    default:
                        stat = ImbueStat.CriticalHit;
                        break;
                }
            }
            switch (stat)
            {
                case ImbueStat.Damage:
                    Item.Damage += (short)value;
                    break;

                case ImbueStat.Defense:
                    Item.Defence += (short)value;
                    break;

                case ImbueStat.AttackRating:
                    Item.AttackRating += (short)value;
                    break;

                case ImbueStat.MaxLife:
                    Item.IncMaxLife += (short)value;
                    break;

                case ImbueStat.MaxMana:
                    Item.IncMaxMana += (short)value;
                    break;

                case ImbueStat.LifeReg:
                    Item.IncLifeRegen += (short)value;
                    break;

                case ImbueStat.ManaReg:
                    Item.IncManaRegen += (short)value;
                    break;

                case ImbueStat.CriticalHit:
                    value = (int)(Math.Round((double)(value / 50))) + 1;
                    Item.Critical += (short)value;
                    break;
            }

            return value;
        }
Пример #8
0
        public void RedImbue(Equipment Item, ImbueStat stat, ref int value, bool success, ref ImbueError error)
        {
            if (success)
                error = ImbueError.Success;
            else
            {
                error = ImbueError.FailedToRemake;
                if (PercentSuccess(30))
                {
                    value *= -1;
                }
                else
                {
                    value *= 0;
                }
            }

            switch (stat)
            {
                case ImbueStat.RequiredLevel:
                    if (Item.RequiredLevel >= -value)
                        Item.RequiredLevel += (short)value;
                    else
                        Item.RequiredLevel = 0;
                    return;
                case ImbueStat.RequiredStrength:
                    if (Item.RequiredStrength >= -value)
                        Item.RequiredStrength += (short)value;
                    else
                        Item.RequiredStrength = 0;
                    return;
                case ImbueStat.RequiredStamina:
                    if (Item.RequiredStamina >= -value)
                        Item.RequiredStamina += (short)value;
                    else
                        Item.RequiredStamina = 0;
                    return;
                case ImbueStat.RequiredDexterity:
                    if (Item.RequiredDexterity >= -value)
                        Item.RequiredDexterity += (short)value;
                    else
                        Item.RequiredDexterity = 0;
                    return;
                case ImbueStat.RequiredEnergy:
                    if (Item.RequiredEnergy >= -value)
                        Item.RequiredEnergy += (short)value;
                    else
                        Item.RequiredEnergy = 0;
                    return;
                default:
                    stat = ImbueStat.None;
                    return;
            }
        }