Ejemplo n.º 1
0
 private void immunitiesSpellLevel(IntPtr intPtr)
 {
     for (int i = 0; i < 10; ++i)
     {
         this.spellImmuneLevel[i] = WinAPIBindings.ReadInt32(intPtr + i * 0x4);
     }
 }
Ejemplo n.º 2
0
        public BGEntity(ResourceManager resourceManager, IntPtr entityIdPtr)
        {
            this.resourceManager = resourceManager;
            this.Loaded          = false;
            // 1020 bytes CGameAIBase
            this.Id      = WinAPIBindings.ReadInt32(entityIdPtr);
            entityIdPtr += 0x4;
            this.Type    = WinAPIBindings.ReadByte(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x004 }));
            if (Type != 49)
            {
                return;
            }
            this.X = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x008 }));
            this.Y = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x00C }));
            if (X < 0 || Y < 0)
            {
                return;
            }
            IntPtr cGameAreaPtr = WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x14 });

            this.RealId              = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x34 }));
            this.AreaName            = WinAPIBindings.ReadString(WinAPIBindings.FindDMAAddy(cGameAreaPtr, new int[] { 0x0 }), 8);
            this.AreaRef             = WinAPIBindings.ReadString(WinAPIBindings.FindDMAAddy(cGameAreaPtr, new int[] { 0x1E4 }), 8);
            this.MousePosX           = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(cGameAreaPtr, new int[] { 0x22C }));
            this.MousePosY           = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(cGameAreaPtr, new int[] { 0x22C + 4 }));
            this.MousePosX1          = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(cGameAreaPtr, new int[] { 0xA84 }));
            this.MousePosY1          = WinAPIBindings.ReadInt32(WinAPIBindings.FindDMAAddy(cGameAreaPtr, new int[] { 0xA84 + 4 }));
            this.Name2               = WinAPIBindings.ReadString(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x28A8, 0 }), 64);
            this.Name1               = WinAPIBindings.ReadString(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x364 }), 8);
            this.CreResourceFilename = WinAPIBindings.ReadString(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x3FC }), 8).Trim('*') + ".CRE";
            this.CurrentHP           = WinAPIBindings.ReadByte(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x438 }));
            //this.DerivedStats                = new CDerivedStats(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0xB30 }));
            //this.DerivedStatsTemp            = new CDerivedStats(entityIdPtr + 0x1454 );
            this.DerivedStatsTemp = new CDerivedStats(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x1454 }));

            //this.DerivedStatsBonus = new CDerivedStats(WinAPIBindings.FindDMAAddy(entityIdPtr, new int[] { 0x1D78 }));
            if (Type == 49)
            {
                this.Reader = resourceManager.GetCREReader(CreResourceFilename.ToUpper());
                if (Reader == null)
                {
                    this.Reader = resourceManager.GetCREReader(CreResourceFilename.ToUpper());
                }
            }
            this.Loaded = true;
        }
Ejemplo n.º 3
0
 public CPtrList(IntPtr addr)
 {
     this.Head  = new Node(addr + 0x04);
     this.Tail  = new Node(addr + 0x08);
     this.Count = WinAPIBindings.ReadInt32(addr + 0x0C);
 }