Ejemplo n.º 1
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				BaseCreature pet = new Horse();

				pet.SetControlMaster( from );
				pet.Direction = Direction.Down;

				pet.MoveToWorld( from.Location, from.Map );

				pet.ControlTarget = from;
				pet.ControlOrder = OrderType.Follow;

				pet.Animate( 5, 7, 1, true, false, 0 );
				//pet.PlaySound( pet.GetAttackSound() );

				Consume();
			}
			else
				from.SendLocalizedMessage( 1042010 );
		}
Ejemplo n.º 2
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null || this.Word == null || (this.RequireIdentification && !this.m_Identified))
                return;

            if (DateTime.Now < this.m_EndTime)
                return;

            string msgstr = "Activating the power of " + this.Word;

            // assign powers to certain words
            switch ( this.Word )
            {
                case "Shoda":
                    m.AddStatMod(new StatMod(StatType.Int, "Shoda", 20, this.Duration));
                    m.SendMessage("Your mind expands!");
                    break;
                case "Malik":
                    m.AddStatMod(new StatMod(StatType.Str, "Malik", 20, this.Duration));
                    m.SendMessage("Your strength surges!");
                    break;
                case "Lepto":
                    m.AddStatMod(new StatMod(StatType.Dex, "Lepto", 20, this.Duration));
                    m.SendMessage("You are more nimble!");
                    break;
                case "Velas":
                    Timer.DelayCall(TimeSpan.Zero, new TimerStateCallback(Hide_Callback), new object[] { m });
                    m.SendMessage("You disappear!");
                    break;
                case "Tarda":
                    m.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, 20, this.Duration));
                    m.SendMessage("You are more skillful warrior!");
                    break;
                case "Marda":
                    m.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, 20, this.Duration));
                    m.SendMessage("You are more skillful mage!");
                    break;
                case "Vas Malik":
                    m.AddStatMod(new StatMod(StatType.Str, "Vas Malik", 40, this.Duration));
                    m.SendMessage("You are exceptionally strong!");
                    break;
                case "Nartor":
                    BaseCreature b = new Drake();
                    b.MoveToWorld(m.Location, m.Map);
                    b.Owners.Add(m);
                    b.SetControlMaster(m);
                    if (b.Controlled)
                        m.SendMessage("You master the beast!");
                    break;
                case "Santor":
                    b = new Horse();
                    b.MoveToWorld(m.Location, m.Map);
                    b.Owners.Add(m);
                    b.SetControlMaster(m);
                    if (b.Controlled)
                        m.SendMessage("You master the beast!");
                    break;
                default:
                    m.SendMessage("There is no effect.");
                    break;
            }
            
            // display activation effects
            Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
            Effects.PlaySound(m, m.Map, 0x201);

            // display a message over the item it was attached to
            if (this.AttachedTo is Item)
            {
                ((Item)this.AttachedTo).PublicOverheadMessage(MessageType.Regular, 0x3B2, true, msgstr);
            }
            
            this.Charges--;

            // remove the attachment after the charges run out
            if (this.Charges == 0)
            {
                this.Delete();
            }
            else
            {
                this.m_EndTime = DateTime.Now + this.Refractory;
            }
        }