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 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 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 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; } }
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 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); }
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 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 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; }
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!"); }