Example #1
0
 public void d()
 {
     if ((this.i != 0) && (this.j != this.i))
     {
         this.m = this.i;
         PluginCore.cq.ax.get_Actions().UseItem(this.i, 0);
         if (this.e.ContainsKey(this.i))
         {
             b5.a a = this.e[this.i];
             a.j++;
             if (a.j >= er.i("BlacklistCorpseOpenAttemptCount"))
             {
                 a.j = 0;
                 a.k = DateTimeOffset.Now;
                 cv     cv  = PluginCore.cq.p.d(this.i);
                 string str = "???";
                 if (cv != null)
                 {
                     str = cv.e();
                 }
                 PluginCore.e("Blacklisting unopenable corpse \"" + str + "\" for " + er.i("BlacklistCorpseOpenTimeoutSeconds").ToString() + " seconds.");
             }
         }
     }
 }
Example #2
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 #3
0
    public bool a(double A_0)
    {
        this.i = 0;
        double maxValue = double.MaxValue;
        bool   flag     = false;

        foreach (KeyValuePair <int, b5.a> pair in this.e)
        {
            b5.a a   = pair.Value;
            int  key = pair.Key;
            if (a.b || a.a)
            {
                continue;
            }
            TimeSpan span = (TimeSpan)(DateTimeOffset.Now - a.g);
            if (span.TotalSeconds < 10.0)
            {
                continue;
            }
            TimeSpan span2 = (TimeSpan)(DateTimeOffset.Now - a.k);
            if (span2.TotalSeconds < er.i("BlacklistCorpseOpenTimeoutSeconds"))
            {
                continue;
            }
            double num3 = dh.a(key, PluginCore.cq.aw.get_CharacterFilter().get_Id(), true);
            if (((num3 > A_0) || !a.i) || (!a.e && er.j("LootOnlyRareCorpses")))
            {
                continue;
            }
            if (a.f != PluginCore.cq.aw.get_CharacterFilter().get_Name())
            {
                if (a.e)
                {
                    continue;
                }
                bool flag2 = false;
                bool j     = false;
                foreach (KeyValuePair <int, ar.a> pair2 in PluginCore.cq.ai.a)
                {
                    if (a.f == pair2.Value.b)
                    {
                        flag2 = true;
                        j     = pair2.Value.j;
                        break;
                    }
                }
                if (flag2)
                {
                    if (er.j("LootFellowCorpses") && (j || ((DateTimeOffset.Now - a.c) >= TimeSpan.FromSeconds(100.0))))
                    {
                        goto Label_01F6;
                    }
                    continue;
                }
                if (((DateTimeOffset.Now - a.c) < TimeSpan.FromSeconds(100.0)) || !er.j("LootAllCorpses"))
                {
                    continue;
                }
            }
Label_01F6:
            if (a.e && !flag)
            {
                flag     = true;
                maxValue = num3;
                this.i   = key;
            }
            else if (a.e || !flag)
            {
                double num4 = num3;
                if (num4 < maxValue)
                {
                    maxValue = num4;
                    this.i   = key;
                }
            }
        }
        if (this.i == 0)
        {
            return(false);
        }
        return(true);
    }