protected override void OnTarget( Mobile from, object o )
		{
			if(o is Container)
			{
				Container xx = o as Container;

//				if (xx is QuestHolder)
//				{
//					from.LocalOverheadMessage( MessageType.Regular, 0x22, true, "Trying to dump into a Questbook is an exploit. Your Account has been flagged."); 
//	                  ((Account)from.Account).SetTag( "QuestExploit", "true"); 
//					return;
//				}

				// Container that is either in a pack or a child thereof
				if ( xx.IsChildOf( from.Backpack) || xx == from.Backpack)
				{
//					from.PublicOverheadMessage( MessageType.Regular, 0x33, true, "Select the container you want to dump items INTO.");
					from.PrivateOverheadMessage( MessageType.Regular, 0x34, true, "Select the container you want to dump items INTO.", from.NetState);
					from.Target = new PackToTarget( from, xx );
				}
				else
				{
//					from.PublicOverheadMessage( MessageType.Regular, 0x22, true, "The container to dump FROM must be in your main backpack or BE your main backpack.");
					from.PrivateOverheadMessage( MessageType.Regular, 0x22, true, "The container to dump FROM must be in your main backpack or BE your main backpack.", from.NetState);
				}
			}
			else
			{
//				from.PublicOverheadMessage( MessageType.Regular, 0x22, true, "That is not a container!");
				from.PrivateOverheadMessage( MessageType.Regular, 0x22, true, "That is not a container!", from.NetState);
			}
		}
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Mobile )
                {
                    // It appears to be:
                    from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1041349, ( (Mobile) o ).Name, from.Client );
                }
                else if ( !from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
                {
                    // You have no idea how much it might be worth.
                    from.SendLocalizedMessage( 1041352 );
                }
                else if ( o is Item )
                {
                    Item item = o as Item;

                    // TODO (SA): Display the value of the item
                    // TODO (SA): When should we show this message? "You conclude that item cannot be magically unraveled. The magic in that item has been weakened due to either low durability or the imbuing process." (1111877)

                    if ( item is IImbuable )
                    {
                        UnravelInfo info = Unraveling.GetUnravelInfo( from, item );

                        if ( info == null )
                        {
                            // You conclude that item cannot be magically unraveled. It appears to possess little to no magic.
                            from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111876, from.Client );
                        }
                        else
                        {
                            if ( from.Skills[SkillName.Imbuing].Value >= info.MinSkill )
                            {
                                // You conclude that item will magically unravel into: ~1_ingredient~
                                from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111874, String.Format( "#{0}", info.Name.ToString() ), from.Client );
                            }
                            else
                            {
                                // Your Imbuing skill is not high enough to identify the imbuing ingredient.
                                from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111875, from.Client );
                            }
                        }
                    }
                    else
                    {
                        // You conclude that item cannot be magically unraveled.
                        from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111878, from.Client );
                    }
                }
                else
                {
                    // You have no idea how much it might be worth.
                    from.SendLocalizedMessage( 1041352 );
                }
            }
Exemple #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this, 1))
            {
                SendLocalizedMessageTo(from, 1076766); // That is too far away.
                return;
            }

            from.RevealingAction();

            if (0.025 > Utility.RandomDouble())
            {
                from.AddToBackpack(new RareSerpentEgg());
                from.SendLocalizedMessage(1112581); // You reach in and find a rare serpent egg!!
            }
            else
            {
                switch (Utility.Random(3))
                {
                    case 0:
                        {
                            from.SendLocalizedMessage(1112578); // You try to reach the eggs, but the hole is too deep.

                            break;
                        }
                    case 1:
                        {
                            from.SendLocalizedMessage(1112579); // You reach in but clumsily destroy the eggs inside the nest.
                            this.Collapse(from);

                            break;
                        }
                    case 2:
                        {
                            from.SendLocalizedMessage(1112580); // Beware! You've hatched the eggs!!
                            this.HatchEggs(from);

                            from.PrivateOverheadMessage(MessageType.Regular, 33, 1112940, from.NetState); // Your hand remains stuck!!!
                            from.Frozen = true;

                            Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(
                                delegate
                                {
                                    from.Frozen = false;
                                    from.PrivateOverheadMessage(MessageType.Regular, 65, 1112941, from.NetState); // You manage to free your hand!
                                }));

                            break;
                        }
                }
            }
        }
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
			{
				Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
			}
			else if ( m.IsDeadBondedPet )
			{
				Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
			}
            else if (m is Golem || (m is BaseCreature &&
                (((BaseCreature)m).Pseu_CanBeHealed == false || ((BaseCreature)m).ChampSpawn != null)))
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( m.Poisoned && !m.IsT2A|| Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				// Algorithm: (40% of magery) + (1-10)

				int toHeal = Utility.Random( 1, 10 ) + (int)(Caster.Skills[SkillName.Magery].Value * 0.4);

				int healmessage = Math.Min( m.HitsMax - m.Hits, toHeal );

				if ( healmessage > 0 )
				{
					m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), m.NetState );
					if ( Caster != m )
						m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), Caster.NetState );
				}

				Caster.DoBeneficial( m );
				SpellHelper.Heal( toHeal, m, Caster );

				m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
				m.PlaySound( 0x202 );
			}

			FinishSequence();
		}
        public static bool Run(Mobile Attacker, Mobile Defender, BaseWeapon Weapon, ref int BaseDamage)
        {
            Effects.SendLocationParticles(EffectItem.Create(Defender.Location, Defender.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
            Effects.PlaySound(Defender, Defender.Map, 0x201);

            bool Summoned = false;

            if (Defender is BaseCreature)
            {
                BaseCreature Creature = Defender as BaseCreature;
                Summoned = Creature.Summoned;
                if (Summoned)
                {
                    if(Attacker.NetState != null)
                        Attacker.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x03B2, true,
                            "Your weapon causes the creature to dissipate on impact!", Attacker.NetState);

                    Creature.Delete();
                    return true;
                }
            }

            ZuluUtil.WipeMods(Defender);

            Defender.Mana = 0;

            if (Weapon.DamageLevel == WeaponDamageLevel.Regular)
                BaseDamage += ZuluCombat.GetDamageLevel(WeaponDamageLevel.Devastation);

            return true;
        }
 public override bool OnSkillUse(Mobile m, int Skill)
 {
     switch (Skill)
     {
         case (int)SkillName.Peacemaking:
             m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, m_sCantUseSkillMsg, m.NetState);
             return false;
         case (int)SkillName.Provocation:
             m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, m_sCantUseSkillMsg, m.NetState);
             return false;
         case (int)SkillName.Discordance:
             m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, m_sCantUseSkillMsg, m.NetState);
             return false;
     }
     return true;
 }
 public void FizzleStrangely(Mobile m)
 {
     m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "The spell fizzles strangely.", m.NetState);
     m.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
     m.FixedEffect(0x3735, 6, 30);
     m.PlaySound(0x5C);
 }
