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); }
public bool AutoConsume(PlayerMobile m) { if (m == null || m.Deleted) { return(false); } if (TitleHue == null) { m.SendMessage(0x22, "This ancient scroll has lost whatever power it once had."); m.PrivateOverheadMessage(MessageType.Label, 1287, true, "*The scroll disintegrates in your hands*", m.NetState); LoggingCustom.Log("HueScrollsInvalid.txt", String.Format("{0} -> {1} ({2})", m, this, TitleHue)); Delete(); return(false); } if (!CanConsume(m, false)) { return(false); } TitleProfile p = CustomTitles.EnsureProfile(m); if (p == null) { return(false); } GrantHue(m, p); return(true); }
public override void OnDoubleClick(Mobile m) { if (!this.CheckDoubleClick(m, true, false, 2, true) || !(m is PlayerMobile)) { return; } if (TitleHue == null) { m.SendMessage(0x22, "This ancient scroll has lost whatever power it once had."); m.PrivateOverheadMessage(MessageType.Label, 1287, true, "*The scroll disintegrates in your hands*", m.NetState); LoggingCustom.Log("HueScrollsInvalid.txt", String.Format("{0} -> {1} ({2})", m, this, TitleHue)); Delete(); return; } if (!CanConsume((PlayerMobile)m, true)) { return; } var pm = (PlayerMobile)m; TitleProfile p = CustomTitles.EnsureProfile(pm); if (p == null) { return; } if (_Gump != null) { _Gump.Close(true); _Gump = null; } _Gump = SuperGump.Send( new ScrollConfirmGump( pm, null, TitleHue, b => GrantHue(pm, p), b => { pm.SendMessage(0x55, "You choose to not use the title hue scroll."); _Gump = null; })); }
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); }