Exemple #1
0
 private void e(cv A_0)
 {
     A_0.m = true;
     if (this.i.ContainsKey(A_0.k))
     {
         A_0.n = 1 + this.i[A_0.k].n;
         if (this.d != null)
         {
             this.d(this.i[A_0.k]);
         }
         this.d(this.i[A_0.k]);
     }
     this.i[A_0.k] = A_0;
     if (!this.j.ContainsKey(A_0.g()))
     {
         this.j[A_0.g()] = new List <cv>();
     }
     this.j[A_0.g()].Add(A_0);
     if (!this.k.ContainsKey(A_0.c()))
     {
         this.k[A_0.c()] = new List <cv>();
     }
     this.k[A_0.c()].Add(A_0);
     this.a(A_0);
 }
Exemple #2
0
    protected override bool e()
    {
        if (PluginCore.cq.ax.get_Actions().get_VendorId() == this.a)
        {
            return(true);
        }
        cv cv = PluginCore.cq.p.d(this.a);

        if (cv == null)
        {
            ai.a("OpenVendor waypoint action ignored, vendor " + this.a.ToString() + " (" + this.b + ") not found.");
            return(true);
        }
        if (cv.c() != ObjectClass.Vendor)
        {
            ai.a("OpenVendor waypoint action ignored, vendor " + this.a.ToString() + " (" + this.b + ") is not a vendor.");
            return(true);
        }
        TimeSpan span = (TimeSpan)(DateTimeOffset.Now - this.c);

        if (span.TotalSeconds > 2.0)
        {
            this.c = DateTimeOffset.Now;
            PluginCore.cq.ax.get_Actions().UseItem(this.a, 0);
        }
        return(false);
    }
Exemple #3
0
    private void d(cv A_0)
    {
        A_0.m = false;
        if (this.i.ContainsKey(A_0.k))
        {
            this.i.Remove(A_0.k);
        }
        if (this.j.ContainsKey(A_0.g()) && this.j[A_0.g()].Contains(A_0))
        {
            this.j[A_0.g()].Remove(A_0);
            if (this.j[A_0.g()].Count == 0)
            {
                this.j.Remove(A_0.g());
            }
        }
        ObjectClass key = A_0.c();

        if (this.k.ContainsKey(key) && this.k[key].Contains(A_0))
        {
            this.k[key].Remove(A_0);
            if (this.k[key].Count == 0)
            {
                this.k.Remove(key);
            }
        }
        if (this.m.Contains(A_0))
        {
            this.m.Remove(A_0);
        }
        this.b(A_0);
    }