Exemple #8
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( !from.InRange( this.GetWorldLocation(), 1 ) )
            {
                from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500446 ); //That is too far away
                return;
            }

            if ( from.Hidden )
            {
                from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "You can not use that while hidden", from.Client );
                return;
            }

            if ( m_Controller != null && m_Controller.CanActive )
            {
                if ( m_Controller.Code.Length < 4 )
                {
                    m_Controller.Code += m_Code;

                    if ( ItemID == 0x108E )
                        ItemID = 0x108C;
                    else if ( ItemID == 0x108C )
                        ItemID = 0x108E;

                    Effects.PlaySound( Location, Map, 0x3E8 );
                }
            }
            else
            {
                from.SendLocalizedMessage( 1060001 ); // You throw the switch, but the mechanism cannot be engaged again so soon.
            }
        }
        public override void OnDoubleClick( Mobile from )
        {
            if ( Empty )
            {
                // A foggy memory is recalled and you have to ask yourself, "Why is the Pungent Brew always gone?"
                from.PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 1113610, from.Client );
            }
            else
            {
                from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );

                from.BAC = 60;
                BaseBeverage.CheckHeaveTimer( from );

                if ( !m_Table.ContainsKey( from ) )
                {
                    from.SendLocalizedMessage( 1095139 ); // Flint wasn't kidding. This brew is strong!

                    InternalTimer t = m_Table[from] = new InternalTimer( from );
                    t.Start();
                }
                else
                {
                    InternalTimer t = m_Table[from];
                    t.Counter = 20;
                }

                Empty = true;
            }
        }
		public override void OnDoubleClick(Mobile from)
        {
			Item n = from.Backpack.FindItemByType(typeof(Curd));
            if (n != null)
            {
				from.AddToBackpack(new BowlofWhey());
                n.Delete();
                Delete();
                from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Finally I have the bowl of curds and whey for the child! Now I must quickly return to her.", from.NetState);
            
            }
            else
            {
                from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "You must have a curd", from.NetState);
            }
		}
        public void Carve(Mobile from, Item item)
        {
            if (from.IsHallucinated || from.Poisoned)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "Vous ne pouvez cueillir convenablement dans cet état", from.NetState);
                return;
            }
            if (DateTime.Now < m_NextHarvestTime)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, true, "Il n'y a pas assez de spores à récolter", from.NetState);
                return;
            }
            
            from.SendMessage("Vous cueillez le champignon"); 
            from.AddToBackpack(new HallucinogenMushroom());

            HarvestTime = DateTime.Now + TimeSpan.FromHours(Utility.RandomMinMax(2,10)); // TODO: Proper time delay
        }
		public override void OnDoubleClick(Mobile from)
		{
			if ( !IsChildOf( from.Backpack ) )
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			else
			{
				from.PrivateOverheadMessage( 0, 1154, false,  "Choose the beeswax you wish to melt or target the pot to empty it.", from.NetState );
				BeginAdd( from );
			}
		}
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m is Golem )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				// Algorithm: (10% of magery) + (1-5)

				int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
				toHeal += Utility.Random( 1, 5 );

				int healmessage = Math.Min( m.HitsMax - m.Hits, toHeal );

				m.Heal( toHeal );

				if ( healmessage > 0 )
				{
					m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), m.NetState );
					if ( Caster != m )
						m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), Caster.NetState );
				}

				m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
				m.PlaySound( 0x1F2 );
			}

			FinishSequence();
		}
 public override void OnDoubleClick(Mobile from)
 {
     Item nm = from.Backpack.FindItemByType(typeof(AncientScroll1));
     if (nm != null)
     {
         from.AddToBackpack(new AncientScroll3());
         nm.Delete();
         Delete();
     }
     else
     {
         from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "You lack the other peice to combine with this", from.NetState);
     }
 }
		public void DoHeal( Mobile from )
		{
			int min = Scale( from, MinHeal );
			int max = Scale( from, MaxHeal );

			int toHeal = Utility.RandomMinMax( min, max );

			int healmessage = Math.Min( from.HitsMax - from.Hits, toHeal );

			from.Heal( toHeal );

			if ( healmessage > 0 )
				from.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), from.NetState );
		}
		public override void OnDoubleClick(Mobile from)
        {
			Item n = from.Backpack.FindItemByType(typeof(FiferPigsScroll));
            if (n != null)
            {
				from.AddToBackpack(new FiferandFiddlerpigsScroll());
                n.Delete();
                Delete();
            }
            else
            {
                from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "You need Fifer Pig's Scroll to combine with Fiddler's", from.NetState);
            }
		}
		public override void OnDoubleClick(Mobile from)
        {
			Item n = from.Backpack.FindItemByType(typeof(WolfsScroll));
            if (n != null)
            {
				from.AddToBackpack(new LittleRedRiddingHoodStory());
                n.Delete();
                Delete();
            }
            else
            {
                from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "You lack the other peice of the story to combine with this", from.NetState);
            }
		}
        public override void OnDoubleClick(Mobile from)
        {
            MerlinsStaff Staff = from.FindItemOnLayer(Layer.TwoHanded) as MerlinsStaff;

            if (Parent != from)
            {
                from.SendMessage("You remember that you must equip the staff to summon a portal to Merlin");
            }
            else
            {
                Item mg2 = new MerlinsGate2();
                mg2.Location = from.Location;
                mg2.Map = from.Map;
                from.PrivateOverheadMessage( MessageType.Regular, 1153, false, "You feel the power of the Staff and Spellbook working together", from.NetState );
            }
        }
