Example #1
1
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this.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 = this.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!" );
					Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
				}

				Effects.PlaySound( this.GetWorldLocation(), this.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 );
			}
		}
Example #2
0
		protected override void OnTarget( Mobile from, object targeted ) 
		{ 
			if ( from.Name == null)
			{
				from.SendMessage("Your name is not valid fix it now");
				return;
			}
           
			if ( targeted is Mobile )
			{ 
				Mobile m_target = (Mobile)targeted;
				from.PublicOverheadMessage(MessageType.Emote ,20, true,"*" + from.Name + " Points at*");
            	
				if ( m_target.Name != null)
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "*" + m_target.Name + "*");
				else
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true,"*"+ from.Name + " whatever it is!*");
			}
			else if ( targeted is Item ) 
			{ 
				Item m_target = (Item)targeted;
				from.PublicOverheadMessage(MessageType.Emote ,20, true,"*" + from.Name + " Points at*");
				if (m_target.Name != null)
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "* " + m_target.Name + "*");
				else
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "*Points Here*");
			}
			else 
			{
				IPoint3D p = targeted as IPoint3D; 

				if ( p != null ) 
				{
					Map map = from.Map;
					Item pointer = new Item (8302);
					Point3D m_point = new Point3D(p);
					pointer.MoveToWorld(m_point,map);
					pointer.Movable = false;
					PointTimer p_time = new PointTimer(pointer);
					from.PublicOverheadMessage(MessageType.Emote ,20, true, "*" + from.Name.ToString() + " Points at*");
					pointer.PublicOverheadMessage(MessageType.Emote ,20, true, "*This Spot*" );
				}
				else
				{ 
					from.SendMessage( "Cannot point at this for some reason!" ); 
				} 
			}     
		}
Example #3
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 85 )
				{
					from.SendMessage( "The scroll bursts into flame in your hands!" );
					from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
					from.Damage( Utility.RandomMinMax( 40, 55 ) );
					
					this.Delete();
				}
				else
				{
					from.Frozen = true;
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 206, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
				}
			}
		}
Example #4
0
		public void PokerMessage( Mobile from, string message )
		{
			from.PublicOverheadMessage( Server.Network.MessageType.Regular, 0x9A, true, message );

			for ( int i = 0; i < m_Players.Count; ++i )
				if ( m_Players[i].Mobile != null )
					m_Players[i].Mobile.SendMessage( 0x9A, "[{0}]: {1}", from.Name, message );
		}
Example #5
0
		public override bool OnEquip( Mobile m ) {
			m.PublicOverheadMessage( Server.Network.MessageType.Regular, m.EmoteHue, true, "*as you place the ring on your hand, you feel a sudden jolt of painful energy course through your body and the ring becomes heavy.*" );
			m.PlaySound( 0x5BF );
			m.Hits = 0;
			m.Stam = 0;

			this.Hue = 1175;
			this.LootType = LootType.Cursed;
			this.Name = "a blackened, jewel-encrusted ring";

			return base.OnEquip( m );
		}
Example #6
0
		public override void OnDoubleClick( Mobile from ) 
		{
			switch ( ((Item)this).ItemID )
			{
				case 0x12AB: // Closed north
					if ( Utility.Random( 2 ) == 0 )
						((Item)this).ItemID = 0x12A5;
					else
						((Item)this).ItemID = 0x12A8;
					break;
				case 0x12AC: // Closed east
					if ( Utility.Random( 2 ) == 0 )
						((Item)this).ItemID = 0x12A6;
					else
						((Item)this).ItemID = 0x12A7;
					break;
				case 0x12A5: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
				case 0x12A6: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
				case 0x12A8: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
				case 0x12A7: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
			}
		}
