Esempio n. 1
0
        private void alterWorkmanshipReqs(eLootAction e, int by)
        {
            if (e == eLootAction.Keep)
            {
                by = -1 * by;
            }

            foreach (cLootItemRule r in this.LootRules.Rules)
            {
                if (r.act == e)
                {
                    foreach (iLootRule req in r.IntRules)
                    {
                        if (req.GetRuleType() == eLootRuleType.DoubleValKeyGE)
                        {
                            ((DoubleValKeyGE)req).keyval = Math.Min(10, ((DoubleValKeyGE)req).keyval + by);
                        }
                        else if (req.GetRuleType() == eLootRuleType.DoubleValKeyLE)
                        {
                            ((DoubleValKeyLE)req).keyval = Math.Max(1, ((DoubleValKeyLE)req).keyval - by);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private void autoSortRulesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            lstRules.Visible = false;
            try
            {
                SetCurrentReq(null, 0);
                SetCurrentRule(null, -1);

                int  i, j;
                bool swap;
                for (i = lstRules.Items.Count - 1; i > 0; i--)
                {
                    for (j = 0; j < i; j++)
                    {
                        eLootAction jAct = LootRules.Rules[j].act == eLootAction.KeepUpTo ? eLootAction.Keep : LootRules.Rules[j].act;
                        eLootAction kAct = LootRules.Rules[j + 1].act == eLootAction.KeepUpTo ? eLootAction.Keep : LootRules.Rules[j + 1].act;
                        swap = (jAct > kAct) ||
                               (jAct == kAct && LootRules.Rules[j].AnyReqRequiresID() && !LootRules.Rules[j + 1].AnyReqRequiresID()) ||
                               (jAct == kAct &&
                                LootRules.Rules[j].AnyReqRequiresID() == LootRules.Rules[j + 1].AnyReqRequiresID() &&
                                LootRules.Rules[j].name.CompareTo(LootRules.Rules[j + 1].name) > 0);
                        if (swap)
                        {
                            ruleMoveDown(j, false);
                            FileChanged = true;
                        }
                    }
                }
            }
            catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Exception: " + ex.ToString()); }
            lstRules.Visible = true;
        }
Esempio n. 3
0
        public override uTank2.LootPlugins.LootAction GetLootDecision(uTank2.LootPlugins.GameItemInfo item)
        {
            try
            {
                if (LootRules == null)
                {
                    return(uTank2.LootPlugins.LootAction.NoLoot);
                }

                string      matchedrulename;
                int         data1;
                eLootAction act      = LootRules.Classify(item, out matchedrulename, out data1);
                LootAction  vtaction = LootAction.NoLoot;
                switch (act)
                {
                case eLootAction.Keep:
                    vtaction = LootAction.Keep;
                    break;

                case eLootAction.NoLoot:
                    vtaction = LootAction.NoLoot;
                    break;

                case eLootAction.Salvage:
                    vtaction = LootAction.Salvage;
                    break;

                case eLootAction.KeepUpTo:
                    vtaction = LootAction.GetKeepUpTo(data1);
                    break;

                case eLootAction.Sell:
                    vtaction = LootAction.Sell;
                    break;
                }
                vtaction.RuleName = matchedrulename;
                return(vtaction);
            }
            catch (Exception ex)
            {
                ExceptionHandler(ex);
            }

            return(uTank2.LootPlugins.LootAction.NoLoot);
        }
        public static string FriendlyName(eLootAction e)
        {
            switch (e)
            {
            case eLootAction.Keep:
                return("Keep");

            case eLootAction.Salvage:
                return("Salvage");

            case eLootAction.Sell:
                return("Sell");

            case eLootAction.Read:
                return("Read");

            case eLootAction.KeepUpTo:
                return("Keep #");
            }
            return(string.Empty);
        }
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     act = eLootActionTool.enumValue((string)comboBox1.Items[comboBox1.SelectedIndex]);
 }
Esempio n. 6
0
        private void alterWorkmanshipReqs(eLootAction e, int by)
        {
            if (e == eLootAction.Keep) by = -1 * by;

            foreach (cLootItemRule r in this.LootRules.Rules)
            {
                if (r.act == e)
                {
                    foreach (iLootRule req in r.IntRules)
                    {
                        if (req.GetRuleType() == eLootRuleType.DoubleValKeyGE)
                        {
                            ((DoubleValKeyGE)req).keyval = Math.Min(10,((DoubleValKeyGE)req).keyval + by);
                        }
                        else if (req.GetRuleType() == eLootRuleType.DoubleValKeyLE)
                        {
                            ((DoubleValKeyLE)req).keyval = Math.Max(1, ((DoubleValKeyLE)req).keyval - by);
                        }

                    }
                }
            }
        }
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     act = eLootActionTool.enumValue((string)comboBox1.Items[comboBox1.SelectedIndex]);
 }
Esempio n. 8
0
 internal LootAction(eLootAction A_0, int A_1)
 {
     this.c = "";
     this.a = A_0;
     this.b = A_1;
 }
Esempio n. 9
0
 internal LootAction(eLootAction A_0)
 {
     this.c = "";
     this.a = A_0;
 }