Exemple #19
0
        public override int danoBonus(HabilidadeNode node, Jogador atacante, Mobile defensor)
        {
            int bonus = 0;

            if(isMortoVivo(defensor)) {

                bonus = (int) (atacante.Skills.SpiritSpeak.Value / 10);

                atacante.SendMessage("Bonus dano Poder da Fé: {0}", bonus);

                //mensagem para atacante e defensor
                atacante.PublicOverheadMessage(Server.Network.MessageType.Regular, 0, false, "Poder da Fé!");
                defensor.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0, false, "Você recebeu o Poder da Fé!", defensor.NetState);
            }

            return bonus;
        }
		public override void OnDoubleClick( Mobile m )
		{
			if ( m.InRange( this, 3 ) ) 
			{
				switch ( ItemID ) 
				{ 
					//do swap or animation here 
					case 0x124B: //open
						Effects.PlaySound( m.Location, m.Map, 0x2D );
						this.ItemID=0x124A; break;
					case 0x124C: //open
						Effects.PlaySound( m.Location, m.Map, 0x2D );
						this.ItemID=0x124A; break;
					case 0x124D: //clean
						if (m.Female)
						{
							Effects.PlaySound( m.Location, m.Map, 0x32D );
						}
						else
						{
							Effects.PlaySound( m.Location, m.Map, 0x43F );
						}
						this.ItemID=0x124B; //open

						m.PrivateOverheadMessage( MessageType.Regular, 1153, false, "You quickly clean up the blood!", m.NetState );

						break; 
					case 0x124A: //close 
						this.ItemID=0x124B;
						Effects.PlaySound( m.Location, m.Map, 0x2C );
						new InternalTimer( this, m ).Start();
						break;
					default: break; 
				}
			}
			else
			{
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
		}
Exemple #21
0
        public override void OnDoubleClick(Mobile from)
        {
            if (CityLoyaltySystem.Enabled && CityLoyaltySystem.IsSetup() && from.InRange(this.Location, 3))
            {
                if (_Cooldown == null || !_Cooldown.ContainsKey(from) || _Cooldown[from] < DateTime.UtcNow)
                {
                    var rope = new GuardsmansRope();
                    from.AddToBackpack(rope);

                    from.SendLocalizedMessage(1152263); // You take a rope from the chest. Use it to arrest rioters and subdued raiders.

                    if (_Cooldown == null)
                        _Cooldown = new Dictionary<Mobile, DateTime>();

                    _Cooldown[from] = DateTime.UtcNow + TimeSpan.FromSeconds(60);
                }
                else
                    from.SendLocalizedMessage(1152264); // You must wait a moment before taking another rope.
            }
            else
                from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045, from.NetState); // I can't reach that.
        }
		protected override void OnTarget( Mobile from, object targeted )
		{
			if ( m_Item.Deleted )
				return;

			if ( targeted is ICarvable )
			{
				((ICarvable)targeted).Carve( from, m_Item );
			}
			else if ( targeted is SwampDragon && ((SwampDragon)targeted).HasBarding )
			{
				SwampDragon pet = (SwampDragon)targeted;

				if ( !pet.Controlled || pet.ControlMaster != from )
					from.SendLocalizedMessage( 1053022 ); // You cannot remove barding from a swamp dragon you do not own.
				else
					pet.HasBarding = false;
			}
            else if (targeted is Head)
            {
                Head targ = (Head)targeted;

                if (from.Karma > - 1500)
                {
                    from.SendMessage("Vous n'avez pas le profil d'un dépeceur de crâne...");
                    return;
                }

                if (from.Dex <= Utility.Random(110))
                {
                    from.SendMessage("Vous avez été trop maladroit et avez raté le dépeçage");
                    targ.Delete();
                    return;
                }

                from.SendMessage("Vous achevez d'enlever la chair du crâne.");
                from.AddToBackpack(new Skull());
                targ.Consume();
            }
            else if (targeted is Pumpkin)
            {
                Pumpkin targ = (Pumpkin)targeted;

                if(from.Dex <= Utility.Random(100))
                {
                    from.SendMessage("Vous avez été trop maladroit et avez raté votre tracé");
                    targ.Consume();
                    return;
                }

                int karma= 0;

                if (from.Karma > 100)
                    karma ++;
                else if (from.Karma < -100)
                    karma --;
                
                int chance = Utility.Random(4) + karma;

                if (chance >=2)
                    from.AddToBackpack(new SmileyPumpkin());
                else
                    from.AddToBackpack(new EvilPumpkin());

                from.SendMessage("Vous taillez la citrouille selon votre humeur");
                targ.Consume();
            }
			else
			{
				if ( targeted is StaticTarget )
				{
					int itemID = ((StaticTarget)targeted).ItemID;

					if ( itemID == 0xD15 || itemID == 0xD16 ) // red mushroom
					{
						PlayerMobile player = from as PlayerMobile;

						if ( player != null )
						{
							QuestSystem qs = player.Quest;

							if ( qs is WitchApprenticeQuest )
							{
								FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;

								if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms )
								{
									player.SendLocalizedMessage( 1055036 ); // You slice a red cap mushroom from its stem.
									obj.Complete();
									return;
								}
							}
						}
					}
				}

				HarvestSystem system = Lumberjacking.System;
				HarvestDefinition def = Lumberjacking.System.Definition;

				int tileID;
				Map map;
				Point3D loc;

				if ( !system.GetHarvestDetails( from, m_Item, targeted, out tileID, out map, out loc ) )
				{
					from.SendLocalizedMessage( 500494 ); // You can't use a bladed item on that!
				}
				else if ( !def.Validate( tileID ) )
				{
					from.SendLocalizedMessage( 500494 ); // You can't use a bladed item on that!
				}
				else
				{
					HarvestBank bank = def.GetBank( map, loc.X, loc.Y );

					if ( bank == null )
						return;

					if ( bank.Current < 5 )
					{
						from.SendLocalizedMessage( 500493 ); // There's not enough wood here to harvest.
					}
					else
					{
						bank.Consume( 5, from );

                        if (map.Season == (int)ServerSeasons.Season.Spring && Utility.RandomDouble() < 0.33)
                        {
                            from.PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, false, "De la sève se met à couler du tronc, souhaitez-vous la recueillir?", from.NetState);
                            from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnSelectTarget));
                            return;
                        }

						Item item = new Kindling();

						if ( from.PlaceInBackpack( item ) )
						{
							from.SendLocalizedMessage( 500491 ); // You put some kindling into your backpack.
							from.SendLocalizedMessage( 500492 ); // An axe would probably get you more wood.
						}
						else
						{
							from.SendLocalizedMessage( 500490 ); // You can't place any kindling into your backpack!

							item.Delete();
						}
					}
				}
			}
		}