Exemple #4
0
 private void a()
 {
     if ((er.j("DeleteGhostMonstersByHPTracker") && PluginCore.cq.n.b) && (PluginCore.cq.an.h() != 0))
     {
         cv cv = PluginCore.cq.p.d(PluginCore.cq.an.h());
         if (cv != null)
         {
             string str = cv.g();
             if (PluginCore.cq.x.e(str) > 0)
             {
                 TimeSpan span = (TimeSpan)(DateTimeOffset.Now - PluginCore.cq.an.g());
                 if (span.TotalSeconds >= er.i("GhostDeleteHPTrackerSeconds"))
                 {
                     TimeSpan span2 = (TimeSpan)(DateTimeOffset.Now - PluginCore.cq.an.e());
                     if (span2.TotalSeconds >= er.i("GhostDeleteHPTrackerSeconds"))
                     {
                         int num = PluginCore.cq.an.h();
                         cv  cv2 = PluginCore.cq.p.d(num);
                         if ((cv2 != null) && (cv2.c() == ObjectClass.Monster))
                         {
                             PluginCore.e("Deleting ghost monster " + cv2.g() + " (" + num.ToString() + ") due to HP tracker notification.");
                             dh.d(num);
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #5
0
 public void a(int A_0, e5 A_1, bool A_2)
 {
     if (!this.f() && (!A_2 || (dh.d() == 1)))
     {
         this.h = DateTimeOffset.Now + TimeSpan.FromMilliseconds(800.0);
         this.j = A_0;
         this.i = true;
         cv cv = PluginCore.cq.p.d(A_0);
         if ((cv != null) && (cv.c() == ObjectClass.MeleeWeapon))
         {
             if (A_1 == e5.b)
             {
                 dh.a(A_0, true, 0);
             }
             else
             {
                 dh.a(A_0, true, 1);
             }
         }
         else
         {
             PluginCore.cq.ax.get_Actions().UseItem(A_0, 0);
         }
     }
 }
 internal GameItemInfo(cv A_0)
 {
     if (A_0 != null)
     {
         this.b = A_0.k;
         this.a = A_0;
         this.d = (uTank2.LootPlugins.ObjectClass)A_0.c();
         this.c = true;
     }
 }
Exemple #7
0
 public int c(cv A_0)
 {
     if (A_0 == null)
     {
         throw new ArgumentException("wo");
     }
     if (!this.b(A_0))
     {
         return(0);
     }
     if (A_0.c() == ObjectClass.TradeNote)
     {
         return(A_0.a[0x13]);
     }
     return((int)Math.Floor((double)(((float)A_0.a[0x13]) * this.h)));
 }
Exemple #8
0
 private void a(cv A_0)
 {
     if (((A_0.k != 0) && (A_0.k != PluginCore.cg)) && (A_0.c() == ObjectClass.Monster))
     {
         foreach (cv cv in this.a.e(A_0.k))
         {
             if (!this.b.Contains(cv.k))
             {
                 this.b.Add(cv.k);
                 this.d.Add(cv.g());
                 if (!this.c.g())
                 {
                     this.c.a(true);
                 }
             }
         }
     }
 }
Exemple #9
0
 public bool b(cv A_0)
 {
     if (A_0 == null)
     {
         throw new ArgumentException("wo");
     }
     if (A_0.c() != ObjectClass.TradeNote)
     {
         int num  = A_0.a(dt.g, 0) / A_0.a(dt.ct, 1);
         int num2 = A_0.a(dt.dd, 0);
         if (num > this.f)
         {
             return(false);
         }
         if ((num2 & this.d) == 0)
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #10
0
 public static void a(MySpell A_0, out MySpell A_1, out int A_2)
 {
     A_1 = null;
     A_2 = 0;
     if (A_0 != null)
     {
         foreach (int num in PluginCore.PC.c1)
         {
             cv cv = PluginCore.cq.p.d(num);
             if ((((cv != null) && (cv.c() == ObjectClass.WandStaffOrb)) && ((PluginCore.cq.p.f(num) == PluginCore.cg) && dh.b(num))) && PluginCore.cq.z.a(num))
             {
                 int     i = cv.i;
                 MySpell p = PluginCore.cq.e.b(i);
                 if (((p != null) && A_0.SameCompClass(p)) && ((A_1 == null) || (A_1.Quality < p.Quality)))
                 {
                     A_1 = p;
                     A_2 = num;
                 }
             }
         }
     }
 }
Exemple #11
0
 public void b(int A_0)
 {
     if (this.b.ContainsKey(A_0))
     {
         Dictionary <int, int> dictionary;
         int num;
         (dictionary = this.b)[num = A_0] = dictionary[num] + 1;
     }
     else
     {
         this.b[A_0] = 1;
     }
     if (this.b[A_0] > er.i("GhostMonsterSpellAttemptCount"))
     {
         cv cv = PluginCore.cq.p.d(A_0);
         if (((cv != null) && (cv.c() == ObjectClass.Monster)) && er.j("DeleteGhostMonsters"))
         {
             PluginCore.e("Deleting ghost monster " + cv.g() + " (" + A_0.ToString() + ")");
             dh.d(A_0);
         }
         this.b.Remove(A_0);
     }
 }
Exemple #12
0
    private void a(MySpell A_0, int A_1, int A_2)
    {
        if (!this.e.ContainsKey(A_0.Id))
        {
            throw new Exception("DebuffTarget: Uncached state detected.");
        }
        bw.a a = this.e[A_0.Id];
        if (a.e.b == null)
        {
            a5.a(eChatType.Errors, "Error: no way to apply a required debuff similar to \"" + A_0.Name + "\"");
            PluginCore.cq.c.StopMacro();
        }
        else
        {
            switch (a.e.c)
            {
            case bw.b.a.a:
            {
                PluginCore.cq.v.d();
                if (!er.j("SwitchWandsToDebuff"))
                {
                    if (!PluginCore.cq.n.a(8, 0, true))
                    {
                        return;
                    }
                    break;
                }
                cv cv = PluginCore.cq.p.d(A_2);
                if ((cv != null) && (PluginCore.cq.n.a(cv.c()) == 8))
                {
                    if (PluginCore.cq.n.a(8, A_2, false))
                    {
                        break;
                    }
                    return;
                }
                if (PluginCore.cq.n.a(8, 0, true))
                {
                    break;
                }
                return;
            }

            case bw.b.a.b:
            {
                ObjectClass class2 = PluginCore.cq.aw.get_WorldFilter().get_Item(a.d).get_ObjectClass();
                CombatState state  = PluginCore.cq.n.a(class2);
                if (state != 8)
                {
                    if (!PluginCore.cq.n.a(state, a.d, false))
                    {
                        PluginCore.cq.v.d();
                        return;
                    }
                    float num = 0f;
                    if (state == 2)
                    {
                        num = 0f;
                    }
                    if (state == 4)
                    {
                        num = 1f;
                    }
                    PluginCore.cq.v.a(A_1, num, a.e.b);
                    return;
                }
                if (PluginCore.cq.n.a(state, a.d, false))
                {
                    PluginCore.cq.z.a(a.d, A_1);
                    return;
                }
                return;
            }

            case bw.b.a.c:
                if (a.b == null)
                {
                    if (a.a != 0)
                    {
                        if (!PluginCore.cq.n.a(4, a.a, false))
                        {
                            return;
                        }
                        PluginCore.cq.v.a(A_1, 1f, a.e.b);
                    }
                    return;
                }
                if (dh.d() == 1)
                {
                    PluginCore.cq.y.a(a.b.a, a.b.b, a.c);
                    return;
                }
                dh.a(1);
                return;

            default:
                return;
            }
            this.a(a.e.b, A_1);
        }
    }
Exemple #13
0
    private void a(int A_0, bool A_1)
    {
        WorldObject obj2 = PluginCore.cq.aw.get_WorldFilter().get_Item(A_0);
        cv          cv   = PluginCore.cq.p.d(A_0);

        if ((A_1 && dh.b(A_0)) && (obj2.get_HasIdData() && (cv != null)))
        {
            ObjectClass class2 = cv.c();
            if (class2 != ObjectClass.Monster)
            {
                if (class2 != ObjectClass.HealingKit)
                {
                    return;
                }
            }
            else
            {
                if (!this.b(obj2.get_Name()))
                {
                    int num  = obj2.Values(2, -1);
                    int num2 = cv.a(dt.dz, -1);
                    v   v    = new v(this.c["SpeciesMembers"]);
                    v[0] = k.a(obj2.get_Name());
                    v[1] = k.a(num);
                    v[2] = k.a(num2);
                    this.c["SpeciesMembers"].c(v);
                    try
                    {
                        this.c.c(Path.Combine(PluginCore.ci, "gameinfodb.ugd"));
                    }
                    catch
                    {
                    }
                    if (this.c["SpeciesDamages"].a(0, k.a(num)) == null)
                    {
                        a5.a(eChatType.Warnings, "Warning: added monster \"" + obj2.get_Name() + "\" to DB but species \"" + ((FileService)PluginCore.cq.aw.get_FileService()).get_SpeciesTable().GetById(num).get_Name() + "\" has no auto damage definition.");
                    }
                    PluginCore.cq.d.c();
                    if (this.a == null)
                    {
                        return;
                    }
                    this.a();
                }
                return;
            }
            if (this.a(obj2.get_Name()) == null)
            {
                dp dp = new dp {
                    a = obj2.get_Name(),
                    b = obj2.Values(100, 1.0),
                    c = obj2.Values(90, 0)
                };
                switch (obj2.Values(0x59, 0))
                {
                case 2:
                    dp.d = eRechargeVital_Single.Health;
                    break;

                case 4:
                    dp.d = eRechargeVital_Single.Stamina;
                    break;

                case 6:
                    dp.d = eRechargeVital_Single.Mana;
                    break;

                default:
                    dp.d = eRechargeVital_Single.Health;
                    break;
                }
                this.a(dp);
                if (this.a != null)
                {
                    this.a();
                }
            }
        }
    }