public virtual void CreateBones_Callback(Mobile from) { Map map = from.Map; if (map == null) { return; } int count = Utility.RandomMinMax(1, 3); for (int i = 0; i < count; ++i) { int x = from.X + Utility.RandomMinMax(-1, 1); int y = from.Y + Utility.RandomMinMax(-1, 1); int z = from.Z; if (!map.CanFit(x, y, z, 16, false, true)) { z = map.GetAverageZ(x, y); if (z == from.Z || !map.CanFit(x, y, z, 16, false, true)) { continue; } } var bone = new UnholyBone { Hue = 0, Name = "unholy bones", ItemID = Utility.Random(0xECA, 9) }; bone.MoveToWorld(new Point3D(x, y, z), map); } }
public virtual void CreateBones_Callback(object state) { Mobile from = (Mobile)state; Map map = from.Map; if (map == null) return; int count = Utility.RandomMinMax(1, 3); for (int i = 0; i < count; ++i) { int x = from.X + Utility.RandomMinMax(-1, 1); int y = from.Y + Utility.RandomMinMax(-1, 1); int z = from.Z; if (!map.CanFit(x, y, z, 16, false, true)) { z = map.GetAverageZ(x, y); if (z == from.Z || !map.CanFit(x, y, z, 16, false, true)) continue; } UnholyBone bone = new UnholyBone(); bone.Hue = 0; bone.Name = "unholy bones"; bone.ItemID = Utility.Random(0xECA, 9); bone.MoveToWorld(new Point3D(x, y, z), map); } }
private void ThrowOutItem(Mobile from, int count, int itemtype, int distance, int amount) { Map map = from.Map; for (int i = 0; i < count; ++i) { int x = from.X + Utility.RandomMinMax(-distance, distance); int y = from.Y + Utility.RandomMinMax(-distance, distance); int z = from.Z; if (!map.CanFit(x, y, z, 16, false, true)) { z = map.GetAverageZ(x, y); if (z == from.Z || !map.CanFit(x, y, z, 16, false, true)) continue; } Object o = null; try { if (itemtype == 0) { if (Map == Map.Felucca) o = new UnholyBone(); else o = Loot.Construct(typeof(Bone)); } else if (itemtype == 1) o = new GruesomeBlood(); else if (itemtype == 2) o = new Gold(); } catch { } if (o != null) { ((Item)o).Hue = 0; ((Item)o).Amount = amount; if (itemtype == 0) { if (Map == Map.Felucca) ((Item)o).Name = "unholy bones"; else ((Item)o).Name = "bones"; ((Item)o).ItemID = Utility.Random(0xECA, 9); } ((Item)o).MoveToWorld(new Point3D(x, y, z), map); if (itemtype == 2) GoldEffect((Item)o); } } }