public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } if (CharacterDatabase.GetBardsTaleQuest(m_Mobile, "BardsTaleCatacombKey")) { m_Giver.SayTo(m_Mobile, "Have you been meditating in the Catacombs?"); } else if (!(CharacterDatabase.GetBardsTaleQuest(m_Mobile, "BardsTaleMadGodName"))) { m_Giver.SayTo(m_Mobile, "Only a true disciple knows the name of the Mad God."); } else if (!(CharacterDatabase.GetBardsTaleQuest(m_Mobile, "BardsTaleCatacombKey"))) { if (!m_Mobile.HasGump(typeof(SpeechGump))) { CharacterDatabase.SetBardsTaleQuest(m_Mobile, "BardsTaleCatacombKey", true); m_Mobile.SendSound(0x3D); m_Mobile.SendGump(new SpeechGump("The Catacombs Below", SpeechFunctions.SpeechText(m_Giver.Name, m_Mobile.Name, "MadGodPriest"))); } } }
public static void JoinGuild(Mobile player, Mobile guildmaster) { PlayerMobile pm = (PlayerMobile)player; if (player.Blessed) { guildmaster.SayTo(player, "Speak to me when that strange effect has worn off."); } else if (((PlayerMobile)player).Profession == 1) { guildmaster.SayTo(player, "I don't think we could let someone like you join."); } else if (pm.NpcGuild == ((BaseVendor)guildmaster).NpcGuild) { guildmaster.SayTo(player, 501047); // Thou art already a member of our guild. } else if (pm.NpcGuild != NpcGuild.None) { guildmaster.SayTo(player, 501046); // Thou must resign from thy other guild first. } else { SayPriceTo(player, guildmaster); } }
public override void HandleButtonResponse( NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo ) { PlayerMobile pm = sender.Mobile as PlayerMobile; Item item = ((ItemTileButtonInfo)buttonInfo).Item; if( !( pm != null && item.IsChildOf( pm.Backpack ) && pm.InRange( m_Collector.Location, 7 )) ) return; item.Delete(); if( ++pm.ToTItemsTurnedIn >= TreasuresOfTokuno.ItemsPerReward ) { m_Collector.SayTo( pm, 1070980 ); // Congratulations! You have turned in enough minor treasures to earn a greater reward. pm.CloseGump( typeof( ToTTurnInGump ) ); //Sanity if( !pm.HasGump( typeof( ToTRedeemGump ) ) ) pm.SendGump( new ToTRedeemGump( m_Collector, false ) ); } else { m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward. ArrayList buttons = FindRedeemableItems( pm ); pm.CloseGump( typeof( ToTTurnInGump ) ); //Sanity if( buttons.Count > 0 ) pm.SendGump( new ToTTurnInGump( m_Collector, buttons ) ); } }
private static void Linguistics_Speech(SpeechEventArgs e) { if (LokaiSkillUtilities.LinguisticsEnabled && WordsLoaded) { Mobile speaker = e.Mobile; // If the speaker has a greater AccessLevel than the linguistics cut-off, then we want everyone to hear them properly. if (speaker.AccessLevel > LokaiSkillUtilities.LinguisticsLevel) { return; } List <Mobile> hearers = new List <Mobile>(); IPooledEnumerable eable = speaker.Map.GetObjectsInRange(speaker.Location, 12); foreach (object o in eable) { if (o is Mobile) { Mobile hearer = (Mobile)o; if (hearer.CanSee(speaker) && (Mobile.NoSpeechLOS || hearer.InLOS(speaker))) { if (hearer.HandlesOnSpeech(speaker)) { e.Handled = false; hearer.OnSpeech(e); continue; } if (hearer.NetState != null) { hearers.Add(hearer); } } } } eable.Free(); foreach (Mobile hearer in hearers) { // We exclude those from the same race or those with AccessLevels greater than the linguistics cut-off value. if (speaker.Race == hearer.Race || hearer.AccessLevel > LokaiSkillUtilities.LinguisticsLevel) { speaker.SayTo(hearer, e.Speech); } else { speaker.SayTo(hearer, Translate(speaker, hearer, e.Speech)); } } e.Blocked = true; } }
protected override void OnTarget(Mobile from, object targeted) { if (!m_Crystal.IsAccessibleTo(from)) { return; } if (from.Map != m_Crystal.Map || !from.InRange(m_Crystal.GetWorldLocation(), 2)) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; return; } if (targeted == m_Crystal) { if (m_Crystal.Active) { m_Crystal.Active = false; from.SendLocalizedMessage(500672); // You turn the crystal off. } else { m_Crystal.Active = true; from.SendLocalizedMessage(500673); // You turn the crystal on. } } else if (targeted == from) { if (m_Crystal.Sender != null) { m_Crystal.Sender = null; from.SendLocalizedMessage(1010044); // You unlink the receiver crystal. } else { from.SendLocalizedMessage(1010045); // That receiver crystal is not linked. } } else { Item targItem = targeted as Item; if (targItem != null && targItem.VerifyMove(from)) { CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType()); if (info != null) { from.SendLocalizedMessage(500677); // This crystal cannot be recharged. return; } } from.SendLocalizedMessage(1010045); // That receiver crystal is not linked. } }
public virtual bool Validate(Mobile from) { if (Parent == null) { from.SayTo(from, 1010095); // This must be on your person to use. return(false); } else if (!BaseMount.CheckMountAllowed(from)) { // CheckMountAllowed sends the message return(false); } else if (from.Mounted) { from.SendLocalizedMessage(1005583); // Please dismount first. return(false); } else if (from.IsBodyMod && !from.Body.IsHuman) { from.SendLocalizedMessage(1061628); // You can't do that while polymorphed. return(false); } else if (from.HasTrade) { from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time return(false); } return(true); }
public virtual bool Validate(Mobile from) { #region SA if (from.Race == Race.Gargoyle) { from.SendLocalizedMessage(1112281); // gargs can't mount return(false); } #endregion if (Parent == null) { from.SayTo(from, 1010095); // This must be on your person to use. return(false); } if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null)) { // CheckIsUsableBy sends the message return(false); } if (!BaseMount.CheckMountAllowed(from, true)) { // CheckMountAllowed sends the message return(false); } if (from.Mounted) { from.SendLocalizedMessage(1005583); // Please dismount first. return(false); } if (from.IsBodyMod && !from.Body.IsHuman) { from.SendLocalizedMessage(1061628); // You can't do that while polymorphed. return(false); } if (from.HasTrade) { from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time return(false); } if ((from.Followers + FollowerSlots) > from.FollowersMax) { from.SendLocalizedMessage(1049679); // You have too many followers to summon your mount. return(false); } if (!DesignContext.Check(from)) { // Check sends the message return(false); } return(true); }
public override void OnDoubleClick(Mobile from) { from.SayTo(from, 1156290, 1153); // *The vines looks as though they may be strong enough to support climbing...* if (ClimbLocation != Point3D.Zero && from.InRange(this.GetWorldLocation(), 2) && Z >= from.Z) { from.MoveToWorld(ClimbLocation, Map); } }
public static void ResignGuild(Mobile player, Mobile guildmaster) { PlayerMobile pm = (PlayerMobile)player; if (pm.NpcGuild != ((BaseVendor)guildmaster).NpcGuild) { guildmaster.SayTo(player, 501052); // Thou dost not belong to my guild! } else { guildmaster.SayTo(player, 501054); // I accept thy resignation. pm.NpcGuild = NpcGuild.None; CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(player); if (DB.CharacterGuilds > 0) { int fees = DB.CharacterGuilds; DB.CharacterGuilds = fees * 2; } else { DB.CharacterGuilds = 4000; } ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is GuildRings) { GuildRings guildring = (GuildRings)item; if (guildring.RingOwner == player) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; item.Delete(); } } }
public static void TryPirateBlab(Mobile from, Mobile npc) { if (m_PirateBlabTable.ContainsKey(from) && m_PirateBlabTable[from] > DateTime.UtcNow || BountyQuestSpawner.Bounties.Count <= 0) { return; } //Make of list of bounties on their map List <Mobile> bounties = new List <Mobile>(); foreach (Mobile mob in BountyQuestSpawner.Bounties.Keys) { if (mob.Map == from.Map && mob is PirateCaptain && !bounties.Contains(mob)) { bounties.Add(mob); } } if (bounties.Count > 0) { Mobile bounty = bounties[Utility.Random(bounties.Count)]; if (bounty != null) { PirateCaptain capt = (PirateCaptain)bounty; int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; Point3D loc = capt.Location; Map map = capt.Map; string locArgs; //string nameArgs; string combine; if (Sextant.Format(loc, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth)) { locArgs = String.Format("{0}°{1}'{2},{3}°{4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W"); } else { locArgs = "?????"; } combine = String.Format("{0}\t{1}", capt.PirateName > -1 ? String.Format("#{0}", capt.PirateName) : capt.Name, locArgs); int cliloc = Utility.RandomMinMax(1149856, 1149865); npc.SayTo(from, cliloc, combine); m_PirateBlabTable[from] = DateTime.UtcNow + BlabDuration; } } ColUtility.Free(bounties); }
/*public override bool IsAccessibleTo( Mobile m ) * { * if ( !BaseHouse.CheckAccessible( m, this ) ) * return false; * * return base.IsAccessibleTo( m ); * } * * public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems ) * { * if ( !BaseHouse.CheckHold( m, this, item, message, checkItems ) ) * return false; * * return base.CheckHold( m, item, message, checkItems ); * } * * public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list ) * { * base.GetContextMenuEntries( from, list ); * SetSecureLevelEntry.AddTo( from, this, list ); * }*/ public override void OnDoubleClick(Mobile from) { if (!from.InLOS(GetWorldLocation())) { from.SayTo(from, true, "I cannot see that."); } else { base.OnDoubleClick(from); } }
protected override void OnTarget(Mobile from, object o) { if (o is Mobile) { Mobile m = (Mobile)o; Party p = Party.Get(from); Party mp = Party.Get(m); if (from == m) { from.SendLocalizedMessage(1005439); // You cannot add yourself to a party. } else if (p != null && p.Leader != from) { from.SendLocalizedMessage(1005453); // You may only add members to the party if you are the leader. } else if (m.Party is Mobile) { return; } else if (p != null && (p.Members.Count + p.Candidates.Count) >= Party.Capacity) { from.SendLocalizedMessage(1008095); // You may only have 10 in your party (this includes candidates). } else if (m.NetState == null) { if (!m.Player && m.Body.IsHuman) { m.SayTo(from, 1005443); // Nay, I would rather stay here and watch a nail rust. } else { from.SendLocalizedMessage(1005444); // The creature ignores your offer. } } else if (mp != null && mp == p) { from.SendLocalizedMessage(1005440); // This person is already in your party! } else if (mp != null) { from.SendLocalizedMessage(1005441); // This person is already in a party! } else { Party.Invite(from, m); } } else { from.SendLocalizedMessage(1005442); // You may only add living things to your party! } }
protected override void OnTick() { m_From.EndAction(typeof(CookableFood)); if (m_From.Map != m_Map || (m_Point != null && m_From.GetDistanceToSqrt(m_Point) > 3)) { m_From.SendAsciiMessage("You burn the food to a crisp! It's ruined."); // You burn the food to a crisp! It's ruined. return; } if (m_From.CheckSkill(SkillName.Cooking, m_CookableFood.CookingLevel, 100)) { Food cookedFood = m_CookableFood.Cook(); if (Utility.RandomBool()) { m_From.SayTo(m_From, true, "Looks delicious."); } else { m_From.SayTo(m_From, true, "Mmmm, smells good."); } m_From.PlaySound(0x57); if (m_From.AddToBackpack(cookedFood)) { m_From.SendAsciiMessage("You put the cooked food into your backpack."); } else { cookedFood.MoveToWorld(m_From.Location, m_From.Map); m_From.SendAsciiMessage("You put the cooked food on the ground."); } } else { m_From.SendAsciiMessage("You burn the food to a crisp! It's ruined."); // You burn the food to a crisp! It's ruined. } }
public void AuraEffect(Mobile m) { if (m is PlayerMobile && Services.TownCryer.TownCryerSystem.UnderMysteriousPotionEffects((PlayerMobile)m, true)) { m.SayTo(m, 1158288, 1154); // *You resist Cora's attack!* } else { int mana = Utility.Random(1, m.Mana); m.Mana -= mana; m.SendLocalizedMessage(1153114, mana.ToString()); // Cora drains ~1_VAL~ points of your mana! } }
public bool TryTurnIn(Mobile from, TradeOrderCrate order, Mobile turninMobile) { if (order == null || from == null || turninMobile == null || order.Entry == null) { return(false); } TradeEntry entry = order.Entry; if (from.AccessLevel == AccessLevel.Player && turninMobile is TradeMinister minister && minister.City != entry.Destination) { turninMobile.SayTo(from, 1151738, string.Format("#{0}", CityLoyaltySystem.GetCityLocalization(entry.Destination))); // Begging thy pardon, but those goods are destined for the City of ~1_city~ }
public override void HandleButtonResponse(NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo) { PlayerMobile pm = sender.Mobile as PlayerMobile; var turnIns = PointsSystem.TreasuresOfTokuno.GetTurnIns(pm); if (pm == null || !pm.InRange(m_Collector.Location, 7) || !(turnIns >= TreasuresOfTokuno.ItemsPerReward)) { return; } bool pigments = (buttonInfo is PigmentsTileButtonInfo); Item item = null; if (pigments) { PigmentsTileButtonInfo p = buttonInfo as PigmentsTileButtonInfo; item = new PigmentsOfTokuno(p.Pigment); } else { TypeTileButtonInfo t = buttonInfo as TypeTileButtonInfo; if (t.Type == typeof(PigmentsOfTokuno)) //Special case of course. { pm.CloseGump(typeof(ToTTurnInGump)); //Sanity pm.CloseGump(typeof(ToTRedeemGump)); pm.SendGump(new ToTRedeemGump(m_Collector, true)); return; } try { item = (Item)Activator.CreateInstance(t.Type); } catch { } } if (item == null) { return; //Sanity } if (pm.AddToBackpack(item)) { PointsSystem.TreasuresOfTokuno.RemoveTurnIns(pm, TreasuresOfTokuno.ItemsPerReward); m_Collector.SayTo(pm, 1070984, (item.Name == null || item.Name.Length <= 0) ? string.Format("#{0}", item.LabelNumber) : item.Name); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack. } else { item.Delete(); m_Collector.SayTo(pm, 500722); // You don't have enough room in your backpack! m_Collector.SayTo(pm, 1070982); // When you wish to choose your reward, you have but to approach me again. } }
public override void OnDoubleClick( Mobile from ) { int xLong = 0, yLat = 0; int xMins = 0, yMins = 0; bool xEast = false, ySouth = false; if ( Sextant.Format( from.Location, from.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) ) { string location = String.Format( "{0}o {1}'{2}, {3}o {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" ); //from.LocalOverheadMessage( MessageType.Regular, from.SpeechHue, false, location ); from.SayTo(from, true, location); } }
public static bool CheckDoneOnce(PlayerMobile player, Type questType, Mobile quester, bool message) { if (player.DoneQuests.Any(x => x.QuestType == questType)) { if (message && quester != null) { quester.SayTo(player, 1075454, 0x3B2); // I can not offer you the quest again. } return(true); } return(false); }
protected override void OnTarget(Mobile from, object o) { if (o is Mobile) { Mobile m = (Mobile)o; Party p = Party.Get(from); Party mp = Party.Get(m); if (from == m) { from.SendMessage("Vous ne pouvez vous ajouter à votre propre groupe"); // You cannot add yourself to a party. } else if (p != null && p.Leader != from) { from.SendMessage("Vous devez être le meneur pour ajouter des membres à votre groupe"); // You may only add members to the party if you are the leader. } else if (m.Party is Mobile) { return; } else if (p != null && (p.Members.Count + p.Candidates.Count) >= Party.Capacity) { from.SendMessage("Un groupe ne comporte que 10 membres. Cela inclus ceux qui sont invités"); // You may only have 10 in your party (this includes candidates). } else if (!m.Player && m.Body.IsHuman) { m.SayTo(from, "Non, je préfère rester ici et regarder des clous rouiller"); // Nay, I would rather stay here and watch a nail rust. } else if (!m.Player) { from.SendMessage("Cette créature ignore votre offre"); // The creature ignores your offer. } else if (mp != null && mp == p) { from.SendMessage("Cette personne est déjà dans votre groupe!"); // This person is already in your party! } else if (mp != null) { from.SendMessage("Cette personne est déjà dans un groupe!"); // This person is already in a party! } else { Party.Invite(from, m); } } else { from.SendMessage("Vous ne pouvez ajouter que des créatures vivantes à votre groupe!"); // You may only add living things to your party! } }
public override void OnDoubleClick(Mobile from) { if (!from.InRange(GetWorldLocation(), 2)) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; return; } from.Target = new InternalTarget(this); }
public bool TryTurnIn(Mobile from, TradeOrderCrate order, Mobile turninMobile) { if (order == null || from == null || turninMobile == null || order.Entry == null) { return(false); } TradeEntry entry = order.Entry; TradeMinister minister = turninMobile as TradeMinister; if (from.AccessLevel == AccessLevel.Player && minister != null && minister.City != entry.Destination) { turninMobile.SayTo(from, 1151738, string.Format("#{0}", CityLoyaltySystem.GetCityLocalization(entry.Destination))); // Begging thy pardon, but those goods are destined for the City of ~1_city~ } else if (!order.Fulfilled) { turninMobile.SayTo(from, 1151732); // This trade order has not been fulfilled. Fill the trade order with all necessary items and try again. } else { CityLoyaltySystem.OnTradeComplete(from, order.Entry); CityTradeEntry pentry = GetPlayerEntry <CityTradeEntry>(from as PlayerMobile); if (pentry != null) { pentry.Points++; pentry.DistanceTraveled += entry.Distance; pentry.Completed++; CheckTitle(pentry); } order.Delete(); return(true); } return(false); }
public override void OnDoubleClick(Mobile from) { if (from.AccessLevel == AccessLevel.Player && (/*!from.InLOS( this ) || */ !from.InRange(GetWorldLocation(), 2))) { //from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; } else { Use(from); } }
public override void OnHit(Mobile attacker, Mobile defender) { base.OnHit(attacker, defender); if (!Core.AOS && Poison != null && PoisonCharges > 0 && !defender.Poisoned) { --PoisonCharges; if (this is WarFork && Utility.RandomDouble() < PoisonChance) { defender.SayTo(defender, true, "{0} has just poisoned you!", attacker.Name); defender.ApplyPoison(attacker, Poison); } } }
public override void OnDoubleClick(Mobile from) { if (from.AccessLevel > AccessLevel.Player || (from.InRange(this.GetWorldLocation(), 2) && from.InLOS(this)) || this.RootParent is PlayerVendor) { Open(from); } else { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; } }
public virtual bool Validate(Mobile from) { if (Parent == null) { from.SayTo(from, 1010095); // This must be on your person to use. return(false); } else if (Parent != from.Backpack) { from.SendMessage("You cannot mount it unless it is in your main backpack!"); return(false); } else if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null)) { } else if (!BaseMount.CheckMountAllowed(from, true)) { } else if (from.IsT2A) { from.SendMessage(61, "You cannot use this item in a T2A zone."); } else if (from.Mounted) { from.SendLocalizedMessage(1005583); // Please dismount first. } else if (from.IsBodyMod && !from.Body.IsHuman) { from.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (from.HasTrade) { from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time } else if ((from.Followers + FollowerSlots) > from.FollowersMax) { from.SendLocalizedMessage(1049679); // You have too many followers to summon your mount. } else if (!Multis.DesignContext.Check(from)) { } else { return(true); } return(false); }
public override bool OnMoveOver(Mobile m) { if ((m is PlayerMobile || (m is BaseCreature && !((BaseCreature)m).IsMonster)) && m.CanBeHarmful(Owner, false)) { if (m is PlayerMobile && Services.TownCryer.TownCryerSystem.UnderMysteriousPotionEffects((PlayerMobile)m, true)) { m.SayTo(m, 1158288, 1154); // *You resist Cora's attack!* } else { m.FixedParticles(0x3779, 10, 25, 5002, EffectLayer.Head); m.Mana = 0; } } return(true); }
public override bool OnMoveOver(Mobile m) { if ((m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).GetMaster() is PlayerMobile)) && m.CanBeHarmful(Owner, false)) { if (Services.TownCryer.TownCryerSystem.UnderMysteriousPotionEffects((PlayerMobile)m, true)) { m.SayTo(m, 1158288, 1154); // *You resist Cora's attack!* } else { m.SendLocalizedMessage(1153114, m.Mana.ToString()); // Cora drains ~1_VAL~ points of your mana! m.Mana = 0; } } return(true); }
public static bool CheckDoneOnce(PlayerMobile player, Type questType, Mobile quester, bool message) { for (var index = 0; index < player.DoneQuests.Count; index++) { var x = player.DoneQuests[index]; if (x.QuestType == questType) { if (message && quester != null) { quester.SayTo(player, 1075454, 0x3B2); // I can not offer you the quest again. } return(true); } } return(false); }
public override bool CheckItemUse(Mobile from, Item item) { if (!base.CheckItemUse(from, item)) { return(false); } if (item != this && from.AccessLevel < AccessLevel.GameMaster && m_Locked) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; return(false); } return(true); }
private static void BountyEntryResponse(NetState ns, PacketReader pvSrc) { Mobile from = ns.Mobile; if (from == null) { return; } Mobile killer = World.FindMobile((Serial)pvSrc.ReadInt32()); byte typeid = pvSrc.ReadByte(); byte index = pvSrc.ReadByte(); bool cancel = pvSrc.ReadByte() == 0; short responseLen = pvSrc.ReadInt16(); string resp = pvSrc.ReadString(); if (killer != null && !cancel) { int bounty = Utility.ToInt32(resp); if (bounty > 5000) { bounty = 5000; } bounty = from.BankBox.ConsumeUpTo(typeof(Gold), bounty, true); killer.Kills++; if (killer is PlayerMobile && bounty > 0) { PlayerMobile kpm = (PlayerMobile)killer; kpm.Bounty += bounty; killer.SendAsciiMessage("{0} has placed a bounty of {1}gp on your head!", from.Name, bounty); if (kpm.Bounty >= 5000 && kpm.Kills > 1 && kpm.BankBox.Items.Count > 0 && kpm.Karma <= (int)Noto.Dark) { killer.SayTo(killer, true, "A bounty hath been issued for thee, and thy worldly goods are hereby confiscated!"); kpm.Bounty += EmptyAndGetGold(killer.BankBox.Items); } } } SendNext(from); }
public override bool CheckItemUse( Mobile from, Item item ) { if ( !base.CheckItemUse( from, item ) ) return false; if ( item != this && from.AccessLevel < AccessLevel.GameMaster && m_Locked ) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; return false; } return true; }
public virtual bool Validate( Mobile from ) { if( Parent == null ) { from.SayTo( from, 1010095 ); // This must be on your person to use. return false; } else if( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) ) { // CheckIsUsableBy sends the message return false; } else if( !BaseMount.CheckMountAllowed( from, true ) ) { // CheckMountAllowed sends the message return false; } else if( from.Mounted ) { from.SendLocalizedMessage( 1005583 ); // Please dismount first. return false; } else if( from.IsBodyMod && !from.Body.IsHuman ) { from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed. return false; } else if( from.HasTrade ) { from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time return false; } else if( ( from.Followers + FollowerSlots ) > from.FollowersMax ) { from.SendLocalizedMessage( 1049679 ); // You have too many followers to summon your mount. return false; } else if( !Multis.DesignContext.Check( from ) ) { // Check sends the message return false; } return true; }
public virtual void Use( Mobile from ) { if ( m_Locked && !m_Open && UseLocks() ) { if ( from.AccessLevel >= AccessLevel.GameMaster ) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502502 ); // That is locked, but you open it with your godly powers. //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "That is locked, but you open it with your godly powers."); from.SpeechHue = OldHue; } else if ( Key.ContainsKey( from.Backpack, this.KeyValue ) ) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501282 ); // You quickly unlock, open, and relock the door int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "You quickly unlock, open, and relock the door."); from.SpeechHue = OldHue; } else if ( IsInside( from ) ) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501280 ); // That is locked, but is usable from the inside. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "That is locked, but is usable from the inside."); from.SpeechHue = OldHue; } else { if (Hue == 0x44E && Map == Map.Malas) // doom door into healer room in doom this.SendLocalizedMessageTo(from, 1060014); // Only the dead may pass. else { //from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502503); // That is locked. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "That is locked."); from.SpeechHue = OldHue; } return; } } if ( m_Open && !IsFreeToClose() ) return; if ( m_Open ) OnClosed( from ); else OnOpened( from ); if ( UseChainedFunctionality ) { bool open = !m_Open; List<BaseDoor> list = GetChain(); for ( int i = 0; i < list.Count; ++i ) list[i].Open = open; } else { Open = !m_Open; BaseDoor link = this.Link; if ( m_Open && link != null && !link.Open ) link.Open = true; } }
public override void OnDoubleClick( Mobile from ) { if (from.AccessLevel == AccessLevel.Player && (/*!from.InLOS( this ) || */!from.InRange(GetWorldLocation(), 2))) { //from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; } else Use(from); }
public virtual bool Validate( Mobile from ) { if( Parent == null ) { from.SayTo( from,1010095 ); // This must be on your person to use. return false; } else if (Parent != from.Backpack) { from.SendMessage("You cannot mount it unless it is in your main backpack!"); return false; } else if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null)) { } else if (!BaseMount.CheckMountAllowed(from, true)) { } else if (from.IsT2A) { from.SendMessage(61, "You cannot use this item in a T2A zone."); } else if (from.Mounted) from.SendLocalizedMessage(1005583); // Please dismount first. else if (from.IsBodyMod && !from.Body.IsHuman) from.SendLocalizedMessage(1061628); // You can't do that while polymorphed. else if (from.HasTrade) from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time else if ((from.Followers + FollowerSlots) > from.FollowersMax) from.SendLocalizedMessage(1049679); // You have too many followers to summon your mount. else if (!Multis.DesignContext.Check(from)) { } else return true; return false; }
public override void OnDoubleClick( Mobile from ) { if (from.AccessLevel > AccessLevel.Player || (from.InRange(this.GetWorldLocation(), 2) && from.InLOS(this)) || this.RootParent is PlayerVendor) Open(from); else { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; } }
protected override void OnTarget(Mobile from, object targeted) { from.RevealingAction(); if (targeted == from) from.SayTo(from, true, "You cannot entice yourself!"); //from.SendAsciiMessage("You cannot entice yourself!"); else if (!m_Instrument.IsChildOf(from.Backpack)) from.SendAsciiMessage("The instrument you are trying to play is no longer in your backpack!"); // The instrument you are trying to play is no longer in your backpack! else if (targeted is Mobile) { Mobile targ = targeted as Mobile; m_SetSkillTime = false; from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0); if (!BaseInstrument.CheckMusicianship(from)) { targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it."); targ.SayTo(from, true, "Your music fails to attract them."); //targ.LocalOverheadMessage(MessageType.Regular, targ.SpeechHue, true, String.Format("You hear lovely music, and for a moment are drawn towards it.")); //targ.NonlocalOverheadMessage(MessageType.Regular, targ.SpeechHue, true, String.Format("You hear lovely music, and for a moment are drawn towards it.")); m_Instrument.PlayInstrumentBadly(from); m_Instrument.ConsumeUse(from); } else if (!from.CheckSkill(SkillName.Discordance, 0.0, 100.0)) { targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it."); targ.SayTo(from, true, "Your music fails to attract them."); m_Instrument.PlayInstrumentBadly(from); m_Instrument.ConsumeUse(from); } else { m_Instrument.PlayInstrumentWell(from); m_Instrument.ConsumeUse(from); targ.SayTo(targ, true, "You hear lovely music, and are drawn towards it..."); from.SayTo(from, true, "You play your hypnotic music, luring them near."); if (targ is PlayerMobile) { targ.SayTo(from, true, "What am I hearing?"); targ.SayTo(from, true, "You might have better luck with sweet words."); } else if (targ is BaseVendor) { targ.SayTo(from, true, "What am I hearing?"); targ.SayTo(from, true, "Oh, but I cannot wander too far from my shop!"); } else if (targ is BaseCreature) { ((BaseCreature)targ).TargetLocation = new Point2D((IPoint2D)from.Location); } } } else from.SendAsciiMessage("You cannot entice that!"); }
protected override void OnTarget(Mobile from, object target) { from.RevealingAction(); if (target is Mobile) { Mobile targ = (Mobile)target; if (targ is BaseCreature && ((BaseCreature)targ).BardImmune) { from.SendAsciiMessage("You cannot entice that!"); } else if (targ == from) { from.SendAsciiMessage("You cannot entice yourself!"); } else { if (!BaseInstrument.CheckMusicianship(from)) { from.SayTo(from, 500612); // You play poorly, and there is no effect. m_Instrument.PlayInstrumentBadly(from); m_Instrument.ConsumeUse(from); } else if (from.CheckTargetSkill(SkillName.Discordance, target, 0, 100)) { m_Instrument.PlayInstrumentWell(from); m_Instrument.ConsumeUse(from); if (targ.Player) { targ.SayTo(targ, "You hear lovely music, and are drawn towards it..."); targ.SayTo(from, "You might have better luck with sweet words."); return; } if (targ.Body.IsHuman) targ.Say("What am I hearing?"); if (targ is BaseGuard || targ is BaseVendor || targ is WanderingHealer || targ is Banker || targ is TownCrier || targ is BaseShieldGuard) { targ.Say("Oh, but I cannot wander too far from my work!"); targ.SayTo(from, true, "They look too dedicated to their job to be lured away."); } else { from.SayTo(from, true, "You play your hypnotic music, luring them near."); if (targ is BaseCreature) ((BaseCreature)targ).TargetLocation = new Point2D(from.Location); } } else { targ.SayTo(targ, true, "You hear lovely music, and for a moment are drawn towards it..."); targ.SayTo(from, true, "Your music fails to attract them."); m_Instrument.PlayInstrumentBadly(from); m_Instrument.ConsumeUse(from); } } } else { m_Instrument.PlayInstrumentBadly(from); } }
public static void SAYTO(TriggerObject trigObject, Mobile from, Mobile to, object said) { if (from == null || to == null) { return; } if (said == null) { said = "null"; } from.SayTo(to, said.ToString()); }
/*public override bool IsAccessibleTo( Mobile m ) { if ( !BaseHouse.CheckAccessible( m, this ) ) return false; return base.IsAccessibleTo( m ); } public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems ) { if ( !BaseHouse.CheckHold( m, this, item, message, checkItems ) ) return false; return base.CheckHold( m, item, message, checkItems ); } public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list ) { base.GetContextMenuEntries( from, list ); SetSecureLevelEntry.AddTo( from, this, list ); }*/ public override void OnDoubleClick(Mobile from) { if ( !from.InLOS( GetWorldLocation() ) ) from.SayTo( from, true, "I cannot see that." ); else base.OnDoubleClick(from); }