示例#1
0
    public void b()
    {
        ev cq = PluginCore.cq;

        if (this.a != null)
        {
            MyQuad <int, eDamageElement, ePrismaticDamageBehavior, int> quad = this.a.a();
            if (((eDamageElement)quad.b) == eDamageElement.Random)
            {
                quad.b = (eDamageElement)this.d;
                this.d++;
                if (this.d == 7)
                {
                    this.d = 0;
                }
            }
            bool           flag  = (this.a.b().b == eDamageElement.Fists) && PluginCore.cq.h.c(PluginCore.cq.e.a("Tusker Fists"));
            int            num   = quad.a;
            eDamageElement b     = quad.b;
            TimeSpan       span  = TimeSpan.FromSeconds((double)er.i("DebuffPrecastSeconds"));
            float          num2  = 1f;
            CombatState    state = 8;
            if (dh.b(num) && (dh.c(num) == PluginCore.cg))
            {
                state = PluginCore.cq.n.a(PluginCore.cq.aw.get_WorldFilter().get_Item(num).get_ObjectClass());
                if (state == 2)
                {
                    fn.a a = PluginCore.cq.n.d(num);
                    if ((a.i == 1) && (PluginCore.cq.n.c(quad.d) != a1.c))
                    {
                        if ((b == eDamageElement.Slash) && a.d)
                        {
                            num2 = 0.5f;
                        }
                        else
                        {
                            num2 = 0f;
                        }
                    }
                    else if (((b == eDamageElement.Pierce) && a.d) && !a.f)
                    {
                        num2 = 0.2f;
                    }
                    else if (((b == eDamageElement.Pierce) && a.d) && (a.f && (PluginCore.cq.n.c(quad.d) == a1.c)))
                    {
                        num2 = 0.49f;
                    }
                    else if (((b == eDamageElement.Pierce) && a.d) && (a.f && (PluginCore.cq.n.c(quad.d) != a1.d)))
                    {
                        num2 = 0.2f;
                    }
                    else
                    {
                        num2 = 1f;
                    }
                }
            }
            if (er.j("UseRecklessness") && dh.b(eGameSkillID.Recklessness))
            {
                if (num2 < 0.11f)
                {
                    num2 = 0.11f;
                }
                if (num2 > 0.9f)
                {
                    num2 = 0.9f;
                }
            }
            bool flag2 = !cq.d.a(this.a.a).s;
            bool i     = cq.d.a(this.a.a).i;
            bool r     = cq.d.a(this.a.a).r;
            if (cq.d.a(this.a.a).h&& (cq.i.a(this.a.b, this.a(cq.e.a("Magic Yield Other I"))) <= span))
            {
                this.a("Magic Yield Other I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).m&& (cq.i.a(this.a.b, this.a(cq.e.a("Weakening Curse I"))) <= span))
            {
                this.a("Weakening Curse I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).n&& (cq.i.a(this.a.b, this.a(cq.e.a("Festering Curse I"))) <= span))
            {
                this.a("Festering Curse I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).o&& (cq.i.a(this.a.b, this.a(cq.e.a("Corruption I"))) <= TimeSpan.Zero))
            {
                this.a("Corruption I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).p&& (cq.i.a(this.a.b, this.a(cq.e.a("Destructive Curse I"))) <= TimeSpan.Zero))
            {
                this.a("Destructive Curse I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).q&& (cq.i.a(this.a.b, this.a(cq.e.a("Corrosion I"))) <= TimeSpan.Zero))
            {
                this.a("Corrosion I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).f&& (cq.i.a(this.a.b, this.a(cq.e.a("Imperil Other I"))) <= span))
            {
                this.a("Imperil Other I", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).g&& (cq.i.a(this.a.b, this.a(cq.h.a(b, eCombatSpellType.Vuln))) <= span))
            {
                this.a(cq.h.a(b, eCombatSpellType.Vuln), this.a.b, num);
            }
            else if ((cq.d.a(this.a.a).c != eDamageElement.None) && (cq.i.a(this.a.b, this.a(cq.h.a(cq.d.a(this.a.a).c, eCombatSpellType.Vuln))) <= span))
            {
                this.a(cq.h.a(cq.d.a(this.a.a).c, eCombatSpellType.Vuln), this.a.b, num);
            }
            else if (cq.d.a(this.a.a).j&& (cq.i.a(this.a.b, this.a(cq.e.a("Gravity Well"))) <= span))
            {
                this.a("Gravity Well", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).k&& (cq.i.a(this.a.b, this.a(cq.e.a("Broadside of a Barn"))) <= span))
            {
                this.a("Broadside of a Barn", this.a.b, num);
            }
            else if (cq.d.a(this.a.a).l&& (cq.i.a(this.a.b, this.a(cq.e.a("Fester Other I"))) <= span))
            {
                this.a("Fester Other I", this.a.b, num);
            }
            else if (flag)
            {
                if (state != 8)
                {
                    PluginCore.cq.v.d();
                    if (!PluginCore.cq.n.a(8, 0, true))
                    {
                        return;
                    }
                }
                else
                {
                    PluginCore.cq.v.d();
                    if (!PluginCore.cq.n.a(8, num, false))
                    {
                        return;
                    }
                }
                cv cv  = PluginCore.cq.p.d(PluginCore.cg);
                cv cv2 = this.a.a;
                if (cv != null)
                {
                    dz dz = cv.b(PluginCore.cq.ax.get_Actions());
                    dz w  = cv2.w;
                    if (!PluginCore.cq.aq.a(dz.a(w) - 0.062831853071795868))
                    {
                        return;
                    }
                }
                this.a("Tusker Fists", this.a.b);
            }
            else if (state == 8)
            {
                PluginCore.cq.aq.b();
                PluginCore.cq.v.d();
                if (PluginCore.cq.n.a(8, num, false))
                {
                    if ((i && (this.b >= er.i("MinimumRingTargets"))) || ((i && !flag2) && (!r && (this.b > 0))))
                    {
                        if (b == eDamageElement.DrainAuto)
                        {
                            PluginCore.cq.ao.a(this.a.b, true);
                        }
                        else
                        {
                            MySpell spell = cq.h.a(b, eCombatSpellType.Ring);
                            if (spell.HasScarabsInInventory)
                            {
                                this.a(spell, this.a.b);
                            }
                            else
                            {
                                this.a(this.a(b, this.a), this.a.b);
                            }
                        }
                    }
                    else if ((flag2 && !r) || ((!flag2 && !r) && i))
                    {
                        if (b == eDamageElement.DrainAuto)
                        {
                            PluginCore.cq.ao.a(this.a.b, false);
                        }
                        else
                        {
                            this.a(this.a(b, this.a), this.a.b);
                        }
                    }
                    else if (!flag2 && r)
                    {
                        if (b == eDamageElement.DrainAuto)
                        {
                            PluginCore.cq.ao.a(this.a.b, false);
                        }
                        else
                        {
                            MySpell spell2 = PluginCore.cq.h.a(PluginCore.cq.h.a(b, eCombatSpellType.Streak));
                            if (spell2 != null)
                            {
                                this.a(spell2, this.a.b);
                            }
                            else
                            {
                                ai.a(string.Format("No streak spell usable for element '{0}', using bolt/arc instead.", er.a(b)));
                                this.a(this.a(b, this.a), this.a.b);
                            }
                        }
                    }
                    else if (flag2 && r)
                    {
                        MySpell spell3 = PluginCore.cq.h.a(PluginCore.cq.h.a(b, eCombatSpellType.Streak));
                        int     num3   = 0;
                        if (spell3 != null)
                        {
                            if (PluginCore.cq.an.d() > 0)
                            {
                                num3 = PluginCore.cq.an.d() / 7;
                            }
                            else
                            {
                                num3 = spell3.Difficulty / 7;
                            }
                        }
                        bool flag5 = ((PluginCore.cq.an.h() == this.a.b) && (PluginCore.cq.an.b() > 0)) && (PluginCore.cq.an.b() < num3);
                        if (b == eDamageElement.DrainAuto)
                        {
                            PluginCore.cq.ao.a(this.a.b, false);
                        }
                        else if (flag5 && (spell3 != null))
                        {
                            this.a(spell3, this.a.b);
                        }
                        else
                        {
                            if (flag5)
                            {
                                ai.a(string.Format("No streak spell usable for element '{0}', using bolt/arc instead.", er.a(b)));
                            }
                            this.a(this.a(b, this.a), this.a.b);
                        }
                    }
                }
            }
            else
            {
                PluginCore.cq.aq.b();
                if (PluginCore.cq.n.a(state, num, false, b, quad.c, quad.d))
                {
                    PluginCore.cq.v.a(this.a.b, num2, null);
                }
            }
        }
    }
示例#2
0
    private MySpell a(MySpell A_0)
    {
        if (A_0 == null)
        {
            return(null);
        }
        if (this.e.ContainsKey(A_0.Id))
        {
            return(this.e[A_0.Id].e.b);
        }
        bw.a a = new bw.a {
            e = new bw.b(bw.b.a.a)
        };
        bw.b b = new bw.b(bw.b.a.a)
        {
            b = PluginCore.cq.h.a(A_0)
        };
        if (b.b != null)
        {
            b.a = b.b.SkillWithSchool;
        }
        bw.b b2 = new bw.b(bw.b.a.b);
        foreach (int num in PluginCore.cq.j.e())
        {
            string str;
            if (PluginCore.cq.p.d(num) != null)
            {
                str = PluginCore.cq.p.d(num).g() + " [" + num.ToString() + "]";
            }
            else
            {
                str = num.ToString();
            }
            PluginCore.cq.n.a("Find debuff choice (" + str + "): Begin", e8.j);
            if (!dh.b(num) || (dh.c(num) != PluginCore.cg))
            {
                goto Label_03EA;
            }
            if (!fn.b(PluginCore.cq.aw.get_WorldFilter().get_Item(num)))
            {
                goto Label_03B9;
            }
            a1   a2 = PluginCore.cq.n.c(num);
            fn.a a3 = PluginCore.cq.n.d(num);
            if (((a2 != a1.c) && (a2 != a1.e)) && (((a2 != a1.f) && (a2 != a1.g)) && (a2 != a1.b)))
            {
                goto Label_0392;
            }
            if ((a2 != a1.b) || PluginCore.cq.z.a(num))
            {
                PluginCore.cq.n.a("Find debuff choice (" + str + "): Test 1 passed", e8.j);
                if (a3.g != null)
                {
                    PluginCore.cq.n.a("Find debuff choice (" + str + "): Test 2 passed", e8.j);
                    if (a3.g.RealFamily == A_0.RealFamily)
                    {
                        PluginCore.cq.n.a("Find debuff choice (" + str + "): Test 3 passed", e8.j);
                        if (b2.b != null)
                        {
                            PluginCore.cq.n.a("Find debuff choice (" + str + "): Test 4 passed", e8.j);
                            if (a3.g.Quality <= b2.b.Quality)
                            {
                                PluginCore.cq.n.a("Find debuff choice (" + str + "): Test 5 passed", e8.j);
                                if (a3.h <= b2.a)
                                {
                                    PluginCore.cq.n.a("Find debuff choice (" + str + "): Test 6 passed", e8.j);
                                    goto Label_036B;
                                }
                            }
                        }
                        b2.b = a3.g;
                        b2.a = a3.h;
                        a.d  = num;
                        PluginCore.cq.n.a("Find debuff choice (" + str + "): Item set to be used, quality " + b2.a.ToString() + ".", e8.j);
                    }
                }
            }
Label_036B:
            PluginCore.cq.n.a("Find debuff choice (" + str + "): Item tests done.", e8.j);
            continue;
Label_0392:
            PluginCore.cq.n.a("Find debuff choice (" + str + "): Stop, wrong object type", e8.j);
            continue;
Label_03B9:
            ai.a("Warning: DbT ignoring item " + PluginCore.cq.aw.get_WorldFilter().get_Item(num).get_Name() + " because it cannot currently be wielded.");
            continue;
Label_03EA:
            PluginCore.cq.n.a("Find debuff choice (" + str + "): Stop, object invalid", e8.j);
        }
        bw.b b3 = new bw.b(bw.b.a.c);
        foreach (KeyValuePair <string, fz> pair in PluginCore.cq.l.h)
        {
            if (((fz)pair.Value) == fz.h)
            {
                bz bz = PluginCore.cq.x.d(pair.Key);
                if (bz == null)
                {
                    ai.a("Warning: DbT ignoring item " + pair.Key + " because it is not in the grenade database.");
                }
                else if (!fn.b(bz.b, bz.c, bz.d, bz.a))
                {
                    ai.a("Warning: DbT ignoring item " + bz.a + " because it cannot currently be wielded.");
                }
                else if (bz.e.RealFamily == A_0.RealFamily)
                {
                    bw.b b4 = new bw.b(bw.b.a.c)
                    {
                        b = bz.e,
                        a = bz.f
                    };
                    if (b4.a(b3) > 0)
                    {
                        MyList <int> list2 = dh.d(pair.Key);
                        if (list2.Count > 0)
                        {
                            int num2 = 0x7fffffff;
                            int num3 = 0;
                            foreach (int num4 in list2)
                            {
                                int num5 = PluginCore.cq.aw.get_WorldFilter().get_Item(num4).Values(0xd000006);
                                if (num5 < num2)
                                {
                                    num3 = num4;
                                    num2 = num5;
                                }
                            }
                            if (num3 != 0)
                            {
                                a.b = null;
                                a.c = "";
                                a.a = num3;
                                b3  = b4;
                            }
                        }
                        else
                        {
                            MyPair <int, int> pair2 = PluginCore.cq.y.a(pair.Key, 1);
                            if (pair2 != null)
                            {
                                a.b = pair2;
                                a.c = pair.Key;
                                a.a = 0;
                                b3  = b4;
                            }
                        }
                    }
                }
            }
        }
        a.e = b;
        if (a.e.a(b2) < 0)
        {
            a.e = b2;
        }
        if (a.e.a(b3) < 0)
        {
            a.e = b3;
        }
        this.e[A_0.Id] = a;
        return(a.e.b);
    }