Example #1
0
 private void a(object A_0, CreateObjectEventArgs A_1)
 {
     try
     {
         if (A_1.get_New().get_ObjectClass() == 0x1b)
         {
             CoordsObject obj2 = A_1.get_New().Coordinates();
             dz           dz   = dz.a(obj2.get_EastWest(), obj2.get_NorthSouth(), 0.0);
             if (this.e.ContainsKey(A_1.get_New().get_Id()) && (dz.a(this.e[A_1.get_New().get_Id()].l, false) > 0.004167))
             {
                 this.e.Remove(A_1.get_New().get_Id());
             }
             if (!this.e.ContainsKey(A_1.get_New().get_Id()))
             {
                 b5.a a = new b5.a {
                     l = dz,
                     h = A_1.get_New().get_Name() == ("Corpse of " + CoreManager.get_Current().get_CharacterFilter().get_Name())
                 };
                 this.e.Add(A_1.get_New().get_Id(), a);
                 PluginCore.cq.u.a(A_1.get_New().get_Id(), b0.a.c);
             }
             else
             {
                 this.e[A_1.get_New().get_Id()].d = DateTimeOffset.Now;
                 this.e[A_1.get_New().get_Id()].a = false;
             }
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }
Example #2
0
    public bool d()
    {
        ReadOnlyCollection <cv> onlys = PluginCore.cq.p.a(ObjectClass.Monster);
        dz dz = PluginCore.cq.p.d(PluginCore.cq.p.f()).b(PluginCore.cq.ax.get_Actions());

        if (this.a.ToString() != k.b(base.a["n"]))
        {
            try
            {
                this.a = new Regex(k.b(base.a["n"]), RegexOptions.Compiled);
            }
            catch
            {
                this.a = new Regex("");
                ai.a("Warning: invalid regex \"" + k.b(base.a["n"]) + "\" in Meta condition.");
            }
        }
        double num  = k.f(base.a["r"]) / 240.0;
        int    num2 = k.e(base.a["c"]);
        int    num3 = 0;

        foreach (cv cv in onlys)
        {
            if (this.a.IsMatch(cv.e()) && (dz.a(cv.b(PluginCore.cq.ax.get_Actions()), true) <= num))
            {
                num3++;
                if (num3 >= num2)
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Example #3
0
 public c2(sCoord A_0) : base(PluginCore.cq)
 {
     this.a = "";
     this.b = new dz();
     this.d = new dz();
     this.g = A_0;
 }
Example #4
0
 public c2(sCoord A_0, string A_1, dz A_2, ObjectClass A_3) : base(PluginCore.cq)
 {
     this.a = "";
     this.b = new dz();
     this.d = new dz();
     this.g = A_0;
     this.a = A_1;
     this.b = A_2;
     this.c = A_3;
 }
Example #5
0
    public bool c()
    {
        ReadOnlyCollection <cv> onlys = PluginCore.cq.p.a(ObjectClass.Monster);
        dz     dz  = PluginCore.cq.p.d(PluginCore.cq.p.f()).b(PluginCore.cq.ax.get_Actions());
        double num = k.f(base.a["r"]) / 240.0;

        foreach (cv cv in onlys)
        {
            if (dz.a(cv.b(PluginCore.cq.ax.get_Actions()), true) <= num)
            {
                return(false);
            }
        }
        return(true);
    }
Example #6
0
    public double a(dz A_0)
    {
        if (!this.b())
        {
            return(0.0);
        }
        if (!A_0.b())
        {
            return(0.0);
        }
        double x    = A_0.f() - this.f();
        double y    = A_0.g() - this.g();
        double num3 = -Math.Atan2(y, x);

        return(num3 + 1.5707963267948966);
    }
Example #7
0
    protected override bool e()
    {
        switch (this.f)
        {
        case c2.a.a:
            if (this.e == PluginCore.ch)
            {
                if (!PluginCore.cq.n.n.b(ActionLockType.ItemUse))
                {
                    int num = this.g();
                    if (num == 0)
                    {
                        PluginCore.e("Warning: cannot find portal object " + this.a + "! Continuing route at next point.");
                        return(false);
                    }
                    this.d = PluginCore.cq.p.d(PluginCore.cq.p.f()).b(PluginCore.cq.ax.get_Actions());
                    PluginCore.cq.n.n.a(ActionLockType.ItemUse, TimeSpan.FromSeconds(3.0));
                    PluginCore.cq.ax.get_Actions().UseItem(num, 0);
                }
                return(true);
            }
            this.f = c2.a.b;
            return(true);

        case c2.a.b:
            if (PluginCore.ch < (this.e + 2L))
            {
                return(true);
            }
            if (PluginCore.cq.p.d(PluginCore.cq.p.f()).b(PluginCore.cq.ax.get_Actions()).a(this.d, true) <= 0.0625)
            {
                PluginCore.e("Warning: use portal route came out of portal space too close to the origin point. Trying again...");
                this.f = c2.a.a;
                this.e = PluginCore.ch;
                return(true);
            }
            return(false);
        }
        return(false);
    }
Example #8
0
    public bool d()
    {
        ReadOnlyCollection <cv> onlys = PluginCore.cq.p.a(ObjectClass.Monster);
        dz     dz   = PluginCore.cq.p.d(PluginCore.cq.p.f()).b(PluginCore.cq.ax.get_Actions());
        double num  = k.f(base.a["r"]) / 240.0;
        int    num2 = k.e(base.a["c"]);
        int    num3 = k.e(base.a["p"]);
        int    num4 = 0;

        foreach (cv cv in onlys)
        {
            if ((PluginCore.cq.d.a(cv).a == num3) && (dz.a(cv.b(PluginCore.cq.ax.get_Actions()), true) <= num))
            {
                num4++;
                if (num4 >= num2)
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Example #9
0
    public double a(dz A_0, bool A_1)
    {
        if (!this.b())
        {
            return(double.MaxValue);
        }
        if (!A_0.b())
        {
            return(double.MaxValue);
        }
        if (A_1)
        {
            double num  = this.f() - A_0.f();
            double num2 = this.g() - A_0.g();
            double num3 = this.h() - A_0.h();
            return(Math.Sqrt(((num * num) + (num2 * num2)) + (num3 * num3)));
        }
        double num4 = this.f() - A_0.f();
        double num5 = this.g() - A_0.g();

        return(Math.Sqrt((num4 * num4) + (num5 * num5)));
    }
Example #10
0
    public static bool a(string A_0, out dz A_1)
    {
        A_1   = new dz();
        A_1.a = false;
        Match match = i.Match(A_0);

        if (!match.Success)
        {
            return(false);
        }
        double num  = double.Parse(match.Groups["ewnum"].Value);
        double num2 = double.Parse(match.Groups["nsnum"].Value);

        if (match.Groups["ewchr"].Value.ToLowerInvariant() == "w")
        {
            num *= -1.0;
        }
        if (match.Groups["nschr"].Value.ToLowerInvariant() == "s")
        {
            num2 *= -1.0;
        }
        A_1 = a(num, num2);
        return(true);
    }
Example #11
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);
                }
            }
        }
    }