Exemple #23
0
        public static void RecordDamage(Mobile owner, Mobile from, Mobile target, DamageType damageType, int amount)
        {
            PlayerMobile player = owner as PlayerMobile;

            if (player == null)
            {
                return;
            }

            if (player.m_DamageTracker == null)
            {
                player.m_DamageTracker = new DamageTracker(player);
            }

            switch (damageType)
            {
            case DamageType.MeleeDamage:
                if (player.m_ShowMeleeDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerMeleeDamageTextHue, "You attack " + target.Name + " for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowMeleeDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerMeleeDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;

            case DamageType.SpellDamage:
                if (player.m_ShowSpellDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerSpellDamageTextHue, "Your spell hits " + target.Name + " for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowSpellDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerSpellDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;

            case DamageType.FollowerDamage:
                if (player.m_ShowFollowerDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerFollowerDamageTextHue, "Follower: " + from.Name + " attacks " + target.Name + " for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowFollowerDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerFollowerDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;

            case DamageType.ProvocationDamage:
                if (player.m_ShowProvocationDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerProvocationDamageTextHue, "Provocation: " + from.Name + " inflicts " + amount.ToString() + " damage on " + target.Name + ".");
                }

                if (player.m_ShowProvocationDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerProvocationDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;

            case DamageType.PoisonDamage:
                if (player.m_ShowPoisonDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerPoisonDamageTextHue, "You inflict " + amount.ToString() + " poison damage on " + target.Name + ".");
                }

                if (player.m_ShowPoisonDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerPoisonDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;

            case DamageType.DamageTaken:
                if (player.m_ShowDamageTaken == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerDamageTakenTextHue, from.Name + " attacks you for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowDamageTaken == DamageDisplayMode.PrivateOverhead)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, player.PlayerDamageTakenTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;

            case DamageType.FollowerDamageTaken:
                if (player.m_ShowFollowerDamageTaken == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerFollowerDamageTakenTextHue, "Follower: " + target.Name + " is hit for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowFollowerDamageTaken == DamageDisplayMode.PrivateOverhead && player.NetState != null)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerFollowerDamageTakenTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;
            }

            if (!player.m_DamageTracker.m_Running)
            {
                return;
            }

            switch (damageType)
            {
            case DamageType.MeleeDamage: player.m_DamageTracker.MeleeDamage += amount; break;

            case DamageType.SpellDamage: player.m_DamageTracker.SpellDamage += amount; break;

            case DamageType.FollowerDamage: player.m_DamageTracker.FollowerDamage += amount; break;

            case DamageType.ProvocationDamage: player.m_DamageTracker.ProvocationDamage += amount; break;

            case DamageType.PoisonDamage: player.m_DamageTracker.PoisonDamage += amount; break;

            case DamageType.DamageTaken: player.m_DamageTracker.DamageTaken += amount; break;

            case DamageType.FollowerDamageTaken: player.m_DamageTracker.FollowerDamageTaken += amount; break;

            case DamageType.HealingDealt: player.m_DamageTracker.HealingDealt += amount; break;
            }
        }
Exemple #24
0
        public static void OnVirtueUsed(Mobile from)
        {
            if (VirtueHelper.GetLevel(from, VirtueName.Humility) < VirtueLevel.Seeker)
            {
                from.SendLocalizedMessage(1155812); // You must be at least a Seeker of Humility to Invoke this ability.
            }
            else if (from.Alive)
            {
                from.SendLocalizedMessage(1155817); // Target the pet you wish to embrace with your Humility.
                from.BeginTarget(10, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
                {
                    if (targeted is BaseCreature)
                    {
                        BaseCreature bc = targeted as BaseCreature;

                        if (!bc.Alive)
                        {
                            from.SendLocalizedMessage(1155815); // You cannot embrace Humility on the dead!
                        }
                        else if (VirtueHelper.GetLevel(m, VirtueName.Humility) < VirtueLevel.Seeker)
                        {
                            from.SendLocalizedMessage(1155812); // You must be at least a Seeker of Humility to Invoke this ability.
                        }
                        else if (!bc.Controlled && !bc.Summoned)
                        {
                            from.SendLocalizedMessage(1155813); // You can only embrace your Humility on a pet.
                        }
                        else if (ActiveTable.ContainsKey(bc))
                        {
                            from.SendLocalizedMessage(1156047); // That pet has already embraced Humility.
                        }
                        else
                        {
                            VirtueHelper.Atrophy(from, VirtueName.Humility, 3200);
                            from.SendLocalizedMessage(1155818); // You have lost some Humility.

                            ActiveTable[bc] = from;

                            m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1150, 1155819, from.NetState); // *Your pet surges with the power of your Humility!*
                            bc.FixedEffect(0x373A, 10, 16);

                            BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.Humility, 1156049, 1156050, TimeSpan.FromMinutes(20), from, String.Format("{0}\t{1}", bc.Name, GetRegenBonus(bc)))); // Pet: ~1_NAME~<br>+~2_VAL~ HPR<br>

                            CheckTimer();
                            bc.ResetStatTimers();

                            Timer.DelayCall(TimeSpan.FromMinutes(20), (o) =>
                            {
                                Mobile mob = o as Mobile;

                                if (mob != null && ActiveTable.ContainsKey(mob))
                                {
                                    Mobile user = ActiveTable[mob];
                                    ActiveTable.Remove(mob);

                                    BuffInfo.RemoveBuff(user, BuffIcon.Humility);
                                    user.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1150, 1155823, from.NetState); // *Your pet's power returns to normal*

                                    CheckTimer();
                                }
                            }, bc);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1155813); // You can only embrace your Humility on a pet.
                    }
                });
            }
        }
		public static void HandleMobile_OnSpeech(Mobile m, SpeechEventArgs e)
		{
			if (e.Mobile != null && !e.Handled)
			{
				bool handle = false;

				for (int i = 0; i < DefVendorKeyPhrases.Length; i++)
				{
					if (e.Speech.ToLower().Contains(DefVendorKeyPhrases[i]))
					{
						handle = true;
						break;
					}
				}

				if (handle)
				{
					int thisNoto = Notoriety.Compute(m, m);
					bool neg = false;

					switch (Notoriety.Compute(m, e.Mobile))
					{
						case Notoriety.Ally:
							{
								m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "Greetings, ally! I need to see your Hearthstone...", e.Mobile.NetState);
							} break;

						case Notoriety.Criminal:
							{
								if (thisNoto == Notoriety.Criminal)
								{
									m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "Be quiet, let me see your Hearthstone.", e.Mobile.NetState);
								}
								else
								{
									m.PrivateOverheadMessage(MessageType.Yell, m.SpeechHue, true, "Do you really think I'd want a criminal coming and going freely to my bar? Get out before I call the guards!", e.Mobile.NetState);
									e.Handled = true;
									return;
								}
							} break;

						case Notoriety.Enemy:
							{
								m.PrivateOverheadMessage(MessageType.Yell, m.SpeechHue, true, "Get lost before I kill you, scum.", e.Mobile.NetState);
								e.Handled = true;
								return;
							} //break;

						case Notoriety.Innocent:
							{
								if (thisNoto == Notoriety.Criminal || thisNoto == Notoriety.Murderer)
								{
									m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "Give me one good reason why I should serve you.", e.Mobile.NetState);
									e.Handled = true;
									return;
								}
								else
								{
									m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "One moment, I need to see your Hearthstone...", e.Mobile.NetState);
								}
							} break;

						case Notoriety.Murderer:
							{
								if (thisNoto == Notoriety.Criminal || thisNoto == Notoriety.Murderer)
								{
									m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "Just shut up and show me your damned Hearthstone!", e.Mobile.NetState);
									neg = true;
								}
								else if (thisNoto == Notoriety.Innocent)
								{
									m.PrivateOverheadMessage(MessageType.Yell, m.SpeechHue, true, "Get out of here before I call the guards or kill you, whichever comes first!", e.Mobile.NetState);
								}
								else if (thisNoto == Notoriety.Invulnerable)
								{
									m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "You caught me in a good mood, show me your Hearthstone and be gone!", e.Mobile.NetState);
								}
								else
								{
									m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "One moment, I need to see your Hearthstone...", e.Mobile.NetState);
								}
							} break;

						case Notoriety.Invulnerable:
							{
								m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "Anything you say, boss! I just need to see your Hearthstone...", e.Mobile.NetState);
								e.Handled = true;
								return;
							} //break;
					}

					Hearthstone hs = Hearthstone.GetStone(e.Mobile);

					if (hs != null)
					{
						if (hs.IsChildOf(e.Mobile.Backpack))
						{
							hs.Home.Set(e.Mobile.Location, e.Mobile.Map);
							m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "There, your Hearthstone has been enchanted, allowing you to recall to " + hs.Home.Name + " every so often.", e.Mobile.NetState);
							e.Handled = true;
							return;
						}
						else
						{
							if (neg)
								m.PrivateOverheadMessage(MessageType.Yell, m.SpeechHue, true, "You don't have your Hearthstone with you! You're wasting my time!", e.Mobile.NetState);
							else
								m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "You don't have your Hearthstone with you.", e.Mobile.NetState);

							e.Handled = true;
							return;
						}
					}
					else
					{
						if (neg)
							m.PrivateOverheadMessage(MessageType.Yell, m.SpeechHue, true, "Pathetic, you don't even have a Hearthstone.", e.Mobile.NetState);
						else
							m.PrivateOverheadMessage(MessageType.Regular, m.SpeechHue, true, "Sorry, but you don't have a Hearthstone.", e.Mobile.NetState);

						e.Handled = true;
						return;
					}
				}
			}
		}