Example #7
0
        public void Target(IPoint3D p, Mobile defender)
        {
            Map map = defender.Map;

            if (this.Parent == null || !(this.Parent is Mobile))
                return;

            Mobile attacker = (Mobile)this.Parent;

            if (p is RecallRune)
            {
                RecallRune rune = (RecallRune)p;

                if (rune.Marked)
                {
                    defender.PublicOverheadMessage(Server.Network.MessageType.Regular, defender.SpeechHue, true, "*the earth trembles and time slows, a small rift appearing and drawing you both into its depth*");
                    attacker.SendMessage("You and your combatant have been sent to the rune\'s location.");

                    defender.MoveToWorld(rune.Target, rune.TargetMap);
                    attacker.MoveToWorld(rune.Target, rune.TargetMap);

                    Effects.PlaySound(defender, map, 510);
                    Effects.SendLocationParticles(defender, 0x37C4, 10, 10, 2023);
                    Effects.PlaySound(attacker, map, 510);
                    Effects.SendLocationParticles(attacker, 0x37C4, 10, 10, 2023);
                }
                else
                    attacker.SendMessage("That is not a valid target.");
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                attacker.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (Server.Spells.SpellHelper.CheckMulti(new Point3D(p), map))
            {
                attacker.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (defender.BodyValue != 402 && defender.BodyValue != 403)
            {
                _lastUsed = DateTime.Now;

                Point3D to = new Point3D(p);

                defender.MoveToWorld(to, map);
                defender.ProcessDelta();

                Effects.PlaySound(defender, map, 510);
                Effects.SendLocationParticles(defender, 0x37C4, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x37C4, 10, 10, 5023);
            }
        }
Example #8
0
		public static void HungerDecay( Mobile m )
		{         
            if ( m != null && m is Player) 
            {
                Adventurer adv = Perk.GetByType<Adventurer>((Player)m);

                if (adv != null) 

                    if (Utility.RandomDouble() < 0.33 && m.Hunger < 20)
                    {
                        m.Hunger += adv.HungerThirstBonus();
                    }                                  
            }

            if ((m != null && m.Alive && m.Hunger >= 1 && m.AccessLevel == AccessLevel.Player) &&
                ((Player)m).Race != Race.Liche && ((Player)m).Race != Race.Elemental)
                m.Hunger --;

			if( m != null && m.Alive )
			{
				if( m.Hunger > 14 )
					return;

				else if( m.Hunger >= 10 && m.Hunger <= 14 )
					m.SendMessage( "You feel somewhat hungry." );

				else if( m.Hunger >= 5 && m.Hunger < 10 )
					m.SendMessage( "You feel quite hungry." );

				else if( m.Hunger > 0 && m.Hunger < 5 )
					m.SendMessage( "You are very hungry, and should find something to eat." );

				else
				{
					m.SendMessage( "Your lack of food is wasting away at your body!" );
					m.Damage( Utility.RandomMinMax(25, 45 ) );
                    m.Stam -= Utility.RandomMinMax(20, 30);
                    m.Mana -= Utility.RandomMinMax(20, 30);
				}

				if( m.Hunger < 10 )
				{
					m.PublicOverheadMessage( MessageType.Regular, m.EmoteHue, true, String.Format( "*{0} stomach growls softly*", m.Female ? "her" : "his" ) );

					if( m.Hidden )
						m.RevealingAction();
				}
			}
		}
        public override void OnDoubleClick( Mobile m )
        {
            if ( !m.InRange( this.GetWorldLocation(), 3 ) )
                return;
            if ( m_Controller.Enabled )
                return;

            if ( (m_Wanderer == null || !m_Wanderer.Alive) )
            {
                m_Wanderer = new WandererOfTheVoid();
                m_Wanderer.MoveToWorld( LeverPuzzleController.lr_Enter, Map.Malas );
                m_Wanderer.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1060002, "" ); // I am the guardian of...
                Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( CallBackMessage ) );
            }
        }
Example #10
0
        public static void SupplyGear(Mobile m, CustomGameEventSupplier eventSupplier)
        {
            //Supply the right type of gear
            SupplyType supplyType = eventSupplier.SupplyType;
            if (supplyType == SupplyType.MaxGear)
                SupplyMaxGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems);
            else if (supplyType == SupplyType.RegularGear)
                SupplyRegGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems);
            else if (supplyType == SupplyType.Custom)
            {
                if (!eventSupplier.CanUseCustomGear)
                    m.PublicOverheadMessage(MessageType.Regular, 906, true, "Custom setup error.");

                //Copy all the items in our bags and make them to event items
                for (int i = 0; i < eventSupplier.ItemContaiers.Length; i++)
                    if (eventSupplier.ItemContaiers[i].Items.Count > 0)
                        SupplyCustomItems(eventSupplier.ItemContaiers[i].Items, m, eventSupplier.ItemContaiers[i].AcceptsType, 
                            eventSupplier.NewbieAllItems, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, 
                            eventSupplier.StayEquipped, eventSupplier.ConsumeItems);
            }
        }
