コード例 #1
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
 private void UpdateItemListFilter()
 {
     if (IsLoading)
     {
         return;
     }
     itemList.Items.Filter = delegate(object obj)
     {
         item_template item = (item_template)obj;
         if (item.name.Contains("Updated at LegacyV3S2"))
         {
             return(false);
         }
         string name = itemSearch.Text;
         if (enableClassFilter.IsChecked == true)
         {
             if (itemFilterSubclass.SelectedValue == null)
             {
                 return(item.name.Contains(name) || item.entry.ToString().Contains(name));
             }
             int _class   = (int)itemFilterClass.SelectedValue;
             int subclass = (int)itemFilterSubclass.SelectedValue;
             return(item.@class == _class && item.subclass == subclass && (item.name.Contains(name) || item.entry.ToString().Contains(name)));
         }
         else
         {
             return(item.name.Contains(name) || item.entry.ToString().Contains(name));
         }
     };
 }
コード例 #2
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void itemDelete_Click(object sender, RoutedEventArgs e)
        {
            item_template t = itemList.SelectedItem as item_template;

            if (t == null)
            {
                return;
            }
            LegacyToolBox.Data.DeleteItemTemplate(t);
        }
コード例 #3
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
 private void itemTab_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S)
     {
         item_template c = itemList.SelectedItem as item_template;
         if (c != null)
         {
             LegacyToolBox.Data.SaveItemTemplate(c);
         }
         LegacyToolBox.AppendMessage("Item Template " + c.entry + " Saved.");
         e.Handled = true;
     }
 }
コード例 #4
0
        private void popupName_Closed(object sender, EventArgs e)
        {
            item_template item_template = item_templateViewSource.View.CurrentItem as item_template;

            if (item_template != null)
            {
                item item = itemViewSource.View.CurrentItem as item;
                foreach (item_template_detail item_template_detail in item_template.item_template_detail)
                {
                    item.name = item.name + item_template_detail.value;
                }
            }
        }
コード例 #5
0
        public void SaveItemTemplate(item_template t)
        {
            var o = (from d in ItemTemplate where d.entry == t.entry select d).SingleOrDefault();

            if (o != null)
            {
                o = t;
            }
            else
            {
                ItemTemplate.Add(t);
            }
            WorldWorker.SaveItemTemplate(t);
        }
コード例 #6
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void itemCopy_Click(object sender, RoutedEventArgs e)
        {
            item_template o = itemList.SelectedItem as item_template;

            if (o == null)
            {
                return;
            }

            item_template n = WorldWorker.GetItemTemplate(o.entry);

            WorldWorker.SetEntityState(n, System.Data.EntityState.Added);
            n.entry = WorldWorker.GenerateNextItemEntry();
            LegacyToolBox.Data.SaveItemTemplate(n);
        }
コード例 #7
0
ファイル: ItemTemplate.xaml.cs プロジェクト: mercaditu/ERP
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            crud_modal.Visibility = Visibility.Visible;
            cntrl.Curd.ItemTemplate _ItemTemplate = new cntrl.Curd.ItemTemplate();
            item_template           item_template = new item_template();

            item_template.name = "Template";
            entity.db.item_template.Add(item_template);

            item_templateViewSource.View.MoveCurrentToLast();
            _ItemTemplate.item_templateViewSource       = item_templateViewSource;
            _ItemTemplate.item_templateDetailViewSource = item_templateitem_template_detailViewSource;
            _ItemTemplate.entity = entity;
            crud_modal.Children.Add(_ItemTemplate);
        }
コード例 #8
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void itemList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //itemTab.DataContext = null;
            item_template t = itemList.SelectedItem as item_template;

            if (t == null)
            {
                return;
            }

            iconPanel.Load(t);
            itemTab.DataContext = t;
            // fku
            int subclass = t.subclass;

            itemSubClass.ItemsSource   = LegacyToolBox.Data.ItemSubclass[t.@class];
            itemSubClass.SelectedValue = subclass;
        }
コード例 #9
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void ModStatCount(item_template t)
        {
            StackStats(t);
            byte count = 0;
            if (t.stat_type1 != 0 && t.stat_value1 != 0)
                count = 1;
            else
            {
                t.stat_type1 = 0;
                t.stat_value1 = 0;
            }
            if (t.stat_type2 != 0 && t.stat_value2 != 0)
                count = 2;
            else
            {
                t.stat_type2 = 0;
                t.stat_value2 = 0;
            }
            if (t.stat_type3 != 0 && t.stat_value3 != 0)
                count = 3;
            else
            {
                t.stat_type3 = 0;
                t.stat_value3 = 0;
            }
            if (t.stat_type4 != 0 && t.stat_value4 != 0)
                count = 4;
            else
            {
                t.stat_type4 = 0;
                t.stat_value4 = 0;
            }
            if (t.stat_type5 != 0 && t.stat_value5 != 0)
                count = 5;
            else
            {
                t.stat_type5 = 0;
                t.stat_value5 = 0;
            }
            if (t.stat_type6 != 0 && t.stat_value6 != 0)
                count = 6;
            else
            {
                t.stat_type6 = 0;
                t.stat_value6 = 0;
            }
            if (t.stat_type7 != 0 && t.stat_value7 != 0)
                count = 7;
            else
            {
                t.stat_type7 = 0;
                t.stat_value7 = 0;
            }
            if (t.stat_type8 != 0 && t.stat_value8 != 0)
                count = 8;
            else
            {
                t.stat_type8 = 0;
                t.stat_value8 = 0;
            }
            if (t.stat_type9 != 0 && t.stat_value9 != 0)
                count = 9;
            else
            {
                t.stat_type9 = 0;
                t.stat_value9 = 0;
            }
            if (t.stat_type10 != 0 && t.stat_value10 != 0)
                count = 10;
            else
            {
                t.stat_type10 = 0;
                t.stat_value10 = 0;
            }

            t.StatsCount = count;
        }
コード例 #10
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static void ModItemStatWithFactor(item_template item, float factor)
 {
     item.stat_value1 = (int)(item.stat_value1 * factor);
     item.stat_value2 = (int)(item.stat_value2 * factor);
     item.stat_value3 = (int)(item.stat_value3 * factor);
     item.stat_value4 = (int)(item.stat_value4 * factor);
     item.stat_value5 = (int)(item.stat_value5 * factor);
     item.stat_value6 = (int)(item.stat_value6 * factor);
     item.stat_value7 = (int)(item.stat_value7 * factor);
     item.stat_value8 = (int)(item.stat_value8 * factor);
     item.stat_value9 = (int)(item.stat_value9 * factor);
     item.stat_value10 = (int)(item.stat_value10 * factor);
 }
コード例 #11
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void CalculateItemStat(item_template t)
        {
            float point = 2.0f * t.ItemLevel;
            switch (t.InventoryType)
            {
                case 17:
                    point *= 2.0f;
                    break;

                default:
                    break;
            }

            switch (t.Quality)
            {
                case 6:
                    point *= 1.3f * 1.3f;
                    break;

                case 5:
                    point *= 1.3f;
                    break;

                case 3:
                    point /= 1.3f;
                    break;

                case 2:
                    point /= 1.3f * 1.3f;
                    break;

                case 1:
                    point /= 1.3f * 1.3f * 1.3f;
                    break;

                case 0:
                    point = 0;
                    break;

                default:
                    break;
            }

            float tPoint = GetStatPoint(t);
            if (tPoint == 0)
                return;

            float factor = point / tPoint;

            ModItemStatWithFactor(t, factor);
            if (t.@class == 2 && t.subclass != 19 && !IsPhysicalItem(t))
            {
                PowerType powerType = GetPowerType(t);
                RemoveSpellDamgeOrHealingOrPower(t);
                AddSpellDamageOrHealingPower(t, powerType);
                ModStatCount(t);
            }
        }
コード例 #12
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void addNextReagent_Click(object sender, RoutedEventArgs e)
        {
            item_template t = itemList.SelectedItem as item_template;

            RecipePanel.self.AddReagent(t.name, t.entry, -1);
        }
コード例 #13
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void CalculateItemDurability(item_template t)
        {
            float factor = 0;

            if (t.@class != 2 && t.@class != 4)
                return;

            if (t.@class == 4 && (t.subclass == 0 || t.InventoryType == (byte)InventoryType.Cloak))
            {
                factor = 0;
            }
            else
            {
                factor = 2; // min 10 durability
                factor += t.ItemLevel / 10;
                factor += t.Quality;
                if (t.@class == 2)
                {
                    switch (t.subclass)
                    {
                        case 1: // 2h axe
                        case 5: // 2h mace
                        case 6: // polearm
                        case 8: // 2h sword
                        case 10:
                            factor *= 1.75f;
                            break;
                    }
                }
                else if (t.@class == 4)
                {
                    switch (t.subclass)
                    {
                        case 2:
                            factor *= 1.25f;
                            break;
                        case 3:
                            factor *= 1.5f;
                            break;
                        case 4:
                        case 6:
                            factor *= 2.0f;
                            break;
                    }
                }
            }

            int intFactor = (int)factor;
            if (intFactor > 24) intFactor = 24;
            t.MaxDurability = 5 * intFactor;
        }
