private string GetChampionTitle() { PlayerMobile.ChampionTitleInfo info = User.ChampionTitles; int v; string str = null; if (TitleSelected == 295) { v = info.Harrower; if (v > 0) { str = String.Format(": {0} of Evil", Titles.HarrowerTitles[Math.Min(Titles.HarrowerTitles.Length, info.Harrower) - 1]); } } else { v = info.GetValue(TitleSelected); ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)TitleSelected); int offset = 0; if (v > 800) { offset = 3; } else if (v > 300) { offset = (int)(v / 300); } if (offset > 0) { str = String.Format(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } return(str); }
public static string ComputeTitle(Mobile beholder, Mobile beheld) { StringBuilder title = new StringBuilder(); bool showSkillTitle = beheld.ShowFameTitle && ((beholder == beheld) || (beheld.Fame >= 5000)); if (Core.UOR && beheld.ShowFameTitle && beheld is PlayerMobile && ((PlayerMobile)beheld).FameKarmaTitle != null) //UOSI- Core.SA { title.AppendFormat(((PlayerMobile)beheld).FameKarmaTitle, beheld.Name, beheld.Female ? "Lady" : "Lord"); } else if (beheld.ShowFameTitle || (beholder == beheld)) { title.Append(ComputeFameTitle(beheld)); } else { title.Append(beheld.Name); } if (beheld is PlayerMobile && ((PlayerMobile)beheld).DisplayChampionTitle) { PlayerMobile.ChampionTitleInfo info = ((PlayerMobile)beheld).ChampionTitles; if (Core.UOR) //UOSI- Core.SA { if (((PlayerMobile)beheld).CurrentChampTitle != null) { title.AppendFormat(((PlayerMobile)beheld).CurrentChampTitle); } } else if (info.Harrower > 0) { title.AppendFormat(": {0} of Evil", HarrowerTitles[Math.Min(HarrowerTitles.Length, info.Harrower) - 1]); } else { int highestValue = 0, highestType = 0; for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v > highestValue) { highestValue = v; highestType = i; } } int offset = 0; if (highestValue > 800) { offset = 3; } else if (highestValue > 300) { offset = (int)(highestValue / 300); } if (offset > 0) { ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)highestType); title.AppendFormat(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } } string customTitle = beheld.Title; if (Core.UOR) //UOSI- Core.SA { #region Level System PlayerMobile pm = beheld as PlayerMobile; XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); Configured c = new Configured(); if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null) { if (c.PaperdollLevel) { string d = LevelCore.Display(pm, new Configured()); title.Append(" - Level " + d + ", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); } else { title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); } } else if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle == null) { string d = LevelCore.Display(pm, new Configured()); if (c.PaperdollLevel) { if (pm.AccessLevel > AccessLevel.Player && c.StaffHasLevel) { title.Append(" - Level " + d); } else { if (pm.AccessLevel < AccessLevel.GameMaster) { title.Append(" - Level " + d); } } } } else if (beheld is BaseVendor) { title.AppendFormat(" {0}", customTitle); } /* * if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null) * title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); * else if (beheld is BaseVendor) * title.AppendFormat(" {0}", customTitle); */ #endregion } else if (customTitle != null && (customTitle = customTitle.Trim()).Length > 0) { title.AppendFormat(" {0}", customTitle); } else if (showSkillTitle && beheld.Player) { string skillTitle = GetSkillTitle(beheld); if (skillTitle != null) { title.Append(", ").Append(skillTitle); } } return(title.ToString()); }
public static string ComputeTitle(Mobile beholder, Mobile beheld) { StringBuilder title = new StringBuilder(); int fame = beheld.Fame; int karma = beheld.Karma; if (beheld.AccessLevel > AccessLevel.Player) { string staffTitle; if (beheld.AccessLevel == AccessLevel.GameMaster) { staffTitle = "Game Master"; } else { staffTitle = beheld.AccessLevel.ToString(); } title.AppendFormat("{0} {1}", staffTitle, beheld.Name); } else if (beheld.Kills >= 5) { title.AppendFormat(beheld.Fame >= 10000 ? "The Murderer {1} {0}" : "The Murderer {0}", beheld.Name, beheld.Female ? "Lady" : "Lord"); } else if (beheld.Criminal) { title.AppendFormat(beheld.Fame >= 10000 ? "The Criminal {1} {0}" : "The Criminal {0}", beheld.Name, beheld.Female ? "Lady" : "Lord"); } else { for (int i = 0; i < m_FameEntries.Length; ++i) { FameEntry fe = m_FameEntries[i]; if (fame <= fe.m_Fame || i == (m_FameEntries.Length - 1)) { KarmaEntry[] karmaEntries = fe.m_Karma; for (int j = 0; j < karmaEntries.Length; ++j) { KarmaEntry ke = karmaEntries[j]; if (karma <= ke.m_Karma || j == (karmaEntries.Length - 1)) { title.AppendFormat(ke.m_Title, beheld.Name, beheld.Female ? "Lady" : "Lord"); break; } } break; } } } if (beheld.Guild != null && !beheld.Guild.Disbanded && !string.IsNullOrEmpty(beheld.Guild.Abbreviation)) { if (beheld.DisplayGuildTitle) { title.AppendFormat(" [{0}]", beheld.Guild.Abbreviation); } } if (beheld is PlayerMobile && ((PlayerMobile)beheld).DisplayChampionTitle) { PlayerMobile.ChampionTitleInfo info = ((PlayerMobile)beheld).ChampionTitles; if (info.Harrower > 0) { title.AppendFormat(": {0} of Evil", HarrowerTitles[Math.Min(HarrowerTitles.Length, info.Harrower) - 1]); } else { int highestValue = 0, highestType = 0; for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v > highestValue) { highestValue = v; highestType = i; } } int offset = 0; if (highestValue > 800) { offset = 3; } else if (highestValue > 300) { offset = (highestValue / 300); } if (offset > 0) { ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)highestType); title.AppendFormat(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } } string customTitle = beheld.Title; if (customTitle != null && (customTitle = customTitle.Trim()).Length > 0) { title.AppendFormat(" {0}", customTitle); } else if (beheld.Guild != null && !beheld.Guild.Disbanded && beheld.DisplayGuildTitle && !string.IsNullOrEmpty(beheld.GuildTitle)) { title.AppendFormat(", {0}", beheld.GuildTitle); } else if (beheld.Player && (beheld.AccessLevel == AccessLevel.Player || beholder == beheld)) { string skillTitle = GetSkillTitle(beheld); if (skillTitle != null) { title.Append(", ").Append(skillTitle); } } return(title.ToString()); }
public static string ComputeTitle(Mobile beholder, Mobile beheld) { StringBuilder title = new StringBuilder(); int fame = beheld.Fame; int karma = beheld.Karma; bool showSkillTitle = beheld.ShowFameTitle && ((beholder == beheld) || (fame >= 5000)); /*if ( beheld.Kills >= 5 ) * { * title.AppendFormat( beheld.Fame >= 10000 ? "The Murderer {1} {0}" : "The Murderer {0}", beheld.Name, beheld.Female ? "Lady" : "Lord" ); * } * else*/if (beheld.ShowFameTitle || (beholder == beheld)) { for (int i = 0; i < m_FameEntries.Length; ++i) { FameEntry fe = m_FameEntries[i]; if (fame <= fe.m_Fame || i == (m_FameEntries.Length - 1)) { KarmaEntry[] karmaEntries = fe.m_Karma; for (int j = 0; j < karmaEntries.Length; ++j) { KarmaEntry ke = karmaEntries[j]; if (karma <= ke.m_Karma || j == (karmaEntries.Length - 1)) { title.AppendFormat(ke.m_Title, beheld.Name, beheld.Female ? "Lady" : "Lord"); break; } } break; } } } else { title.Append(beheld.Name); } if (beheld is PlayerMobile && ((PlayerMobile)beheld).DisplayChampionTitle) { PlayerMobile.ChampionTitleInfo info = ((PlayerMobile)beheld).ChampionTitles; if (info.Harrower > 0) { title.AppendFormat(": {0} of Evil", HarrowerTitles[Math.Min(HarrowerTitles.Length, info.Harrower) - 1]); } else { int highestValue = 0, highestType = 0; for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v > highestValue) { highestValue = v; highestType = i; } } int offset = 0; if (highestValue > 800) { offset = 3; } else if (highestValue > 300) { offset = (int)(highestValue / 300); } if (offset > 0) { ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)highestType); title.AppendFormat(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } } string customTitle = beheld.Title; if (customTitle != null && (customTitle = customTitle.Trim()).Length > 0) { title.AppendFormat(" {0}", customTitle); } else if (showSkillTitle && beheld.Player) { string skillTitle = GetSkillTitle(beheld); if (skillTitle != null) { title.Append(", ").Append(skillTitle); } } return(title.ToString()); }
private void BuildPaperdollSuffix() { AddHtmlLocalized(55, 190, 160, 16, 1115030, 0xFFFF, false, false); // Skills AddCallbackButton(20, 190, 4005, 4007, 100, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Skills; Reset(); Refresh(); }); PlayerMobile.ChampionTitleInfo info = User.ChampionTitles; if (info != null && info.HasChampionTitle(User)) { AddHtmlLocalized(55, 212, 160, 16, 1115032, 0xFFFF, false, false); // Monster AddCallbackButton(20, 212, 4005, 4007, 101, GumpButtonType.Reply, 0, b => { Category = TitleCategory.Champion; Reset(); Refresh(); }); } if (Category == TitleCategory.Skills) { if (!ShowingDescription || TitleSelected == -1) { int index = 0; int page = 1; AddPage(page); foreach (Skill sk in User.Skills) { if (sk.Base < 30) { continue; } AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", Titles.GetSkillTitle(User, sk)), false, false); AddCallbackButton(225, 70 + (index * 22), 4005, 4007, sk.Info.SkillID + 102, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 102; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); } } else { string str = Titles.GetSkillTitle(User, User.Skills[(SkillName)TitleSelected]); AddHtmlLocalized(225, 70, 270, 200, 1115056 + TitleSelected, 0xFFFF, false, false); AddHtmlLocalized(225, 220, 160, 16, 1115027, 0xFFFF, false, false); // Paperdoll Name (Suffix) AddHtml(275, 240, 245, 16, Color("#FFFFFF", str), false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 199, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED str = Titles.GetSkillTitle(User, User.Skills[(SkillName)TitleSelected]); Refresh(false); User.PaperdollSkillTitle = str; }); } } else if (Category == TitleCategory.Champion && info != null) { if (!ShowingDescription || TitleSelected == -1) { int y = 70; int page = 1; int index = 0; AddPage(page); if (info.Harrower > 0) { AddHtml(260, y, 245, 16, Color("#FFFFFF", String.Format(": {0} of Evil", Titles.HarrowerTitles[Math.Min(Titles.HarrowerTitles.Length, info.Harrower) - 1])), false, false); AddCallbackButton(225, y, 4005, 4007, 295, GumpButtonType.Reply, 0, b => { TitleSelected = 295; ShowingDescription = true; Refresh(); }); index++; } for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v == 0) { continue; } int offset = 0; if (v > 800) { offset = 3; } else if (v > 300) { offset = (int)(v / 300); } if (offset <= 0) { continue; } ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)i); AddHtml(260, y + (index * 22), 245, 16, Color("#FFFFFF", String.Format(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name)), false, false); AddCallbackButton(225, y + (index * 22), 4005, 4007, i + 251, GumpButtonType.Reply, 0, b => { TitleSelected = b.ButtonID - 251; ShowingDescription = true; Refresh(); }); index++; CheckPage(ref index, ref page); } } else { string str = GetChampionTitle(); object description = GetChampInfo(); if (description is int) { AddHtmlLocalized(225, 70, 270, 140, (int)description, 0xFFFF, false, false); } else if (description is string) { AddHtml(250, 70, 270, 140, Color("#FFFFFF", (string)description), false, false); } AddHtmlLocalized(225, 220, 160, 16, 1115027, 0xFFFF, false, false); // Paperdoll Name (Suffix) AddHtml(275, 240, 245, 16, Color("#FFFFFF", str), false, false); AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title? AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false); // APPLY AddCallbackButton(445, 275, 4005, 4007, 299, GumpButtonType.Reply, 0, b => { AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED str = GetChampionTitle(); User.DisplayChampionTitle = true; User.CurrentChampTitle = str; Refresh(false); }); } } }
public static string ComputeTitle(Mobile beholder, Mobile beheld) { StringBuilder title = new StringBuilder(); bool showSkillTitle = beheld.ShowFameTitle && ((beholder == beheld) || (beheld.Fame >= 5000)); if (beheld.ShowFameTitle || (beholder == beheld)) { title.Append(ComputeFameTitle(beheld)); } else { title.Append(beheld.Name); } if (beheld is PlayerMobile && ((PlayerMobile)beheld).DisplayChampionTitle) { PlayerMobile.ChampionTitleInfo info = ((PlayerMobile)beheld).ChampionTitles; if (info.Harrower > 0) { title.AppendFormat(": {0} of Evil", HarrowerTitles[Math.Min(HarrowerTitles.Length, info.Harrower) - 1]); } else { int highestValue = 0, highestType = 0; for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v > highestValue) { highestValue = v; highestType = i; } } int offset = 0; if (highestValue > 800) { offset = 3; } else if (highestValue > 300) { offset = (int)(highestValue / 300); } if (offset > 0) { ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)highestType); title.AppendFormat(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } } string customTitle = beheld.Title; if (customTitle != null && (customTitle = customTitle.Trim()).Length > 0) { title.AppendFormat(" {0}", customTitle); } else if (showSkillTitle && beheld.Player) { string skillTitle = GetSkillTitle(beheld); if (skillTitle != null) { title.Append(", ").Append(skillTitle); } } return(title.ToString()); }
public RemoteClientChampion(ChampionSpawnInfo spawnInfo) : base(spawnInfo) { StateHistory = new SnapshotHistory <StateUpdateData>(HISTORY_TIME_KEPT); }
public RemoteDrawableChampion(ChampionSpawnInfo spawnInfo, bool ally, ChampionsInfo champInfo) : base(new RemoteClientChampion(spawnInfo), ally, champInfo) { }
public MainDrawableChampion(ChampionSpawnInfo spawnInfo, GameMatch match, ChampionsInfo champInfo) : base(new MainClientChampion(spawnInfo, match), true, champInfo) { }