Example #11
0
		public void CheckTriggers( Mobile m, Skill s, bool hasproximity )
		{

			// only proximity trigger when no spawns have already been triggered
			if( AllowTriggering && !m_proximityActivated )
			{
				bool needs_item_trigger = false;
				bool needs_speech_trigger = false;
				bool needs_skill_trigger = false;
				bool needs_object_trigger = false;
				bool needs_mob_trigger = false;
				bool needs_player_trigger = false;
				bool needs_noitem_trigger = false;
				bool has_object_trigger = false;
				bool has_mob_trigger = false;
				bool has_player_trigger = false;
				bool has_item_trigger = false;
				bool has_noitem_trigger = true; // assume the player doesnt have the trigger-blocking item until it is found by search

				m_skipped = false;

				// test for the various triggering options in the order of increasing computational demand.  No point checking a high demand test
				// if a low demand one has already failed.

				// check for external triggering
				if( m_ExternalTriggering && !m_ExternalTrigger ) return;

				// if speech triggering is set then test for successful activation
				if( m_SpeechTrigger != null && m_SpeechTrigger.Length > 0 )
				{
					needs_speech_trigger = true;
				}
				// check to see if we have to continue
				if( needs_speech_trigger && !m_speechTriggerActivated ) return;

				// if skill triggering is set then test for successful activation
				if( m_SkillTrigger != null && m_SkillTrigger.Length > 0 )
				{
					needs_skill_trigger = true;
				}
				// check to see if we have to continue
				if( needs_skill_trigger && !m_skillTriggerActivated ) return;

				// if item property triggering is set then test for the property value
				//
				if( m_ObjectPropertyName != null && m_ObjectPropertyName.Length > 0 )
				{
					needs_object_trigger = true;
					string status_str;

					if( BaseXmlSpawner.TestItemProperty( this, m_ObjectPropertyItem, m_ObjectPropertyName, null, out status_str ) )
					{
						has_object_trigger = true;
					}
					else
						has_object_trigger = false;
					if( status_str != null && status_str.Length > 0 )
					{
						this.status_str = status_str;
					}
				}

				// check to see if we have to continue
				if( needs_object_trigger && !has_object_trigger ) return;

				// if player property triggering is set then look for the mob and test properties
				if( m_PlayerPropertyName != null && m_PlayerPropertyName.Length > 0 )
				{
					needs_player_trigger = true;
					string status_str;

					if( BaseXmlSpawner.TestMobProperty( this, m, m_PlayerPropertyName, null, out status_str ) )
					{
						has_player_trigger = true;
					}
					else
						has_player_trigger = false;
					if( status_str != null && status_str.Length > 0 )
					{
						this.status_str = status_str;
					}
				}

				// check to see if we have to continue
				if( needs_player_trigger && !has_player_trigger ) return;

				// if mob property triggering is set then look for the mob and test properties
				if( m_MobPropertyName != null && m_MobPropertyName.Length > 0 &&
					m_MobTriggerName != null && m_MobTriggerName.Length > 0 )
				{
					needs_mob_trigger = true;

					string status_str;

					if( BaseXmlSpawner.TestMobProperty( this, MobTriggerId, m_MobPropertyName, null, out status_str ) )
					{
						has_mob_trigger = true;
					}
					else
						has_mob_trigger = false;

					if( status_str != null && status_str.Length > 0 )
					{
						this.status_str = status_str;
					}
				}

				// check to see if we have to continue
				if( needs_mob_trigger && !has_mob_trigger ) return;

				// if player-carried item triggering is set then test for the presence of an item on the player an in their pack
				if( m_ItemTriggerName != null && m_ItemTriggerName.Length > 0 )
				{
					//enable_triggering = false;
					needs_item_trigger = true;

					has_item_trigger = BaseXmlSpawner.CheckForCarried( m, m_ItemTriggerName );
				}
				// check to see if we have to continue
				if( needs_item_trigger && !has_item_trigger ) return;

				// if player-carried noitem triggering is set then test for the presence of an item in the players pack that should block triggering
				if( m_NoItemTriggerName != null && m_NoItemTriggerName.Length > 0 )
				{
					needs_noitem_trigger = true;

					has_noitem_trigger = BaseXmlSpawner.CheckForNotCarried( m, m_NoItemTriggerName );
				}
				// check to see if we have to continue
				if( needs_noitem_trigger && !has_noitem_trigger ) return;

				// if this was called without being proximity triggered then check to see that the non-movement triggers were enabled.
				if( !hasproximity && !needs_object_trigger && !needs_mob_trigger && !m_ExternalTriggering ) return;

				// all of the necessary trigger conditions have been met so go ahead and trigger
				// after you make the probability check

				if( Utility.RandomDouble() < m_TriggerProbability )
				{

					// play a sound indicating the spawner has been triggered
					if( m_ProximityTriggerSound > 0 && m != null && !m.Deleted )
						m.PlaySound( m_ProximityTriggerSound );

					// display the trigger message
					if( m_ProximityTriggerMessage != null && m_ProximityTriggerMessage.Length > 0 && m != null && !m.Deleted )
						m.PublicOverheadMessage( MessageType.Regular, 0x3B2, true, m_ProximityTriggerMessage );

					// enable spawning at the next ontick
					// this will also start the refractory timer and send the triggering indicators
					ProximityActivated = true;

					// keep track of who triggered this
					m_mob_who_triggered = m;

					// keep track of the skill that triggered this
					if( s != null )
					{
						m_skill_that_triggered = s.SkillName;
					}
					else
					{
						m_skill_that_triggered = XmlSpawnerSkillCheck.RegisteredSkill.Invalid;
					}


				}
				else
				{
					m_skipped = true;
					// reset speech triggering if it was set

					m_speechTriggerActivated = false;

					// reset skill triggering if it was set
					m_skillTriggerActivated = false;
					// reset external triggering if it was set
					//this.m_ExternalTrigger = false;
				}
			}
		}