Exemple #26
0
        public static void RecordDamage(Mobile owner, Mobile from, Mobile target, DamageType damageType, int amount)
        {
            PlayerMobile player = owner as PlayerMobile;

            if (player == null)
            {
                return;
            }

            if (player.m_DamageTracker == null)
            {
                player.m_DamageTracker = new DamageTracker(player);
            }

            BaseCreature bc_From   = from as BaseCreature;
            BaseCreature bc_Target = target as BaseCreature;

            PlayerMobile pm_From   = from as PlayerMobile;
            PlayerMobile pm_Target = target as PlayerMobile;

            PlayerMobile rootPlayerFrom   = pm_From;
            PlayerMobile rootPlayerTarget = pm_Target;

            #region Ship Damage to Creature: For Doubloon Distribution on Death

            if (bc_Target != null)
            {
                if (bc_Target.DoubloonValue > 0)
                {
                    BaseShip shipFrom = null;

                    if (bc_From != null)
                    {
                        if (bc_From.ShipOccupied != null)
                        {
                            shipFrom = bc_From.ShipOccupied;
                        }
                    }

                    if (pm_From != null)
                    {
                        if (pm_From.ShipOccupied != null)
                        {
                            shipFrom = pm_From.ShipOccupied;
                        }
                    }

                    if (shipFrom != null)
                    {
                        bool foundDamageEntry = false;

                        foreach (DamageFromShipEntry damageFromShipEntry in bc_Target.m_DamageFromShipEntries)
                        {
                            if (damageFromShipEntry == null)
                            {
                                continue;
                            }

                            if (damageFromShipEntry.m_Ship == shipFrom)
                            {
                                damageFromShipEntry.m_TotalAmount   += amount;
                                damageFromShipEntry.m_LastDamageTime = DateTime.UtcNow;

                                foundDamageEntry = true;
                            }
                        }

                        if (!foundDamageEntry)
                        {
                            DamageFromShipEntry damageEntry = new DamageFromShipEntry(shipFrom, amount, DateTime.UtcNow);

                            bc_Target.m_DamageFromShipEntries.Add(damageEntry);
                        }
                    }
                }
            }

            #endregion

            #region Arena

            bool checkArenaDamage = false;

            if (bc_From != null)
            {
                if (bc_From.ControlMaster is PlayerMobile)
                {
                    rootPlayerFrom = bc_From.ControlMaster as PlayerMobile;
                }
            }

            if (bc_Target != null)
            {
                if (bc_Target.ControlMaster is PlayerMobile)
                {
                    rootPlayerTarget = bc_Target.ControlMaster as PlayerMobile;
                }
            }

            if (rootPlayerFrom != null && rootPlayerTarget != null)
            {
                ArenaGroupController arenaGroupControllerFrom   = ArenaGroupController.GetArenaGroupRegionAtLocation(rootPlayerFrom.Location, rootPlayerFrom.Map);
                ArenaGroupController arenaGroupControllerTarget = ArenaGroupController.GetArenaGroupRegionAtLocation(rootPlayerFrom.Location, rootPlayerFrom.Map);

                if (arenaGroupControllerFrom != null && arenaGroupControllerTarget != null && arenaGroupControllerFrom == arenaGroupControllerTarget)
                {
                    if (rootPlayerFrom.m_ArenaMatch != null && rootPlayerTarget.m_ArenaMatch != null && rootPlayerFrom.m_ArenaMatch == rootPlayerTarget.m_ArenaMatch)
                    {
                        if (rootPlayerFrom.m_ArenaMatch.m_MatchStatus == ArenaMatch.MatchStatusType.Fighting)
                        {
                            checkArenaDamage = true;
                        }
                    }
                }
            }

            #endregion

            switch (damageType)
            {
            case DamageType.MeleeDamage:
                if (player.m_ShowMeleeDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerMeleeDamageTextHue, "You attack " + target.Name + " for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowMeleeDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerMeleeDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }

                if (checkArenaDamage)
                {
                    ArenaFight.CheckArenaDamage(player, DamageType.MeleeDamage, amount);
                }
                break;

            case DamageType.SpellDamage:
                if (player.m_ShowSpellDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerSpellDamageTextHue, "Your spell hits " + target.Name + " for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowSpellDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerSpellDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }

                if (checkArenaDamage)
                {
                    ArenaFight.CheckArenaDamage(player, DamageType.SpellDamage, amount);
                }
                break;

            case DamageType.FollowerDamage:
                if (player.m_ShowFollowerDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerFollowerDamageTextHue, "Follower: " + from.Name + " attacks " + target.Name + " for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowFollowerDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerFollowerDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }

                if (checkArenaDamage)
                {
                    ArenaFight.CheckArenaDamage(player, DamageType.FollowerDamage, amount);
                }
                break;

            case DamageType.ProvocationDamage:
                if (player.m_ShowProvocationDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerProvocationDamageTextHue, "Provocation: " + from.Name + " inflicts " + amount.ToString() + " damage on " + target.Name + ".");
                }

                if (player.m_ShowProvocationDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerProvocationDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }

                if (checkArenaDamage)
                {
                    ArenaFight.CheckArenaDamage(player, DamageType.ProvocationDamage, amount);
                }
                break;

            case DamageType.PoisonDamage:
                if (player.m_ShowPoisonDamage == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerPoisonDamageTextHue, "You inflict " + amount.ToString() + " poison damage on " + target.Name + ".");
                }

                if (player.m_ShowPoisonDamage == DamageDisplayMode.PrivateOverhead)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerPoisonDamageTextHue, false, "-" + amount.ToString(), player.NetState);
                }

                if (checkArenaDamage)
                {
                    ArenaFight.CheckArenaDamage(player, DamageType.PoisonDamage, amount);
                }
                break;

            case DamageType.DamageTaken:
                if (player.m_ShowDamageTaken == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerDamageTakenTextHue, from.Name + " attacks you for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowDamageTaken == DamageDisplayMode.PrivateOverhead)
                {
                    player.PrivateOverheadMessage(MessageType.Regular, player.PlayerDamageTakenTextHue, false, "-" + amount.ToString(), player.NetState);
                }

                if (checkArenaDamage)
                {
                    ArenaFight.CheckArenaDamage(player, DamageType.DamageTaken, amount);
                }
                break;

            case DamageType.FollowerDamageTaken:
                if (player.m_ShowFollowerDamageTaken == DamageDisplayMode.PrivateMessage)
                {
                    player.SendMessage(player.PlayerFollowerDamageTakenTextHue, "Follower: " + target.Name + " is hit for " + amount.ToString() + " damage.");
                }

                if (player.m_ShowFollowerDamageTaken == DamageDisplayMode.PrivateOverhead && player.NetState != null)
                {
                    target.PrivateOverheadMessage(MessageType.Regular, player.PlayerFollowerDamageTakenTextHue, false, "-" + amount.ToString(), player.NetState);
                }
                break;
            }

            if (!player.m_DamageTracker.m_Running)
            {
                return;
            }

            switch (damageType)
            {
            case DamageType.MeleeDamage: player.m_DamageTracker.MeleeDamage += amount; break;

            case DamageType.SpellDamage: player.m_DamageTracker.SpellDamage += amount; break;

            case DamageType.FollowerDamage: player.m_DamageTracker.FollowerDamage += amount; break;

            case DamageType.ProvocationDamage: player.m_DamageTracker.ProvocationDamage += amount; break;

            case DamageType.PoisonDamage: player.m_DamageTracker.PoisonDamage += amount; break;

            case DamageType.DamageTaken: player.m_DamageTracker.DamageTaken += amount; break;

            case DamageType.FollowerDamageTaken: player.m_DamageTracker.FollowerDamageTaken += amount; break;

            case DamageType.HealingDealt: player.m_DamageTracker.HealingDealt += amount; break;
            }
        }
		public void BeginAdd( Mobile from )
		{
			if ( m_RawBeeswax < MaxWax )
				from.Target = new AddWaxTarget( this );
			else
				from.PrivateOverheadMessage( 0, 1154, false,  "The pot cannot hold any more raw beeswax.", from.NetState );
		}
		public void EndAdd( Mobile from, object o )
		{
			if ( o is Item && ((Item)o).IsChildOf( from.Backpack ) )
			{
				if( o is RawBeeswax )
				{
					RawBeeswax wax = (RawBeeswax)o;

					if( (wax.Amount + RawBeeswax) > MaxWax )
					{
						wax.Amount -= (MaxWax - RawBeeswax);
						RawBeeswax = MaxWax;
					}
					else
					{
						RawBeeswax += wax.Amount;
						wax.Delete();
					}

					from.PrivateOverheadMessage( 0, 1154, false,  "You put raw beeswax in the pot.", from.NetState );

					if( from.HasGump( typeof(BeehiveSmallPotGump)) )
						from.CloseGump( typeof(BeehiveSmallPotGump) );

					from.SendGump( new BeehiveSmallPotGump( from, this ) ); //resend the gump

					if ( m_RawBeeswax < MaxWax )
						BeginAdd( from );
				}
				else
					from.PrivateOverheadMessage( 0, 1154, false,  "You can only put raw beeswax in the pot.", from.NetState );
			}
			else
			{
				from.PrivateOverheadMessage( 0, 1154, false,  "The wax must be in your pack to target it.", from.NetState );
			}
		}
 public override void OnDoubleClick(Mobile from)
 {
     if (!m_Active)
         from.SendMessage(0x9A, "This table is inactive");
     else if (!InRange(from.Location, 8))
         from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x22, true, "I am too far away to do that", from.NetState);
     else if (m_MinBuyIn == 0 || m_MaxBuyIn == 0)
         from.SendMessage(0x9A, "This table is inactive");
     else if (m_MinBuyIn > m_MaxBuyIn)
         from.SendMessage(0x9A, "This table is inactive");
     else if (m_Seats.Count < m_MaxPlayers)
         from.SendMessage(0x9A, "This table is inactive");
     else if (m_Game.GetIndexFor(from) != -1)
         return; //TODO: Grab more chips from the player's bankbox
     else if (m_Game.Players.Count >= m_MaxPlayers)
     {
         from.SendMessage(0x22, "This table is full");
         base.OnDoubleClick(from);
     }
     else if (m_Game.Players.Count < m_MaxPlayers)
     {
         //TODO: Send player the poker join gump
         from.CloseGump(typeof(PokerJoinGump));
         from.SendGump(new PokerJoinGump(from, m_Game));
     }
 }