コード例 #14
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void GenerateLegacyItems(item_template item)
        {
            item_legacy d = new item_legacy();
            d.Prototype = item.entry;
            d.Comment = item.name;

            item_template n1 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n1, EntityState.Added);
            n1.entry = DataProcessor.GenerateNextItemEntry();
            n1.Flags |= 8;
            d.Rank1 = n1.entry;
            item_legacy_upgrade_data u1 = GetUpgradeData(item, item.entry, n1.entry, 1);
            DataProcessor.SaveItemTemplate(n1);
            DataProcessor.SaveItemUpgradeData(u1);

            item_template n2 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n2, EntityState.Added);
            n2.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n2, Math.Pow(1.15, 1));
            d.Rank2 = n2.entry;
            item_legacy_upgrade_data u2 = GetUpgradeData(item, n1.entry, n2.entry, 2);
            DataProcessor.SaveItemTemplate(n2);
            DataProcessor.SaveItemUpgradeData(u2);

            item_template n3 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n3, EntityState.Added);
            n3.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n3, Math.Pow(1.15, 2));
            d.Rank3 = n3.entry;
            item_legacy_upgrade_data u3 = GetUpgradeData(item, n2.entry, n3.entry, 3);
            DataProcessor.SaveItemTemplate(n3);
            DataProcessor.SaveItemUpgradeData(u3);

            item_template n4 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n4, EntityState.Added);
            n4.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n4, Math.Pow(1.15, 3));
            d.Rank4 = n4.entry;
            item_legacy_upgrade_data u4 = GetUpgradeData(item, n3.entry, n4.entry, 4);
            DataProcessor.SaveItemTemplate(n4);
            DataProcessor.SaveItemUpgradeData(u4);

            item_template n5 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n5, EntityState.Added);
            n5.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n5, Math.Pow(1.15, 4));
            d.Rank5 = n5.entry;
            item_legacy_upgrade_data u5 = GetUpgradeData(item, n4.entry, n5.entry, 5);
            DataProcessor.SaveItemTemplate(n5);
            DataProcessor.SaveItemUpgradeData(u5);

            item_template n6 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n6, EntityState.Added);
            n6.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n6, Math.Pow(1.15, 5));
            d.Rank6 = n6.entry;
            item_legacy_upgrade_data u6 = GetUpgradeData(item, n5.entry, n6.entry, 6);
            DataProcessor.SaveItemTemplate(n6);
            DataProcessor.SaveItemUpgradeData(u6);

            item_template n7 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n7, EntityState.Added);
            n7.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n7, Math.Pow(1.15, 6));
            d.Rank7 = n7.entry;
            item_legacy_upgrade_data u7 = GetUpgradeData(item, n6.entry, n7.entry, 7);
            DataProcessor.SaveItemTemplate(n7);
            DataProcessor.SaveItemUpgradeData(u7);

            item_template n8 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n8, EntityState.Added);
            n8.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n8, Math.Pow(1.15, 7));
            d.Rank8 = n8.entry;
            item_legacy_upgrade_data u8 = GetUpgradeData(item, n7.entry, n8.entry, 8);
            DataProcessor.SaveItemTemplate(n8);
            DataProcessor.SaveItemUpgradeData(u8);

            item_template n9 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n9, EntityState.Added);
            n9.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n9, Math.Pow(1.15, 8));
            d.Rank9 = n9.entry;
            item_legacy_upgrade_data u9 = GetUpgradeData(item, n8.entry, n9.entry, 9);
            DataProcessor.SaveItemTemplate(n9);
            DataProcessor.SaveItemUpgradeData(u9);

            item_template n10 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n10, EntityState.Added);
            n10.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n10, Math.Pow(1.15, 9));
            d.Rank10 = n10.entry;
            item_legacy_upgrade_data u10 = GetUpgradeData(item, n9.entry, n10.entry, 10);
            DataProcessor.SaveItemTemplate(n10);
            DataProcessor.SaveItemUpgradeData(u10);

            item_template n11 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n11, EntityState.Added);
            n11.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n11, Math.Pow(1.15, 10));
            d.Rank11 = n11.entry;
            item_legacy_upgrade_data u11 = GetUpgradeData(item, n10.entry, n11.entry, 11);
            DataProcessor.SaveItemTemplate(n11);
            DataProcessor.SaveItemUpgradeData(u11);

            item_template n12 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n12, EntityState.Added);
            n12.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n12, Math.Pow(1.15, 11));
            d.Rank12 = n12.entry;
            item_legacy_upgrade_data u12 = GetUpgradeData(item, n11.entry, n12.entry, 12);
            DataProcessor.SaveItemTemplate(n12);
            DataProcessor.SaveItemUpgradeData(u12);

            item_template n13 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n13, EntityState.Added);
            n13.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n13, Math.Pow(1.15, 12));
            d.Rank13 = n13.entry;
            item_legacy_upgrade_data u13 = GetUpgradeData(item, n12.entry, n13.entry, 13);
            DataProcessor.SaveItemTemplate(n13);
            DataProcessor.SaveItemUpgradeData(u13);

            item_template n14 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n14, EntityState.Added);
            n14.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n14, Math.Pow(1.15, 13));
            d.Rank14 = n14.entry;
            item_legacy_upgrade_data u14 = GetUpgradeData(item, n13.entry, n14.entry, 14);
            DataProcessor.SaveItemTemplate(n14);
            DataProcessor.SaveItemUpgradeData(u14);

            item_template n15 = DataProcessor.GetItemTemplate(item.entry);
            DataProcessor.SetEntityState(n15, EntityState.Added);
            n15.entry = DataProcessor.GenerateNextItemEntry();
            ModItemWithFactor(n15, Math.Pow(1.15, 14));
            d.Rank15 = n15.entry;
            item_legacy_upgrade_data u15 = GetUpgradeData(item, n14.entry, n15.entry, 15);
            DataProcessor.SaveItemTemplate(n15);
            DataProcessor.SaveItemUpgradeData(u15);

            DataProcessor.SaveItemLegacyData(d);
        }
コード例 #15
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static void CalculateEverything(item_template t)
 {
     RemoveObsoleteStats(t);
     StackStats(t);
     CalculateShieldBlock(t);
     if (t.@class == 2)
         CalculateItemDamage(t);
     else
         CalculateItemArmor(t);
     CalculateItemStat(t);
     CalculateItemPrice(t);
     CalculateItemDurability(t);
     DataProcessor.SaveItemTemplate(t);
 }
コード例 #16
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static float GetStatPoint(item_template t)
 {
     float point = 0;
     point += GetStatPoint(t.stat_type1, t.stat_value1, t.@class == 2);
     point += GetStatPoint(t.stat_type2, t.stat_value2, t.@class == 2);
     point += GetStatPoint(t.stat_type3, t.stat_value3, t.@class == 2);
     point += GetStatPoint(t.stat_type4, t.stat_value4, t.@class == 2);
     point += GetStatPoint(t.stat_type5, t.stat_value5, t.@class == 2);
     point += GetStatPoint(t.stat_type6, t.stat_value6, t.@class == 2);
     point += GetStatPoint(t.stat_type7, t.stat_value7, t.@class == 2);
     point += GetStatPoint(t.stat_type8, t.stat_value8, t.@class == 2);
     point += GetStatPoint(t.stat_type9, t.stat_value9, t.@class == 2);
     point += GetStatPoint(t.stat_type10, t.stat_value10, t.@class == 2);
     return point;
 }
コード例 #17
0
ファイル: IconPanel.xaml.cs プロジェクト: update88/mtb
 public void Load(item_template item)
 {
     Item = item;
 }
コード例 #18
0
ファイル: ResearchPanel.xaml.cs プロジェクト: update88/mtb
        private string GenerateDescriptionString(string title)
        {
            if (_SelectedResearchData == null)
            {
                return("");
            }
            string s = "";

            s += String.Format(DESC_FORMAT_TITLE, title);
            if (_SelectedResearchData.Spell != 0)
            {
                SpellTemplate spell = WorldWorker.GetSpell(LegacyToolBox.Data.Spell, _SelectedResearchData.Spell);
                if (spell != null)
                {
                    s += Environment.NewLine;
                    s += Environment.NewLine;
                    s += String.Format(DESC_FORMAT_SPELL, spell.Name, spell.Description);
                }
            }
            if (_SelectedResearchData.Item != 0)
            {
                item_template item = WorldWorker.GetItemTemplate(_SelectedResearchData.Item);
                if (item != null)
                {
                    s += Environment.NewLine;
                    s += Environment.NewLine;
                    string sp = "";
                    if (item.spellid_1 != 0)
                    {
                        SpellTemplate p = WorldWorker.GetSpell(LegacyToolBox.Data.Spell, item.spellid_1);
                        if (p != null)
                        {
                            sp = p.Description;
                        }
                    }
                    s += String.Format(DESC_FORMAT_ITEM, item.name, sp);
                }
            }

            s += Environment.NewLine;
            s += Environment.NewLine;
            s += "研究物资:";

            if (_SelectedResearchData.ReqItem1 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem1);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT1, t.name);
                }
            }
            if (_SelectedResearchData.ReqItem2 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem2);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT2, t.name);
                }
            }
            if (_SelectedResearchData.ReqItem3 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem3);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT3, t.name);
                }
            }
            if (_SelectedResearchData.ReqItem4 != 0)
            {
                s += Environment.NewLine;
                item_template t = WorldWorker.GetItemTemplate(_SelectedResearchData.ReqItem4);
                if (t != null)
                {
                    s += String.Format(DESC_FORMAT_REAGENT4, t.name);
                }
            }

            s += Environment.NewLine;
            s += Environment.NewLine;
            s += DESC_FORMAT_PROGRESS;

            return(s);
        }
コード例 #19
0
 public void DeleteItemTemplate(item_template t)
 {
     ItemTemplate.Remove(t);
     WorldWorker.DeleteItemTemplate(t);
 }
コード例 #20
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void itemFlagBtn_Click(object sender, RoutedEventArgs e)
        {
            item_template t = itemList.SelectedItem as item_template;

            new ItemFlagsSelector(t).Show();
        }
