コード例 #1
0
ファイル: LotroInterface.cs プロジェクト: lieblingek/CSharp
        private void a(int A_0, int A_1)
        {
            if (A_0 == 0 || A_1 == 0)
            {
                return;
            }
            LotroMe me = this.EntityManager.Me as LotroMe;

            if (me == null || me.BasePtr != A_1)
            {
                return;
            }
            LotroEntity lotroEntity1             = (LotroEntity)null;
            ReadOnlyCollection <Entity> entities = this.EntityManager.Entities;
            int count = entities.Count;

            for (int index = 0; index < count; ++index)
            {
                LotroEntity lotroEntity2 = entities[index] as LotroEntity;
                if (lotroEntity2 != null && lotroEntity2.BasePtr == A_0)
                {
                    lotroEntity1 = lotroEntity2;
                    break;
                }
            }
            if (lotroEntity1 == null || lotroEntity1.Type == LotroEntity.LotroEntityType.PLAYER || (double)lotroEntity1.DistanceTo((Entity)me) > 40.0)
            {
                return;
            }
            Console.WriteLine(lotroEntity1.FullName + " is attacking us (" + (object)me.MyId + ")");
            this.EntityManager.AddAttacker((Entity)lotroEntity1);
        }
コード例 #2
0
 private void b()
 {
     lock (this.m_attackerLock)
     {
         if (this.m_attackersList.Count == 0)
         {
             return;
         }
         LotroMe local_0 = this.m_me as LotroMe;
         if (local_0 == null)
         {
             return;
         }
         if (!local_0.CombatActive)
         {
             this.m_attackersList.Clear();
         }
         else
         {
             for (int local_1 = this.m_attackersList.Count - 1; local_1 >= 0; --local_1)
             {
                 LotroEntity local_2 = this.m_attackersList[local_1] as LotroEntity;
                 if (local_2 != null && (!local_2.CombatActive || local_2.IsInvalid || (local_2.Dead || (double)local_2.DistanceTo((Entity)local_0) > 60.0)))
                 {
                     this.m_attackersList.RemoveAt(local_1);
                 }
             }
         }
     }
 }
コード例 #3
0
        public void ReloadFellowship()
        {
            FileLog instance = Singleton <FileLog> .Instance;
            int     num1     = this.m_reader.ReadDWORD(this.b);

            if (this.m_reader.ReadDWORD(num1 + 240) <= 0)
            {
                return;
            }
            int address1 = this.m_reader.ReadDWORD(this.m_reader.ReadDWORD(this.m_reader.ReadDWORD(this.c) + 120) + 24);

            if (this.m_reader.ReadDWORD(address1) == 6)
            {
                int num2 = this.m_reader.ReadDWORD(address1 + 8);
                int num3 = this.m_reader.ReadDWORD(address1 + 16);
                for (int index = 0; index < num3; ++index)
                {
                    int address2 = this.m_reader.ReadDWORD(num2 + index * 8);
                    if (this.m_reader.ReadDWORD(address2) == this.d)
                    {
                        long num4 = (long)this.m_reader.ReadLong(address2 + 96);
                        break;
                    }
                }
            }
            Hashtable hashtable = new pwnagebot.LotroInterface.a(this.m_reader, num1 + 228, 2).b();
            ReadOnlyCollection <Entity> entities = this.Entities;

            this.m_groupList = new List <Entity>(hashtable.Count);
            LotroMe me = (LotroMe)this.Me;

            foreach (DictionaryEntry dictionaryEntry in hashtable)
            {
                LotroFellowshipEntity fellowshipEntity = new LotroFellowshipEntity(this.m_reader, this.m_reader.ReadDWORD((int)dictionaryEntry.Value + 16));
                fellowshipEntity.Update();
                if ((long)fellowshipEntity.Guid != (long)me.Guid)
                {
                    foreach (Entity entity in entities)
                    {
                        LotroEntity lotroEntity = entity as LotroEntity;
                        if (lotroEntity != null && (long)lotroEntity.Guid == (long)fellowshipEntity.Guid)
                        {
                            fellowshipEntity.EntityRef = lotroEntity;
                            break;
                        }
                    }
                    this.m_groupList.Add((Entity)fellowshipEntity);
                }
            }
        }