Exemple #30
0
		public override void OnDoubleClick(Mobile from)
		{
			from.PrivateOverheadMessage( 0, 1154, false,  "This tool is used to harvest resources from a beehive.", from.NetState );				
		}
Exemple #31
0
		protected override void OnTarget( Mobile from, object o )
		{
			if( o is Container)
			{
				Container xx = o as Container;

//				if (xx is QuestHolder)
//				{
//					from.LocalOverheadMessage( MessageType.Regular, 0x22, true, "Dumping into a Questbook is an exploit. Your Account has been flagged."); 
//	                  ((Account)from.Account).SetTag( "QuestExploit", "true"); 
//					return;
//				}
				//make sure they aren't targeting same container
				if (xx == FromCont)
				{
//					from.PublicOverheadMessage( MessageType.Regular, 0x22, true, "The container to dump INTO must be different from the one you are dumping FROM.");
					from.PrivateOverheadMessage( MessageType.Regular, 0x22, true, "The container to dump INTO must be different from the one you are dumping FROM.", from.NetState);
					return;
				}
                if (xx == FromCont || xx.IsChildOf(FromCont))
                {
//					from.PublicOverheadMessage( MessageType.Regular, 0x22, true, "You cannot sort INTO a subcontainer of the same container you are sorting FROM."); 
					from.PrivateOverheadMessage( MessageType.Regular, 0x22, true, "You cannot sort INTO a subcontainer of the same container you are sorting FROM.", from.NetState);
					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!");
						from.PrivateOverheadMessage( MessageType.Regular, 0x22, true, "That container is too full!", from.NetState);
				}
			}
			else
			{
//				from.PublicOverheadMessage( MessageType.Regular, 0x22, true, "That is not a container!");
				from.PrivateOverheadMessage( MessageType.Regular, 0x22, true, "That is not a container!", from.NetState);

			}
		}