コード例 #21
0
        public ItemFlagsSelector(item_template item)
        {
            _Item = item;
            long flags = _Item.Flags;

            InitializeComponent();
            itemFlag.IsChecked   = (flags & (1 << 0)) != 0;
            itemFlag1.IsChecked  = (flags & (1 << 1)) != 0;
            itemFlag2.IsChecked  = (flags & (1 << 2)) != 0;
            itemFlag3.IsChecked  = (flags & (1 << 3)) != 0;
            itemFlag4.IsChecked  = (flags & (1 << 4)) != 0;
            itemFlag5.IsChecked  = (flags & (1 << 5)) != 0;
            itemFlag6.IsChecked  = (flags & (1 << 6)) != 0;
            itemFlag7.IsChecked  = (flags & (1 << 7)) != 0;
            itemFlag8.IsChecked  = (flags & (1 << 8)) != 0;
            itemFlag9.IsChecked  = (flags & (1 << 9)) != 0;
            itemFlag10.IsChecked = (flags & (1 << 10)) != 0;
            itemFlag11.IsChecked = (flags & (1 << 11)) != 0;
            itemFlag12.IsChecked = (flags & (1 << 12)) != 0;
            itemFlag13.IsChecked = (flags & (1 << 13)) != 0;
            itemFlag14.IsChecked = (flags & (1 << 14)) != 0;
            itemFlag15.IsChecked = (flags & (1 << 15)) != 0;
            itemFlag16.IsChecked = (flags & (1 << 16)) != 0;
            itemFlag17.IsChecked = (flags & (1 << 17)) != 0;
            itemFlag18.IsChecked = (flags & (1 << 18)) != 0;
            itemFlag19.IsChecked = (flags & (1 << 19)) != 0;
            itemFlag20.IsChecked = (flags & (1 << 20)) != 0;
            itemFlag21.IsChecked = (flags & (1 << 21)) != 0;
            itemFlag22.IsChecked = (flags & (1 << 22)) != 0;
            itemFlag23.IsChecked = (flags & (1 << 23)) != 0;
            itemFlag24.IsChecked = (flags & (1 << 24)) != 0;
            itemFlag25.IsChecked = (flags & (1 << 25)) != 0;
            itemFlag26.IsChecked = (flags & (1 << 26)) != 0;
            itemFlag27.IsChecked = (flags & (1 << 27)) != 0;
            itemFlag28.IsChecked = (flags & (1 << 28)) != 0;
            itemFlag29.IsChecked = (flags & (1 << 29)) != 0;
            itemFlag30.IsChecked = (flags & (1 << 30)) != 0;
            itemFlag31.IsChecked = (flags & 0x80000000) != 0;
            itemFlag.Click      += UpdateFlags;
            itemFlag1.Click     += UpdateFlags;
            itemFlag2.Click     += UpdateFlags;
            itemFlag3.Click     += UpdateFlags;
            itemFlag4.Click     += UpdateFlags;
            itemFlag5.Click     += UpdateFlags;
            itemFlag6.Click     += UpdateFlags;
            itemFlag7.Click     += UpdateFlags;
            itemFlag8.Click     += UpdateFlags;
            itemFlag9.Click     += UpdateFlags;
            itemFlag10.Click    += UpdateFlags;
            itemFlag11.Click    += UpdateFlags;
            itemFlag12.Click    += UpdateFlags;
            itemFlag13.Click    += UpdateFlags;
            itemFlag14.Click    += UpdateFlags;
            itemFlag15.Click    += UpdateFlags;
            itemFlag16.Click    += UpdateFlags;
            itemFlag17.Click    += UpdateFlags;
            itemFlag18.Click    += UpdateFlags;
            itemFlag19.Click    += UpdateFlags;
            itemFlag20.Click    += UpdateFlags;
            itemFlag21.Click    += UpdateFlags;
            itemFlag22.Click    += UpdateFlags;
            itemFlag23.Click    += UpdateFlags;
            itemFlag24.Click    += UpdateFlags;
            itemFlag25.Click    += UpdateFlags;
            itemFlag26.Click    += UpdateFlags;
            itemFlag27.Click    += UpdateFlags;
            itemFlag28.Click    += UpdateFlags;
            itemFlag29.Click    += UpdateFlags;
            itemFlag30.Click    += UpdateFlags;
            itemFlag31.Click    += UpdateFlags;
        }
コード例 #22
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void CalculateWeaponDamage()
        {
            item_template t = itemList.SelectedItem as item_template;

            if (t == null || t.@class != 2)
            {
                return;
            }

            float dps = t.ItemLevel;

            switch (t.Quality)
            {
            case 0:
                dps *= 0.35f;
                break;

            case 1:
                dps *= 0.5f;
                break;

            case 2:
                dps *= 0.7f;
                break;

            case 3:
                dps *= 1.0f;
                break;

            case 4:
                dps *= 1.4f;
                break;

            case 5:
                dps *= 2.0f;
                break;

            case 6:
                dps *= 2.8f;
                break;

            default:
                dps = 0;
                break;
            }

            switch (t.subclass)
            {
            case 1:
            case 6:
            case 5:
            case 8:     // 2hand weapons
                dps *= 2.0f;
                break;

            case 15:     // dagger
                dps *= 1.2f;
                break;

            case 10:     // staff
                dps *= 1.2f;
                break;

            default:
                break;
            }

            float damage    = dps * t.delay / 1000;
            float minDamage = damage;
            float maxDamage = damage;

            switch (t.subclass)
            {
            case 0:
            case 1:
            case 18:     // axe & crossbow
                minDamage /= 1.4f;
                maxDamage *= 1.4f;
                break;

            case 4:
            case 5:
            case 3:     // mace & gun
                minDamage /= 1.3f;
                maxDamage *= 1.3f;
                break;

            case 7:
            case 8:
            case 2:
            case 19:
            case 13:
            case 15:
            case 16:     // sword & bow & wand & fistweapon & dagger & throw
                minDamage /= 1.2f;
                maxDamage *= 1.2f;
                break;

            case 6:
            case 10:
            case 20:     // polearm & staff & fishing pole
                minDamage /= 1.1f;
                maxDamage *= 1.1f;
                break;
            }

            if (minDamage < 1)
            {
                minDamage = 1;
            }
            if (maxDamage < 2)
            {
                maxDamage = 2;
            }

            t.dmg_min1 = minDamage;
            t.dmg_max1 = maxDamage;
        }
コード例 #23
0
 item_template CopyItem(item_template t)
 {
     item_template n = DataProcessor.GetItemTemplate(t.entry);
     DataProcessor.SetEntityState(n, EntityState.Added);
     n.entry = DataProcessor.GenerateNextItemEntry();
     LegacyToolBox.Data.SaveItemTemplate(n);
     return n;
 }
コード例 #24
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void CalculateItemPrice(item_template t)
        {
            if (t.@class != 2 && t.@class != 4)
                return;

            float buyprice = t.ItemLevel;
            float sellprice = 0;
            switch (t.Quality)
            {
                case 0:
                    buyprice *= 100;
                    break;
                case 1:
                    buyprice *= 200;
                    break;
                case 2:
                    buyprice *= 350;
                    break;
                case 3:
                    buyprice *= 600;
                    break;
                case 4:
                    buyprice *= 950;
                    break;
                case 5:
                    buyprice *= 1450;
                    break;
                case 6:
                    buyprice *= 2200;
                    break;
                default:
                    break;
            }

            if (t.@class == 4)
            {
                switch (t.subclass)
                {
                    case 0:
                        buyprice *= 2.5f;
                        break;
                    case 1:
                        break;
                    case 2:
                        buyprice *= 1.25f;
                        break;
                    case 3:
                        buyprice *= 1.6f;
                        break;
                    case 4:
                        buyprice *= 2.0f;
                        break;
                    case 6:
                        buyprice *= 3.0f;
                        break;
                    case 7:
                    case 8:
                    case 9:
                    case 10:
                    case 11:
                        buyprice *= 6.84f;
                        break;
                    default:
                        break;
                }

                switch ((InventoryType)t.InventoryType)
                {
                    case InventoryType.Head:
                    case InventoryType.Chest:
                    case InventoryType.Legs:
                        buyprice *= 2.87f;
                        break;
                    case InventoryType.Waists:
                    case InventoryType.Wrists:
                        buyprice *= 1.43f;
                        break;
                    case InventoryType.Shoulder:
                    case InventoryType.Hands:
                    case InventoryType.Cloak:
                    case InventoryType.Feet:
                        buyprice *= 1.97f;
                        break;
                }
            }
            else if (t.@class == 2)
            {
                switch (t.subclass)
                {
                    case 0: // 1h axe
                    case 4: // 1h mace
                    case 7: // 1h sword
                    case 13: // fist weapon
                        buyprice *= 4.16f;
                        break;
                    case 15: // dagger
                        buyprice *= 5.53f;
                        break;
                    case 1: // 2h axe
                    case 5: // 2h mace
                    case 8: // 2h sword
                    case 6: // polearm
                        buyprice *= 7.98f;
                        break;
                    case 2: // bow
                    case 18: // crossbow
                    case 3: // gun
                        buyprice *= 6.66f;
                        break;
                    case 10: // staff
                        buyprice *= 9.61f;
                        break;
                    case 19: // wand
                        buyprice *= 6.84f;
                        break;
                    case 16: // thrown
                        buyprice *= 4.13f;
                        break;
                    case 20: // fishing pole
                        buyprice *= 5.18f;
                        break;
                    default:
                        break;
                }
            }

            t.BuyPrice = (long)buyprice;
            sellprice = t.BuyPrice / 45;
            if (sellprice < 1) sellprice = 1;
            t.SellPrice = (long)sellprice;
        }
コード例 #25
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static bool IsHealing(item_template item)
        {
            bool hasSpirit = false;
            bool hasManaRegen = false;
            bool hasHit = false;

            CheckHealing(item.stat_type1, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type2, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type3, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type4, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type5, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type6, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type7, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type8, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type9, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type10, ref hasSpirit, ref hasManaRegen, ref hasHit);

            return !hasHit && (hasSpirit || hasManaRegen);
        }
コード例 #26
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void CalculateItemArmor(item_template t)
        {
            if (t.@class != 4)
                return;

            float factor = 1.0f;
            switch (t.InventoryType)
            {
                case 1:
                    factor = 5.769f;
                    break;

                case 3:
                    factor = 5.321f;
                    break;

                case 5:
                case 20:
                    factor = 7.097f;
                    break;

                case 6:
                    factor = 3.993f;
                    break;

                case 7:
                    factor = 6.209f;
                    break;

                case 8:
                    factor = 4.881f;
                    break;

                case 9:
                    factor = 3.105f;
                    break;

                case 10:
                    factor = 4.443f;
                    break;

                case 14:
                    if (t.subclass == 6)
                        factor = 23.83f;
                    else
                        return;
                    break;

                case 16:
                    factor = 3.559f;
                    break;

                default:
                    return;
            }

            switch (t.subclass)
            {
                case 3:
                    factor *= 0.5594f;
                    break;

                case 2:
                    factor *= 0.2515f;
                    break;

                case 1:
                    factor *= 0.1339f;
                    break;

                default:
                    break;
            }

            switch (t.Quality)
            {
                case 6:
                    factor *= 1.3f * 1.3f;
                    break;

                case 5:
                    factor *= 1.3f;
                    break;

                case 3:
                    factor /= 1.3f;
                    break;

                case 2:
                    factor /= 1.3f * 1.3f;
                    break;

                case 1:
                    factor /= 1.3f * 1.3f * 1.3f;
                    break;

                case 0:
                    factor /= 1.3f * 1.3f * 1.3f * 1.3f;
                    break;

                default:
                    break;
            }

            long armor = (long)(t.ItemLevel * factor / 1.25f);
            if (armor < 1) armor = 1;
            t.armor = armor;
        }