コード例 #4
0
        private void a()
        {
            Hashtable hashtable = new pwnagebot.LotroInterface.a(this.m_reader, this.m_reader.ReadDWORD(this.f) + 20, 2).b();
            LotroMe   me        = (LotroMe)this.m_me;

            foreach (DictionaryEntry dictionaryEntry in hashtable)
            {
                if ((long)(ulong)dictionaryEntry.Key == (long)me.Guid)
                {
                    IDictionaryEnumerator enumerator = new pwnagebot.LotroInterface.a(this.m_reader, this.m_reader.ReadDWORD((int)dictionaryEntry.Value + 16) + 32, 1).b().GetEnumerator();
                    try
                    {
                        while (enumerator.MoveNext())
                        {
                            DictionaryEntry current = (DictionaryEntry)enumerator.Current;
                            this.m_reader.ReadDWORD((int)current.Value);
                            if ((int)current.Key == 1)
                            {
                                me.MoralePtr = (int)current.Value;
                            }
                            else if ((int)current.Key == 2)
                            {
                                me.PowerPtr = (int)current.Value;
                            }
                        }
                        break;
                    }
                    finally
                    {
                        IDisposable disposable = enumerator as IDisposable;
                        if (disposable != null)
                        {
                            disposable.Dispose();
                        }
                    }
                }
            }
        }
コード例 #5
0
        public void Reload()
        {
            ulong num1 = this.m_reader.ReadLong(this.e);
            ulong num2 = 0;

            if (this.m_injected)
            {
                num2 = pwnagebot.LotroInterface.b.d();
            }
            Hashtable     hashtable = new pwnagebot.LotroInterface.a(this.m_reader, this.m_reader.ReadDWORD(this.a) + 12, 2).b();
            List <Entity> entities_ = new List <Entity>(hashtable.Count);

            foreach (DictionaryEntry dictionaryEntry in hashtable)
            {
                LotroEntity lotroEntity = new LotroEntity(this.m_reader, this.m_reader.ReadDWORD((int)dictionaryEntry.Value + 16));
                if (this.m_me == null || lotroEntity.MyId != this.m_me.MyId)
                {
                    entities_.Add((Entity)lotroEntity);
                }
            }
            Dictionary <int, Entity> entites = this.ParseEntites(entities_);

            Dictionary <int, Entity> .ValueCollection values = entites.Values;
            if (this.m_me != null)
            {
                this.m_me.Update();
                this.b();
                int num3 = 0;
                int num4 = 999;
                int num5 = 0;
                foreach (LotroEntity lotroEntity in values)
                {
                    if (lotroEntity.Durability != -1 && lotroEntity.ValidName && lotroEntity.Type == LotroEntity.LotroEntityType.NODE)
                    {
                        num3 += lotroEntity.Durability;
                        if (lotroEntity.Durability < num4)
                        {
                            num4 = lotroEntity.Durability;
                        }
                        ++num5;
                    }
                }
                int num6;
                if (num5 == 0)
                {
                    num6 = 999;
                    num4 = 999;
                }
                else
                {
                    num6 = num3 / num5;
                }
                LotroMe me = (LotroMe)this.m_me;
                me.AvgDurability = num6;
                me.MinDurability = num4;
            }
            else
            {
                foreach (LotroEntity lotroEntity in values)
                {
                    if ((long)lotroEntity.Guid == (long)num1)
                    {
                        entites.Remove(lotroEntity.MyId);
                        this.m_me = (Entity) new LotroMe(this.m_reader, lotroEntity.MyId);
                        this.m_me.Update();
                        this.a();
                        break;
                    }
                }
            }
            Entity entity = (Entity)null;

            if ((long)num2 != 0L)
            {
                foreach (LotroEntity lotroEntity in values)
                {
                    if ((long)lotroEntity.Guid == (long)num2)
                    {
                        entity = (Entity)lotroEntity;
                        break;
                    }
                }
            }
            this.m_target     = entity;
            this.m_entityDict = entites;
        }