public ConstellationInfo(GenericReader reader) { reader.ReadInt(); Identifier = reader.ReadInt(); TimeCoordinate = (TimeCoordinate)reader.ReadInt(); Name = reader.ReadString(); DiscoveredBy = reader.ReadMobile(); DiscoveredOn = reader.ReadDateTime(); CoordRA = reader.ReadInt(); CoordDEC = reader.ReadDouble(); int count = reader.ReadInt(); StarPositions = new StarPosition[count]; for (int i = 0; i < count; i++) { StarPosition pos = new StarPosition { ImageID = reader.ReadInt(), X = reader.ReadInt(), Y = reader.ReadInt() }; StarPositions[i] = pos; } if (HasBeenDiscovered) { AstronomySystem.AddDiscovery(this); } }
public override bool OnDragDrop(Mobile m, Item dropped) { if (dropped is StarChart) { StarChart chart = (StarChart)dropped; if (chart.Constellation >= 0 && chart.Constellation < AstronomySystem.MaxConstellations) { if (String.IsNullOrEmpty(chart.ConstellationName)) { m.SendLocalizedMessage(1158751); // You must name your constellation before submitting it. } else { ConstellationInfo info = AstronomySystem.GetConstellation(chart.Constellation); if (info != null) { Gump gump = new Gump(100, 100); gump.AddBackground(0, 0, 720, 270, 0x2454); gump.AddImage(0, 0, 0x69D); gump.AddHtmlLocalized(290, 14, 418, 18, 1114513, "#1158517", 0xC63, false, false); // Willebrord the Astronomer if (info.HasBeenDiscovered) { m.SendLocalizedMessage(1158764); // That constellation name has already been chosen, please choose another and resubmit your star chart. gump.AddHtmlLocalized(290, 51, 418, 209, 1158530, 0xC63, false, true); // Sorry to say that constellation has already been discovered! Fix your eyes to the heavens and keep up the searc } else { gump.AddHtmlLocalized(290, 51, 418, 209, 1158519, 0xC63, false, true); // Wow! Would you look at that! Always amazes me how even an amateur can make such profound discoveries! // I've recorded your discovery in the ledger. Here's some items I think you have more than earned! Well done! info.DiscoveredBy = chart.ChartedBy; info.Name = chart.ConstellationName; info.DiscoveredOn = chart.ChartedOn; AstronomySystem.AddDiscovery(info); m.AddToBackpack(new RecipeScroll(465)); m.AddToBackpack(new AstronomerTitleDeed()); } m.SendGump(gump); } } } } else { SayTo(m, 1158529, 1163); // What's this? I haven't time for this! Star Charts only please! } return(false); }