コード例 #27
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void ModArmorItem31(item_template t, Random rand)
        {
            // armor
            if (t.@class == 4)
            {
                if (t.subclass == 1) // cloth
                {
                    if (t.InventoryType != 16)
                    {
                        RemoveStat(t, 3);
                        RemoveStat(t, 4);

                        int intellect = StatValue(t, 5);
                        int spirit = StatValue(t, 6);
                        int stamina = StatValue(t, 7);

                        int total = intellect + spirit + stamina;
                        if (total < 10)
                            total = 10;
                        if (spirit > 0)
                        {
                            AddStat(t, 5, (int)(total * 0.3 * (4 + rand.NextDouble() / 5)));
                            AddStat(t, 6, (int)(total * 0.6 * (4 + rand.NextDouble() / 5)));
                            AddStat(t, 7, (int)(total * 0.1 * (4 + rand.NextDouble() / 5)));
                        }
                        else
                        {
                            AddStat(t, 5, (int)(total * 0.6 * (4 + rand.NextDouble() / 5)));
                            AddStat(t, 6, (int)(total * 0.3 * (4 + rand.NextDouble() / 5)));
                            AddStat(t, 7, (int)(total * 0.1 * (4 + rand.NextDouble() / 5)));
                        }
                    }
                }
                else if (t.subclass == 2) // leather
                {
                    RemoveStat(t, 5);
                    RemoveStat(t, 6);

                    int strength = StatValue(t, 4);
                    int agility = StatValue(t, 3);
                    int stamina = StatValue(t, 7);
                    int total = strength + agility + stamina;
                    if (total < 10)
                        total = 10;

                    AddStat(t, 4, (int)(total * 0.5 * (4 + rand.NextDouble() / 5)));
                    AddStat(t, 3, (int)(total * 0.2 * (4 + rand.NextDouble() / 5)));
                    AddStat(t, 7, (int)(total * 0.2 * (4 + rand.NextDouble() / 5)));
                }
                else if (t.subclass == 3) // mail
                {
                    RemoveStat(t, 3);
                    RemoveStat(t, 4);

                    int intellect = StatValue(t, 5);
                    int spirit = StatValue(t, 6);
                    int stamina = StatValue(t, 7);

                    int total = intellect + spirit + stamina;
                    if (total < 10)
                        total = 10;

                    AddStat(t, 5, (int)(total * 0.3 * (4 + rand.NextDouble() / 5)));
                    AddStat(t, 6, (int)(total * 0.3 * (4 + rand.NextDouble() / 5)));
                    AddStat(t, 7, (int)(total * 0.3 * (4 + rand.NextDouble() / 5)));
                }
                else if (t.subclass == 4) // plate
                {
                    RemoveStat(t, 5);
                    RemoveStat(t, 6);

                    int strength = StatValue(t, 4);
                    int agility = StatValue(t, 3);
                    int stamina = StatValue(t, 7);
                    int total = strength + agility + stamina;
                    if (total < 10)
                        total = 10;

                    AddStat(t, 4, (int)(total * 0.3 * (4 + rand.NextDouble() / 5)));
                    AddStat(t, 3, (int)(total * 0.1 * (4 + rand.NextDouble() / 5)));
                    AddStat(t, 7, (int)(total * 0.6 * (4 + rand.NextDouble() / 5)));
                }
            }
        }
コード例 #28
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void CalculateItemDamage(item_template t)
        {
            if (t == null || t.@class != 2)
                return;

            bool physical = IsPhysicalItem(t);

            float dps = t.ItemLevel;

            switch (t.InventoryType)
            {
                case 17:
                    dps *= physical ? 1.3683f : 0.8367f;
                    break;

                case 13:
                case 14:
                case 21:
                case 22:
                    dps *= physical ? 0.9112f : 0.5612f;
                    break;

                case 15:
                case 26:
                    dps *= 1.051f;
                    break;

                default: // 1h
                    break;
            }

            switch (t.Quality)
            {
                case 0:
                    dps /= 1.3f * 1.3f * 1.3f * 1.3f;
                    break;

                case 1:
                    dps /= 1.3f * 1.3f * 1.3f;
                    break;

                case 2:
                    dps /= 1.3f * 1.3f;
                    break;

                case 3:
                    dps /= 1.3f;
                    break;

                case 4:
                    break;

                case 5:
                    dps *= 1.3f;
                    break;

                case 6:
                    dps *= 1.3f * 1.3f;
                    break;

                default:
                    dps = 0;
                    break;
            }

            dps *= 1.25f;

            float damage = dps / 1000 * t.delay;
            float minDamage = damage;
            float maxDamage = damage;

            switch (t.subclass)
            {
                case 0:
                case 1:
                case 18: // axe & crossbow
                    minDamage /= 1.4f;
                    maxDamage *= 1.4f;
                    break;

                case 4:
                case 5:
                case 3: // mace & gun
                    minDamage /= 1.3f;
                    maxDamage *= 1.3f;
                    break;

                case 7:
                case 8:
                case 2:
                case 13:
                case 15:
                case 16: // sword & bow & wand & fistweapon & dagger & throw
                    minDamage /= 1.2f;
                    maxDamage *= 1.2f;
                    break;

                case 19:
                    minDamage = minDamage / 1.2f * 0.8f;
                    maxDamage = maxDamage * 1.2f * 0.8f;
                    break;

                case 6:
                case 10:
                case 20: // polearm & staff & fishing pole
                    minDamage /= 1.1f;
                    maxDamage *= 1.1f;
                    break;
            }

            if (minDamage < 1)
                minDamage = 1;
            if (maxDamage < 2)
                maxDamage = 2;

            t.dmg_min1 = minDamage;
            t.dmg_max1 = maxDamage;
        }
コード例 #29
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void ModHealingOrDamage(item_template item)
        {
            if (item.@class == 4 && (item.subclass == 2 || item.subclass == 3))
                return;

            bool hasSpirit = false;
            bool hasManaRegen = false;
            bool hasHit = false;

            CheckHealing(item.stat_type1, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type2, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type3, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type4, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type5, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type6, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type7, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type8, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type9, ref hasSpirit, ref hasManaRegen, ref hasHit);
            CheckHealing(item.stat_type10, ref hasSpirit, ref hasManaRegen, ref hasHit);

            bool healing = !hasHit && (hasSpirit || hasManaRegen);

            if (healing)
            {
                if (item.stat_type1 == 45)
                    item.stat_type1 = 41;
                if (item.stat_type2 == 45)
                    item.stat_type2 = 41;
                if (item.stat_type3 == 45)
                    item.stat_type3 = 41;
                if (item.stat_type4 == 45)
                    item.stat_type4 = 41;
                if (item.stat_type5 == 45)
                    item.stat_type5 = 41;
                if (item.stat_type6 == 45)
                    item.stat_type6 = 41;
                if (item.stat_type7 == 45)
                    item.stat_type7 = 41;
                if (item.stat_type8 == 45)
                    item.stat_type8 = 41;
                if (item.stat_type9 == 45)
                    item.stat_type9 = 41;
                if (item.stat_type10 == 45)
                    item.stat_type10 = 41;
            }
            else
            {
                if (item.stat_type1 == 45)
                    item.stat_type1 = 42;
                if (item.stat_type2 == 45)
                    item.stat_type2 = 42;
                if (item.stat_type3 == 45)
                    item.stat_type3 = 42;
                if (item.stat_type4 == 45)
                    item.stat_type4 = 42;
                if (item.stat_type5 == 45)
                    item.stat_type5 = 42;
                if (item.stat_type6 == 45)
                    item.stat_type6 = 42;
                if (item.stat_type7 == 45)
                    item.stat_type7 = 42;
                if (item.stat_type8 == 45)
                    item.stat_type8 = 42;
                if (item.stat_type9 == 45)
                    item.stat_type9 = 42;
                if (item.stat_type10 == 45)
                    item.stat_type10 = 42;
            }

            DataProcessor.SaveItemTemplate(item);
        }
コード例 #30
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static PowerType GetPowerType(item_template t)
 {
     if (t.stat_type1 == 45
         || t.stat_type2 == 45
         || t.stat_type3 == 45
         || t.stat_type4 == 45
         || t.stat_type5 == 45
         || t.stat_type6 == 45
         || t.stat_type7 == 45
         || t.stat_type8 == 45
         || t.stat_type9 == 45
         || t.stat_type10 == 45)
         return PowerType.SpellPower;
     if (t.stat_type1 == 41
         || t.stat_type2 == 41
         || t.stat_type3 == 41
         || t.stat_type4 == 41
         || t.stat_type5 == 41
         || t.stat_type6 == 41
         || t.stat_type7 == 41
         || t.stat_type8 == 41
         || t.stat_type9 == 41
         || t.stat_type10 == 41)
         return PowerType.HealPower;
     if (t.stat_type1 == 42
         || t.stat_type2 == 42
         || t.stat_type3 == 42
         || t.stat_type4 == 42
         || t.stat_type5 == 42
         || t.stat_type6 == 42
         || t.stat_type7 == 42
         || t.stat_type8 == 42
         || t.stat_type9 == 42
         || t.stat_type10 == 42)
         return PowerType.DamagePower;
     return PowerType.SpellPower;
 }
コード例 #31
0
ファイル: ItemPanel.xaml.cs プロジェクト: update88/mtb
        private void CalculateVendorPrice()
        {
            item_template t = itemList.SelectedItem as item_template;

            if (t == null || (t.@class != 2 && t.@class != 4))
            {
                return;
            }

            int buyprice = t.ItemLevel;

            switch (t.Quality)
            {
            case 0:
            case 1:
                buyprice *= 5;
                break;

            case 2:
                buyprice *= 30;
                break;

            case 3:
                buyprice *= 360;
                break;

            case 4:
                buyprice *= 8640;
                break;

            case 5:
                buyprice *= 414720;
                break;

            default:
                buyprice = 0;
                break;
            }

            if (t.@class == 2)
            {
                switch (t.subclass)
                {
                case 1:
                case 5:
                case 8:
                case 10:
                    buyprice *= 2;
                    break;

                default:
                    break;
                }
            }

            int sellprice = buyprice / 5;

            t.BuyPrice  = buyprice;
            t.SellPrice = sellprice;
            t.BuyCount  = 1;
        }
コード例 #32
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void GetTendency(item_template item, item_stat_tendency tendency)
        {
            switch (item.stat_type1)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value1;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value1;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value1;
                    break;

                default:
                    break;
            }

            switch (item.stat_type2)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value2;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value2;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value2;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value2;
                    break;

                default:
                    break;
            }

            switch (item.stat_type3)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value3;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value3;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value3;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value3;
                    break;

                default:
                    break;
            }

            switch (item.stat_type4)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value4;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value4;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value4;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value4;
                    break;

                default:
                    break;
            }

            switch (item.stat_type5)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value5;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value5;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value5;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value5;
                    break;

                default:
                    break;
            }

            switch (item.stat_type6)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value6;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value6;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value6;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value6;
                    break;

                default:
                    break;
            }

            switch (item.stat_type7)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value7;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value7;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value7;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value7;
                    break;

                default:
                    break;
            }

            switch (item.stat_type8)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value8;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value8;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value8;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value8;
                    break;

                default:
                    break;
            }

            switch (item.stat_type9)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value9;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value9;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value9;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value9;
                    break;

                default:
                    break;
            }

            switch (item.stat_type10)
            {
                case 3:
                case 4:
                case 16:
                case 17:
                case 19:
                case 20:
                case 28:
                case 29:
                case 37:
                case 38:
                case 39:
                case 44:
                    tendency.AttackPower += item.stat_value10;
                    break;

                case 21:
                case 30:
                case 45:
                    tendency.SpellDamage += item.stat_value1;
                    tendency.SpellHeal += item.stat_value1;
                    break;

                case 5:
                case 18:
                case 42:
                case 47:
                    tendency.SpellDamage += item.stat_value10;
                    break;

                case 6:
                case 41:
                case 43:
                    tendency.SpellHeal += item.stat_value10;
                    break;

                case 1:
                case 7:
                case 12:
                case 13:
                case 14:
                case 15:
                case 35:
                case 46:
                case 48:
                    tendency.Defense += item.stat_value10;
                    break;

                default:
                    break;
            }
        }
コード例 #33
0
ファイル: Druid_Feral.cs プロジェクト: Lillecarl/FightClass1
 public void RemoveItem(item_template item)
 {
     Logging.WriteDebug(string.Format("Removing item {0} {1}", item.name, item.entry));
     Lua.RunMacroText(string.Format("/run for b=0,4 do for s=1,36 do n=GetContainerItemLink(b,s);if n and string.find(n,\"{0}\") then PickupContainerItem(b,s);DeleteCursorItem();end;end;end;", item.entry));
 }
コード例 #34
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static item_legacy_upgrade_data GetUpgradeData(item_template item, int entry, int next, int rank)
        {
            int count = item.ItemLevel * 100;
            item_legacy_upgrade_data data = new item_legacy_upgrade_data();
            data.Item = entry;
            data.Next = next;
            switch (item.Quality)
            {
                case 2:
                    break;

                case 3:
                    count *= 3;
                    break;

                case 4:
                    count *= 12;
                    break;
            }
            if (item.@class == 2)
            {
                count *= 2;
                if (item.InventoryType == 17)
                    count *= 2;
            }
            data.Xp = (int)(count + count * Math.Pow(2, rank));
            return data;
        }
コード例 #35
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void StackStats(item_template t)
        {
            if (t.stat_type10 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type10)
                {
                    t.stat_type1 = t.stat_type10;
                    t.stat_value1 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type10)
                {
                    t.stat_type2 = t.stat_type10;
                    t.stat_value2 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type10)
                {
                    t.stat_type3 = t.stat_type10;
                    t.stat_value3 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type4 == 0 || t.stat_type4 == t.stat_type10)
                {
                    t.stat_type4 = t.stat_type10;
                    t.stat_value4 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type5 == 0 || t.stat_type5 == t.stat_type10)
                {
                    t.stat_type5 = t.stat_type10;
                    t.stat_value5 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type6 == 0 || t.stat_type6 == t.stat_type10)
                {
                    t.stat_type6 = t.stat_type10;
                    t.stat_value6 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type7 == 0 || t.stat_type7 == t.stat_type10)
                {
                    t.stat_type7 = t.stat_type10;
                    t.stat_value7 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type8 == 0 || t.stat_type8 == t.stat_type10)
                {
                    t.stat_type8 = t.stat_type10;
                    t.stat_value8 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
                else if (t.stat_type9 == 0 || t.stat_type9 == t.stat_type10)
                {
                    t.stat_type9 = t.stat_type10;
                    t.stat_value9 = t.stat_value10;
                    t.stat_type10 = 0;
                    t.stat_value10 = 0;
                }
            }

            if (t.stat_type9 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type9)
                {
                    t.stat_type1 = t.stat_type9;
                    t.stat_value1 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type9)
                {
                    t.stat_type2 = t.stat_type9;
                    t.stat_value2 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type9)
                {
                    t.stat_type3 = t.stat_type9;
                    t.stat_value3 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type4 == 0 || t.stat_type4 == t.stat_type9)
                {
                    t.stat_type4 = t.stat_type9;
                    t.stat_value4 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type5 == 0 || t.stat_type5 == t.stat_type9)
                {
                    t.stat_type5 = t.stat_type9;
                    t.stat_value5 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type6 == 0 || t.stat_type6 == t.stat_type9)
                {
                    t.stat_type6 = t.stat_type9;
                    t.stat_value6 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type7 == 0 || t.stat_type7 == t.stat_type9)
                {
                    t.stat_type7 = t.stat_type9;
                    t.stat_value7 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
                else if (t.stat_type8 == 0 || t.stat_type8 == t.stat_type9)
                {
                    t.stat_type8 = t.stat_type9;
                    t.stat_value8 = t.stat_value9;
                    t.stat_type9 = 0;
                    t.stat_value9 = 0;
                }
            }

            if (t.stat_type8 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type8)
                {
                    t.stat_type1 = t.stat_type8;
                    t.stat_value1 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type8)
                {
                    t.stat_type2 = t.stat_type8;
                    t.stat_value2 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type8)
                {
                    t.stat_type3 = t.stat_type8;
                    t.stat_value3 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
                else if (t.stat_type4 == 0 || t.stat_type4 == t.stat_type8)
                {
                    t.stat_type4 = t.stat_type8;
                    t.stat_value4 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
                else if (t.stat_type5 == 0 || t.stat_type5 == t.stat_type8)
                {
                    t.stat_type5 = t.stat_type8;
                    t.stat_value5 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
                else if (t.stat_type6 == 0 || t.stat_type6 == t.stat_type8)
                {
                    t.stat_type6 = t.stat_type8;
                    t.stat_value6 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
                else if (t.stat_type7 == 0 || t.stat_type7 == t.stat_type8)
                {
                    t.stat_type7 = t.stat_type8;
                    t.stat_value7 = t.stat_value8;
                    t.stat_type8 = 0;
                    t.stat_value8 = 0;
                }
            }

            if (t.stat_type7 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type7)
                {
                    t.stat_type1 = t.stat_type7;
                    t.stat_value1 = t.stat_value7;
                    t.stat_type7 = 0;
                    t.stat_value7 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type7)
                {
                    t.stat_type2 = t.stat_type7;
                    t.stat_value2 = t.stat_value7;
                    t.stat_type7 = 0;
                    t.stat_value7 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type7)
                {
                    t.stat_type3 = t.stat_type7;
                    t.stat_value3 = t.stat_value7;
                    t.stat_type7 = 0;
                    t.stat_value7 = 0;
                }
                else if (t.stat_type4 == 0 || t.stat_type4 == t.stat_type7)
                {
                    t.stat_type4 = t.stat_type7;
                    t.stat_value4 = t.stat_value7;
                    t.stat_type7 = 0;
                    t.stat_value7 = 0;
                }
                else if (t.stat_type5 == 0 || t.stat_type5 == t.stat_type7)
                {
                    t.stat_type5 = t.stat_type7;
                    t.stat_value5 = t.stat_value7;
                    t.stat_type7 = 0;
                    t.stat_value7 = 0;
                }
                else if (t.stat_type6 == 0 || t.stat_type6 == t.stat_type7)
                {
                    t.stat_type6 = t.stat_type7;
                    t.stat_value6 = t.stat_value7;
                    t.stat_type7 = 0;
                    t.stat_value7 = 0;
                }
            }

            if (t.stat_type6 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type6)
                {
                    t.stat_type1 = t.stat_type6;
                    t.stat_value1 = t.stat_value6;
                    t.stat_type6 = 0;
                    t.stat_value6 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type6)
                {
                    t.stat_type2 = t.stat_type6;
                    t.stat_value2 = t.stat_value6;
                    t.stat_type6 = 0;
                    t.stat_value6 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type6)
                {
                    t.stat_type3 = t.stat_type6;
                    t.stat_value3 = t.stat_value6;
                    t.stat_type6 = 0;
                    t.stat_value6 = 0;
                }
                else if (t.stat_type4 == 0 || t.stat_type4 == t.stat_type6)
                {
                    t.stat_type4 = t.stat_type6;
                    t.stat_value4 = t.stat_value6;
                    t.stat_type6 = 0;
                    t.stat_value6 = 0;
                }
                else if (t.stat_type5 == 0 || t.stat_type5 == t.stat_type6)
                {
                    t.stat_type5 = t.stat_type6;
                    t.stat_value5 = t.stat_value6;
                    t.stat_type6 = 0;
                    t.stat_value6 = 0;
                }
            }

            if (t.stat_type5 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type5)
                {
                    t.stat_type1 = t.stat_type5;
                    t.stat_value1 = t.stat_value5;
                    t.stat_type5 = 0;
                    t.stat_value5 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type5)
                {
                    t.stat_type2 = t.stat_type5;
                    t.stat_value2 = t.stat_value5;
                    t.stat_type5 = 0;
                    t.stat_value5 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type5)
                {
                    t.stat_type3 = t.stat_type5;
                    t.stat_value3 = t.stat_value5;
                    t.stat_type5 = 0;
                    t.stat_value5 = 0;
                }
                else if (t.stat_type4 == 0 || t.stat_type4 == t.stat_type5)
                {
                    t.stat_type4 = t.stat_type5;
                    t.stat_value4 = t.stat_value5;
                    t.stat_type5 = 0;
                    t.stat_value5 = 0;
                }
            }

            if (t.stat_type4 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type4)
                {
                    t.stat_type1 = t.stat_type4;
                    t.stat_value1 = t.stat_value4;
                    t.stat_type4 = 0;
                    t.stat_value4 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type4)
                {
                    t.stat_type2 = t.stat_type4;
                    t.stat_value2 = t.stat_value4;
                    t.stat_type4 = 0;
                    t.stat_value4 = 0;
                }
                else if (t.stat_type3 == 0 || t.stat_type3 == t.stat_type4)
                {
                    t.stat_type3 = t.stat_type4;
                    t.stat_value3 = t.stat_value4;
                    t.stat_type4 = 0;
                    t.stat_value4 = 0;
                }
            }

            if (t.stat_type3 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type3)
                {
                    t.stat_type1 = t.stat_type3;
                    t.stat_value1 = t.stat_value3;
                    t.stat_type3 = 0;
                    t.stat_value3 = 0;
                }
                else if (t.stat_type2 == 0 || t.stat_type2 == t.stat_type3)
                {
                    t.stat_type2 = t.stat_type3;
                    t.stat_value2 = t.stat_value3;
                    t.stat_type3 = 0;
                    t.stat_value3 = 0;
                }
            }

            if (t.stat_type2 != 0)
            {
                if (t.stat_type1 == 0 || t.stat_type1 == t.stat_type2)
                {
                    t.stat_type1 = t.stat_type2;
                    t.stat_value1 = t.stat_value2;
                    t.stat_type2 = 0;
                    t.stat_value2 = 0;
                }
            }
        }
コード例 #36
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static bool IsPhysicalItem(item_template item)
        {
            int physical = 0;
            int magical = 0;

            int switcher = PhysicalOrMagical(item.stat_type1);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type2);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type3);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type4);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type5);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type6);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type7);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type8);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type9);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            switcher = PhysicalOrMagical(item.stat_type10);
            if (switcher == 1)
                physical += 1;
            else if (switcher == 2)
                magical += 1;
            return physical >= magical;
        }
コード例 #37
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static int StatValue(item_template t, byte stat)
 {
     if (t.stat_type1 == stat)
         return t.stat_value1;
     if (t.stat_type2 == stat)
         return t.stat_value2;
     if (t.stat_type3 == stat)
         return t.stat_value3;
     if (t.stat_type4 == stat)
         return t.stat_value4;
     if (t.stat_type5 == stat)
         return t.stat_value5;
     if (t.stat_type6 == stat)
         return t.stat_value6;
     if (t.stat_type7 == stat)
         return t.stat_value7;
     if (t.stat_type8 == stat)
         return t.stat_value8;
     if (t.stat_type9 == stat)
         return t.stat_value9;
     if (t.stat_type10 == stat)
         return t.stat_value10;
     return 0;
 }
コード例 #38
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static void ModGRating(item_template item)
 {
     if (item.stat_type1 == 31 || item.stat_type1 == 32 || item.stat_type1 == 36 || item.stat_type1 == 45)
         item.stat_value1 = (int)(item.stat_value1 * 2 / 3);
     if (item.stat_type2 == 31 || item.stat_type2 == 32 || item.stat_type2 == 36 || item.stat_type2 == 45)
         item.stat_value2 = (int)(item.stat_value2 * 2 / 3);
     if (item.stat_type3 == 31 || item.stat_type3 == 32 || item.stat_type3 == 36 || item.stat_type3 == 45)
         item.stat_value3 = (int)(item.stat_value3 * 2 / 3);
     if (item.stat_type4 == 31 || item.stat_type4 == 32 || item.stat_type4 == 36 || item.stat_type4 == 45)
         item.stat_value4 = (int)(item.stat_value4 * 2 / 3);
     if (item.stat_type5 == 31 || item.stat_type5 == 32 || item.stat_type5 == 36 || item.stat_type5 == 45)
         item.stat_value5 = (int)(item.stat_value5 * 2 / 3);
     if (item.stat_type6 == 31 || item.stat_type6 == 32 || item.stat_type6 == 36 || item.stat_type6 == 45)
         item.stat_value6 = (int)(item.stat_value6 * 2 / 3);
     if (item.stat_type7 == 31 || item.stat_type7 == 32 || item.stat_type7 == 36 || item.stat_type7 == 45)
         item.stat_value7 = (int)(item.stat_value7 * 2 / 3);
     if (item.stat_type8 == 31 || item.stat_type8 == 32 || item.stat_type8 == 36 || item.stat_type8 == 45)
         item.stat_value8 = (int)(item.stat_value8 * 2 / 3);
     if (item.stat_type9 == 31 || item.stat_type9 == 32 || item.stat_type9 == 36 || item.stat_type9 == 45)
         item.stat_value9 = (int)(item.stat_value9 * 2 / 3);
     if (item.stat_type10 == 31 || item.stat_type10 == 32 || item.stat_type10 == 36 || item.stat_type10 == 45)
         item.stat_value10 = (int)(item.stat_value10 * 2 / 3);
     DataProcessor.SaveItemTemplate(item);
 }
コード例 #39
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void AddSpellDamageOrHealingPower(item_template t, PowerType powerType)
        {
            float power = t.ItemLevel;
            switch (t.InventoryType)
            {
                case 17:
                    power *= 5.635f;
                    break;

                case 13:
                case 14:
                case 21:
                case 22:
                    power *= 4.169f;
                    break;

                default: // 1h
                    return;
            }

            switch (t.Quality)
            {
                case 0:
                    power /= 1.3f * 1.3f * 1.3f * 1.3f;
                    break;

                case 1:
                    power /= 1.3f * 1.3f * 1.3f;
                    break;

                case 2:
                    power /= 1.3f * 1.3f;
                    break;

                case 3:
                    power /= 1.3f;
                    break;

                case 4:
                    break;

                case 5:
                    power *= 1.3f;
                    break;

                case 6:
                    power *= 1.3f * 1.3f;
                    break;

                default:
                    power = 0;
                    break;
            }

            power /= 1.25f;
            if (powerType == PowerType.SpellPower)
                power /= 1.5f;

            if (power > 1)
            {
                switch (powerType)
                {
                    case PowerType.SpellPower:
                        {
                            if (t.stat_type1 == 0)
                            {
                                t.stat_type1 = 45;
                                t.stat_value1 = (int)power;
                            }
                            else if (t.stat_type2 == 0)
                            {
                                t.stat_type2 = 45;
                                t.stat_value2 = (int)power;
                            }
                            else if (t.stat_type3 == 0)
                            {
                                t.stat_type3 = 45;
                                t.stat_value3 = (int)power;
                            }
                            else if (t.stat_type4 == 0)
                            {
                                t.stat_type4 = 45;
                                t.stat_value4 = (int)power;
                            }
                            else if (t.stat_type5 == 0)
                            {
                                t.stat_type5 = 45;
                                t.stat_value5 = (int)power;
                            }
                            else if (t.stat_type6 == 0)
                            {
                                t.stat_type6 = 45;
                                t.stat_value6 = (int)power;
                            }
                            else if (t.stat_type7 == 0)
                            {
                                t.stat_type7 = 45;
                                t.stat_value7 = (int)power;
                            }
                            else if (t.stat_type8 == 0)
                            {
                                t.stat_type8 = 45;
                                t.stat_value8 = (int)power;
                            }
                            else if (t.stat_type9 == 0)
                            {
                                t.stat_type9 = 45;
                                t.stat_value9 = (int)power;
                            }
                            else if (t.stat_type10 == 0)
                            {
                                t.stat_type10 = 45;
                                t.stat_value10 = (int)power;
                            }
                            break;
                        }
                    case PowerType.HealPower:
                        {
                            if (t.stat_type1 == 0)
                            {
                                t.stat_type1 = 41;
                                t.stat_value1 = (int)power;
                            }
                            else if (t.stat_type2 == 0)
                            {
                                t.stat_type2 = 41;
                                t.stat_value2 = (int)power;
                            }
                            else if (t.stat_type3 == 0)
                            {
                                t.stat_type3 = 41;
                                t.stat_value3 = (int)power;
                            }
                            else if (t.stat_type4 == 0)
                            {
                                t.stat_type4 = 41;
                                t.stat_value4 = (int)power;
                            }
                            else if (t.stat_type5 == 0)
                            {
                                t.stat_type5 = 41;
                                t.stat_value5 = (int)power;
                            }
                            else if (t.stat_type6 == 0)
                            {
                                t.stat_type6 = 41;
                                t.stat_value6 = (int)power;
                            }
                            else if (t.stat_type7 == 0)
                            {
                                t.stat_type7 = 41;
                                t.stat_value7 = (int)power;
                            }
                            else if (t.stat_type8 == 0)
                            {
                                t.stat_type8 = 41;
                                t.stat_value8 = (int)power;
                            }
                            else if (t.stat_type9 == 0)
                            {
                                t.stat_type9 = 41;
                                t.stat_value9 = (int)power;
                            }
                            else if (t.stat_type10 == 0)
                            {
                                t.stat_type10 = 41;
                                t.stat_value10 = (int)power;
                            }
                            break;
                        }
                    case PowerType.DamagePower:
                        {
                            if (t.stat_type1 == 0)
                            {
                                t.stat_type1 = 42;
                                t.stat_value1 = (int)power;
                            }
                            else if (t.stat_type2 == 0)
                            {
                                t.stat_type2 = 42;
                                t.stat_value2 = (int)power;
                            }
                            else if (t.stat_type3 == 0)
                            {
                                t.stat_type3 = 42;
                                t.stat_value3 = (int)power;
                            }
                            else if (t.stat_type4 == 0)
                            {
                                t.stat_type4 = 42;
                                t.stat_value4 = (int)power;
                            }
                            else if (t.stat_type5 == 0)
                            {
                                t.stat_type5 = 42;
                                t.stat_value5 = (int)power;
                            }
                            else if (t.stat_type6 == 0)
                            {
                                t.stat_type6 = 42;
                                t.stat_value6 = (int)power;
                            }
                            else if (t.stat_type7 == 0)
                            {
                                t.stat_type7 = 42;
                                t.stat_value7 = (int)power;
                            }
                            else if (t.stat_type8 == 0)
                            {
                                t.stat_type8 = 42;
                                t.stat_value8 = (int)power;
                            }
                            else if (t.stat_type9 == 0)
                            {
                                t.stat_type9 = 42;
                                t.stat_value9 = (int)power;
                            }
                            else if (t.stat_type10 == 0)
                            {
                                t.stat_type10 = 42;
                                t.stat_value10 = (int)power;
                            }
                        }
                        break;
                }
            }
        }
