public override void Drink( Mobile from ) { if( from.InRange( GetWorldLocation(), 1) && from.InLOS( this ) ) from.Target = new ShrinkTarget( from, this, false ); else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. }
public override void OnDoubleClick( Mobile from ) { if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that } else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse ) { Point3D p = GetWorldLocation(); if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) ) { Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() ); from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" ); SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) ); } Effects.PlaySound( GetWorldLocation(), Map, 0x387 ); Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) ); Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) ); Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) ); m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 ); } }
public void OnTarget(Mobile from, object obj) { if (!from.InRange(GetWorldLocation(), 5) || !from.InLOS(this)) from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. else if (obj is Corpse) { Corpse c = obj as Corpse; if (c.Carved) return; if (c.Owner is PlayerMobile) { ((ICarvable)obj).Carve(from, this); c.PublicOverheadMessage(MessageType.Emote, 33, true, string.Format("*You see {0} steal the soul of {1}*", from.Name, c.Owner.Name)); from.PlaySound(0x19c); from.PlaySound(20); from.PlaySound(230); Effects.SendLocationEffect(c.Location, c.Map, 0x37c4, 18, 15, 1); } else ((ICarvable) obj).Carve(from, this); } else from.SendAsciiMessage("You cannot use this on that"); }
public override void OnDoubleClick( Mobile from ) { if (! from.InRange( this.GetWorldLocation(), 1 )) { from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that. } }
public override bool OnDragDrop( Mobile from, Item item ) { if ( item.LootType == LootType.Newbied || item.LootType == LootType.Blessed ) { from.LocalOverheadMessage(MessageType.Regular, 906, true, "You cannot trash blessed or newbied items"); return false; } if (!base.OnDragDrop(from, item)) return false; if (TotalItems >= 50) { Empty(501478); // The trash is full! Emptying! } else { /* from.LocalOverheadMessage(MessageType.Regular, 906, true, string.Format("The item will be deleted in 20 seconds")); if (m_Timer != null) m_Timer.Stop(); else m_Timer = new EmptyTimer(this); m_Timer.Start(); */ from.LocalOverheadMessage(MessageType.Regular, 906, true, "You trash the item"); item.Delete(); } return true; }
public override void OnDoubleClick( Mobile m ) { if ( !m.InRange( this, 2 ) ) { m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. return; } if ( RaisableItem != null && RaisableItem.Deleted ) RaisableItem = null; Flip(); if ( RaisableItem != null ) { if ( RaisableItem.IsRaisable ) { RaisableItem.Raise(); m.LocalOverheadMessage( MessageType.Regular, 0x5A, true, "You hear a grinding noise echoing in the distance." ); } else { m.LocalOverheadMessage( MessageType.Regular, 0x5A, true, "You flip the switch again, but nothing happens." ); } } }
public override void Drink( Mobile from ) { if ( from.Hits < from.HitsMax ) { if ( from.Poisoned || MortalStrike.IsWounded( from ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x22, 1005000 ); // You can not heal yourself in your current state. } else { if ( from.BeginAction( typeof( BaseHealPotion ) ) ) { DoHeal( from ); BasePotion.PlayDrinkEffect( from ); if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) ) this.Consume(); Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseHealLock ), from ); } else { from.LocalOverheadMessage( MessageType.Regular, 0x22, 500235 ); // You must wait 10 seconds before using another healing potion. } } } else { from.SendLocalizedMessage( 1049547 ); // You decide against drinking this potion, as you are already at full health. } }
protected override void OnTarget( Mobile from, object o ) { IEntity entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Owner)) { return; } IPoint3D loc = o as IPoint3D; if ( loc == null ) return; if ( m_Owner.CheckSequence() ) { SpellHelper.Turn( from, o ); if ( o is Mobile ) from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked. else if ( !( o is LockableContainer ) ) from.SendLocalizedMessage( 501666 ); // You can't unlock that! else { LockableContainer cont = (LockableContainer)o; if ( Multis.BaseHouse.CheckSecured( cont ) ) from.SendLocalizedMessage( 503098 ); // You cannot cast this on a secure item. else if ( !cont.Locked ) from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked. else if ( cont.LockLevel == 0 ) from.SendLocalizedMessage( 501666 ); // You can't unlock that! else { Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 ); Effects.PlaySound( loc, from.Map, 0x1FF ); int level = (int)(from.Skills[SkillName.Magery].Value * 0.55) - 4; // Note from Alan: I see why somebody changed this from below, so you can't magic unlock a GM tinker chest // but it is also preventing you from picking that lock which is pretty silly //int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4; // <-- this is RunUO default if (cont.LockLevel == -255) // it is magic locked so always succeed at unlocking { cont.Locked = false; cont.LockLevel = cont.RequiredSkill - 10; } else if ( level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2) ) // this is basically a magery skill vs lock level check { cont.Locked = false; } else from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 ); // My spell does not seem to have an effect on that lock. } } m_Owner.FinishSequence(); } }
}// hitching rope public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1071159); // Select the hitching post you want to supply hitching rope. from.Target = new InternalTarget(this); } else { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } }
protected override void OnTarget( Mobile from, object o ) { IPoint3D loc = o as IPoint3D; if( loc == null ) return; if( m_Owner.CheckSequence() ) { SpellHelper.Turn( from, o ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 ); Effects.PlaySound( loc, from.Map, 0x1FF ); if( o is Mobile ) from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked. else if( !(o is LockableContainer) ) from.SendLocalizedMessage( 501666 ); // You can't unlock that! else { LockableContainer cont = (LockableContainer)o; if( Multis.BaseHouse.CheckSecured( cont ) ) from.SendLocalizedMessage( 503098 ); // You cannot cast this on a secure item. else if( !cont.Locked ) from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked. else if( cont.LockLevel == 0 ) from.SendLocalizedMessage( 501666 ); // You can't unlock that! else { int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4; level += (int)(from.Skills[SkillName.EvalInt].Value * 0.2); if( level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2) ) { cont.Locked = false; if( cont.LockLevel == -255 ) cont.LockLevel = cont.RequiredSkill - 10; } else { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 ); // My spell does not seem to have an effect on that lock. } } } } m_Owner.FinishSequence(); }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Thorn.Deleted ) return; if ( !m_Thorn.IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it. return; } if ( !from.CanBeginAction( typeof( GreenThorns ) ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061908 ); // * You must wait a while before planting another thorn. * return; } if ( from.Map != Map.Trammel && from.Map != Map.Felucca ) { from.LocalOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet. Try again in Trammel or Felucca." ); return; } LandTarget land = targeted as LandTarget; if ( land == null ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061912 ); // * You cannot plant a green thorn there! * } else { GreenThornsEffect effect = GreenThornsEffect.Create( from, land ); if ( effect == null ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061913 ); // * You sense it would be useless to plant a green thorn there. * } else { m_Thorn.Consume(); from.LocalOverheadMessage( MessageType.Emote, 0x961, 1061914 ); // * You push the strange green thorn into the ground * from.NonlocalOverheadMessage( MessageType.Emote, 0x961, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. * from.BeginAction( typeof( GreenThorns ) ); new GreenThorns.EndActionTimer( from ).Start(); effect.Start(); } } }
public override void OnHit( Mobile attacker, Mobile defender, int damage ) { if ( !Validate( attacker ) || !CheckMana( attacker, true ) ) return; ClearCurrentAbility( attacker ); // Necromancers under Lich or Wraith Form are immune to Bleed Attacks. TransformContext context = TransformationSpell.GetContext( defender ); if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) || (defender is BaseCreature && ((BaseCreature)defender).BleedImmune) ) { attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack! return; } attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding! defender.SendLocalizedMessage( 1060160 ); // You are bleeding! if ( defender is PlayerMobile ) { defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely } defender.PlaySound( 0x133 ); defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist ); BeginBleed( defender, attacker ); }
public override bool OnMoveOver( Mobile m ) { if( m.SolidHueOverride != -1 ) return true; else if( m.Player && !m.Alive ) // mobile is dead { m.SolidHueOverride = -1; if( m_TargetMap != null && m_TargetMap != Map.Internal ) { m.MoveToWorld( m_Target, m_TargetMap ); BaseCreature.TeleportPets( m, m_Target, m_TargetMap ); } else m.SendAsciiMessage( "This has not yet been activated" ); m.Combatant = null; m.Warmode = false; m.Resurrect(); return false; } else if( ( m.Player ) && ( m.Hits < m.HitsMax ) ) m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" ); else if( m.Player && m.SolidHueOverride != 2544 ) { m_CasinoTimer = new CasinoTimer(this, m); m_CasinoTimer.Start(); m.SolidHueOverride = 2544; m.SendAsciiMessage( "You are about to enter the Casino!" ); } return true; }
public override void OnDoubleClick( Mobile from ) { if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this)) Roll(from); else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. }
public override void OnDoubleClick( Mobile from ) { if ( Utility.InRange( Location, from.Location, 2 ) ) Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x55F, 0x561 ) ); else from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it. } else if ( !from.CanBeginAction( typeof( Bola ) ) ) { from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola! } else if ( from.Target is BolaTarget ) { from.SendLocalizedMessage( 1049631 ); // This bola is already being used. } else if ( !HasFreeHands( from ) ) { from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this } else if ( from.Mounted ) { from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount } else if ( Server.Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) ) { from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form! } else { EtherealMount.StopMounting( from ); from.Target = new BolaTarget( this ); from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola... } }
public override void OnComponentUsed(AddonComponent c, Mobile from) { if (from.InRange(c.Location, 2)) { if (this.m_Fruits > 0) { Item fruit = this.Fruit; if (fruit == null) return; if (!from.PlaceInBackpack(fruit)) { fruit.Delete(); from.SendLocalizedMessage(501015); // There is no room in your backpack for the fruit. } else { if (--this.m_Fruits == 0) Timer.DelayCall(TimeSpan.FromMinutes(30), new TimerCallback(Respawn)); from.SendLocalizedMessage(501016); // You pick some fruit and put it in your backpack. } } else from.SendLocalizedMessage(501017); // There is no more fruit on this tree } else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. }
public override void OnDoubleClick( Mobile from ) { if ( !from.InRange( this.GetWorldLocation(), 3 )) from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. else from.SendAsciiMessage( "This looks like part of a larger contraption." ); }
public override bool OnEquip(Mobile from) { from.LocalOverheadMessage(MessageType.Regular, 906, true, "You feel a dark soul protecting you!"); from.PlaySound(0x246); return base.OnEquip(from); }
public override bool OnMoveOver( Mobile m ) { if( m.SolidHueOverride != -1 ) return true; if( m.Player && !m.Alive ) // mobile is dead { m.SolidHueOverride = -1; if( m_TargetMap != null && m_TargetMap != Map.Internal ) { m.MoveToWorld( m_Target, m_TargetMap ); BaseCreature.TeleportPets( m, m_Target, m_TargetMap ); } else m.SendAsciiMessage( "This has not yet been activated" ); m.Combatant = null; m.Warmode = false; m.Resurrect(); return false; } if( ( m.Player ) && ( m.Hits < m.HitsMax ) ) m.LocalOverheadMessage( MessageType.Regular, 906, true, "You do not have full HP." ); else if( m.Player && m.SolidHueOverride != 2535 ) { new RuneTimer( this, m ).Start(); m.SolidHueOverride = 2535; } return true; }
public override void OnHit( Mobile attacker, Mobile defender, int damage ) { if( !Validate(attacker) || !CheckStam(attacker, true) ) return; ClearCurrentAbility(attacker); if( (defender is BaseCreature && ((BaseCreature)defender).BleedImmune) ) { attacker.SendLocalizedMessage(1062052); // Your target is not affected by the bleed attack! return; } attacker.SendLocalizedMessage(1060159); // Your target is bleeding! defender.SendLocalizedMessage(1060160); // You are bleeding! if( defender is PlayerMobile ) { defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757); // You are bleeding profusely defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely } defender.PlaySound(0x133); defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist); BeginBleed(defender, attacker); }
public override void OnDoubleClick(Mobile from) { if (!this.VerifyMove(from)) return; if (!from.InRange(this.GetWorldLocation(), 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } Point3D fireLocation = this.GetFireLocation(from); if (fireLocation == Point3D.Zero) { from.SendLocalizedMessage(501695); // There is not a spot nearby to place your campfire. } else if (!from.CheckSkill(SkillName.Camping, 0.0, 100.0)) { from.SendLocalizedMessage(501696); // You fail to ignite the campfire. } else { this.Consume(); if (!this.Deleted && this.Parent == null) from.PlaceInBackpack(this); new Campfire().MoveToWorld(fireLocation, from.Map); } }
public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 1)) this.UseGate(from); else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that }
protected override void OnTarget(Mobile from, object targeted) { if (from == targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500324); // You know yourself quite well enough already. } else if (targeted is TownCrier) { ((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500322, from.NetState); // This person looks fine to me, though he may have some news... } else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable) { ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326, from.NetState); // That can not be inspected. } else if (targeted is Mobile) { Mobile targ = (Mobile)targeted; int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4)); int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError); int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError); int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError); int strMod = str / 10; int dexMod = dex / 10; int stmMod = stm / 10; if (strMod < 0) strMod = 0; else if (strMod > 10) strMod = 10; if (dexMod < 0) dexMod = 0; else if (dexMod > 10) dexMod = 10; if (stmMod > 10) stmMod = 10; else if (stmMod < 0) stmMod = 0; if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100)) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState); // That looks [strong] and [dexterous]. if (from.Skills[SkillName.Anatomy].Base >= 65.0) targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance. } else { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042666, from.NetState); // You can not quite get a sense of their physical characteristics. } } else if (targeted is Item) { ((Item)targeted).SendLocalizedMessageTo(from, 500323, ""); // Only living things have anatomies! } }
public override void OnDoubleClick(Mobile from) { if (!from.InRange(this.GetWorldLocation(), 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } else { bool isHomeOwner = IsHomeOwner(from); //Console.WriteLine("OnDoubleClick"); // set owner if not already set -- this is only done the first time. if (m_Owner == null && isHomeOwner) { m_Owner = from; //this.Name = m_Owner.Name.ToString() + "'s Personal Ankh"; this.Name = m_Owner.Name.ToString() + "'s Shrine"; from.SendMessage("Ownership of this ankh has been bestowed upon you."); } else { if (m_Owner != from) { from.SendMessage("This is not your's to use."); return; } else if (!isHomeOwner) { from.SendMessage("This is not your home!"); } } } }
public void Throw( Mobile from ) { BaseKnife knife = from.Weapon as BaseKnife; if ( knife == null ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife... return; } from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 ); from.MovingEffect( this, knife.ItemID, 7, 1, false, false ); from.PlaySound( 0x238 ); double rand = Utility.RandomDouble(); int message; if ( rand < 0.05 ) message = 500752; // BULLSEYE! 50 Points! else if ( rand < 0.20 ) message = 500753; // Just missed the center! 20 points. else if ( rand < 0.45 ) message = 500754; // 10 point shot. else if ( rand < 0.70 ) message = 500755; // 5 pointer. else if ( rand < 0.85 ) message = 500756; // 1 point. Bad throw. else message = 500757; // Missed. PublicOverheadMessage( MessageType.Regular, 0x3B2, message ); }
private bool CheckUse( Mobile from ) { if ( !IsAccessibleTo( from ) ) return false; if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS(this) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. return false; } if ( !from.CanBeginAction( typeof( FireHorn ) ) ) { from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath. return false; } int sulfAsh = Core.AOS ? 4 : 15; if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh ) { from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash. return false; } return true; }
public override void OnDoubleClick( Mobile from ) { Direction dir; if ( from.Location != this.Location ) dir = from.GetDirectionTo( this ); else if ( this.East ) dir = Direction.West; else dir = Direction.North; from.Direction = dir; bool canThrow = true; if ( !from.InRange( this, 4 ) || !from.InLOS( this ) ) canThrow = false; else if ( this.East ) canThrow = ( dir == Direction.Left || dir == Direction.West || dir == Direction.Up ); else canThrow = ( dir == Direction.Up || dir == Direction.North || dir == Direction.Right ); if ( canThrow ) Throw( from ); else from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. }
}// Wall Torch public override void OnDoubleClick(Mobile from) { if (from.InRange(this.Location, 2)) { switch ( this.ItemID ) { case 0x3D98: this.ItemID = 0x3D9B; break; case 0x3D9B: this.ItemID = 0x3D98; break; case 0x3D94: this.ItemID = 0x3D97; break; case 0x3D97: this.ItemID = 0x3D94; break; } Effects.PlaySound(this.Location, this.Map, 0x3BE); } else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. }
protected override void OnTarget(Mobile from, object o) { if (o is Container) { Container xx = o as Container; //make sure they aren't targeting same container if (xx == FromCont) { from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "The container to dump INTO must be different from the one you are dumping FROM."); return; } if (xx == FromCont || xx.IsChildOf(FromCont)) { from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "You cannot sort INTO a subcontainer of the same container you are sorting FROM."); return; } Item[] items = FromCont.FindItemsByType(typeof(Item), true); foreach (Item item in items) { if (!(xx.TryDropItem(from, item, true))) from.SendMessage("That container is too full!"); } } else { from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "That is not a container!"); } }
public virtual bool ExecuteTrap(Mobile from) { if (m_TrapType != TrapType.None) { Point3D loc = this.GetWorldLocation(); Map facet = this.Map; if (from.AccessLevel >= AccessLevel.GameMaster) { SendMessageTo(from, "That is trapped, but you open it with your godly powers.", 0x3B2); return(false); } switch (m_TrapType) { case TrapType.ExplosionTrap: { SendMessageTo(from, 502999, 0x3B2); // You set off a trap! if (from.InRange(loc, 3)) { int damage; if (m_TrapLevel > 0) { damage = Utility.RandomMinMax(10, 30) * m_TrapLevel; } else { damage = m_TrapPower; } AOS.Damage(from, damage, 0, 100, 0, 0, 0); // Your skin blisters from the heat! from.LocalOverheadMessage(Network.MessageType.Regular, 0x2A, 503000); } Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10); Effects.PlaySound(loc, facet, 0x307); break; } case TrapType.MagicTrap: { if (from.InRange(loc, 1)) { from.Damage(m_TrapPower); } //AOS.Damage( from, m_TrapPower, 0, 100, 0, 0, 0 ); Effects.PlaySound(loc, Map, 0x307); Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), Map, 0x36BD, 15); break; } case TrapType.DartTrap: { SendMessageTo(from, 502999, 0x3B2); // You set off a trap! if (from.InRange(loc, 3)) { int damage; if (m_TrapLevel > 0) { damage = Utility.RandomMinMax(5, 15) * m_TrapLevel; } else { damage = m_TrapPower; } AOS.Damage(from, damage, 100, 0, 0, 0, 0); // A dart imbeds itself in your flesh! from.LocalOverheadMessage(Network.MessageType.Regular, 0x62, 502998); } Effects.PlaySound(loc, facet, 0x223); break; } case TrapType.PoisonTrap: { SendMessageTo(from, 502999, 0x3B2); // You set off a trap! if (from.InRange(loc, 3)) { Poison poison; if (m_TrapLevel > 0) { poison = Poison.GetPoison(Math.Max(0, Math.Min(4, m_TrapLevel - 1))); } else { AOS.Damage(from, m_TrapPower, 0, 0, 0, 100, 0); poison = Poison.Greater; } from.ApplyPoison(from, poison); // You are enveloped in a noxious green cloud! from.LocalOverheadMessage(Network.MessageType.Regular, 0x44, 503004); } Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20); Effects.PlaySound(loc, facet, 0x231); break; } } m_TrapType = TrapType.None; m_TrapPower = 0; m_TrapLevel = 0; return(true); } return(false); }
protected virtual bool CheckUse(Mobile from) { DateTime now = DateTime.UtcNow; PlayerMobile pm = from as PlayerMobile; if (Deleted || !IsAccessibleTo(from)) { return(false); } else if (from.Map != Map || !from.InRange(GetWorldLocation(), 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return(false); } else if (Account != null && (!(from.Account is Account) || from.Account.Username != Account)) { from.SendLocalizedMessage(1070714); // This is an Account Bound Soulstone, and your character is not bound to it. You cannot use this Soulstone. return(false); } else if (CheckCombat(from, TimeSpan.FromMinutes(2.0))) { from.SendLocalizedMessage(1070727); // You must wait two minutes after engaging in combat before you can use a Soulstone. return(false); } else if (from.Criminal) { from.SendLocalizedMessage(1070728); // You must wait two minutes after committing a criminal act before you can use a Soulstone. return(false); } else if (from.Region.GetLogoutDelay(from) > TimeSpan.Zero) { from.SendLocalizedMessage(1070729); // In order to use your Soulstone, you must be in a safe log-out location. return(false); } else if (!from.Alive) { from.SendLocalizedMessage(1070730); // You may not use a Soulstone while your character is dead. return(false); } else if (Factions.Sigil.ExistsOn(from)) { from.SendLocalizedMessage(1070731); // You may not use a Soulstone while your character has a faction town sigil. return(false); } else if (from.Spell != null && from.Spell.IsCasting) { from.SendLocalizedMessage(1070733); // You may not use a Soulstone while your character is casting a spell. return(false); } else if (from.Poisoned) { from.SendLocalizedMessage(1070734); // You may not use a Soulstone while your character is poisoned. return(false); } else if (from.Paralyzed) { from.SendLocalizedMessage(1070735); // You may not use a Soulstone while your character is paralyzed. return(false); } #region Scroll of Alacrity if (pm.AcceleratedStart > DateTime.UtcNow) { from.SendLocalizedMessage(1078115); // You may not use a soulstone while your character is under the effects of a Scroll of Alacrity. return(false); } #endregion else { return(true); } }
public void DoubleClick(Mobile from) { Mobile m_Player = from as PlayerMobile; if (m_Player.CantWalk && !m_Sleeping) { m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You are already sleeping somewhere!"); } else { if (!m_Sleeping) { BaseHouse m_house = BaseHouse.FindHouseAt(from); BaseHouse this_house = BaseHouse.FindHouseAt(this); if (m_house != null && (m_house != this_house)) { from.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You cannot sleep in someone elses bed! Get a bed of your own."); return; } if (m_house != null && (m_house.IsOwner(from) || m_house.IsCoOwner(from) || m_house.IsFriend(from))) { wtry = 0; m_Owner = m_Player; m_Player.Hidden = true; m_Player.CantWalk = true; m_Sleeping = true; m_SleeperBedBody = new SleeperBedBody(m_Player, false, false); Point3D m_Location = new Point3D(this.Location.X + 1, this.Location.Y, this.Location.Z + 6); m_SleeperBedBody.Direction = Direction.East; m_SleeperBedBody.MoveToWorld(m_Location, this.Map); } else { from.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You must be in the house and be the owner, co-owner or friend of the house this bed is in to sleep in it."); return; } } else { if (m_Owner == m_Player) { m_Sleeping = false; m_Player.Hidden = false; m_Player.CantWalk = false; if (m_SleeperBedBody != null) { m_SleeperBedBody.Delete(); } m_SleeperBedBody = null; switch (Utility.RandomMinMax(1, 3)) { case 1: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You wake up and feel rested and strong."); break; case 2: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You spring out of bed, ready for another day!"); break; case 3: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You fall out of bed and blearily reach for the coffee pot."); break; } } else { switch (wtry) { case 0: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "Shhh, don't wake them up. They really need their beauty rest!"); wtry = wtry + 1; break; case 1: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You really should NOT bother someone that is sleeping. Bad things might happen."); wtry = wtry + 1; break; case 2: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You were warned!! Now leave them alone."); m_Player.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.Head); m_Player.PlaySound(0x208); m_Player.Hits = m_Player.Hits - 40; break; } } } } }
public override void OnResponse(NetState sender, RelayInfo info) { int page = m_Page; Mobile from = m_From; BaseHouse house = m_House; BasePlayerBB board = m_Board; if (house == null || !house.IsLockedDown(board)) { from.SendLocalizedMessage(1062396); // This bulletin board must be locked down in a house to be usable. return; } else if (!from.InRange(board.GetWorldLocation(), 2) || !from.InLOS(board)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } else if (!BasePlayerBB.CheckAccess(house, from)) { from.SendLocalizedMessage(1062398); // You are not allowed to post to this bulletin board. return; } switch (info.ButtonID) { case 1: // Post message { from.Prompt = new BasePlayerBB.PostPrompt(page, house, board, false); from.SendLocalizedMessage(1062397); // Please enter your message: break; } case 2: // Set title { if (house.IsOwner(from)) { from.Prompt = new BasePlayerBB.SetTitlePrompt(page, house, board); from.SendLocalizedMessage(1062402); // Enter new title: } break; } case 3: // Post greeting { if (house.IsOwner(from)) { from.Prompt = new BasePlayerBB.PostPrompt(page, house, board, true); from.SendLocalizedMessage(1062404); // Enter new greeting (this will always be the first post): } break; } case 4: // Scroll up { if (page == 0) { page = board.Messages.Count; } else { page -= 1; } from.SendGump(new PlayerBBGump(from, house, board, page)); break; } case 5: // Scroll down { page += 1; page %= board.Messages.Count + 1; from.SendGump(new PlayerBBGump(from, house, board, page)); break; } case 6: // Banish poster { if (house.IsOwner(from)) { if (page >= 1 && page <= board.Messages.Count) { PlayerBBMessage message = (PlayerBBMessage)board.Messages[page - 1]; Mobile poster = message.Poster; if (poster == null) { from.SendGump(new PlayerBBGump(from, house, board, page)); return; } if (poster.AccessLevel > AccessLevel.Player && from.AccessLevel <= poster.AccessLevel) { from.SendLocalizedMessage(501354); // Uh oh...a bigger boot may be required. } else if (house.IsFriend(poster)) { from.SendLocalizedMessage(1060750); // That person is a friend, co-owner, or owner of this house, and therefore cannot be banished! } else if (poster is PlayerVendor) { from.SendLocalizedMessage(501351); // You cannot eject a vendor. } else if (house.Bans.Count >= BaseHouse.MaxBans) { from.SendLocalizedMessage(501355); // The ban limit for this house has been reached! } else if (house.IsBanned(poster)) { from.SendLocalizedMessage(501356); // This person is already banned! } else if (poster is BaseCreature && ((BaseCreature)poster).NoHouseRestrictions) { from.SendLocalizedMessage(1062040); // You cannot ban that. } else { if (!house.Bans.Contains(poster)) { house.Bans.Add(poster); } from.SendLocalizedMessage(1062417); // That person has been banned from this house. if (house.IsInside(poster) && !BasePlayerBB.CheckAccess(house, poster)) { poster.MoveToWorld(house.BanLocation, house.Map); } } } from.SendGump(new PlayerBBGump(from, house, board, page)); } break; } case 7: // Delete message { if (house.IsOwner(from)) { if (page >= 1 && page <= board.Messages.Count) { board.Messages.RemoveAt(page - 1); } from.SendGump(new PlayerBBGump(from, house, board, 0)); } break; } case 8: // Post props { if (from.AccessLevel >= AccessLevel.GameMaster) { PlayerBBMessage message = board.Greeting; if (page >= 1 && page <= board.Messages.Count) { message = (PlayerBBMessage)board.Messages[page - 1]; } from.SendGump(new PlayerBBGump(from, house, board, page)); from.SendGump(new PropertiesGump(from, message)); } break; } } }
protected override void OnTarget(Mobile from, object targeted) { int OldHue = 0; if (from == targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You know yourself quite well enough already."); // You know yourself quite well enough already. } else if (targeted is TownCrier) { ((TownCrier)targeted).SayTo(from, true, "This person looks fine to me, though he may have some news..."); //((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500322, from.NetState ); // This person looks fine to me, though he may have some news... } else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable) { OldHue = ((BaseVendor)targeted).SpeechHue; ((BaseVendor)targeted).SpeechHue = 0; ((BaseVendor)targeted).SayTo(from, true, "That can not be inspected."); //((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500326, from.NetState ); // That can not be inspected. ((BaseVendor)targeted).SpeechHue = OldHue; } else if (targeted is Mobile) { Mobile targ = (Mobile)targeted; OldHue = targ.SpeechHue; targ.SpeechHue = 0; int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4)); int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError); int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError); int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError); int strMod = str / 10; int dexMod = dex / 10; int stmMod = stm / 10; if (strMod < 0) { strMod = 0; } else if (strMod > 10) { strMod = 10; } if (dexMod < 0) { dexMod = 0; } else if (dexMod > 10) { dexMod = 10; } if (stmMod > 10) { stmMod = 10; } else if (stmMod < 0) { stmMod = 0; } if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100)) { switch (strMod) { case 0: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and very agile."); break; case 6: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and superhumanly agile."); break; } break; case 1: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks rather feeble and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks rather feeble and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks rather feeble and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks rather feeble and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks rather feeble and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks rather feeble and very agile."); break; case 6: targ.SayTo(from, true, "That looks rather feeble and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks rather feeble and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks rather feeble and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks rather feeble and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks rather feeble and superhumanly agile."); break; } break; case 2: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks somewhat weak and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks somewhat weak and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks somewhat weak and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks somewhat weak and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks somewhat weak and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks somewhat weak and very agile."); break; case 6: targ.SayTo(from, true, "That looks somewhat weak and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks somewhat weak and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks somewhat weak and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks somewhat weak and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks somewhat weak and superhumanly agile."); break; } break; case 3: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks to be of normal strength and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks to be of normal strength and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks to be of normal strength and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks to be of normal strength and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks to be of normal strength and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks to be of normal strength and very agile."); break; case 6: targ.SayTo(from, true, "That looks to be of normal strength and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks to be of normal strength and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks to be of normal strength and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks to be of normal strength and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks to be of normal strength and superhumanly agile."); break; } break; case 4: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks somewhat strong and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks somewhat strong and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks somewhat strong and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks somewhat strong and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks somewhat strong and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks somewhat strong and very agile."); break; case 6: targ.SayTo(from, true, "That looks somewhat strong and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks somewhat strong and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks somewhat strong and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks somewhat strong and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks somewhat strong and superhumanly agile."); break; } break; case 5: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks very strong and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks very strong and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks very strong and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks very strong and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks very strong and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks very strong and very agile."); break; case 6: targ.SayTo(from, true, "That looks very strong and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks very strong and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks very strong and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks very strong and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks very strong and superhumanly agile."); break; } break; case 6: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks extremely strong and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks extremely strong and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks extremely strong and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks extremely strong and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks extremely strong and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks extremely strong and very agile."); break; case 6: targ.SayTo(from, true, "That looks extremely strong and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks extremely strong and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks extremely strong and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks extremely strong and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks extremely strong and superhumanly agile."); break; } break; case 7: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks extraordinarily strong and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks extraordinarily strong and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks extraordinarily strong and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks extraordinarily strong and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks extraordinarily strong and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks extraordinarily strong and very agile."); break; case 6: targ.SayTo(from, true, "That looks extraordinarily strong and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks extraordinarily strong and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks extraordinarily strong and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks extraordinarily strong and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks extraordinarily strong and superhumanly agile."); break; } break; case 8: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks strong as an ox and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks strong as an ox and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks strong as an ox and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks strong as an ox and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks strong as an ox and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks strong as an ox and very agile."); break; case 6: targ.SayTo(from, true, "That looks strong as an ox and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks strong as an ox and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks strong as an ox and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks strong as an ox and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks strong as an ox and superhumanly agile."); break; } break; case 9: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and like they barely manage to stay standing."); break; case 1: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and very clumsy."); break; case 2: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and somewhat uncoordinated."); break; case 3: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and moderately dexterous."); break; case 4: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and somewhat agile."); break; case 5: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and very agile."); break; case 6: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and extremely agile."); break; case 7: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and extraordinarily agile."); break; case 8: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and moves like quicksilver."); break; case 9: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and faster than anything you have ever seen."); break; case 10: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and superhumanly agile."); break; } break; case 10: switch (dexMod) { case 0: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 1: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 2: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 3: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 4: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 5: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 6: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 7: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 8: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 9: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; case 10: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break; } break; } //targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState ); // That looks [strong] and [dexterous]. if (from.Skills[SkillName.Anatomy].Base >= 65.0) { switch (stmMod) { case 0: targ.SayTo(from, true, "This being is at zero percent endurance."); break; case 1: targ.SayTo(from, true, "This being is at ten percent endurance."); break; case 2: targ.SayTo(from, true, "This being is at twenty percent endurance."); break; case 3: targ.SayTo(from, true, "This being is at thirty percent endurance."); break; case 4: targ.SayTo(from, true, "This being is at forty percent endurance."); break; case 5: targ.SayTo(from, true, "This being is at fifty percent endurance."); break; case 6: targ.SayTo(from, true, "This being is at sixty percent endurance."); break; case 7: targ.SayTo(from, true, "This being is at seventy percent endurance."); break; case 8: targ.SayTo(from, true, "This being is at eighty percent endurance."); break; case 9: targ.SayTo(from, true, "This being is at ninety percent endurance."); break; case 10: targ.SayTo(from, true, "This being is at one-hundred percent endurance."); break; } //targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance. targ.SpeechHue = OldHue; } } else { OldHue = targ.SpeechHue; targ.SpeechHue = 0; targ.SayTo(from, true, "You can not quite get a sense of their physical characteristics."); targ.SpeechHue = OldHue; //targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042666, from.NetState ); // You can not quite get a sense of their physical characteristics. } } else if (targeted is Item) { from.Send(new AsciiMessage(((Item)targeted).Serial, ((Item)targeted).ItemID, MessageType.Regular, 0, 3, "", "Only living things have anatomies!")); //((Item)targeted).SendLocalizedMessageTo( from, 500323, "" ); // Only living things have anatomies! } }
public static TimeSpan OnUse(Mobile m) { if (m.Spell != null) { m.SendLocalizedMessage(501238); // You are busy doing something else and cannot hide. return(TimeSpan.FromSeconds(1.0)); } if (Server.Engines.VvV.ManaSpike.UnderEffects(m)) { return(TimeSpan.FromSeconds(1.0)); } if (m.Target != null) { Targeting.Target.Cancel(m); } double bonus = 0.0; BaseHouse house = BaseHouse.FindHouseAt(m); if (house != null && house.IsFriend(m)) { bonus = 100.0; } //int range = 18 - (int)(m.Skills[SkillName.Hiding].Value / 10); int skill = Math.Min(100, (int)m.Skills[SkillName.Hiding].Value); int range = Math.Min((100 - skill) / 2 + 8, 18); //Cap of 18 not OSI-exact, intentional difference bool badCombat = (!m_CombatOverride && m.Combatant is Mobile && m.InRange(m.Combatant.Location, range) && ((Mobile)m.Combatant).InLOS(m.Combatant)); bool ok = (!badCombat /*&& m.CheckSkill( SkillName.Hiding, 0.0 - bonus, 100.0 - bonus )*/); if (ok) { if (!m_CombatOverride) { IPooledEnumerable eable = m.GetMobilesInRange(range); foreach (Mobile check in eable) { if (check.InLOS(m) && check.Combatant == m) { badCombat = true; ok = false; break; } } eable.Free(); } ok = (!badCombat && m.CheckSkill(SkillName.Hiding, 0.0 - bonus, 100.0 - bonus)); } if (badCombat) { m.RevealingAction(); m.LocalOverheadMessage(MessageType.Regular, 0x22, 501237); // You can't seem to hide right now. return(TimeSpan.Zero); } else { if (ok) { m.Hidden = true; m.Warmode = false; Server.Spells.Sixth.InvisibilitySpell.RemoveTimer(m); Server.Items.InvisibilityPotion.RemoveTimer(m); m.LocalOverheadMessage(MessageType.Regular, 0x1F4, 501240); // You have hidden yourself well. } else { m.RevealingAction(); m.LocalOverheadMessage(MessageType.Regular, 0x22, 501241); // You can't seem to hide here. } return(TimeSpan.FromSeconds(10.0)); } }
public override void OnComponentUsed(AddonComponent c, Mobile from) { BaseHouse house = BaseHouse.FindHouseAt(this); /* * Unique problems have unique solutions. OSI does not have a problem with 1000s of mining carts * due to the fact that they have only a miniscule fraction of the number of 10 year vets that a * typical RunUO shard will have (RunUO's scaled down account aging system makes this a unique problem), * and the "freeness" of free accounts. We also dont have mitigating factors like inactive (unpaid) * accounts not gaining veteran time. * * The lack of high end vets and vet rewards on OSI has made testing the *exact* ranging/stacking * behavior of these things all but impossible, so either way its just an estimation. * * If youd like your shard's carts/stumps to work the way they did before, simply replace the check * below with this line of code: * * if (!from.InRange(GetWorldLocation(), 2) * * However, I am sure these checks are more accurate to OSI than the former version was. * */ if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this) || !((from.Z - Z) > -3 && (from.Z - Z) < 3)) { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } else if (house != null && house.HasSecureAccess(from, SecureLevel.Friends)) { if (m_Logs > 0) { Item logs = null; switch (Utility.Random(7)) { case 0: logs = new Log(); break; case 1: logs = new AshLog(); break; case 2: logs = new OakLog(); break; case 3: logs = new YewLog(); break; case 4: logs = new HeartwoodLog(); break; case 5: logs = new BloodwoodLog(); break; case 6: logs = new FrostwoodLog(); break; } int amount = Math.Min(10, m_Logs); logs.Amount = amount; if (!from.PlaceInBackpack(logs)) { logs.Delete(); from.SendLocalizedMessage(1078837); // Your backpack is full! Please make room and try again. } else { m_Logs -= amount; PublicOverheadMessage(MessageType.Regular, 0, 1094719, m_Logs.ToString()); // Logs: ~1_COUNT~ } } else { from.SendLocalizedMessage(1094720); // There are no more logs available. } } else { from.SendLocalizedMessage(1061637); // You are not allowed to access this. } }
public override void OnResponse(NetState sender, RelayInfo info) { if (m_Chest.Deleted || info.ButtonID == 0 || !m_From.CheckAlive()) { return; } if (m_From.IsPlayer() && (m_From.Map != m_Chest.Map || !m_From.InRange(m_Chest.GetWorldLocation(), 2))) { m_From.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500446); // That is too far away. return; } if (info.ButtonID == 1) { m_Chest.SubmitSolution(m_From, m_Solution); } else { if (info.Switches.Length == 0) { return; } int pedestal = info.Switches[0]; if (pedestal < 0 || pedestal >= m_Solution.Cylinders.Length) { return; } PuzzleChestCylinder cylinder; switch (info.ButtonID) { case 10: cylinder = PuzzleChestCylinder.LightBlue; break; case 11: cylinder = PuzzleChestCylinder.Blue; break; case 12: cylinder = PuzzleChestCylinder.Green; break; case 13: cylinder = PuzzleChestCylinder.Orange; break; case 14: cylinder = PuzzleChestCylinder.Purple; break; case 15: cylinder = PuzzleChestCylinder.Red; break; case 16: cylinder = PuzzleChestCylinder.DarkBlue; break; case 17: cylinder = PuzzleChestCylinder.Yellow; break; default: return; } m_Solution.Cylinders[pedestal] = cylinder; m_From.SendGump(new PuzzleGump(m_From, m_Chest, m_Solution, pedestal)); } }
public static bool OnHarvest(Mobile m, Item tool) { if (!(m is PlayerMobile) || m.Map != Map.TerMur) { return(false); } PlayerMobile pm = m as PlayerMobile; if ((pm.ToggleMiningStone || pm.ToggleStoneOnly) && VolcanoMineBounds.Contains(m.Location)) { object locked = tool; if (!m.BeginAction(locked)) { return(false); } m.Animate(AnimationType.Attack, 3); Timer.DelayCall(Mining.System.OreAndStone.EffectSoundDelay, () => { m.PlaySound(Utility.RandomList(Mining.System.OreAndStone.EffectSounds)); }); Timer.DelayCall(Mining.System.OreAndStone.EffectDelay, () => { TheGreatVolcanoQuest quest = QuestHelper.GetQuest(pm, typeof(TheGreatVolcanoQuest)) as TheGreatVolcanoQuest; if (quest != null && !quest.Completed && 0.05 > Utility.RandomDouble()) { if (m.CheckSkill(SkillName.Mining, 90, 100)) { double chance = Utility.RandomDouble(); if (0.08 > chance) { BaseCreature spawn = new VolcanoElemental(); Point3D p = m.Location; for (int i = 0; i < 10; i++) { int x = Utility.RandomMinMax(p.X - 1, p.X + 1); int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1); int z = Map.TerMur.GetAverageZ(x, y); if (Map.TerMur.CanSpawnMobile(x, y, z)) { p = new Point3D(x, y, z); break; } } spawn.OnBeforeSpawn(p, Map.TerMur); spawn.MoveToWorld(p, Map.TerMur); spawn.OnAfterSpawn(); spawn.Combatant = m; m.SendLocalizedMessage(1156508); // Uh oh...that doesn't look like a lava rock! } else if (0.55 > chance) { m.PrivateOverheadMessage(MessageType.Regular, 1154, 1156507, m.NetState); // *You uncover a lava rock and carefully store it for later!* quest.Update(m); } else { m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509); // You loosen some dirt but fail to find anything. } } else { m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509); // You loosen some dirt but fail to find anything. } } else { m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509); // You loosen some dirt but fail to find anything. } if (tool is IUsesRemaining) { ((IUsesRemaining)tool).UsesRemaining--; if (((IUsesRemaining)tool).UsesRemaining <= 0) { m.SendLocalizedMessage(1044038); // You have worn out your tool! tool.Delete(); } } m.EndAction(locked); }); return(true); } return(false); }
protected override void OnTargetOutOfRange(Mobile from, object targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502825); // That location is too far away }
/// <summary> /// Executes the trap of this container, if any. /// </summary> /// <param name="from">The mobile who triggered the trap.</param> public virtual void ExecuteTrap(Mobile from) { Point3D loc = this.GetWorldLocation(); Map facet = this.Map; switch (m_TrapType) { case TrapType.ExplosionTrap: { if (from.InRange(loc, 3)) { int damage; if (m_TrapLevel > 0) { damage = Utility.RandomMinMax(10, 30) * m_TrapLevel; } else { damage = m_TrapPower; } AOS.Damage(from, damage, 0, 100, 0, 0, 0); // Your skin blisters from the heat! from.LocalOverheadMessage(Network.MessageType.Regular, 0x2A, 503000); } Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10); Effects.PlaySound(loc, facet, 0x307); break; } case TrapType.MagicTrap: { if (from.InRange(loc, 1)) { from.Damage(m_TrapPower); } Effects.PlaySound(loc, Map, 0x307); Effects.SendLocationEffect(new Point3D(loc.X - 1, loc.Y, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X, loc.Y - 1, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X, loc.Y + 1, loc.Z), Map, 0x36BD, 15); Effects.SendLocationEffect(new Point3D(loc.X + 1, loc.Y + 1, loc.Z + 11), Map, 0x36BD, 15); break; } case TrapType.DartTrap: { if (from.InRange(loc, 3)) { int damage; if (m_TrapLevel > 0) { damage = Utility.RandomMinMax(5, 15) * m_TrapLevel; } else { damage = m_TrapPower; } AOS.Damage(from, damage, 100, 0, 0, 0, 0); // A dart imbeds itself in your flesh! from.LocalOverheadMessage(Network.MessageType.Regular, 0x62, 502998); } Effects.PlaySound(loc, facet, 0x223); break; } case TrapType.PoisonTrap: { if (from.InRange(loc, 3)) { Poison poison; if (m_TrapLevel > 0) { poison = Poison.GetPoison(Math.Max(0, Math.Min(4, m_TrapLevel - 1))); } else { AOS.Damage(from, m_TrapPower, 0, 0, 0, 100, 0); poison = Poison.Greater; } from.ApplyPoison(from, poison); } Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20); Effects.PlaySound(loc, facet, 0x231); break; } } }
public override void OnDoubleClick(Mobile from) { from.LocalOverheadMessage(MessageType.Regular, 0x47E, 1157341); // *You cut a slice from the cake.* from.AddToBackpack(new WeddingCakeSlice()); }
protected override void OnTarget(Mobile from, object targeted) { PlayerMobile player = from as PlayerMobile; if (player == null) { return; } if (from == targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500324); // You know yourself quite well enough already. } else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable) { ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326, from.NetState); // That can not be inspected. } else if (targeted is Mobile) { Mobile targ = (Mobile)targeted; int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4)); int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError); int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError); int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError); int strMod = str / 10; int dexMod = dex / 10; int stmMod = stm / 10; if (strMod < 0) { strMod = 0; } else if (strMod > 10) { strMod = 10; } if (dexMod < 0) { dexMod = 0; } else if (dexMod > 10) { dexMod = 10; } if (stmMod > 10) { stmMod = 10; } else if (stmMod < 0) { stmMod = 0; } bool gumpSuccess = false; BaseCreature bc_Creature = targ as BaseCreature; if (bc_Creature != null) { if (bc_Creature.IsHenchman) { gumpSuccess = true; } } from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.AnatomyCooldown * 1000); if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100, 1.0)) { if (!gumpSuccess) { if (bc_Creature != null) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState); // That looks [strong] and [dexterous]. if (from.Skills[SkillName.Anatomy].Base >= 65.0) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance. } } } } else if (!gumpSuccess) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042666, from.NetState); // You can not quite get a sense of their physical characteristics. } if (gumpSuccess) { from.SendGump(new AnimalLoreGump(player, bc_Creature, AnimalLoreGump.AnimalLoreGumpPage.Stats, new List <AnimalLoreGump.TraitSelectionType>())); from.SendSound(0x055); } } else if (targeted is Item) { ((Item)targeted).SendLocalizedMessageTo(from, 500323, ""); // Only living things have anatomies! } }
public void DoubleClick(Mobile from) { Mobile m_Player = from as PlayerMobile; if (!m_Player.CanSee(this) || !m_Player.InLOS(this)) { m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You are too far from the bed!"); return; } if (m_Player.CantWalk && !m_Sleeping) { m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You are already sleeping somewhere!"); } else { if (!m_Sleeping) { BaseHouse m_house = BaseHouse.FindHouseAt(from); BaseHouse this_house = BaseHouse.FindHouseAt(this); if (m_house != null && (m_house != this_house)) { from.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You cannot sleep in someone elses bed! Get a bed of your own."); return; } if (m_house != null && (m_house.IsOwner(from) || m_house.IsCoOwner(from) || m_house.IsFriend(from))) { m_Owner = m_Player; m_Player.Hidden = true; m_Player.Squelched = true; m_Player.Frozen = true; m_wakeup = 0; m_Player.CantWalk = true; m_Sleeping = true; m_Player.Blessed = true; m_SleepingBodies = new SleepingBodies(m_Player, false, false); #region Sleeping Body Position Point3D m_Location = new Point3D(this.Location.X + 2, this.Location.Y, this.Location.Z + 10); #endregion m_SleepingBodies.Direction = Direction.East; m_SleepingBodies.MoveToWorld(m_Location, this.Map); } else { from.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You must be the owner, co-owner or friend of this house this bed is in to sleep in it."); return; } } else { if (m_Owner == m_Player) { m_Player.Hidden = false; m_Player.Squelched = false; m_Player.Frozen = false; m_wakeup = 0; m_Player.CantWalk = false; m_Sleeping = false; m_Player.Blessed = false; if (m_SleepingBodies != null) { m_SleepingBodies.Delete(); } m_SleepingBodies = null; switch (Utility.RandomMinMax(1, 3)) { case 1: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You wake up and feel strong and well rested."); break; case 2: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You spring out of bed, ready for another day!"); break; case 3: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You fall out of bed and crack your knee on the wooden bedframe!"); m_Player.Hits = m_Player.Hits - 25; break; } } else { switch (m_wakeup) { case 0: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "Shhh, don't wake them up. They really need their beauty rest!"); m_wakeup = m_wakeup + 1; break; case 1: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You really should NOT bother someone that is sleeping. Bad things might happen."); m_wakeup = m_wakeup + 1; break; case 2: m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You were warned!! Now leave them alone."); m_Player.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.Head); m_Player.PlaySound(0x208); m_Player.Hits = m_Player.Hits - 40; break; } } } } }
public void OnTarget(Mobile from, object obj) { // TODO: Need details on how oil cloths should get consumed here if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (obj is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)obj; if (weapon.RootParent != from) { from.SendLocalizedMessage(1005425); // You may only wipe down items you are holding or carrying. } else if (weapon.Poison == null || weapon.PoisonCharges <= 0) { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1005422); // Hmmmm... this does not need to be cleaned. } else { if (weapon.PoisonCharges < 2) { weapon.PoisonCharges = 0; } else { weapon.PoisonCharges -= 2; } if (weapon.PoisonCharges > 0) { from.SendLocalizedMessage(1005423); // You have removed some of the caustic substance, but not all. } else { from.SendLocalizedMessage(1010497); // You have cleaned the item. } } } else if (obj == from && obj is PlayerMobile) { PlayerMobile pm = (PlayerMobile)obj; if (pm.BodyMod == 183 || pm.BodyMod == 184) { pm.SavagePaintExpiration = TimeSpan.Zero; pm.BodyMod = 0; pm.HueMod = -1; from.SendLocalizedMessage(1040006); // You wipe away all of your body paint. Consume(); } else { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1005422); // Hmmmm... this does not need to be cleaned. } } else if (obj is BaseBeverage) { BaseBeverage beverage = (BaseBeverage)obj; if (beverage.Content == BeverageType.Liquor) { Firebomb bomb = new Firebomb(beverage.ItemID); bomb.Name = beverage.Name; Point3D loc = beverage.Location; beverage.Delete(); from.AddToBackpack(bomb); bomb.Location = loc; from.SendLocalizedMessage(1060580); // You prepare a firebomb. Consume(); } } else if (obj is Firebomb) { from.SendLocalizedMessage(1060579); // That is already a firebomb! } else { from.SendLocalizedMessage(1005426); // The cloth will not work on that. } }
public override void OnDoubleClick(Mobile from) { if (!from.InRange(this.GetWorldLocation(), 4)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } else { switch (Utility.Random(22)) { default: case 0: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new FoolGump()); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Fool'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 50.")); break; } case 1: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new MageGump()); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Mage'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 500.")); break; } case 2: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new HPGump()); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The High Priestess'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 350.")); break; } case 3: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Empress'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Bet 250.")); break; } case 4: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Emperor'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Bet 500 gp.")); break; } case 5: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Hierophant'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Bet 50 gp.")); break; } case 6: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); if (m_IsNoisy) { from.PlaySound(from.Female ? 811 : 1085); //Ooo } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Lovers'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("You will split the winning pot, unless you pull Death.")); break; } case 7: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); if (m_IsNoisy) { from.PlaySound(from.Female ? 796 : 1068); //disgusted noise } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'Temperance'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} must now put up half the amount of the current pot!", from.Name)); break; } case 8: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new JusticeGump()); if (m_IsNoisy) { from.PlaySound(from.Female ? 816 : 1090); //sigh... } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'Justice'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Skip your next turn.")); break; } case 9: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Hermit'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Bet 10 Gp.")); break; } case 10: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new WoFGump()); if (m_IsNoisy) { from.PlaySound(from.Female ? 778 : 1049); //ah! } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Wheel of Fortune'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} may now take one-tenth of the pot!", from.Name)); break; } case 11: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); if (m_IsNoisy) { from.PlaySound(from.Female ? 794 : 1066); //giggle } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'Strength'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("All players BUT {0} must bet 300.", from.Name)); break; } case 12: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Chariot'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Put in double the amount of the last bet!")); break; } case 13: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new DeathGump()); if (m_IsNoisy) { from.PlaySound(Utility.Random(from.Female ? 0x314 : 0x423, from.Female ? 4 : 5)); //death sounds } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'Death'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("You lose! Leave the game now!")); break; } case 14: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new HangedmanGump()); if (m_IsNoisy) { from.PlaySound(from.Female ? 793 : 1065); //gasp! } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'Hanged Man'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0}'s bet must match the amount of the current pot!", from.Name)); break; } case 15: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Devil'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 500.")); break; } case 16: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new TowerGump()); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Tower'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("The player across from {0} must bet 250.", from.Name)); break; } case 17: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new StarGump()); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Star'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 200.")); break; } case 18: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Moon'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 150.")); break; } case 19: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Sun'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 250.")); break; } case 20: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); if (m_IsNoisy) { from.PlaySound(from.Female ? 783 : 1054); // Woo-hoo! } this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The Judgement'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} wins the game and takes the pot!", from.Name)); break; } case 21: { from.CloseGump(typeof(DeathGump)); from.CloseGump(typeof(FoolGump)); from.CloseGump(typeof(HangedmanGump)); from.CloseGump(typeof(HPGump)); from.CloseGump(typeof(JusticeGump)); from.CloseGump(typeof(MageGump)); from.CloseGump(typeof(StarGump)); from.CloseGump(typeof(TowerGump)); from.CloseGump(typeof(WoFGump)); from.CloseGump(typeof(WorldGump)); from.SendGump(new WorldGump()); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("{0} pulls 'The World'", from.Name)); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Everyone bets 1000.")); break; } } } }
public void Fire(Mobile from) { BaseRanged bow = from.Weapon as BaseRanged; if (bow == null) { SendLocalizedMessageTo(from, 500593); // You must practice with ranged weapons on this. return; } if (DateTime.UtcNow < (m_LastUse + UseDelay)) { return; } Point3D worldLoc = GetWorldLocation(); if (FacingEast ? from.X <= worldLoc.X : from.Y <= worldLoc.Y) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500596); // You would do better to stand in front of the archery butte. return; } if (FacingEast ? from.Y != worldLoc.Y : from.X != worldLoc.X) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500597); // You aren't properly lined up with the archery butte to get an accurate shot. return; } if (!from.InRange(worldLoc, 6)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500598); // You are too far away from the archery butte to get an accurate shot. return; } else if (from.InRange(worldLoc, 4)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500599); // You are too close to the target. return; } Container pack = from.Backpack; Type ammoType = bow.AmmoType; bool isArrow = (ammoType == typeof(Arrow)); bool isBolt = (ammoType == typeof(Bolt)); bool isKnown = (isArrow || isBolt); if (pack == null || !pack.ConsumeTotal(ammoType, 1)) { if (isArrow) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500594); // You do not have any arrows with which to practice. } else if (isBolt) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500595); // You do not have any crossbow bolts with which to practice. } else { SendLocalizedMessageTo(from, 500593); // You must practice with ranged weapons on this. } return; } m_LastUse = DateTime.UtcNow; from.Direction = from.GetDirectionTo(GetWorldLocation()); bow.PlaySwingAnimation(from); from.MovingEffect(this, bow.EffectID, 18, 1, false, false); ScoreEntry se = GetEntryFor(from); if (!from.CheckSkill(bow.Skill, m_MinSkill, m_MaxSkill)) { from.PlaySound(bow.MissSound); PublicOverheadMessage(MessageType.Regular, 0x3B2, 500604, from.Name); // You miss the target altogether. se.Record(0); if (se.Count == 1) { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1062719, se.Total.ToString()); } else { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1042683, String.Format("{0}\t{1}", se.Total, se.Count)); } return; } Effects.PlaySound(Location, Map, 0x2B1); double rand = Utility.RandomDouble(); int area, score, splitScore; if (0.10 > rand) { area = 0; // bullseye score = 50; splitScore = 100; } else if (0.25 > rand) { area = 1; // inner ring score = 10; splitScore = 20; } else if (0.50 > rand) { area = 2; // middle ring score = 5; splitScore = 15; } else { area = 3; // outer ring score = 2; splitScore = 5; } bool split = (isKnown && ((m_Arrows + m_Bolts) * 0.02) > Utility.RandomDouble()); if (split) { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1010027 + area, String.Format("{0}\t{1}", from.Name, isArrow ? "arrow" : "bolt")); } else { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1010035 + area, from.Name); if (isArrow) { ++m_Arrows; } else if (isBolt) { ++m_Bolts; } } se.Record(split ? splitScore : score); if (se.Count == 1) { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1062719, se.Total.ToString()); } else { PublicOverheadMessage(MessageType.Regular, 0x3B2, 1042683, String.Format("{0}\t{1}", se.Total, se.Count)); } }
protected override void OnTarget(Mobile from, object targeted) { if (from == targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500324); // You know yourself quite well enough already. } else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable) { ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326, from.NetState); // That can not be inspected. } else if (targeted is Mobile) { Mobile targ = (Mobile)targeted; int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4)); int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError); int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError); int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError); int strMod = str / 10; int dexMod = dex / 10; int stmMod = stm / 10; if (strMod < 0) { strMod = 0; } else if (strMod > 10) { strMod = 10; } if (dexMod < 0) { dexMod = 0; } else if (dexMod > 10) { dexMod = 10; } if (stmMod > 10) { stmMod = 10; } else if (stmMod < 0) { stmMod = 0; } if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100)) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState); // That looks [strong] and [dexterous]. if (from.Skills[SkillName.Anatomy].Base >= 65.0) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance. } } else { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042666, from.NetState); // You can not quite get a sense of their physical characteristics. } } else if (targeted is Item) { ((Item)targeted).SendLocalizedMessageTo(from, 500323, ""); // Only living things have anatomies! } }
public static TimeSpan OnUse(Mobile m) { if (m.Spell != null) { m.SendLocalizedMessage(501238); // You are busy doing something else and cannot hide. return(TimeSpan.FromSeconds(1.0)); } if (Core.ML && m.Target != null) { Target.Cancel(m); } var bonus = 0.0; var house = BaseHouse.FindHouseAt(m); if (house?.IsFriend(m) == true) { bonus = 100.0; } else if (!Core.AOS) { house ??= BaseHouse.FindHouseAt(new Point3D(m.X - 1, m.Y, 127), m.Map, 16) ?? BaseHouse.FindHouseAt(new Point3D(m.X + 1, m.Y, 127), m.Map, 16) ?? BaseHouse.FindHouseAt(new Point3D(m.X, m.Y - 1, 127), m.Map, 16) ?? BaseHouse.FindHouseAt(new Point3D(m.X, m.Y + 1, 127), m.Map, 16); if (house != null) { bonus = 50.0; } } // int range = 18 - (int)(m.Skills.Hiding.Value / 10); var range = Math.Min( (int)((100 - m.Skills.Hiding.Value) / 2) + 8, 18 ); // Cap of 18 not OSI-exact, intentional difference var badCombat = !CombatOverride && m.Combatant != null && m.InRange(m.Combatant.Location, range) && m.Combatant.InLOS(m); var ok = !badCombat; if (ok) { if (!CombatOverride) { var eable = m.GetMobilesInRange(range); foreach (var check in eable) { if (check.InLOS(m) && check.Combatant == m) { badCombat = true; break; } } eable.Free(); } ok = !badCombat && m.CheckSkill(SkillName.Hiding, 0.0 - bonus, 100.0 - bonus); } if (badCombat) { m.RevealingAction(); m.LocalOverheadMessage(MessageType.Regular, 0x22, 501237); // You can't seem to hide right now. return(TimeSpan.FromSeconds(1.0)); } if (ok) { m.Hidden = true; m.Warmode = false; m.LocalOverheadMessage(MessageType.Regular, 0x1F4, 501240); // You have hidden yourself well. } else { m.RevealingAction(); m.LocalOverheadMessage(MessageType.Regular, 0x22, 501241); // You can't seem to hide here. } return(TimeSpan.FromSeconds(10.0)); }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; int m_Offer; switch (info.ButtonID) { case 0: { // You have decided to tithe no gold to the shrine. from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1060193); break; } case 1: { if (from.TithingPoints >= MaxTithing) { from.SendLocalizedMessage(1060840); // You have reached the maximum amount of Tithing Points available. break; } int totalGold = Banker.GetBalance(from); if (totalGold <= 0) { // You have decided to tithe no gold to the shrine. from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1060193); break; } m_Offer = MaxTithing - from.TithingPoints; if (m_Offer > totalGold) { m_Offer = totalGold; } from.SendGump(new TithingGump(from, m_Offer)); break; } case 2: { if (from.TithingPoints >= MaxTithing) { from.SendLocalizedMessage(1060840); // You have reached the maximum amount of Tithing Points available. break; } int totalGold = Banker.GetBalance(from); if (totalGold <= 0) { // You have decided to tithe no gold to the shrine. from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1060193); break; } TextRelay tr = info.GetTextEntry(1); if (tr != null) { string text = tr.Text; int num = Utility.ToInt32(text); if (num > 0) { if (num > totalGold) { m_Offer = totalGold; } else { m_Offer = num; } if ((from.TithingPoints + m_Offer) > MaxTithing) { m_Offer = MaxTithing - from.TithingPoints; } Container pack = from.Backpack; if (Banker.Withdraw(from, m_Offer, true)) { // You tithe gold to the shrine as a sign of devotion. from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1060195); from.TithingPoints += m_Offer; from.PlaySound(0x243); from.PlaySound(0x2E6); } else { // You do not have enough gold to tithe that amount! from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1060194); } } else { from.SendLocalizedMessage(1159140); // You have entered an invalid entry. You must enter a number between 1 and 100,000. } } break; } } }
protected override void OnTarget(Mobile from, object targeted) { EventSink.InvokeSkillUsed(new SkillUsedEventArgs(from, from.Skills[SkillName.EvalInt])); if (from == targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500910); // Hmm, that person looks really silly. } else if (targeted is TownCrier) { ((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500907, from.NetState); // He looks smart enough to remember the news. Ask him about it. } else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable) { ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500909, from.NetState); // That person could probably calculate the cost of what you buy from them. } else if (targeted is Mobile) { Mobile targ = (Mobile)targeted; int marginOfError = Math.Max(0, 20 - (int)(from.Skills[SkillName.EvalInt].Value / 5)); int intel = targ.Int + Utility.RandomMinMax(-marginOfError, +marginOfError); int mana = ((targ.Mana * 100) / Math.Max(targ.ManaMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError); int intMod = intel / 10; int mnMod = mana / 10; if (intMod > 10) { intMod = 10; } else if (intMod < 0) { intMod = 0; } if (mnMod > 10) { mnMod = 10; } else if (mnMod < 0) { mnMod = 0; } int body; if (targ.Body.IsHuman) { body = targ.Female ? 11 : 0; } else { body = 22; } if (from.CheckTargetSkill(SkillName.EvalInt, targ, 0.0, 120.0)) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038169 + intMod + body, from.NetState); // He/She/It looks [slighly less intelligent than a rock.] [Of Average intellect] [etc...] if (from.Skills[SkillName.EvalInt].Base >= 76.0) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038202 + mnMod, from.NetState); // That being is at [10,20,...] percent mental strength. } } else { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038166 + (body / 11), from.NetState); // You cannot judge his/her/its mental abilities. } } else if (targeted is Item) { ((Item)targeted).SendLocalizedMessageTo(from, 500908, ""); // It looks smarter than a rock, but dumber than a piece of wood. } }
public override void OnLocationChanged(Mobile m, Point3D oldLocation) { base.OnLocationChanged(m, oldLocation); if (m.IsPlayer) { if (m_Maze.HasTrap(m.Location)) { switch (Utility.Random(5)) { default: case 0: { AOS.Damage(m, Utility.RandomMinMax(70, 90), 0, 100, 0, 0, 0); Effects.SendPacket(m.Location, m.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x3709, m.Location, m.Location, 10, 30, true, false)); Effects.PlaySound(m.Location, m.Map, 0x54); m.LocalOverheadMessage(MessageType.Regular, 238, 1010524, ""); // Searing heat scorches thy skin. break; } case 1: { AOS.Damage(m, Utility.RandomMinMax(60, 80), 0, 0, 100, 0, 0); Effects.PlaySound(m.Location, m.Map, 0x223); m.LocalOverheadMessage(MessageType.Regular, 98, 1010525, ""); // Pain lances through thee from a sharp metal blade. break; } case 2: { AOS.Damage(m, Utility.RandomMinMax(55, 75), 0, 0, 0, 0, 100); Effects.SendPacket(m.Location, m.Map, new GraphicalEffect(EffectType.Lightning, m.Serial, Serial.Zero, 0, m.Location, m.Location, 0, 0, false, false)); Effects.SendPacket(m.Location, m.Map, new ParticleEffect(EffectType.FixedFrom, m.Serial, Serial.Zero, 0, m.Location, m.Location, 0, 0, false, false, 0, 0, 0x13A7, 0, 0, m.Serial, (int)Layer.Shoes, 0)); Effects.PlaySound(m.Location, m.Map, 0x29); m.LocalOverheadMessage(MessageType.Regular, 218, 1010526, ""); // Lightning arcs through thy body. break; } case 3: { m.ApplyPoison(m, Poison.Deadly); Effects.SendPacket(m.Location, m.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x113A, m.Location, m.Location, 10, 20, true, false)); Effects.PlaySound(m.Location, m.Map, 0x231); m.LocalOverheadMessage(MessageType.Regular, 68, 1010523, ""); // A toxic vapor envelops thee. break; } case 4: { Point3D location1 = m.Location; location1.Z = 49; Point3D location2 = m.Location; location2.Z = -1; Effects.SendPacket(m, m.Map, new HuedEffect(EffectType.Moving, Serial.Zero, m.Serial, 0x11B7, location1, location2, 20, 0, true, true, 0, 0)); Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, m.Female ? 0x14B : 0x154); Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, 0x307); m.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "A speeding rock hits you in the head!")); AOS.Damage(m, Utility.RandomMinMax(60, 80), 100, 0, 0, 0, 0); m.SendLocalizedMessage(502382); // You can move! if (Utility.RandomBool()) { Effects.SendPacket(m, m.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, new Point3D(m.X, m.Y, 0), new Point3D(m.X, m.Y, 0), 20, 10, true, false)); Effects.SendPacket(m, m.Map, new GraphicalEffect(EffectType.FixedFrom, m.Serial, Serial.Zero, 0x36BD, new Point3D(m.X, m.Y, -1), new Point3D(m.X, m.Y, -1), 20, 10, true, false)); for (int k = 0; k < 5; k++) { Effects.SendPacket(m, m.Map, new GraphicalEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x1363 + Utility.Random(0, 11), new Point3D(m.X, m.Y, 0), new Point3D(m.X, m.Y, 0), 5, 0, false, false)); Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, 0x13F); Effects.PlaySound(new Point3D(m.X, m.Y, -1), m.Map, 0x154); } AOS.Damage(m, Utility.RandomMinMax(40, 60), 100, 0, 0, 0, 0); m.Say("OUCH!"); m.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "You are pinned down by the weight of the boulder!!!")); } break; } } } else if (m.Backpack.FindItemByType <GoldenCompass>(false) != null) { m.CloseGump(typeof(CompassGump)); m.SendGump(new CompassGump(m_Maze.GetCompassDirection(m.Location))); } } }
protected override void OnTarget(Mobile from, object targeted) { IEntity entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.Anatomy, from.Skills[SkillName.Anatomy].Value)) { return; } if (from == targeted) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500324); // You know yourself quite well enough already. } else if (targeted is TownCrier) { ((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500322, from.NetState); // This person looks fine to me, though he may have some news... } else if (targeted is BaseVendor /*&& ((BaseVendor)targeted).IsInvulnerable*/) { ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326, from.NetState); // That can not be inspected. } else if (targeted is BaseGuard) { ((BaseGuard)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "That person looks strong enough to find criminals and apprehend them.", from.NetState); } else if (targeted is Mobile) { Mobile targ = (Mobile)targeted; if (targ.AccessLevel > AccessLevel.Player) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "That entity is clearly beyond mortal understanding.", from.NetState); } else { int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 1)); // 4 int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError); int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError); int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError); int strMod = str / 10; int dexMod = dex / 10; int stmMod = stm / 10; if (strMod < 0) { strMod = 0; } else if (strMod > 10) { strMod = 10; } if (dexMod < 0) { dexMod = 0; } else if (dexMod > 10) { dexMod = 10; } if (stmMod > 10) { stmMod = 10; } else if (stmMod < 0) { stmMod = 0; } if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100)) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState); // That looks [strong] and [dexterous]. if (from.Skills[SkillName.Anatomy].Base >= 65.0) { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance. } } else { targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042666, from.NetState); // You can not quite get a sense of their physical characteristics. } } } else if (targeted is Item) { ((Item)targeted).SendLocalizedMessageTo(from, 500323, ""); // Only living things have anatomies! } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant) { return; } if (info.ButtonID == 3 && !from.InRange(m_Plant.GetWorldLocation(), 3)) { from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 500446); // That is too far away. return; } if (!m_Plant.IsUsableBy(from)) { m_Plant.LabelTo(from, 1061856); // You must have the item in your backpack or locked down in order to use it. return; } switch (info.ButtonID) { case 1: // Cancel { from.SendGump(new MainPlantGump(m_Plant)); break; } case 2: // Help { from.Send(new DisplayHelpTopic(71, true)); // EMPTYING THE BOWL from.SendGump(new EmptyTheBowlGump(m_Plant)); break; } case 3: // Ok { PlantBowl bowl = new PlantBowl(); if (!from.PlaceInBackpack(bowl)) { bowl.Delete(); m_Plant.LabelTo(from, 1053047); // You cannot empty a bowl with a full pack! from.SendGump(new MainPlantGump(m_Plant)); break; } if (m_Plant.PlantStatus != PlantStatus.BowlOfDirt && m_Plant.PlantStatus < PlantStatus.Plant) { Seed seed = new Seed(m_Plant.PlantType, m_Plant.PlantHue, m_Plant.ShowType); if (!from.PlaceInBackpack(seed)) { bowl.Delete(); seed.Delete(); m_Plant.LabelTo(from, 1053047); // You cannot empty a bowl with a full pack! from.SendGump(new MainPlantGump(m_Plant)); break; } } m_Plant.Delete(); break; } } }
public virtual void Use(Mobile from) { if (this.m_Locked && !this.m_Open && this.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. } else if (Key.ContainsKey(from.Backpack, this.KeyValue)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501282); // You quickly unlock, open, and relock the door } else if (this.IsInside(from)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501280); // That is locked, but is usable from the inside. } else { if (this.Hue == 0x44E && this.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. } return; } } if (this.m_Open && !this.IsFreeToClose()) { return; } if (this.m_Open) { this.OnClosed(from); } else { this.OnOpened(from); } if (this.UseChainedFunctionality) { bool open = !this.m_Open; List <BaseDoor> list = this.GetChain(); for (int i = 0; i < list.Count; ++i) { list[i].Open = open; } } else { this.Open = !this.m_Open; BaseDoor link = this.Link; if (this.m_Open && link != null && !link.Open) { link.Open = true; } } }
public override void OnDoubleClick(Mobile from) { if (!from.InRange(GetWorldLocation(), 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } Point2D[] banks; PMList moongates; /*Zycron * if ( from.Map == Map.Trammel ) * { * banks = m_TrammelBanks; * moongates = PMList.Trammel; * } * Zycron*/ if (from.Map == Map.Felucca) { banks = m_FeluccaBanks; moongates = PMList.Felucca; } /*Zycron * else if ( from.Map == Map.Ilshenar ) * { #if false * banks = m_IlshenarBanks; * moongates = PMList.Ilshenar; #else * from.Send( new MessageLocalized( Serial, ItemID, MessageType.Label, 0x482, 3, 1061684, "", "" ) ); // The magic of the sextant fails... * return; #endif * } * else if ( from.Map == Map.Malas ) * { * banks = m_MalasBanks; * moongates = PMList.Malas; * } * Zycron*/ else { banks = null; moongates = null; } Point3D closestMoongate = Point3D.Zero; double moongateDistance = double.MaxValue; if (moongates != null) { foreach (PMEntry entry in moongates.Entries) { double dist = from.GetDistanceToSqrt(entry.Location); if (moongateDistance > dist) { closestMoongate = entry.Location; moongateDistance = dist; } } } Point2D closestBank = Point2D.Zero; double bankDistance = double.MaxValue; if (banks != null) { foreach (Point2D p in banks) { double dist = from.GetDistanceToSqrt(p); if (bankDistance > dist) { closestBank = p; bankDistance = dist; } } } int moonMsg; if (moongateDistance == double.MaxValue) { moonMsg = 1048021; // The sextant fails to find a Moongate nearby. } else if (moongateDistance > m_LongDistance) { moonMsg = 1046449 + (int)from.GetDirectionTo(closestMoongate); // A moongate is * from here } else if (moongateDistance > m_ShortDistance) { moonMsg = 1048010 + (int)from.GetDirectionTo(closestMoongate); // There is a Moongate * of here. } else { moonMsg = 1048018; // You are next to a Moongate at the moment. } from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, moonMsg, "", "")); int bankMsg; if (bankDistance == double.MaxValue) { bankMsg = 1048020; // The sextant fails to find a Bank nearby. } else if (bankDistance > m_LongDistance) { bankMsg = 1046462 + (int)from.GetDirectionTo(closestBank); // A town is * from here } else if (bankDistance > m_ShortDistance) { bankMsg = 1048002 + (int)from.GetDirectionTo(closestBank); // There is a city Bank * of here. } else { bankMsg = 1048019; // You are next to a Bank at the moment. } from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x5AA, 3, bankMsg, "", "")); }
public override void OnComponentUsed(AddonComponent c, Mobile from) { BaseHouse house = BaseHouse.FindHouseAt(this); if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this) || !((from.Z - Z) > -3 && (from.Z - Z) < 3)) { from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } else if (house != null && house.HasSecureAccess(from, SecureLevel.Friends)) { if (m_Logs > 0) { Item logs = null; switch (Utility.Random(14)) { case 0: logs = new Log(); break; case 1: logs = new AshLog(); break; case 2: logs = new CherryLog(); break; case 3: logs = new EbonyLog(); break; case 4: logs = new GoldenOakLog(); break; case 5: logs = new HickoryLog(); break; case 6: logs = new MahoganyLog(); break; case 7: logs = new OakLog(); break; case 8: logs = new PineLog(); break; case 9: logs = new RosewoodLog(); break; case 10: logs = new WalnutLog(); break; case 11: logs = new GhostLog(); break; case 12: logs = new PetrifiedLog(); break; case 13: logs = new ElvenLog(); break; } int amount = Math.Min(10, m_Logs); logs.Amount = amount; if (!from.PlaceInBackpack(logs)) { logs.Delete(); from.SendLocalizedMessage(1078837); // Your backpack is full! Please make room and try again. } else { m_Logs -= amount; PublicOverheadMessage(MessageType.Regular, 0, 1094719, m_Logs.ToString()); // Logs: ~1_COUNT~ } } else { from.SendLocalizedMessage(1094720); // There are no more logs available. } } else { from.SendLocalizedMessage(1061637); // You are not allowed to access this. } }
protected override void OnTarget(Mobile from, object targeted) { from.RevealingAction(); if (targeted is Mobile) { if (targeted is BaseCreature) { BaseCreature creature = (BaseCreature)targeted; if (!creature.Tamable) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049655, from.NetState); // That creature cannot be tamed. } else if (creature.Controlled) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502804, from.NetState); // That animal looks tame already. } else if (from.Female && !creature.AllowFemaleTamer) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049653, from.NetState); // That creature can only be tamed by males. } else if (!from.Female && !creature.AllowMaleTamer) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049652, from.NetState); // That creature can only be tamed by females. } /*else if ( creature is CuSidhe && from.Race != Race.Elf ) * { * creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502801, from.NetState ); // You can't tame that! * }*/ else if (from.Followers + creature.ControlSlots > from.FollowersMax) { from.SendLocalizedMessage(1049611); // You have too many followers to tame that creature. } else if (creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains(from)) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1005615, from.NetState); // This animal has had too many owners and is too upset for you to tame. } else if (MustBeSubdued(creature)) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1054025, from.NetState); // You must subdue this creature before you can tame it! } else if (CheckMastery(from, creature) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill) { FactionWarHorse warHorse = creature as FactionWarHorse; if (warHorse != null) { Faction faction = Faction.Find(from); if (faction == null || faction != warHorse.Faction) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042590, from.NetState); // You cannot tame this creature. return; } } if (m_BeingTamed.Contains(targeted)) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502802, from.NetState); // Someone else is already taming this. } else if (creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble()) { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502805, from.NetState); // You seem to anger the beast! creature.PlaySound(creature.GetAngerSound()); creature.Direction = creature.GetDirectionTo(from); creature.Combatant = from; } else { m_BeingTamed[targeted] = from; from.LocalOverheadMessage(MessageType.Emote, 0x59, 1010597); // You start to tame the creature. from.NonlocalOverheadMessage(MessageType.Emote, 0x59, 1010598); // *begins taming a creature.* new InternalTimer(from, creature, Utility.Random(3, 2)).Start(); m_SetSkillTime = false; } } else { creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502806, from.NetState); // You have no chance of taming this creature. } } else { ((Mobile)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502469, from.NetState); // That being cannot be tamed. } } else { from.SendLocalizedMessage(502801); // You can't tame that! } }
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. return; } if (targeted == m_Crystal) { if (m_Crystal.Active) { m_Crystal.Active = false; from.SendLocalizedMessage(500672); // You turn the crystal off. } else { if (m_Crystal.Charges > 0) { m_Crystal.Active = true; from.SendLocalizedMessage(500673); // You turn the crystal on. } else { from.SendLocalizedMessage(500676); // This crystal is out of charges. } } } else if (targeted is ReceiverCrystal) { ReceiverCrystal receiver = (ReceiverCrystal)targeted; if (m_Crystal.Receivers.Count >= 10) { from.SendLocalizedMessage(1010042); // This broadcast crystal is already linked to 10 receivers. } else if (receiver.Sender == m_Crystal) { from.SendLocalizedMessage(500674); // This crystal is already linked with that crystal. } else if (receiver.Sender != null) { from.SendLocalizedMessage(1010043); // That receiver crystal is already linked to another broadcast crystal. } else { receiver.Sender = m_Crystal; from.SendLocalizedMessage(500675); // That crystal has been linked to this crystal. } } else if (targeted == from) { foreach (ReceiverCrystal receiver in new List <ReceiverCrystal>(m_Crystal.Receivers)) { receiver.Sender = null; } from.SendLocalizedMessage(1010046); // You unlink the broadcast crystal from all of its receivers. } else { Item targItem = targeted as Item; if (targItem != null && targItem.VerifyMove(from)) { CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType()); if (info != null) { if (m_Crystal.Charges >= MaxCharges) { from.SendLocalizedMessage(500678); // This crystal is already fully charged. } else { targItem.Consume(); if (m_Crystal.Charges + info.Amount >= MaxCharges) { m_Crystal.Charges = MaxCharges; from.SendLocalizedMessage(500679); // You completely recharge the crystal. } else { m_Crystal.Charges += info.Amount; from.SendLocalizedMessage(500680); // You recharge the crystal. } } return; } } from.SendLocalizedMessage(500681); // You cannot use this crystal on that. } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant) { return; } if (((info.ButtonID >= 6 && info.ButtonID <= 10) || info.ButtonID == 12) && !from.InRange(m_Plant.GetWorldLocation(), 3)) { from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 500446); // That is too far away. return; } if (!m_Plant.IsUsableBy(from)) { m_Plant.LabelTo(from, 1061856); // You must have the item in your backpack or locked down in order to use it. return; } switch (info.ButtonID) { case 1: // Reproduction menu { if (m_Plant.PlantStatus > PlantStatus.BowlOfDirt) { from.SendGump(new ReproductionGump(m_Plant)); } else { from.SendLocalizedMessage(1061885); // You need to plant a seed in the bowl first. from.SendGump(new MainPlantGump(m_Plant)); } break; } case 2: // Infestation { from.Send(new DisplayHelpTopic(54, true)); // INFESTATION LEVEL from.SendGump(new MainPlantGump(m_Plant)); break; } case 3: // Fungus { from.Send(new DisplayHelpTopic(56, true)); // FUNGUS LEVEL from.SendGump(new MainPlantGump(m_Plant)); break; } case 4: // Poison { from.Send(new DisplayHelpTopic(58, true)); // POISON LEVEL from.SendGump(new MainPlantGump(m_Plant)); break; } case 5: // Disease { from.Send(new DisplayHelpTopic(60, true)); // DISEASE LEVEL from.SendGump(new MainPlantGump(m_Plant)); break; } case 6: // Water { Item[] item = from.Backpack.FindItemsByType(typeof(BaseBeverage)); bool foundUsableWater = false; if (item != null && item.Length > 0) { for (int i = 0; i < item.Length; ++i) { BaseBeverage beverage = (BaseBeverage)item[i]; if (!beverage.IsEmpty && beverage.Pourable && beverage.Content == BeverageType.Water) { foundUsableWater = true; m_Plant.Pour(from, beverage); break; } } } if (!foundUsableWater) { from.Target = new PlantPourTarget(m_Plant); from.SendLocalizedMessage(1060808, "#" + m_Plant.GetLocalizedPlantStatus().ToString()); // Target the container you wish to use to water the ~1_val~. } break; } case 7: // Poison potion { AddPotion(from, PotionEffect.PoisonGreater, PotionEffect.PoisonDeadly); break; } case 8: // Cure potion { AddPotion(from, PotionEffect.CureGreater); break; } case 9: // Heal potion { AddPotion(from, PotionEffect.HealGreater); break; } case 10: // Strength potion { AddPotion(from, PotionEffect.StrengthGreater); break; } case 11: // Help { from.Send(new DisplayHelpTopic(48, true)); // PLANT GROWING from.SendGump(new MainPlantGump(m_Plant)); break; } case 12: // Empty the bowl { from.SendGump(new EmptyTheBowlGump(m_Plant)); break; } } }