当前位置: 首页>>代码示例>>C#>>正文


C# IMap.SpawnItem方法代码示例

本文整理汇总了C#中IMap.SpawnItem方法的典型用法代码示例。如果您正苦于以下问题:C# IMap.SpawnItem方法的具体用法?C# IMap.SpawnItem怎么用?C# IMap.SpawnItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMap的用法示例。


在下文中一共展示了IMap.SpawnItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClearChamber

        public static void ClearChamber(IMap map, int startX, int startY, int endX, int endY, PacketHitList hitlist)
        {
            if (map.MapType != Enums.MapType.RDungeonMap) return;
            PacketHitList.MethodStart(ref hitlist);
            int[,] intArray = new int[map.MaxX + 1, map.MaxY + 1];
            for (int x = startX; x <= endX; x++) {
                for (int y = startY; y <= endY; y++) {
                    if (map.Tile[x,y].Type == Enums.TileType.ScriptedSign) {
                        if (map.Tile[x,y].Data1 == 9) {
                            if (map.Tile[x, y].String1.IsNumeric()) {
                                map.SpawnItem(map.Tile[x, y].String1.ToInt(), 1, false, false, map.Tile[x, y].String2, x, y, null);
                            }
                            intArray[x, y] = map.Tile[x, y].String3.ToInt();
                            RDungeonFloorGen.AmbiguateTile(map.Tile[x, y]);
                        } else if (map.Tile[x,y].Data1 == 10) {
                            intArray[x, y] = 3;
                            RDungeonFloorGen.AmbiguateTile(map.Tile[x, y]);
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateSoundPacket("magic161.wav"), x, y, 10);
                            hitlist.AddPacketToMap(map, PacketBuilder.CreateBattleMsg("The chamber was opened!", Text.WhiteSmoke), x, y, 10);
                        }
                    } else if (map.Tile[x, y].RDungeonMapValue >= 1280 && map.Tile[x, y].RDungeonMapValue < 1536) {
                        intArray[x, y] = 1025;
                        RDungeonFloorGen.AmbiguateTile(map.Tile[x, y]);
                        map.Tile[x, y].Type = Enums.TileType.Blocked;
                    }
                }
            }
            DungeonArrayFloor.TextureDungeon(intArray, startX+1, startY+1, endX-1, endY-1);
            for (int x = startX; x <= endX; x++) {
                for (int y = startY; y <= endY; y++) {
                    map.Tile[x, y].RDungeonMapValue = intArray[x, y];
                }
            }

            RDungeonFloorGen.TextureDungeonMap((RDungeonMap)map, startX, startY, endX, endY);

            for (int x = startX; x <= endX; x++) {
                for (int y = startY; y <= endY; y++) {
                    hitlist.AddPacketToMap(map, PacketBuilder.CreateTilePacket(x, y, map));
                }
            }

            PacketHitList.MethodEnded(ref hitlist);
        }
开发者ID:pzaps,项目名称:Server,代码行数:44,代码来源:MapInteractions.cs

示例2: SpawnItems

        public static void SpawnItems(Client client, IMap imap)
        {
            //new item code

            #region item arrays
            int[] heal = new int[] {
                2, //apple
                4, //oran berry
                991, //oren berry
                487, //pecha berry
                493, //chesto berry
                496, //persim berry
                492, //cheri berry
                494, //rawst berry
                497, //lum berry
                489, //reviver seed
                //reviser seed
                452, //revival herb
                557, //dark liquid
                203, //elixir
                86 //leppa berry
                };

            int[] held = new int[] {
                41, //power band
                87, //def. scarf
                153, //zinc band
                46, //special band
                483, //pecha scarf
                298, //heal ribbon
                323, //persim band
                421, //no-stick cap
                431, //no-slip cap
                151, //stamina band
                66, //x-ray specs
                348 //y-ray specs
                };

            int[] oneuse = new int[] {
                559, //pitch-black key
                432, //pathfinder orb
                449, //sleep seed
                460, //slip seed
                //doom seed
                //dough seed
                //vile seed
                //via seed
                345, //gravelerock
                //gravelyrock
                346, //geo pebble
                48, //stick
                60, //iron thorn
                642, //colbur berry
                648, //kasib berry
                653, //kebia berry
                11 //tasty honey
                };

            int[] tm = new int[] {
                19, //toxic
                558, //shadow claw
                124, //torment
                548, //dream eater
                126, //calm mind
                184, //safeguard
                335, //sludge bomb
                13, //rest
                12, //payback
                332, //psych up
                552, //trick room
                440, //psyshock
                //quash //unmade, move is unfinished
                //443 //vacuum-cut //make chest-only //removed
                };

            int[] orb = new int[] {
                316, //sunny orb
                317, //rainy orb
                315, //hail orb
                320, //cloudy orb
                319, //snowy orb
                321, //foggy orb
                293, //slumber orb
                294, //totter orb
                304, //petrify orb
                291, //trap-see orb
                500 //escape orb
                };

            int[] treasure = new int[] {
                1, //poke
                110, //egg
                542 //sinister box
                };
            #endregion

            int rand, num, randx, randy, itemnum, amount;
            string para;

            if (imap.MaxX == 19) {
//.........这里部分代码省略.........
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:101,代码来源:PitchBlackAbyss.cs

示例3: RandomItemSpawn

        public static void RandomItemSpawn(IMap map, int itemNum, int amount, bool sticky, bool hidden, string tag)
        {
            int x, y;

            FindFreeTile(map, 0, 0, map.MaxX, map.MaxY, out x, out y);

            if (x != -1) {
                map.SpawnItem(itemNum, amount, sticky, hidden, tag, x, y, null);
            }
        }
开发者ID:MandL27,项目名称:Server,代码行数:10,代码来源:Main.cs


注:本文中的IMap.SpawnItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。