Exemple #32
0
        public override void OnDoubleClick( Mobile from )
        {
            BottleOfPungentBrew bottle;

            if ( m_Held <= 0 )
            {
                // A foggy memory is recalled and you have to ask yourself, "Why is the Pungent Brew always gone?"
                from.PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 1113610, from.Client );
            }
            else if ( ( bottle = from.Backpack.FindItemByType<BottleOfPungentBrew>() ) == null )
            {
                // Where is your special bottle for Flint's brew?
                from.SendLocalizedMessage( 1113619 );
            }
            else if ( bottle.Empty )
            {
                // You refill the special bottle with Flint's Pungent Brew.  Boy, it's lucky you kept that bottle!
                from.PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 1113609, from.Client );

                bottle.Empty = false;

                Held--;
            }
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        { 
                   Mobile m = from;
			PlayerMobile mobile = m as PlayerMobile;

            if (mobile != null)
            {
                if (dropped is ElementFeu)
                {
                        dropped.Delete();
                        mobile.SendGump(new ElementQuestGump2(from));
                        mobile.AddToBackpack(new eParchment1());
                        return true;
                    }
                  else if (dropped is ElementAir)
                {
                        dropped.Delete();
                        mobile.SendGump(new ElementQuestGump4(from));
                        mobile.AddToBackpack(new eParchment2());
                        return true;
                    }
                    else if (dropped is ElementEau)
                {
                        dropped.Delete();
                        mobile.SendGump(new ElementQuestGump6(from));
                        mobile.AddToBackpack(new aeParchment1());
                        return true;
                    }
                  else if (dropped is ElementTerre)
                {
                        dropped.Delete();
                        mobile.SendGump(new ElementQuestGump8(from));
                        mobile.AddToBackpack(new aeParchment2());
                        return true;
                    }
                
                    else
                    {
                        from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Have we met before ?", from.NetState);
                        return false;
                    }
                }
                else
                {
                    from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "What am I to do with this ?", from.NetState);
                    return false;
                }

            }