Example #12
0
        public static void PublicOverheadMessage( Mobile m, MessageType messageType, int hue, TextDefinition def )
        {
            if ( def == null )
                return;

            if ( def.m_Number > 0 )
                m.PublicOverheadMessage( messageType, hue, def.m_Number );
            else if ( def.m_String != null )
                m.PublicOverheadMessage( messageType, hue, false, def.m_String );
        }
Example #13
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( IsLockedDown )
            {
                if ( !from.InRange( this.Location, 2 ) )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
                    return;
                }

                IHouse house = HousingHelper.FindHouseAt( from );

                if ( house != null )
                {
                    from.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071131 ); // Praying…

                    if ( m_CooldownList.Contains( from ) )
                    {
                        from.SendLocalizedMessage( 1071145 ); // In order to summon an undead again, you have to wait for at least 90 minutes.
                    }
                    else
                    {
                        Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback(
                            delegate
                            {
                                // Add the skill mod
                                SkillMod mod = new DefaultSkillMod( SkillName.SpiritSpeak, true, 5.0 );
                                mod.ObeyCap = true;
                                from.AddSkillMod( mod );
                                m_Table[from] = new BonusContext( Timer.DelayCall( Duration, new TimerStateCallback<Mobile>( RemoveEffect ), from ), mod );

                                // Set the cooldown
                                m_CooldownList.Add( from );
                                Timer.DelayCall( Cooldown, new TimerCallback( delegate { m_CooldownList.Remove( from ); } ) );

                                // Spawn our undead friend :)
                                SummonUndead( from );

                                from.SendLocalizedMessage( 1071148 ); // You feel a greater sense.
                            } ) );
                    }
                }
                else
                    from.SendLocalizedMessage( 502436 ); // That is not accessible.
            }
            else
                from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
        }
Example #14
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 75 )
					from.SendMessage( "You do not have the skill to understand this spellscroll." );
				else
				{
					from.Frozen = true;

					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 230, 7, 1, true, false, 0 );

					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Ort Jux", false );
					from.SendMessage( "Please select your target." );

					from.BeginTarget( 10, false, TargetFlags.Harmful, new TargetCallback( WrathOfFray_OnTarget ) );
				}
			}
		}
