public override void OnComponentUsed(AddonComponent c, Mobile from) { var l = JollyRogerData.GetList(from); if (from is PlayerMobile pm && l != null && l.Shrine != null) { var title = JollyRogerData.GetShrineTitle(pm); if (title > 0) { var shrine = JollyRogerData.GetShrine(title); ShrineArray s = null; for (var index = 0; index < l.Shrine.Count; index++) { var y = l.Shrine[index]; if (y.Shrine == shrine) { s = y; break; } } if (s != null) { var count = s.MasterDeath; if (count >= 8) { from.CloseGump(typeof(TabardRewardGump)); from.SendGump(new TabardRewardGump(shrine)); } else if (count < 3) { from.SendLocalizedMessage(1159362); // Thou art virtuous, but have not truly fought for virtue. } else { from.SendLocalizedMessage(1159370, shrine.ToString()); // Thou art virtuous, but have not truly fought for ~1_VIRTUE~ } } else { from.SendLocalizedMessage(1159361); // Thou art not virtuous... } } else { from.SendLocalizedMessage(1159361); // Thou art not virtuous... } }
public override void OnEnter(Mobile m) { var virtue = Virtue.FirstOrDefault(x => x.Area.Contains(m.Location)); if (virtue != null) { var list = JollyRogerData.GetList(m); if (list != null && list.Shrine != null) { var s = list.Shrine.FirstOrDefault(x => x.Shrine == virtue.Shrine); if (s != null && s.MasterDeath >= 3) { if (!list.Cloak && list.Shrine.Count == 8 && !list.Shrine.Any(x => x.MasterDeath < 3)) { var item = new CloakOfTheVirtuous(); if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false)) { m.SendLocalizedMessage(1152337, item.ToString()); // A reward of ~1_ITEM~ will be delivered to you once you free up room in your backpack. item.Delete(); } else { m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1159339, m.NetState); // Thous hast proven thou walks the path of Virtue! JollyRogerData.SetCloak(m, true); m.SendLocalizedMessage(1152339, item.ToString()); // A reward of ~1_ITEM~ has been placed in your backpack. m.PlaySound(0x419); } } else { m.PrivateOverheadMessage(MessageType.Regular, 0x47E, false, $"*Thou are truly {virtue.Title}...*", m.NetState); m.FixedParticles(0x376A, 1, 72, 0x13B5, EffectLayer.Waist); m.PlaySound(0x1F2); } } else { m.PrivateOverheadMessage(MessageType.Regular, 0x47E, false, $"*Thou are not truly {virtue.Title}...*", m.NetState); } } else { m.PrivateOverheadMessage(MessageType.Regular, 0x47E, false, $"*Thou are not truly {virtue.Title}...*", m.NetState); } } }
public override void OnComponentUsed(AddonComponent c, Mobile from) { var l = JollyRogerData.GetList(from); var pm = from as PlayerMobile; if (pm != null && l != null && l.Shrine != null) { var title = JollyRogerData.GetShrineTitle(pm); if (title > 0) { var shrine = JollyRogerData.GetShrine(title); var s = l.Shrine.FirstOrDefault(y => y.Shrine == shrine); if (s != null) { var count = s.MasterDeath; if (count >= 8) { from.CloseGump(typeof(TabardRewardGump)); from.SendGump(new TabardRewardGump(shrine)); } else if (count < 3) { from.SendLocalizedMessage(1159362); // Thou art virtuous, but have not truly fought for virtue. } else { from.SendLocalizedMessage(1159370, shrine.ToString()); // Thou art virtuous, but have not truly fought for ~1_VIRTUE~ } } else { from.SendLocalizedMessage(1159361); // Thou art not virtuous... } } else { from.SendLocalizedMessage(1159361); // Thou art not virtuous... } } else { from.SendLocalizedMessage(1159361); // Thou art not virtuous... } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; switch (info.ButtonID) { case 0: { break; } case 1: { var l = JollyRogerData.GetList(from); if (l != null) { if (l.Tabard) { from.SendLocalizedMessage(1152687); // You've already claimed your reward! } else { from.CloseGump(typeof(TabardClaimConfirmGump)); from.SendGump(new TabardClaimConfirmGump(_Shrine)); } } break; } case 2: { from.CloseGump(typeof(TabardConvertConfirmGump)); from.SendGump(new TabardConvertConfirmGump()); break; } } }