本文整理汇总了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);
}
示例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) {
//.........这里部分代码省略.........
示例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);
}
}