Example #15
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Karma > -625 )
					from.SendMessage( "Your past actions are too blessed to call on this spell." );
				else
				{
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "Kal Rel Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 209, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.Harmful, new TargetCallback( Pigify_OnTarget ) );
				}
			}
		}
Example #16
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				from.Frozen = true;
				from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "Uus Ylem", false );
				
				if( !from.Mounted && from.Body.IsHuman )
					from.Animate( 230, 7, 1, true, false, 0 );
				
				from.Target = new InternalTarget( this );
				from.SendMessage( "Target the water where you would like to summon the ship." );
			}
		}
Example #17
0
        public void GiveReward(Mobile from, int total)
        {
            int toGive = (total - 200) * 10;
            if (toGive < 0)
                toGive = 0;

            try 
            {
                string message = string.Format("Congratulations! You have scored a grand total of {0} points. You win {1} gold.", total, toGive);
                string overheadMessage = string.Format("Yahtzee! {0} Points", total);
                if (!(toGive == 0))
                    from.AddToBackpack(new Gold(toGive));
                from.SendMessage(50, message);
                from.PublicOverheadMessage(MessageType.Regular, 50, true, overheadMessage, true );
            }
            catch { }
            

        }
Example #18
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (!from.CanSee(target))
            {
                from.SendMessage("Target cannot be seen.");
            }
            else if (!from.Alive)
            {
                from.SendMessage("You cannot transform out of your current state.");
            }
            else if (target is Mobile && ((Mobile)target).Alive)
            {
                Mobile t = (Mobile)target;

                if (t == from)
                {
                    from.HueMod = -1;

                    ((Player)from).RawStr -= ((Player)from).StrMod;
                    ((Player)from).RawDex -= ((Player)from).DexMod;
                    ((Player)from).RawInt -= ((Player)from).IntMod;

                    ((Player)from).RaceBody = 58;
                    ((Player)from).AdjustBody();

                    ((Player)from).StrMod = 0;
                    ((Player)from).DexMod = 0;
                    ((Player)from).IntMod = 0;

                    ((Player)from).BodyDamageBonus = 0;

                }

                else if (from.Mounted && !t.Body.IsHuman)
                {
                    from.SendMessage("You cannot transform while mounted.");
                }

                else
                {
                    from.FixedParticles(14089, 0, 30, 0, 1155, 7, EffectLayer.CenterFeet);

                    ((Player)from).RaceBody = t.Body;
                    ((Player)from).AdjustBody();

                    from.HueMod = t.Hue;

                    ((Player)from).RawStr -= ((Player)from).StrMod;
                    ((Player)from).RawDex -= ((Player)from).DexMod;
                    ((Player)from).RawInt -= ((Player)from).IntMod;

                    ((Player)from).StrMod = (int)(t.RawStr / 10);
                    ((Player)from).DexMod = (int)(t.RawDex / 10);
                    ((Player)from).IntMod = (int)(t.RawInt / 10);

                    from.RawStr += ((Player)from).StrMod;
                    from.RawDex += ((Player)from).DexMod;
                    from.RawInt += ((Player)from).IntMod;

                    if (t.Body.IsHuman == false)
                    {
                        ((Player)from).BodyDamageBonus = (int)(t.RawStr / 15);
                    }

                    if (t.Body.IsHuman)
                    {
                        from.HairItemID = t.HairItemID;
                        from.FacialHairItemID = t.FacialHairItemID;
                        from.HairHue = t.HairHue;
                        from.FacialHairHue = t.FacialHairHue;
                    }

                    from.PublicOverheadMessage(MessageType.Regular, from.EmoteHue, false, String.Format("*transforms into the shape of {0}*", t.RawName));

                    hasChanged = true;

                    for (int x = 1; x <= 2; x++)
                    {
                        Item toDisarm = from.FindItemOnLayer(Layer.OneHanded);

                        if (toDisarm == null || !toDisarm.Movable)
                            toDisarm = from.FindItemOnLayer(Layer.TwoHanded);

                        Container pack = from.Backpack;
                        pack.DropItem(toDisarm);
                    }
                }
            }

            else
            {
                from.SendMessage("You cannot take that form.");
            }
        }
