private TreasureMap Construct(TreasureMapEntry entry) { if (entry == null) { return(null); } TreasureMap map = new TreasureMap(); map.ChestLocation = new Point2D(entry.Location.X, entry.Location.Y); map.Level = entry.Level; map.Facet = entry.Map; map.Completed = entry.Completed; map.CompletedBy = entry.CompletedBy; map.Decoder = entry.Decoder; map.NextReset = entry.NextReset; map.Width = 300; map.Height = 300; int x = entry.Location.X; int y = entry.Location.Y; int width, height; Map facet = entry.Map; map.GetWidthAndHeight(facet, out width, out height); int x1 = x - Utility.RandomMinMax(width / 4, (width / 4) * 3); int y1 = y - Utility.RandomMinMax(height / 4, (height / 4) * 3); if (x1 < 0) { x1 = 0; } if (y1 < 0) { y1 = 0; } int x2, y2; map.AdjustMap(facet, out x2, out y2, x1, y1, width, height); x1 = x2 - width; y1 = y2 - height; map.Bounds = new Rectangle2D(x1, y1, width, height); map.Protected = true; map.AddWorldPin(x, y); return(map); }
public void TryAddEntry(Item item, Mobile from) { if (!CanUse(from) || item == null) { return; } if (!CheckRange(from)) { from.SendLocalizedMessage(3000268); // that is too far away. } else if (!(item is TreasureMap || item is SOS || item is MessageInABottle)) { from.SendLocalizedMessage(1153564); // That is not a treasure map or message in a bottle. } else if (!item.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1054107); // This item must be in your backpack. } else if (Entries.Count >= 500) { from.SendLocalizedMessage(1153565); // The locker is full } else { DaviesLockerEntry entry = null; if (item is TreasureMap) { entry = new TreasureMapEntry((TreasureMap)item); } else if (item is SOS) { entry = new SOSEntry((SOS)item); } else if (item is MessageInABottle) { entry = new SOSEntry((MessageInABottle)item); } if (entry != null) { Entries.Add(entry); from.CloseGump(typeof(DaviesLockerGump)); from.SendGump(new DaviesLockerGump(from, this)); item.Delete(); UpdateProperties(); } } }
private int GetPackage(TreasureMapEntry entry) { switch (entry.Package) { default: case TreasurePackage.Artisan: return(1159000); case TreasurePackage.Assassin: return(1158998); case TreasurePackage.Mage: return(1158997); case TreasurePackage.Ranger: return(1159002); case TreasurePackage.Warrior: return(1158999); } }
private string GetPackage(TreasureMapEntry entry) { switch (entry.Package) { default: case TreasurePackage.Artisan: return("1159000"); case TreasurePackage.Assassin: return("1158998"); case TreasurePackage.Mage: return("1158997"); case TreasurePackage.Ranger: return("1159002"); case TreasurePackage.Warrior: return("1158999"); } }
private int GetStatus(DaviesLockerEntry entry) { if (entry is SOSEntry) { SOSEntry sosEntry = (SOSEntry)entry; if (!sosEntry.Opened) { return(1153570); // Unopened } if (sosEntry.IsAncient) { return(1153572); // Ancient } return(1153571); // Opened } else if (entry is TreasureMapEntry) { TreasureMapEntry mapEntry = (TreasureMapEntry)entry; if (mapEntry.Completed) { return(1153582); // Completed } else if (mapEntry.Decoder != null) { return(1153581); // Decoded } else { return(1153580); // Not Decoded } } return(1153569); // Unknown }
private TreasureMap Construct(TreasureMapEntry entry) { if (entry == null) { return(null); } TreasureMap map; if (entry.QuestItem) { map = new HiddenTreasuresTreasureMap(entry.Level, entry.Map, new Point2D(entry.Location.X, entry.Location.Y)); } else { map = new TreasureMap { Facet = entry.Map, Level = entry.Level, Package = entry.Package, ChestLocation = new Point2D(entry.Location.X, entry.Location.Y) }; } bool eodon = map.TreasureFacet == TreasureFacet.Eodon; map.Completed = entry.Completed; map.CompletedBy = entry.CompletedBy; map.Decoder = entry.Decoder; map.NextReset = entry.NextReset; map.Width = 300; map.Height = 300; int x = entry.Location.X; int y = entry.Location.Y; Map facet = entry.Map; map.GetWidthAndHeight(facet, out int width, out int height); int x1 = x - Utility.RandomMinMax(width / 4, (width / 4) * 3); int y1 = y - Utility.RandomMinMax(height / 4, (height / 4) * 3); if (x1 < 0) { x1 = 0; } if (y1 < 0) { y1 = 0; } map.AdjustMap(facet, out int x2, out int y2, x1, y1, width, height, eodon); x1 = x2 - width; y1 = y2 - height; map.Bounds = new Rectangle2D(x1, y1, width, height); map.Protected = true; map.AddWorldPin(x, y); return(map); }
private int GetLevel(TreasureMapEntry entry) { return(1158992 + Math.Min(4, entry.Level)); }
private string GetLevel(TreasureMapEntry entry) { return((1158992 + Math.Min(4, entry.Level)).ToString()); }
public void TryAddEntry(Item item, Mobile from) { if (!CanUse(from) || item == null) return; if (!CheckRange(from)) from.SendLocalizedMessage(3000268); // that is too far away. else if (!(item is TreasureMap || item is SOS || item is MessageInABottle)) from.SendLocalizedMessage(1153564); // That is not a treasure map or message in a bottle. else if (!item.IsChildOf(from.Backpack)) from.SendLocalizedMessage(1054107); // This item must be in your backpack. else if (m_Entries.Count >= 500) from.SendLocalizedMessage(1153565); // The locker is full else { DaviesLockerEntry entry = null; if (item is TreasureMap) entry = new TreasureMapEntry((TreasureMap)item); else if (item is SOS) entry = new SOSEntry((SOS)item); else if (item is MessageInABottle) entry = new SOSEntry((MessageInABottle)item); if (entry != null) { m_Entries.Add(entry); from.CloseGump(typeof(DaviesLockerGump)); from.SendGump(new DaviesLockerGump(from, this)); item.Delete(); InvalidateProperties(); } } }
private TreasureMap Construct(TreasureMapEntry entry) { if (entry == null) return null; TreasureMap map = new TreasureMap(); map.ChestLocation = new Point2D(entry.Location.X, entry.Location.Y); map.Level = entry.Level; map.Facet = entry.Map; map.Completed = entry.Completed; map.CompletedBy = entry.CompletedBy; map.Decoder = entry.Decoder; map.NextReset = entry.NextReset; map.Width = 300; map.Height = 300; int x = entry.Location.X; int y = entry.Location.Y; int width, height; Map facet = entry.Map; map.GetWidthAndHeight(facet, out width, out height); int x1 = x - Utility.RandomMinMax(width / 4, (width / 4) * 3); int y1 = y - Utility.RandomMinMax(height / 4, (height / 4) * 3); if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0; int x2, y2; map.AdjustMap(facet, out x2, out y2, x1, y1, width, height); x1 = x2 - width; y1 = y2 - height; map.Bounds = new Rectangle2D(x1, y1, width, height); map.Protected = true; map.AddWorldPin(x, y); return map; }