コード例 #40
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void ModItemSpell(item_template item)
        {
            if (item.spelltrigger_1 == 1 && item.spellid_1 != 0)
            {
                var spell = (from d in LegacyToolBox.Data.Spell where d.ID == item.spellid_1 select d).SingleOrDefault();
                if (spell != null)
                {
                    if (spell.EffectApplyAura[0] == 189 && (spell.Attributes[0] & 0x40) != 0)
                    {
                        if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DEFENSE)) != 0)
                        {
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                            ModItemStat(item, (int)ItemStat.DEFENSE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DODGE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.DODGE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.PARRY)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.PARRY_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.BLOCK)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.BLOCK_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.EXPERTISE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.EXPERTISE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.ARMOR_PENETRATION)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.ARMOR_PENETRATION_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_1 = 0;
                            item.spellid_1 = 0;
                        }
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 13 || spell.EffectApplyAura[0] == 135) && spell.EffectMisc[0] == 126)
                    {
                        ModItemStat(item, (int)ItemStat.SPELL_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_1 = 0;
                        item.spellid_1 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 99 || spell.EffectApplyAura[0] == 124))
                    {
                        ModItemStat(item, (int)ItemStat.ATTACK_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_1 = 0;
                        item.spellid_1 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 85)
                    {
                        ModItemStat(item, (int)ItemStat.MANA_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_1 = 0;
                        item.spellid_1 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 161)
                    {
                        ModItemStat(item, (int)ItemStat.HEALTH_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_1 = 0;
                        item.spellid_1 = 0;
                    }
                }
            }

            if (item.spelltrigger_2 == 1 && item.spellid_2 != 0)
            {
                var spell = (from d in LegacyToolBox.Data.Spell where d.ID == item.spellid_2 select d).SingleOrDefault();
                if (spell != null)
                {
                    if (spell.EffectApplyAura[0] == 189 && (spell.Attributes[0] & 0x40) != 0)
                    {
                        if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DEFENSE)) != 0)
                        {
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                            ModItemStat(item, (int)ItemStat.DEFENSE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DODGE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.DODGE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.PARRY)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.PARRY_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.BLOCK)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.BLOCK_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.EXPERTISE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.EXPERTISE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.ARMOR_PENETRATION)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.ARMOR_PENETRATION_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_2 = 0;
                            item.spellid_2 = 0;
                        }
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 13 || spell.EffectApplyAura[0] == 135) && spell.EffectMisc[0] == 126)
                    {
                        ModItemStat(item, (int)ItemStat.SPELL_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_2 = 0;
                        item.spellid_2 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 99 || spell.EffectApplyAura[0] == 124))
                    {
                        ModItemStat(item, (int)ItemStat.ATTACK_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_2 = 0;
                        item.spellid_2 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 85)
                    {
                        ModItemStat(item, (int)ItemStat.MANA_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_2 = 0;
                        item.spellid_2 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 161)
                    {
                        ModItemStat(item, (int)ItemStat.HEALTH_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_2 = 0;
                        item.spellid_2 = 0;
                    }
                }
            }

            if (item.spelltrigger_3 == 1 && item.spellid_3 != 0)
            {
                var spell = (from d in LegacyToolBox.Data.Spell where d.ID == item.spellid_3 select d).SingleOrDefault();
                if (spell != null)
                {
                    if (spell.EffectApplyAura[0] == 189 && (spell.Attributes[0] & 0x40) != 0)
                    {
                        if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DEFENSE)) != 0)
                        {
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                            ModItemStat(item, (int)ItemStat.DEFENSE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DODGE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.DODGE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.PARRY)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.PARRY_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.BLOCK)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.BLOCK_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.EXPERTISE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.EXPERTISE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.ARMOR_PENETRATION)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.ARMOR_PENETRATION_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_3 = 0;
                            item.spellid_3 = 0;
                        }
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 13 || spell.EffectApplyAura[0] == 135) && spell.EffectMisc[0] == 126)
                    {
                        ModItemStat(item, (int)ItemStat.SPELL_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_3 = 0;
                        item.spellid_3 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 99 || spell.EffectApplyAura[0] == 124))
                    {
                        ModItemStat(item, (int)ItemStat.ATTACK_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_3 = 0;
                        item.spellid_3 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 85)
                    {
                        ModItemStat(item, (int)ItemStat.MANA_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_3 = 0;
                        item.spellid_3 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 161)
                    {
                        ModItemStat(item, (int)ItemStat.HEALTH_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_3 = 0;
                        item.spellid_3 = 0;
                    }
                }
            }

            if (item.spelltrigger_4 == 1 && item.spellid_4 != 0)
            {
                var spell = (from d in LegacyToolBox.Data.Spell where d.ID == item.spellid_4 select d).SingleOrDefault();
                if (spell != null)
                {
                    if (spell.EffectApplyAura[0] == 189 && (spell.Attributes[0] & 0x40) != 0)
                    {
                        if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DEFENSE)) != 0)
                        {
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                            ModItemStat(item, (int)ItemStat.DEFENSE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DODGE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.DODGE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.PARRY)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.PARRY_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.BLOCK)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.BLOCK_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.EXPERTISE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.EXPERTISE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.ARMOR_PENETRATION)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.ARMOR_PENETRATION_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_4 = 0;
                            item.spellid_4 = 0;
                        }
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 13 || spell.EffectApplyAura[0] == 135) && spell.EffectMisc[0] == 126)
                    {
                        ModItemStat(item, (int)ItemStat.SPELL_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_4 = 0;
                        item.spellid_4 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 99 || spell.EffectApplyAura[0] == 124))
                    {
                        ModItemStat(item, (int)ItemStat.ATTACK_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_4 = 0;
                        item.spellid_4 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 85)
                    {
                        ModItemStat(item, (int)ItemStat.MANA_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_4 = 0;
                        item.spellid_4 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 161)
                    {
                        ModItemStat(item, (int)ItemStat.HEALTH_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_4 = 0;
                        item.spellid_4 = 0;
                    }
                }
            }

            if (item.spelltrigger_5 == 1 && item.spellid_5 != 0)
            {
                var spell = (from d in LegacyToolBox.Data.Spell where d.ID == item.spellid_5 select d).SingleOrDefault();
                if (spell != null)
                {
                    if (spell.EffectApplyAura[0] == 189 && (spell.Attributes[0] & 0x40) != 0)
                    {
                        if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DEFENSE)) != 0)
                        {
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                            ModItemStat(item, (int)ItemStat.DEFENSE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.DODGE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.DODGE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.PARRY)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.PARRY_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.BLOCK)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.BLOCK_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.CRIT_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.CRIT_TAKEN_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.RESILIENCE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_MELEE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_RANGED)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.HASTE_SPELL)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.HASTE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.EXPERTISE)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.EXPERTISE_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                        else if ((spell.EffectMisc[0] & (1 << (int)CombatRating.ARMOR_PENETRATION)) != 0)
                        {
                            ModItemStat(item, (int)ItemStat.ARMOR_PENETRATION_RATING, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                            item.spelltrigger_5 = 0;
                            item.spellid_5 = 0;
                        }
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 13 || spell.EffectApplyAura[0] == 135) && spell.EffectMisc[0] == 126)
                    {
                        ModItemStat(item, (int)ItemStat.SPELL_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_5 = 0;
                        item.spellid_5 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && (spell.EffectApplyAura[0] == 99 || spell.EffectApplyAura[0] == 124))
                    {
                        ModItemStat(item, (int)ItemStat.ATTACK_POWER, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_5 = 0;
                        item.spellid_5 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 85)
                    {
                        ModItemStat(item, (int)ItemStat.MANA_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_5 = 0;
                        item.spellid_5 = 0;
                    }
                    else if ((spell.Attributes[0] & 0x40) != 0 && spell.EffectApplyAura[0] == 161)
                    {
                        ModItemStat(item, (int)ItemStat.HEALTH_REGEN, spell.EffectBasePoints[0] + spell.EffectDieSides[0]);
                        item.spelltrigger_5 = 0;
                        item.spellid_5 = 0;
                    }
                }
            }

            DataProcessor.SaveItemTemplate(item);
        }
コード例 #41
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static int CreateEpicItem(item_template t)
 {
     item_template n = DataProcessor.GetItemTemplate(t.entry);
     DataProcessor.SetEntityState(n, EntityState.Added);
     n.entry = DataProcessor.GenerateNextItemEntry();
     n.Quality = 4;
     ModItemWithFactor(n, 1.3f);
     DataProcessor.SaveItemTemplate(n);
     return n.entry;
 }
コード例 #42
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void ModItemStat(item_template item, int type, int value)
        {
            if (item.stat_type1 == 0 && item.stat_value1 == 0)
            {
                item.stat_type1 = (byte)type;
                item.stat_value1 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type2 == 0 && item.stat_value2 == 0)
            {
                item.stat_type2 = (byte)type;
                item.stat_value2 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type3 == 0 && item.stat_value3 == 0)
            {
                item.stat_type3 = (byte)type;
                item.stat_value3 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type4 == 0 && item.stat_value4 == 0)
            {
                item.stat_type4 = (byte)type;
                item.stat_value4 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type5 == 0 && item.stat_value5 == 0)
            {
                item.stat_type5 = (byte)type;
                item.stat_value5 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type6 == 0 && item.stat_value6 == 0)
            {
                item.stat_type6 = (byte)type;
                item.stat_value6 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type7 == 0 && item.stat_value7 == 0)
            {
                item.stat_type7 = (byte)type;
                item.stat_value7 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type8 == 0 && item.stat_value8 == 0)
            {
                item.stat_type8 = (byte)type;
                item.stat_value8 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type9 == 0 && item.stat_value9 == 0)
            {
                item.stat_type9 = (byte)type;
                item.stat_value9 = (short)value;
                item.StatsCount += 1;
                return;
            }

            if (item.stat_type10 == 0 && item.stat_value10 == 0)
            {
                item.stat_type10 = (byte)type;
                item.stat_value10 = (short)value;
                item.StatsCount += 1;
                return;
            }
        }
コード例 #43
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void CreateSocket(item_template t, Random rand)
        {
            if (t.InventoryType == 1)
                t.socketColor_1 = 1;
            else
            {
                switch (rand.Next(0, 3))
                {
                    case 0:
                        t.socketColor_1 = 2;
                        break;

                    case 1:
                        t.socketColor_1 = 4;
                        break;

                    case 2:
                        t.socketColor_1 = 8;
                        break;
                }
            }

            switch (rand.Next(0, 3))
            {
                case 0:
                    t.socketColor_2 = 2;
                    break;

                case 1:
                    t.socketColor_2 = 4;
                    break;

                case 2:
                    t.socketColor_2 = 8;
                    break;
            }

            // create socket bonus
        }