Example #19
0
        private void OnTargetBottle( Mobile from, object target )
        {
            if ( target is Bottle )
            {
                Bottle bottle = (Bottle)target;
                object parent = bottle.RootParent;

                if ( parent == from || ( parent == null && from.InRange( bottle.GetWorldLocation(), 3 ) ) )
                {
                    Item potion;
                    try
                    {
                        ConstructorInfo ctor = m_Contains.GetConstructor( Type.EmptyTypes );
                        potion = ctor.Invoke( null ) as Item;
                    }
                    catch
                    {
                        potion = null;
                    }

                    m_Contains = null;
                    if ( potion != null )
                    {
                        from.PublicOverheadMessage( MessageType.Emote, 0x25, true, String.Format( "*{0} pours the completed potion into a bottle.*", from.Name ) );
                        from.PlaySound( 0x240 );
                        from.AddToBackpack( potion );

                        bottle.Consume();
                    }
                    else
                    {
                        from.SendAsciiMessage( "Maybe there was nothing in the mortar after all...." );
                    }
                }
                else
                {
                    from.SendAsciiMessage( "The bottle must be in your backpack to use." );
                }
            }
            else
            {
                from.SendAsciiMessage( "That is not an empty bottle." );
            }
        }
Example #20
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !from.InRange( this, 2 ) )
			{
				from.SendLocalizedMessage( 500446 ); //That is too far away.
			}
			else if( !Active )
			{
				Active = true;

				from.PublicOverheadMessage( Network.MessageType.Regular, from.EmoteHue, false, "*begins warming up at the piano*" );
				new WarmUpTimer( from, this ).Start();
			}
			else
			{
				Active = false;
			}
		}
Example #21
0
        public override void OnGaveMeleeAttack( Mobile defender )
        {
            base.OnGaveMeleeAttack( defender );

            if ( 0.1 > Utility.RandomDouble() )
            {
                defender.FixedParticles( 0x374A, 1, 17, 0x15B6, 0, 0, EffectLayer.Waist );
                defender.PlaySound( 0x233 );

                defender.Damage( 10, this );

                switch ( Utility.Random( 3 ) )
                {
                    case 0:
                        {
                            defender.SendLocalizedMessage( 1112391 ); // The creature's tail smashes into you!

                            break;
                        }
                    case 1:
                        {
                            defender.Freeze( TimeSpan.FromSeconds( 3.0 ) );

                            defender.SendLocalizedMessage( 1112554 ); // You're stunned as the creature's tail knocks the wind out of you.

                            break;
                        }
                    case 2:
                        {
                            defender.SendLocalizedMessage( 1112555 ); // You're left confused as the creature's tail catches you right in the face!
                            defender.PublicOverheadMessage( MessageType.Regular, 946, 502039 ); // *looks confused*

                            defender.AddStatMod( new StatMod( StatType.Dex, "Boura Dex Malus", -20, TimeSpan.FromSeconds( 5.0 ) ) );
                            defender.AddStatMod( new StatMod( StatType.Int, "Boura Int Malus", -20, TimeSpan.FromSeconds( 5.0 ) ) );

                            defender.FixedParticles( 0x37B9, 1, 10, 0x232A, 5, 0, EffectLayer.Head );
                            defender.PlaySound( 0xF9 );

                            break;
                        }
                }
            }
        }
Example #22
0
		public PointTarget(Mobile from, Item targeted) : base( -1, true, TargetFlags.None ) 
		{
			from.PublicOverheadMessage(MessageType.Emote ,20, true, from.Name.ToString() + " Points There");
			targeted.PublicOverheadMessage(MessageType.Emote ,20,true, from.Name.ToString() + " Points Here"); 	
		}
Example #23
0
		public static void ShowPointsOverhead( Mobile from )
		{
			if(from == null) return;

			from.PublicOverheadMessage( MessageType.Regular, 0x3B2, false, GetPoints(from).ToString());
		}
Example #24
0
        public static void BarkIngredient( Mobile from )
        {
            if ( !QuestStarted( from ) )
                return;

            QuestContext context = m_Table[from];

            // I need to add some ~1_INGREDIENT~.
            from.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1112821, String.Format( "#{0}", (int) context.CurrentIngredient ) );
        }
