public static string OnModuleExamine(string existingDescription, NWObject examinedObject) { if (examinedObject.ObjectType != ObjectType.Item) { return(existingDescription); } NWItem examinedItem = (examinedObject.Object); if (examinedItem.GetLocalFloat("DURABILITY_MAX") <= 0f) { return(existingDescription); } string description = ColorTokenService.Orange("Durability: "); float durability = GetDurability(examinedItem); if (durability <= 0.0f) { description += ColorTokenService.Red(Convert.ToString(durability)); } else { description += ColorTokenService.White(FormatDurability(durability)); } description += ColorTokenService.White(" / " + FormatDurability(GetMaxDurability(examinedItem))); return(existingDescription + "\n\n" + description); }
public static string PrismaticString() { return(ColorTokenService.Red("p") + ColorTokenService.Orange("r") + ColorTokenService.Yellow("i") + ColorTokenService.Green("s") + ColorTokenService.Blue("m") + ColorTokenService.LightPurple("a") + ColorTokenService.Purple("t") + ColorTokenService.White("i") + ColorTokenService.Black("c")); }
private static void ShowMOTD() { NWPlayer player = GetEnteringObject(); ServerConfiguration config = DataService.ServerConfiguration.Get(); string message = ColorTokenService.Green("Welcome to " + config.ServerName + "!\n\nMOTD: ") + ColorTokenService.White(config.MessageOfTheDay); DelayCommand(6.5f, () => { player.SendMessage(message); }); }