Ejemplo n.º 1
0
    private void a(object A_0, ChangeObjectEventArgs A_1)
    {
        try
        {
            int num;
            if (PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_Changed().get_Id()) == null)
            {
                PluginCore.cq.n.a("RETURN NULL ITEM", e8.k);
                return;
            }
            if (A_1.get_Change() != 1)
            {
                return;
            }
            if (PluginCore.cq.q.m != PluginCore.cq.q.j)
            {
                PluginCore.cq.n.a("RETURN WRONG CORPSE (" + A_1.get_Changed().get_Name() + ")", e8.k);
                return;
            }
            if (dh.c(A_1.get_Changed().get_Id()) != PluginCore.cq.aw.get_CharacterFilter().get_Id())
            {
                goto Label_045B;
            }
            if (!this.d.ContainsKey(A_1.get_Changed().get_Id()) || !this.d[A_1.get_Changed().get_Id()].a)
            {
                goto Label_042B;
            }
            PluginCore.cq.n.a("Got item in lootlist (" + A_1.get_Changed().get_Name() + "," + this.d[A_1.get_Changed().get_Id()].f.a.ToString() + ")", e8.k);
            if (!PluginCore.cq.n.b)
            {
                goto Label_048B;
            }
            LootAction f = this.d[A_1.get_Changed().get_Id()].f;
            switch (f.a)
            {
            case eLootAction.Salvage:
                if ((A_1.get_Changed().Values(0xab, 0) == 0) && string.IsNullOrEmpty(A_1.get_Changed().Values(8, "")))
                {
                    if (A_1.get_Changed().Values(0x83, 0) != 0)
                    {
                        break;
                    }
                    ai.a("Warning: Lootplugin attempted to classify item " + A_1.get_Changed().get_Name() + " for salvaging, but that item does not have a salvage material. Ignoring it.");
                }
                goto Label_03E7;

            case eLootAction.Read:
                num = PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_Changed().get_Id()).Values(0xd000008, 0);
                if (num != 0)
                {
                    if (A_1.get_Changed().get_ObjectClass() == 0x2a)
                    {
                        goto Label_02EF;
                    }
                    ai.a("Warning: Lootplugin attempted to classify item " + A_1.get_Changed().get_Name() + " for reading, but that item does not appear to be a scroll. Ignoring it.");
                }
                goto Label_03E7;

            case eLootAction.ManaStone:
                if (this.f > 0)
                {
                    this.f--;
                }
                PluginCore.cq.ab.b(A_1.get_Changed().get_Id());
                goto Label_03E7;

            case eLootAction.ManaTank:
                if ((A_1.get_Changed().Values(0xab, 0) == 0) && string.IsNullOrEmpty(A_1.get_Changed().Values(8, "")))
                {
                    if (this.g > 0)
                    {
                        this.g--;
                    }
                    PluginCore.cq.ab.c(A_1.get_Changed().get_Id());
                }
                goto Label_03E7;

            default:
                PluginCore.cq.n.g.Add(A_1.get_Changed().get_Id(), f.a);
                goto Label_03E7;
            }
            PluginCore.cq.t.c(A_1.get_Changed().get_Id());
            PluginCore.cq.n.a("S: Object \"" + A_1.get_Changed().get_Name() + "\" added.", e8.c);
            goto Label_03E7;
Label_02EF:
            if (!PluginCore.cq.n.h.ContainsKey(num))
            {
                PluginCore.cq.n.h.Add(num, A_1.get_Changed().get_Id());
            }
Label_03E7:
            if (this.e.ContainsKey(A_1.get_Changed().get_Name()))
            {
                Dictionary <string, int> dictionary;
                string str;
                (dictionary = this.e)[str = A_1.get_Changed().get_Name()] = dictionary[str] - 1;
            }
            goto Label_048B;
Label_042B:
            PluginCore.cq.n.a("ITEM NOT IN LOOTLIST (" + A_1.get_Changed().get_Name() + ")", e8.k);
            goto Label_048B;
Label_045B:
            PluginCore.cq.n.a("STORAGECHANGE NONINVENTORY (" + A_1.get_Changed().get_Name() + ")", e8.k);
            return;

Label_048B:
            if (this.d.ContainsKey(A_1.get_Changed().get_Id()))
            {
                this.d.Remove(A_1.get_Changed().get_Id());
            }
            if (this.c.ContainsKey(A_1.get_Changed().get_Id()))
            {
                this.c.Remove(A_1.get_Changed().get_Id());
            }
        }
        catch (Exception exception)
        {
            ad.a(exception);
        }
    }
Ejemplo n.º 2
0
 private void a(object A_0, ChangeObjectEventArgs A_1)
 {
     try
     {
         if ((PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_Changed().get_Id()) != null) && ((A_1.get_Change() == 2) && this.e.ContainsKey(A_1.get_Changed().get_Id())))
         {
             string input = A_1.get_Changed().Values(0x10, "");
             Match  match = this.f.Match(input);
             if (match.Success && (match.Groups[0].Index == 0))
             {
                 this.e[A_1.get_Changed().get_Id()].f = match.Groups[1].Value;
                 if (this.g.Match(input).Success)
                 {
                     this.e[A_1.get_Changed().get_Id()].e = true;
                 }
                 this.e[A_1.get_Changed().get_Id()].i = true;
                 Match match2 = this.h.Match(this.e[A_1.get_Changed().get_Id()].f);
                 if (match2.Success)
                 {
                     string b = match2.Groups[1].Value;
                     if (string.Equals(PluginCore.cq.aw.get_CharacterFilter().get_Name(), b, StringComparison.OrdinalIgnoreCase))
                     {
                         this.e[A_1.get_Changed().get_Id()].f = PluginCore.cq.aw.get_CharacterFilter().get_Name();
                     }
                     else if (PluginCore.cq.ai.c())
                     {
                         foreach (KeyValuePair <int, ar.a> pair in PluginCore.cq.ai.a)
                         {
                             if (string.Equals(pair.Value.b, b, StringComparison.OrdinalIgnoreCase))
                             {
                                 this.e[A_1.get_Changed().get_Id()].f = pair.Value.b;
                                 return;
                             }
                         }
                     }
                 }
             }
             else
             {
                 this.e[A_1.get_Changed().get_Id()].f = "";
                 this.e[A_1.get_Changed().get_Id()].e = true;
                 this.e[A_1.get_Changed().get_Id()].i = true;
             }
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }