コード例 #1
0
ファイル: MapHandler.cs プロジェクト: noah-/DirtyDeeds
        protected void UnloadAct(uint pAct, UnitAny player)
        {
            var path  = game.Debugger.Read <Path>(player.pPath);
            var room1 = game.Debugger.Read <Room1>(path.pRoom1);
            var room2 = game.Debugger.Read <Room2>(room1.pRoom2);
            var lev   = game.Debugger.Read <Level>(room2.pLevel);

            InitLayer(lev.dwLevelNo);
            game.Debugger.Call(D2Common.UnloadAct,
                               MagicConvention.StdCall,
                               pAct);
        }
コード例 #2
0
ファイル: LowLevel.cs プロジェクト: noah-/DirtyDeeds
        public bool FindUnit(uint dwId, UnitType dwType, out UnitAny unit)
        {
            var result = FindUnit(dwId, dwType);

            if (result == 0)
            {
                unit = new UnitAny();
                return(false);
            }

            unit = pd.Read <UnitAny>(result);
            return(true);
        }
コード例 #3
0
ファイル: GameApi.cs プロジェクト: noah-/DirtyDeeds
        public bool GetPlayerUnit(out UnitAny unit)
        {
            var pUnit = GetPlayerUnit();

            if (pUnit == 0)
            {
                unit = new UnitAny();
                return(false);
            }

            unit = pd.Read <UnitAny>(pUnit);
            return(true);
        }
コード例 #4
0
ファイル: MapHandler.cs プロジェクト: noah-/DirtyDeeds
        protected uint LoadAct(UnitAny player)
        {
            var act         = game.Debugger.Read <Act>(player.pAct);
            var expCharFlag = game.Debugger.Read <uint>(D2Client.pExpCharFlag);
            var diff        = game.Debugger.Read <byte>(D2Client.pDifficulty);

            return(game.Debugger.Call <uint>(D2Common.LoadAct,
                                             MagicConvention.StdCall,
                                             player.dwAct,
                                             act.dwMapSeed,
                                             expCharFlag,
                                             0,
                                             diff,
                                             0,
                                             (uint)m_ActLevels[player.dwAct],
                                             game.Debugger.GetAddress(D2Client.LoadAct_1),
                                             game.Debugger.GetAddress(D2Client.LoadAct_2)));
        }
コード例 #5
0
ファイル: LowLevel.cs プロジェクト: noah-/DirtyDeeds
        public StorageType GetItemLocation(UnitAny item)
        {
            if (item.pItemData == 0)
            {
                return(StorageType.Null);
            }

            var itemData = pd.Read <ItemData>(item.pItemData);

            switch ((StorageType)itemData.ItemLocation)
            {
            case StorageType.Inventory:
                return(StorageType.Inventory);

            case StorageType.Trade:
                if ((Nodepage)itemData.NodePage == Nodepage.Storage)
                {
                    return(StorageType.Trade);
                }
                break;

            case StorageType.Cube:
                return(StorageType.Cube);

            case StorageType.Stash:
                return(StorageType.Stash);

            case StorageType.Null:
                switch ((Nodepage)itemData.NodePage)
                {
                case Nodepage.Equip:
                    return(StorageType.Equip);

                case Nodepage.BeltSlots:
                    return(StorageType.Belt);
                }
                break;
            }

            return(StorageType.Null);
        }