public override void OnDoubleClick(Mobile m) { var pm = (PlayerMobile)m; if (TitleHue == null) { pm.SendMessage(0x22, "THIS HUE DOES NOT EXIST, PLEASE PAGE IN."); Delete(); return; } TitleProfile p = CustomTitles.EnsureProfile(pm); if (p == null) { return; } if (p.Contains(TitleHue)) { pm.SendMessage(0x22, "YOU ALREADY OWN THIS HUE. THIS SHOULDN'T HAPPEN. PLEASE PAGE IN."); return; } GrantHue(pm, p); }
private void GrantTitle(PlayerMobile pm, TitleProfile p) { if (Title == null || pm == null || p == null) { return; } if (p.Contains(Title)) { pm.SendMessage(0x22, "YOU ALREADY OWN THIS TITLE. THIS SHOULDN'T HAPPEN. PLEASE PAGE IN."); return; } p.Add(Title); pm.PrivateOverheadMessage( MessageType.Label, 1287, true, "*You have gained the title: " + (!pm.Female ? Title.MaleTitle : Title.FemaleTitle) + "*", pm.NetState); Delete(); }
private void GrantHue(PlayerMobile pm, TitleProfile p) { if (TitleHue == null || pm == null || p == null) { return; } if (p.Contains(TitleHue)) { pm.SendMessage(0x22, "YOU ALREADY OWN THIS HUE. THIS SHOULDN'T HAPPEN. PLEASE PAGE IN."); return; } p.Add(TitleHue); pm.PrivateOverheadMessage( MessageType.Label, 1287, true, "*You have gained the title hue: " + TitleHue.Hue + "*", pm.NetState); Delete(); }
private void GrantHue(PlayerMobile pm, TitleProfile p) { if (TitleHue == null || pm == null || p == null) { return; } if (p.Contains(TitleHue)) { pm.SendMessage(0x22, "You already own this title hue."); return; } p.Add(TitleHue); pm.PrivateOverheadMessage( MessageType.Label, 1287, true, "*The scroll crumbles in your hands as you absorb its power*", pm.NetState); LoggingCustom.Log("HueScrollsUsed.txt", String.Format("{0} -> {1} ({2})", pm, this, TitleHue)); Delete(); }
public bool CanConsume(PlayerMobile pm, bool message) { if (TitleHue == null) { return(false); } if (BoundToMobile != null && BoundToMobile != pm) { if (message) { pm.SendMessage(54, "This scroll is bound to another entity."); } return(false); } TitleProfile p = CustomTitles.EnsureProfile(pm); if (p == null) { return(false); } if (p.Contains(TitleHue)) { if (message) { pm.SendMessage(0x22, "You already own this title hue."); } return(false); } return(true); }