private void OnConfirm(Mobile m, object o) { PlayerMobile pm = m as PlayerMobile; if (pm != null) { if (Banker.Withdraw(pm, CityLoyaltySystem.BannerCost)) { CityBannerDeed deed = new CityBannerDeed(City); CitySystem.AddToTreasury(m, CityLoyaltySystem.BannerCost); if (pm.Backpack == null || !pm.Backpack.TryDropItem(pm, deed, false)) { pm.BankBox.DropItem(deed); pm.SendMessage("The deed has been placed in your bank box."); } else { pm.SendMessage("The deed has been placed in your backpack."); } AddToCooldown(pm); } else { SayTo(pm, 1152302); // I am afraid your bank box does not contain the funds needed to complete this transaction. } } }
public override void OnMovement(Mobile m, Point3D oldLocation) { if (CitySystem != null && m is PlayerMobile && InRange(m.Location, 2)) { Raider raider = ((PlayerMobile)m).AllFollowers.FirstOrDefault(mob => mob is Raider && mob.InRange(this.Location, 2)) as Raider; if (raider != null) { CitySystem.AwardLove(m, 1000); SayTo(m, 1152250, m.Name); // Thank you, ~1_name~, for your assistance during these difficult times. raider.Delete(); } } base.OnMovement(m, oldLocation); }
public override void OnDoubleClick(Mobile from) { if (!CityLoyaltySystem.Enabled || CitySystem == null) { return; } if (CitySystem.IsCitizen(from, true)) { if (from.InRange(this.Location, 3)) { from.SendGump(new PlayerBBGump(from, null, this, 0)); } else { from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045, from.NetState); } } else { from.SendLocalizedMessage(1154275); // Only Citizens of this City may use this. } }
public override void GetContextMenuEntries(Mobile from, List <ContextMenuEntry> list) { base.GetContextMenuEntries(from, list); if (!CityLoyaltySystem.Enabled || CitySystem == null || !CitySystem.IsGovernor(from)) { return; } list.Add(new SimpleContextMenuEntry(from, 1154912, m => // Set New Announcement { if (m.Prompt != null) { m.SendLocalizedMessage(1079166); // You already have a text entry request pending. } else if (CitySystem.Herald != null) { m.SendMessage("Enter message board headline:"); m.BeginPrompt( (mob, text) => { if (Server.Guilds.BaseGuildGump.CheckProfanity(text, 150)) { CitySystem.Herald.Announcement = text; } else { mob.SendLocalizedMessage(1112587); // Invalid entry. } }, (mob, text) => { mob.SendMessage("Herald message unchanged."); }); } }, enabled: CitySystem.Herald != null)); list.Add(new SimpleContextMenuEntry(from, 1154913, m => // Set Headline { if (m.Prompt != null) { m.SendLocalizedMessage(1079166); // You already have a text entry request pending. } else { m.SendMessage("Enter message board headline:"); m.BeginPrompt( (mob, text) => { if (Server.Guilds.BaseGuildGump.CheckProfanity(text, 150)) { if (String.IsNullOrEmpty(text)) { CitySystem.Headline = null; CitySystem.Body = null; CitySystem.PostedOn = DateTime.Now; mob.SendMessage("{0} message board headline removed!", CitySystem.Definition.Name); } else { CitySystem.Headline = text; CitySystem.PostedOn = DateTime.Now; mob.SendMessage("{0} message board headline changed!", CitySystem.Definition.Name); } } else { mob.SendLocalizedMessage(1112587); // Invalid entry. } }, (mob, text) => { mob.SendMessage("Message headline unchanged."); }); } })); list.Add(new SimpleContextMenuEntry(from, 1154914, m => // Set Body { if (m.Prompt != null) { m.SendLocalizedMessage(1079166); // You already have a text entry request pending. } else { m.SendMessage("Enter message board body:"); m.BeginPrompt( (mob, text) => { if (Server.Guilds.BaseGuildGump.CheckProfanity(text, 150)) { if (String.IsNullOrEmpty(text)) { CitySystem.Body = null; CitySystem.PostedOn = DateTime.Now; mob.SendMessage("{0} message board body removed!", CitySystem.Definition.Name); } else { CitySystem.Body = text; CitySystem.PostedOn = DateTime.Now; mob.SendMessage("{0} message board body removed!", CitySystem.Definition.Name); } } else { mob.SendLocalizedMessage(1112587); // Invalid entry. } }, (mob, text) => { mob.SendMessage("Message body unchanged."); }); } })); }