Example #25
0
        public static void StopEffect(Mobile m, bool message)
        {
            Timer t = (Timer)m_Table[m];

            if (t != null)
            {
                if (message)
                    m.PublicOverheadMessage(Network.MessageType.Emote, m.SpeechHue, true, "* The open flame begins to scatter the swarm of insects *");

                t.Stop();
                m_Table.Remove(m);
            }
        }
Example #26
0
        public static bool Poison( Mobile who, Mobile poisoner, Dictionary<PoisonEffectEnum, int> effects, int duration, int actingSpeed, bool ingested )
        {
            if ( who == null )
                return false;

            if( who is PlayerMobile && ((PlayerMobile)who).IsVampire )
                return false;

            if ( ingested )
            {
                List<PoisonEffectEnum> keyList = new List<PoisonEffectEnum>();
                foreach ( KeyValuePair<PoisonEffectEnum, int> kvp in effects )
                    keyList.Add( kvp.Key );
                foreach ( PoisonEffectEnum K in keyList )
                    effects[K] *= 3;
            }

            PoisonAttachment attachment = XmlAttach.FindAttachment( who, typeof( PoisonAttachment ) ) as PoisonAttachment;
            if ( attachment != null )
            {
                int strength = 0;
                foreach( KeyValuePair<PoisonEffectEnum, int> kvp in effects )
                    strength += kvp.Value;
                if ( attachment.PoisonStrength >= strength ) // already has stronger or equally strong poison applied
                    return false;
                else
                    attachment.Delete(); // this poison is stronger
            }
            attachment = new PoisonAttachment( effects, duration, actingSpeed, poisoner );
            XmlAttach.AttachTo( who, attachment );

            int level = 0;
            if ( attachment.PoisonStrength > 400 )
                level = 4;
            else if ( attachment.PoisonStrength > 300 )
                level = 3;
            else if ( attachment.PoisonStrength > 200 )
                level = 2;
            else if ( attachment.PoisonStrength > 100 )
                level = 1;

            if ( !who.Hidden )
                who.PublicOverheadMessage( MessageType.Regular, 0x22, 1042858 + (level * 2), who.Name );
            return true;
        }
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this, 1 ) )
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
			else if ( ItemID == 4238 )
				from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, false, "I must wait before flipping that again." );
			else if ( Barrier != null )
			{
				ItemID = 4238;
				Effects.PlaySound( Location, Map, 0x3E8 );
				Barrier.Open();
				new InternalTimer( this, Delay ).Start();
			}
		}
Example #28
0
		public virtual void TjnarsScythe_OnTarget( Mobile from, object target )
		{
			if( !from.CanSee( target ) )
			{
				from.SendLocalizedMessage( 500237 ); //Target cannot be seen.
			}
			else if( target is Mobile )
			{
				Mobile targetMobile = (Mobile)target;
				
				if( targetMobile.Body.IsHuman )
				{
					if( targetMobile.Hits < (targetMobile.HitsMax / 10) )
					{
						targetMobile.PlaySound( 565 ); //Consecrate Weapon sound
						from.PlaySound( 565 );
						
						from.MovingEffect( targetMobile, 0x26C4, 9, 1, false, false ); //Launches a solid scythe
						Effects.SendMovingParticles( from, targetMobile, 0x26C4, 1, 0, false, false, 1109, 3, 9501, 1, 0, EffectLayer.Waist, 0x100 ); //Launches a rendered scythe
						
						targetMobile.FixedParticles( 0x3779, 1, 30, 9964, 1109, 3, EffectLayer.Waist ); //Small sparklies on the target
						
						targetMobile.Kill();
						
						Head head = new Head( String.Format( "the head of {0}", targetMobile.Name ) );
						from.AddToBackpack( head );
						
						from.BoltEffect( 1 );
						
						this.Delete();
					}
					else
					{
						from.PublicOverheadMessage( MessageType.Emote, from.EmoteHue, false, "*the voice of Tjnar rings out across the region:*", false );
						from.PublicOverheadMessage( MessageType.Yell, from.SpeechHue, false, "\"You fool! That mere mortal is not prepared to die! Crush the body, and the mind shall be yours!\"", false );
						
						from.SendMessage( "Your target must have less than 10% of his health in order for this spell to work." );
					}
				}
				else
				{
					from.SendMessage( "This spell will only work on humans." );
				}
			}

			from.Frozen = false;
		}