コード例 #44
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static void ModItemWithFactor(item_template item, double factor, bool modItemLevel = false)
        {
            item.BuyPrice = (int)(item.BuyPrice * factor);
            item.SellPrice = (int)(item.SellPrice * factor);

            if (modItemLevel)
                item.ItemLevel = (int)(item.ItemLevel * factor);
            item.dmg_min1 = (float)(item.dmg_min1 * factor);
            item.dmg_max1 = (float)(item.dmg_max1 * factor);
            item.dmg_min2 = (float)(item.dmg_min2 * factor);
            item.dmg_max2 = (float)(item.dmg_max2 * factor);

            item.armor = (int)(item.armor * factor);

            item.holy_res = (int)(item.holy_res * factor);
            item.fire_res = (int)(item.fire_res * factor);
            item.nature_res = (int)(item.nature_res * factor);
            item.frost_res = (int)(item.frost_res * factor);
            item.shadow_res = (int)(item.shadow_res * factor);
            item.arcane_res = (int)(item.arcane_res * factor);

            item.stat_value1 = (int)(item.stat_value1 * factor);
            item.stat_value2 = (int)(item.stat_value2 * factor);
            item.stat_value3 = (int)(item.stat_value3 * factor);
            item.stat_value4 = (int)(item.stat_value4 * factor);
            item.stat_value5 = (int)(item.stat_value5 * factor);
            item.stat_value6 = (int)(item.stat_value6 * factor);
            item.stat_value7 = (int)(item.stat_value7 * factor);
            item.stat_value8 = (int)(item.stat_value8 * factor);
            item.stat_value9 = (int)(item.stat_value9 * factor);
            item.stat_value10 = (int)(item.stat_value10 * factor);

            // @todo: build spell case
        }
コード例 #45
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
 public static int CreateSocketedItem(item_template t, Random rand)
 {
     item_template n = DataProcessor.GetItemTemplate(t.entry);
     DataProcessor.SetEntityState(n, EntityState.Added);
     n.entry = DataProcessor.GenerateNextItemEntry();
     CreateSocket(n, rand);
     DataProcessor.SaveItemTemplate(n);
     return n.entry;
 }
コード例 #46
0
ファイル: ItemUtils.cs プロジェクト: stolborez/Vanilla
        public static item_template[] GenerateInventoryByIDs(int[] ids)
        {
            if (ids == null)
            {
                return(null);
            }

            item_template[] inventory = new item_template[19];
            for (int i = 0; i < ids.Length; i++)
            {
                if (ids[i] > 0)
                {
                    var           itemEntry = ids[i];
                    item_template item      = new DatabaseUnitOfWork <WorldDatabase>().GetRepository <item_template>().SingleOrDefault(it => it.entry == itemEntry);
                    switch ((InventorySlotID)item.InventoryType)
                    {
                    case InventorySlotID.Head:
                        inventory[0] = item;
                        break;

                    case InventorySlotID.Shirt:
                        inventory[3] = item;
                        break;

                    case InventorySlotID.Vest:
                    case InventorySlotID.Robe:
                        inventory[4] = item;
                        break;

                    case InventorySlotID.Waist:
                        inventory[5] = item;
                        break;

                    case InventorySlotID.Legs:
                        inventory[6] = item;
                        break;

                    case InventorySlotID.Feet:
                        inventory[7] = item;
                        break;

                    case InventorySlotID.Wrist:
                        inventory[8] = item;
                        break;

                    case InventorySlotID.Hands:
                        inventory[9] = item;
                        break;

                    case InventorySlotID.Ring:
                        inventory[10] = item;
                        break;

                    case InventorySlotID.Trinket:
                        inventory[12] = item;
                        break;

                    case InventorySlotID.Mainhand:
                    case InventorySlotID.Onehand:
                    case InventorySlotID.Twohand:
                        inventory[15] = item;
                        break;

                    case InventorySlotID.Offhand:
                    case InventorySlotID.Shield:
                    case InventorySlotID.Bow:
                        inventory[16] = item;
                        break;
                    }
                }
            }
            return(inventory);
        }
コード例 #47
0
ファイル: ItemManager.cs プロジェクト: shilvasa/LegacyToolBox
        public static bool AddStat(item_template t, byte stat, int value)
        {
            if (value <= 0)
                return true;

            if (t.stat_type1 == stat)
            {
                t.stat_value1 += value;
                return true;
            }

            if (t.stat_type2 == stat)
            {
                t.stat_value2 += value;
                return true;
            }

            if (t.stat_type3 == stat)
            {
                t.stat_value3 += value;
                return true;
            }

            if (t.stat_type4 == stat)
            {
                t.stat_value4 += value;
                return true;
            }

            if (t.stat_type5 == stat)
            {
                t.stat_value5 += value;
                return true;
            }

            if (t.stat_type6 == stat)
            {
                t.stat_value6 += value;
                return true;
            }

            if (t.stat_type7 == stat)
            {
                t.stat_value7 += value;
                return true;
            }

            if (t.stat_type8 == stat)
            {
                t.stat_value8 += value;
                return true;
            }

            if (t.stat_type9 == stat)
            {
                t.stat_value9 += value;
                return true;
            }

            if (t.stat_type10 == stat)
            {
                t.stat_value10 += value;
                return true;
            }

            if (t.stat_type1 == 0)
            {
                t.stat_type1 = stat;
                t.stat_value1 = value;
                return true;
            }

            if (t.stat_type2 == 0)
            {
                t.stat_type2 = stat;
                t.stat_value2 = value;
                return true;
            }

            if (t.stat_type3 == 0)
            {
                t.stat_type3 = stat;
                t.stat_value3 = value;
                return true;
            }

            if (t.stat_type4 == 0)
            {
                t.stat_type4 = stat;
                t.stat_value4 = value;
                return true;
            }

            if (t.stat_type5 == 0)
            {
                t.stat_type5 = stat;
                t.stat_value5 = value;
                return true;
            }

            if (t.stat_type6 == 0)
            {
                t.stat_type6 = stat;
                t.stat_value6 = value;
                return true;
            }

            if (t.stat_type7 == 0)
            {
                t.stat_type7 = stat;
                t.stat_value7 = value;
                return true;
            }

            if (t.stat_type8 == 0)
            {
                t.stat_type8 = stat;
                t.stat_value8 = value;
                return true;
            }

            if (t.stat_type9 == 0)
            {
                t.stat_type9 = stat;
                t.stat_value9 = value;
                return true;
            }

            if (t.stat_type10 == 0)
            {
                t.stat_type10 = stat;
                t.stat_value10 = value;
                return true;
            }

            return false;
        }
コード例 #48
0
 public static void ModRaidItem(item_template item, int modItemLevel)
 {
     float factor = (float)(item.ItemLevel + modItemLevel) / (float)item.ItemLevel;
     ModRaidItem(item.entry, factor);
     ModLegacyItems(item.entry, factor);
 }
コード例 #49
0
        private void SaveRecipe()
        {
            // save spell
            SpellTemplate spell = WorldWorker.CreateSpell(LegacyToolBox.Data.Spell);

            recipeSpellEntry.Text = spell.ID.ToString();
            ProfessionDefine define = type.SelectedItem as ProfessionDefine;

            spell.Attributes[0]       = 0x10030;
            spell.Attributes[1]       = 0x400;
            spell.Icon                = (uint)define.SpellIcon;
            spell.Visual[0]           = (uint)define.SpellVisual;
            spell.Name                = recipeItemName.Text;
            spell.CastingTime         = 22; // 3.5 sec
            spell.InterruptFlags      = 17;
            spell.ProcChance          = 101;
            spell.TotemCategory[0]    = Convert.ToInt32(rt1.SelectedValue);
            spell.TotemCategory[1]    = Convert.ToInt32(rt2.SelectedValue);
            spell.Totem[0]            = Convert.ToInt32(rti1.Text);
            spell.Totem[1]            = Convert.ToInt32(rti2.Text);
            spell.RequiredSpellFocus  = Convert.ToUInt32(rf.Text);
            spell.Effect[0]           = 24;
            spell.EffectTargetA[0]    = 1;
            spell.EffectItemType[0]   = Convert.ToUInt32(i1i.Text);
            spell.EffectBasePoints[0] = Convert.ToInt32(i1c.Text) - 1;
            spell.EffectDieSides[0]   = 1;
            spell.Reagent[0]          = Convert.ToInt32(r1i.Text);
            spell.Reagent[1]          = Convert.ToInt32(r2i.Text);
            spell.Reagent[2]          = Convert.ToInt32(r3i.Text);
            spell.Reagent[3]          = Convert.ToInt32(r4i.Text);
            spell.Reagent[4]          = Convert.ToInt32(r5i.Text);
            spell.Reagent[5]          = Convert.ToInt32(r6i.Text);
            spell.Reagent[6]          = Convert.ToInt32(r7i.Text);
            spell.Reagent[7]          = Convert.ToInt32(r8i.Text);
            spell.ReagentCount[0]     = Convert.ToUInt32(r1c.Text);
            spell.ReagentCount[1]     = Convert.ToUInt32(r2c.Text);
            spell.ReagentCount[2]     = Convert.ToUInt32(r3c.Text);
            spell.ReagentCount[3]     = Convert.ToUInt32(r4c.Text);
            spell.ReagentCount[4]     = Convert.ToUInt32(r5c.Text);
            spell.ReagentCount[5]     = Convert.ToUInt32(r6c.Text);
            spell.ReagentCount[6]     = Convert.ToUInt32(r7c.Text);
            spell.ReagentCount[7]     = Convert.ToUInt32(r8c.Text);

            WorldWorker.SaveSpell(LegacyToolBox.Data.Spell);

            // save item - only recipe.
            item_template item = WorldWorker.CreateItemTemplate(LegacyToolBox.Data.ItemTemplate);

            item.name              = define.Prefix + recipeItemName.Text;
            item.description       = "教你学会制作" + recipeItemName.Text + "。";
            item.displayid         = define.DisplayID;
            item.RequiredSkill     = define.SkillLine;
            item.RequiredSkillRank = Convert.ToInt32(rs.Text);
            item.@class            = 9;
            item.subclass          = (byte)define.RecipeSubClass;
            item.AllowableClass    = -1;
            item.AllowableRace     = -1;
            item.Flags             = 64;
            item.Quality           = 1;
            item.spellid_1         = 483;
            item.spelltrigger_1    = 0;
            item.spellcharges_1    = -1;
            item.spellid_2         = Convert.ToInt32(recipeSpellEntry.Text);
            item.spelltrigger_2    = 6;
            WorldWorker.SaveItemTemplate(item);

            // save skillline
            SkillLinePanel.AddToSkill((int)spell.ID, Convert.ToInt32(type.SelectedValue), Convert.ToInt32(recipeRequiredSkillValue.Text), Convert.ToInt32(recipeSkillGoYellow.Text), Convert.ToInt32(recipeSkillGoGray.Text));
        }