Esempio n. 1
0
		public override void OnDoubleClick( Mobile m )
		{
			if ( m.InRange( this, 3 ) ) 
			{
				switch ( ItemID ) 
				{ 
					//do swap or animation here 
					case 10857: //1
					 m.PrivateOverheadMessage( MessageType.Regular, 0x3b2, false, "Hello?", m.NetState );
						ItemID=10858; 
						break;
					case 10858: //2
					m.PrivateOverheadMessage( MessageType.Regular, 0x3b2, false, "What was that?", m.NetState );
						ItemID=10859; 
						break;
					case 10859: //3
					m.PrivateOverheadMessage( MessageType.Regular, 0x3b2, false, "I must be seeing things?", m.NetState );	
						ItemID=10860; 
						break;
					case 10860: //4
						ItemID=10857; 
//						new InternalTimer( this, m ).Start();
						break; 
					default: break; 
				}
			}
			else
			{
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
		}
		public override void OnDoubleClick( Mobile m )
		{
			if ( m.InRange( this, 3 ) ) 
			{
				switch ( ItemID ) 
				{ 
					//do swap or animation here 
					case 10845: //1
						ItemID=10846;
						m.PrivateOverheadMessage( MessageType.Regular, 0x3b2, false, "What was that?", m.NetState ); 
						break;
					case 10846: //2
						ItemID=10847; 
						break;
					case 10847: //3
						ItemID=10848; 
						break;
					case 10848: //4
						ItemID=10845; 
						break;
					default: break; 
				}
			}
			else
			{
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
		}
Esempio n. 3
0
        public override bool OnEquip(Mobile from)
        {
            if (from.Karma > -5000)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3b2, true, "Your karma is too high to equip this", from.NetState);
                return false;
            }

            if (from.Skills[SkillName.Swords].Base < 100.0)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3b2, true, "You don't know enough about swordfighting to equip this", from.NetState);
                return false;
            }

            return base.OnEquip(from);
        }
Esempio n. 4
0
		public override void OnDoubleClick( Mobile m )
		{
			if ( m.InRange( this, 3 ) ) 
			{
				switch ( ItemID ) 
				{ 
					//do swap or animation here 
					case 10861: //1
						ItemID=10862;
						m.PrivateOverheadMessage( MessageType.Regular, 1153, false, "What was that?  It's watching me.", m.NetState ); 
						break;
					case 10862: //2
						ItemID=10863; 
						break;
					case 10863: //3
						ItemID=10864; 
						break;
					case 10864: //4
						ItemID=10861; 
						break;
					default: break; 
				}
			}
			else
			{
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
		}
Esempio n. 5
0
        public override bool OnEquip(Mobile from)
        {
            if (from.Skills[SkillName.Tactics].Base < 100.0)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3b2, true, "You don't know enough about tactics to equip this", from.NetState);
                return false;
            }

            if (from.Skills[SkillName.Archery].Base < 100.0)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3b2, true, "You don't know enough about archery to equip this", from.NetState);
                return false;
            }

            return base.OnEquip(from);
        }
Esempio n. 6
0
        public void ChangelingDropTarget(Mobile from, object obj)
        {
            if (!(obj is HairStrand))
            {
                from.SendMessage("Cela ne servirait à rien de verser le liquide ici");
                return;
            }

            HairStrand targ = (HairStrand)obj;

            if (from.Skills[SkillName.Alchemy].Value < 60)
            {
                from.SendMessage("Vos maigres talents d'alchimistes ne permettraient pas une pareille mixture...");
                return;
            }

            if (!from.CheckTargetSkill(SkillName.Alchemy, targ, 55, 95))
            {
                from.SendMessage("Vous mettez trop de cheveux à l'intérieur, ce qui gâche le mélange...");
                targ.Delete();
                return;
            }

            from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "Vous mélangez doucement le tout et terminez le mélange...", from.NetState);
            GenderPotion potion = new GenderPotion();
            potion.Female = targ.HairOwner.Female;
            from.AddToBackpack(potion);
            this.Delete();
            targ.Delete();
            return;
        }
Esempio n. 7
0
        public override void OnMovement(Mobile from, Point3D oldLocation)
        {
            if (from is PlayerMobile)
            {
                if (DateTime.Now >= m_NextTalk && Utility.InRange(from.Location, this.Location, 5))
                {
                    from.PrivateOverheadMessage(MessageType.Regular, 1150, false, this.Name, from.NetState);

                    if (this.X == 5764 && this.Y == 2215)
                    {
                        from.CloseGump(typeof(Server.Gumps.ClueGump));
                        from.SendGump(new Server.Gumps.ClueGump("Seems like an odd phrase. Perhaps I should remember the name that some give to a ruby.", "The Bloodstone"));
                    }
                    else if (this.X == 6268 && this.Y == 2661)
                    {
                        from.CloseGump(typeof(Server.Gumps.ClueGump));
                        from.SendGump(new Server.Gumps.ClueGump("What altars did Harkyn set? What name must be spoken?", "Harkyn's Altars"));
                    }
                    else if (this.X == 6293 && this.Y == 1649)
                    {
                        from.CloseGump(typeof(Server.Gumps.ClueGump));
                        from.SendGump(new Server.Gumps.ClueGump("The emerald gate? Perhaps a magical gate of green? If I speak the name of the ruby near it, I may be able to enter.", "The Emerald Gate"));
                    }
                    else if (this.X == 6497 && this.Y == 1440)
                    {
                        from.CloseGump(typeof(Server.Gumps.ClueGump));
                        from.SendGump(new Server.Gumps.ClueGump("The shapes of three, silver they be, can make the golden skull speak? Perhaps these things I must find, but where?", "The Silver Shapes"));
                    }
                    else if (this.X == 6501 && this.Y == 1773)
                    {
                        from.CloseGump(typeof(Server.Gumps.ClueGump));
                        from.SendGump(new Server.Gumps.ClueGump("Know this, that a man called Tarjan, thought by many to be insane, had through wizardly powers proclaimed himself a god in Skara Brae a hundred years ago. Perhaps that cult in town knows of this.", "The Mad God"));
                    }
                    else if (this.X == 6988 && this.Y == 164)
                    {
                        from.CloseGump(typeof(Server.Gumps.ClueGump));
                        from.SendGump(new Server.Gumps.ClueGump("You can already feel the magical energy that is sealing this door. Perhaps there is another way to enter this vile place.", "Mangar's Tower Door"));
                    }

                    m_NextTalk = (DateTime.Now + TimeSpan.FromSeconds(30));
                }
            }
        }
Esempio n. 8
0
        public override void OnDamage(int amount, Mobile from, bool willkill)
        {
            base.OnDamage(amount, from, willkill);

            int oldhits = Hits;

            if (this.ItemID == IDHalfHits && this.Hits <= (HitsMax * .10))
            {
                ItemID = 40154;
            }

            if (0.033 > Utility.RandomDouble())
            {
                from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x23, 1156855, from.NetState); // *Arcing energy from the generator zaps you!*
                AOS.Damage(from, Utility.RandomMinMax(50, 100), 0, 0, 0, 0, 100);
                from.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Waist);
                Effects.PlaySound(this.Location, this.Map, 0x1DC);
            }
        }
Esempio n. 9
0
        private static void FinishThrow(object state)
        {
            object[] states = (object[])state;

            Mobile from = (Mobile)states[0];
            Mobile to   = (Mobile)states[1];
            Item   bola = (Item)states[2];

            if (!from.Alive)
            {
                return;
            }
            if (!bola.IsChildOf(from.Backpack))
            {
                bola.PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
            }
            else if (!from.InRange(to, 15) || !from.InLOS(to) || !from.CanSee(to))
            {
                from.PrivateOverheadMessage(MessageType.Regular, 946, 1042060, from.NetState); // You cannot see that target!
            }
            else if (!to.Mounted && !to.Flying && (!Core.ML || !AnimalForm.UnderTransformation(to)))
            {
                to.PrivateOverheadMessage(MessageType.Regular, 946, 1049628, from.NetState); // You have no reason to throw a bola at that.
            }
            else
            {
                bola.Consume();

                from.Direction = from.GetDirectionTo(to);
                from.Animate(AnimationType.Attack, 4);
                from.MovingEffect(to, 0x26AC, 10, 0, false, false);

                new Bola().MoveToWorld(to.Location, to.Map);

                if (CheckHit(to, from))
                {
                    to.Damage(Utility.RandomMinMax(10, 20), from);
                    //    Dismount(from, to, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(10.0), true);
                    Server.Items.Dismount.DoDismount(from, to, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(10.0), true);
                }
            }
        }
Esempio n. 10
0
        protected override void BeginLockpick(Mobile from, ILockpickable item)
        {
            if (from is PlayerMobile pm && item.Locked && QuestHelper.HasQuest <TheTreasureChaseQuest>(pm) && item is TreasureMapChest chest && chest.TreasureMap is BuriedRichesTreasureMap)
            {
                pm.PlaySound(0x241);

                Timer.DelayCall(TimeSpan.FromMilliseconds(200), () =>
                {
                    if (item.Locked && from.InRange(chest.GetWorldLocation(), 1))
                    {
                        from.CheckTargetSkill(SkillName.Lockpicking, item, 0, 100);

                        // Success! Pick the lock!
                        from.PrivateOverheadMessage(MessageType.Regular, 1154, 1158252, from.NetState); // *Your recent study of Treasure Hunting helps you pick the lock...*
                        chest.SendLocalizedMessageTo(from, 502076);                                     // The lock quickly yields to your skill.
                        from.PlaySound(0x4A);
                        item.LockPick(from);
                    }
                });
            }
Esempio n. 11
0
        public bool SubmitSolution(Mobile m, UnderworldPuzzleSolution solution)
        {
            if (m == null)
            {
                return(false);
            }

            if (solution.Matches(Solution))
            {
                Item item = Loot.Construct(m_Rewards[Utility.Random(m_Rewards.Length)]);

                if (item != null)
                {
                    if (item is VoidEssence || item is SilverSerpentVenom || item is ToxicVenomSac)
                    {
                        item.Amount = 30;
                    }

                    if (item is LuckyCoin)
                    {
                        item.Amount = Utility.RandomMinMax(2, 6);
                    }

                    if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
                    {
                        m.BankBox.DropItem(item);
                    }
                }

                m.PlaySound(0x3D);
                m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1113579, m.NetState); // Correct Code Entered. Crystal Lock Disengaged.

                Delete();
                return(true);
            }
            else
            {
                PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1150177, m.NetState); // Incorrect Code Sequence. Access Denied.
                return(false);
            }
        }
Esempio n. 12
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendMessage("This must be in your backpack to use.");
         return;
     }
     else
     {
         from.AddToBackpack(new BlackPearl(50));
         from.AddToBackpack(new Bloodmoss(50));
         from.AddToBackpack(new Garlic(50));
         from.AddToBackpack(new Ginseng(50));
         from.AddToBackpack(new MandrakeRoot(50));
         from.AddToBackpack(new Nightshade(50));
         from.AddToBackpack(new SulfurousAsh(50));
         from.AddToBackpack(new SpidersSilk(50));
         from.PrivateOverheadMessage(MessageType.Regular, 0x14C, false, "You dump the contents into your backpack", from.NetState);
         this.Delete();
     }
 }
Esempio n. 13
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (PointsSystem.TreasuresOfDoom.InSeason && m.Player && m.InRange(Location, 3) && m.InLOS(this))
            {
                if (NextMessage == null)
                {
                    NextMessage = new Dictionary <Mobile, DateTime>();
                }
                else
                {
                    CheckList();
                }

                if (!NextMessage.ContainsKey(m))
                {
                    m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1155660, m.NetState); // *You examine the plaque...there appears to be a series of runic characters that are raised up...they look like buttons...*

                    NextMessage[m] = DateTime.UtcNow + TimeSpan.FromMinutes(10);
                }
            }
        }
Esempio n. 14
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is PlayerMobile)
            {
                var neck = m.FindItemOnLayer(Layer.Neck);

                if (neck != null && neck.Hue == 1151 && (neck is FellowshipMedallion || neck is GargishFellowshipMedallion))
                {
                    BaseCreature.TeleportPets(m, m_Dest, Map.Ilshenar);
                    m.MoveToWorld(m_Dest, Map.Ilshenar);
                    return(false);
                }
                else
                {
                    m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1159385,
                                             m.NetState); // * Your connection to the ethereal void is not honed, you cannot pass... *
                }
            }

            return(true);
        }
Esempio n. 15
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack) || from.Backpack == null)
     {
         from.SendLocalizedMessage(1054107);                 // This item must be in your backpack.
     }
     else if (!CheckSkill(from))
     {
         from.SendLocalizedMessage(1153981, m_CraftType.ToString());                 // Only a Grandmaster ~1_PROFESSION~ would know what to do with this.
     }
     else if (!from.Backpack.ConsumeTotal(GetRawMaterial(), 20))
     {
         from.SendLocalizedMessage(1153978);                 // You lack the required quantity of raw materials to craft the Armor Refinement.
     }
     else
     {
         from.Backpack.DropItem(new RefinementItem(m_RefinementType, m_CraftType, m_SubCraftType, m_ModType));
         from.PrivateOverheadMessage(MessageType.Regular, 0, 1153979, from.NetState);                 // *You carefully and skillfully craft an Armor Refinement* TODO Hue???
         Delete();
     }
 }
Esempio n. 16
0
        public void OnForensicEval(Mobile m)
        {
            if (!m.Player)
            {
                return;
            }

            var quest = QuestHelper.GetQuest <GoingGumshoeQuest2>((PlayerMobile)m);

            if (quest != null)
            {
                m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "Forensics", m.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item*
                m.SendLocalizedMessage(1158612, null, 0x23);                                            // You have identified a clue! This item seems pertinent to the investigation!

                m.SendSound(quest.UpdateSound);
                m.SendSound(m.Female ? 0x30B : 0x41A);

                m.CloseGump(typeof(GumshoeItemGump));
                m.SendGump(new GumshoeItemGump(m, ItemID, Hue, ItemName, Cliloc, null));
            }
        }
Esempio n. 17
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m.Player && m.InRange(Location, 3) && m.InLOS(this))
            {
                if (NextMessage == null)
                {
                    NextMessage = new Dictionary <Mobile, DateTime>();
                }
                else
                {
                    CheckList();
                }

                if (!NextMessage.ContainsKey(m))
                {
                    m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1155659, m.NetState); // *The wooden sign seems in oddly good condition for how old the sarcophagus is. Most of the inscription is worn away...*

                    NextMessage[m] = DateTime.UtcNow + TimeSpan.FromMinutes(10);
                }
            }
        }
Esempio n. 18
0
            protected override void OnTick()
            {
                if (_Item != null && _Item._Controller != null && _Mobile != null)
                {
                    Effects.SendPacket(_Item.Location, _Item.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x377A, _Item.Location, _Item.Location, 1, 72, true, true));

                    _Mobile.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1159029, _Mobile.NetState); // *You feel a slight energy pulse through you...*
                    Effects.SendPacket(_Mobile.Location, _Mobile.Map, new GraphicalEffect(EffectType.FixedFrom, _Mobile.Serial, Serial.Zero, 0x377A, _Mobile.Location, _Mobile.Location, 1, 72, true, true));
                    _Mobile.PlaySound(0x202);

                    if (_Item._Controller.FragmentCount == 8 && _Count == 8)
                    {
                        _Item._Controller.FragmentCount = 0;
                        DelayCall(TimeSpan.FromSeconds(5), () => _Item._Controller.Active = true);
                    }

                    JollyRogerData.FragmentIncrease(_Mobile, _Item._Controller.Shrine);

                    _Item.Delete();
                }
            }
Esempio n. 19
0
        public override void Open(Mobile from)
        {
            if (!Fermenting)
            {
                DisplayTo(from);
            }
            else if (FermentingEnds > DateTime.UtcNow)
            {
                from.SendLocalizedMessage(1157230); // You may not open the barrel once fermentation has begun!
            }
            else if (Fermented)
            {
                if (BottlesRemaining == -1)
                {
                    from.PrivateOverheadMessage(MessageType.Regular, 0x22, 1157258, from.NetState); // *You gently taste the fermentation...it's spoiled! You should probably empty the barrel*
                }
                else if (BottlesRemaining > 0)
                {
                    var bottle = new BottleOfWine(FruitType, Vintage, Year);

                    if (from.Backpack != null && from.Backpack.TryDropItem(from, bottle, false))
                    {
                        from.PlaySound(0x240);

                        BottlesRemaining--;

                        InvalidateProperties();
                    }
                    else
                    {
                        from.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
                        bottle.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042975); // It's empty.
                }
            }
        }
Esempio n. 20
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentMove(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon != null && (_Table == null || !_Table.ContainsKey(attacker)))
            {
                int toDrain = (int)(attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value + (MasteryInfo.GetMasteryLevel(attacker, SkillName.Fencing) * 40) / 3);
                toDrain /= 3;

                Server.Timer t;

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, Timer>();
                }

                _Table[attacker] = t = new InternalTimer(this, attacker, defender, toDrain);
                t.Start();

                attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1155993, attacker.NetState); // You deliver a piercing blow!
                defender.FixedEffect(0x36BD, 20, 10, 2725, 5);

                int drain = (int)(defender.StamMax * (toDrain / 100.0));

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Pierce, 1155994, 1155995, TimeSpan.FromSeconds(10), defender, (drain / 7).ToString()));
                //-~1_VAL~ Stamina Regeneration.
            }
            else
            {
                attacker.SendLocalizedMessage(1095215); // Your target is already under the effect of this attack.
            }
        }
Esempio n. 21
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentMove(attacker);

            attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1155984, attacker.NetState);

            defender.FixedEffect(0x3779, 20, 10, 2719, 0);

            double skills = (attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value + (MasteryInfo.GetMasteryLevel(attacker, MoveSkill) * 40)) / 3;

            AddToTable(defender, (int)(skills / 2));
            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Stagger, 1155981, 1155982, TimeSpan.FromSeconds(10), defender, ((int)skills / 2).ToString()));

            defender.Delta(MobileDelta.WeaponDamage);

            AddToCooldown(attacker);
        }
Esempio n. 22
0
		public override void OnDoubleClick( Mobile m )
		{
			if ( m.InRange( this, 3 ) ) 
			{
				switch ( ItemID ) 
				{ 
					//do swap or animation here 
					case 10877: //blank
						ItemID=10878;
						m.PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "The mirror went blank", m.NetState ); 
						break;
					case 10878: //green
						ItemID=10877; 
						break;
					default: break; 
				}
			}
			else
			{
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
		}
Esempio n. 23
0
        public void OnForensicEval(Mobile m)
        {
            if (!m.Player)
            {
                return;
            }

            var quest = QuestHelper.GetQuest <GoingGumshoeQuest2>((PlayerMobile)m);

            if (quest != null)
            {
                if (HasFoundClue(quest))
                {
                    m.SendLocalizedMessage(1158613); // You have already documented this clue.
                }
                else
                {
                    m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "Forensics", m.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item*
                    m.SendLocalizedMessage(1158612, null, 0x23);                                            // You have identified a clue! This item seems pertinent to the investigation!

                    m.SendSound(quest.UpdateSound);

                    var gump = new Gump(50, 50);
                    gump.AddBackground(0, 0, 500, 500, 9380);

                    gump.AddItem(84, 130, ItemID, Hue);
                    gump.AddHtml(167, 50, 310, 20, "<center><basefont color=#B22222>a dust pile</center>", false, false);
                    gump.AddHtmlLocalized(167, 70, 310, 380, 1158617, true, false);

                    m.SendGump(gump);

                    /*The dust seems to have have settled in a distinct pattern around whatever once was placed at this location.
                     * Whatever it was, it was certainly small enough to be taken away in a hurry.*/

                    SetFoundClue(quest);
                }
            }
        }
Esempio n. 24
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_HasLinkedDoor)
            {
                if (m_LinkedDoor == null || m_LinkedDoor.Deleted)
                {
                    m_HasLinkedDoor = false;
                    m_LinkedDoor    = null;
                    return;
                }

                if (from.InRange(GetWorldLocation(), 5) && from.InLOS(this))
                {
                    if (m_HasMessage)
                    {
                        if (m_SayOverhead)
                        {
                            PublicOverheadMessage(MessageType.Regular, 0, false, m_Message);
                        }
                        else
                        {
                            from.PrivateOverheadMessage(MessageType.Regular, 0, false, m_Message, from.NetState);
                        }
                    }

                    if (m_HasOnItemId)
                    {
                        ItemID = (ItemID == m_OnItemId) ? m_OffItemId : m_OnItemId;
                    }

                    m_LinkedDoor.Open = !m_LinkedDoor.Open;
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                }
            }
        }
Esempio n. 25
0
 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));
     }
 }
Esempio n. 26
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!CityLoyaltySystem.Enabled || CitySystem == null)
            {
                return;
            }

            if (CitySystem.IsCitizen(from, true))
            {
                if (from.InRange(this.Location, 3))
                {
                    from.SendGump(new PlayerBBGump(from, null, this, 0));
                }
                else
                {
                    from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045, from.NetState);
                }
            }
            else
            {
                from.SendLocalizedMessage(1154275); // Only Citizens of this City may use this.
            }
        }
Esempio n. 27
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is Gold)
            {
                int nPenalty = AssassinFunctions.QuestFailure(from);

                if (dropped.Amount == nPenalty)
                {
                    CharacterDatabase.ClearQuestInfo(from, "AssassinQuest");
                    from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Your failure in this task has been forgiven.", from.NetState);
                    dropped.Delete();
                }
                else
                {
                    from.AddToBackpack(dropped);
                }
            }
            else
            {
                from.AddToBackpack(dropped);
            }
            return(true);
        }
Esempio n. 28
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is Gold)
            {
                int nPenalty = FishingQuestFunctions.QuestFailure(from);

                if (dropped.Amount == nPenalty)
                {
                    CharacterDatabase.ClearQuestInfo(from, "FishingQuest");
                    from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Someone else will eventually take care of this.", from.NetState);
                    dropped.Delete();
                }
                else
                {
                    from.AddToBackpack(dropped);
                }
            }
            else
            {
                from.AddToBackpack(dropped);
            }
            return(true);
        }
Esempio n. 29
0
        public void OnInscribeTarget(Mobile m)
        {
            GoingGumshoeQuest2 quest = QuestHelper.GetQuest <GoingGumshoeQuest2>((PlayerMobile)m);

            if (quest != null)
            {
                if (HasFoundClue2(quest))
                {
                    m.SendLocalizedMessage(1158613); // You have already documented this clue.
                }
                else
                {
                    m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1158582, m.NetState); // *You copy several pages onto some parchment and roll it up...*
                    m.SendLocalizedMessage(1158612, null, 0x23);                               // You have identified a clue! This item seems pertinent to the investigation!
                    m.AddToBackpack(new RolledParchment(GetPage()));
                    m.PlaySound(0x249);

                    m.SendSound(quest.UpdateSound);

                    SetFoundClue2(quest);
                }
            }
        }
Esempio n. 30
0
        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);
        }
Esempio n. 31
0
        public void DoEffect(Mobile from)
        {
            int effect = Utility.Random(30);

            if (effect <= 30 && effect >= 25)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "Vous terminez la sucette...", from.NetState);
                from.Say("Sa langue est toute verte!");
                this.Consume();
                return;
            }

            if (effect <= 23 && effect >= 20)
            {
                from.Say("*Affiche un large sourire*");
                return;
            }

            if (effect <= 18 && effect >= 15)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "*Le goût du melon vous appaise*",from.NetState);
                return;
            }

            if (effect <= 13 && effect >= 10)
            {
                from.Say("*Lèche bruyamment la sucette*");
                return;
            }

            if (effect <= 5 && effect >= 0)
            {
                from.Say("*Joue avec le bâton de la sucette*");
                return;
            }
            return;
        }
Esempio n. 32
0
        public void DoEffect(Mobile from)
        {
            int effect = Utility.Random(30);

            if (effect <= 30 && effect >= 25)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "Vous terminez la sucette... enfin!", from.NetState);
                from.Say("Sa langue est toute jaune!");
                this.Consume();
                return;
            }

            if (effect <= 23 && effect >= 20)
            {
                from.Say("*Grimace*");
                return;
            }

            if (effect <= 18 && effect >= 15)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "*L'acidité du bonbon vous fait frémir*",from.NetState);
                return;
            }

            if (effect <= 13 && effect >= 10)
            {
                from.Say("*Fait cogner le bonbon contre ses dents*");
                return;
            }

            if (effect <= 5 && effect >= 0)
            {
                from.Say("*Slurp!*");
                return;
            }
            return;
        }
Esempio n. 33
0
        public override void OnDoubleClick(Mobile m)
        {
            m.PlaySound(Utility.Random(0x3A, 3));

            if (m.Body.IsHuman && !m.Mounted)
            {
                m.Animate(34, 5, 1, true, false, 0);
            }

            String phrase = "";

            switch (Utility.RandomMinMax(0, 6))
            {
            case 0: phrase = "Mmmmmmmmm"; break;

            case 1: phrase = "Tastes pretty good"; break;

            case 2: phrase = "I feel a sugar buzz coming on"; break;

            case 3: phrase = "I think it was stale"; break;

            case 4: phrase = "Do I feel a razor blade?"; break;

            case 5: phrase = "Ouch...my tooth!"; break;

            case 6: phrase = "This will go straight to the hips"; break;
            }

            m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, phrase, m.NetState);

            m.Stam   = m.Stam + 300;
            m.Hits   = m.Hits + 300;
            m.Mana   = m.Mana + 300;
            m.Thirst = 20;
            m.Hunger = 20;
            this.Delete();
        }
Esempio n. 34
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.NetState);
                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.
            }
        }
Esempio n. 35
0
        public void DoEffect(Mobile from)
        {
            int effect = Utility.Random(30);

            if (effect <= 30 && effect >= 25)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "Vous terminez la sucette...", from.NetState);
                from.Say("Sa langue est toute rouge!");
                this.Consume();
                return;
            }

            if (effect <= 23 && effect >= 20)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "*Le goût sucré de la pomme chatouille vos papilles", from.NetState);
                return;
            }

            if (effect <= 18 && effect >= 15)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "*Vous salivez abondamment*",from.NetState);
                return;
            }

            if (effect <= 13 && effect >= 10)
            {
                from.Say("*Croque le bonbon, produisant un bruit sourd*");
                return;
            }

            if (effect <= 5 && effect >= 0)
            {
                from.Say("*Lèche bruyamment la sucette*");
                return;
            }
            return;
        }
Esempio n. 36
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m.InRange(this, 3))
            {
                switch (ItemID)
                {
                //do swap or animation here
                case 10853:                         //1
                    ItemID = 10854;
                    m.PrivateOverheadMessage(MessageType.Regular, 1153, false, "What was that?", m.NetState);
                    break;

                case 10854:                         //2
                    ItemID = 10853;
                    break;

                default: break;
                }
            }
            else
            {
                m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that
            }
        }
Esempio n. 37
0
            private bool DoFreeze(Mobile from, Mobile to)
            {
                if (to.Frozen || to.Paralyzed)
                {
                    from.SendMessage("The target is already frozen.");
                }
                else if (from.Skills[SkillName.Magery].BaseFixedPoint < 300)
                {
                    from.SendMessage("You are not sure how to use the magic within the staff.");
                }
                else if (from.Mana < 15)
                {
                    from.SendMessage("You lack the concentration to use the staff.");
                }
                else
                {
                    Mobile caster = from;
                    caster.RevealingAction();
                    SpellHelper.Turn(caster, to);
                    SpellHelper.CheckReflect((int)SpellCircle.Fifth, ref from, ref to);

                    to.Paralyze(TimeSpan.FromSeconds(7.0));
                    Timer.DelayCall <int>(TimeSpan.FromSeconds(2.5), new TimerStateCallback <int>(ReleaseSolidHueOverrideMod), to.SolidHueOverride);
                    to.SolidHueOverride = 1264;
                    m_To = to;

                    caster.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1008127, caster.NetState);
                    to.PlaySound(0x204);
                    caster.Animate(218, 7, 1, true, false, 0);
                    Effects.SendTargetEffect(to, 0x376A, 16);
                    m_From.Mana -= 15;
                    return(true);
                }

                return(false);
            }
Esempio n. 38
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m.InRange(this, 3))
            {
                switch (ItemID)
                {
                //do swap or animation here
                case 10875:                         //blank
                    ItemID = 10876;
                    break;

                case 10876:                         //green
                    ItemID = 10875;
                    m.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "The mirror went blank", m.NetState);
                    break;

                default: break;
                }
            }
            else
            {
                m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that
            }
        }
Esempio n. 39
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            bool isMatch = false;

            Mobile from = e.Mobile;

            string keyword  = this.Name + " hail";
            string keyword2 = this.Name + " translate";


            if (keyword != null && e.Speech.ToLower().IndexOf(keyword.ToLower()) >= 0)
            {
                isMatch = true;

                if (!isMatch)
                {
                    return;
                }

                from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I need your help.", from.NetState);
                e.Handled = true;
            }
            if (keyword2 != null && e.Speech.ToLower().IndexOf(keyword2.ToLower()) >= 0)
            {
                isMatch = true;

                if (!isMatch)
                {
                    return;
                }

                from.SendGump(new MerlinsQuestGump7(from));
                e.Handled = true;
            }
            base.OnSpeech(e);
        }
Esempio n. 40
0
        public static void CheckHit(Mobile attacker, Mobile defender)
        {
            if (IsImmune(defender))
            {
                attacker.SendLocalizedMessage(1157322); // Your target is currently immune to swarm!
                return;
            }

            SwarmContext context = PropertyEffect.GetContext <SwarmContext>(attacker, defender, EffectsType.Swarm);

            if (context == null)
            {
                context = new SwarmContext(attacker, defender, null);

                if (defender.NetState != null)
                {
                    defender.PrivateOverheadMessage(MessageType.Regular, 1150, 1157321, defender.NetState); // *You are engulfed in a swarm of insects!*
                }
                Server.Effects.SendTargetEffect(defender, context._ID, 40);

                defender.PlaySound(0x00E);
                defender.PlaySound(0x1BC);
            }
        }
Esempio n. 41
0
		public override bool Eat(Mobile from)
		{
			int oldHunger = from.Hunger;

			// Fill the Mobile with FillFactor
			if (CheckHunger(from))
			{
				if (Owner != null)
				{
					if (Owner.RawInt > from.RawInt)
					{
						from.PrivateOverheadMessage(
							MessageType.Label,
							54,
							true,
							"Yup, you definitely feel smarter after eating " + Owner.Name + "'s brain.",
							from.NetState);
						//SpellHelper.AddStatBonus(from, from, StatType.Int, true);
					}
					else if (Owner.RawInt == from.RawInt)
					{
						from.PrivateOverheadMessage(
							MessageType.Label,
							54,
							true,
							"You don't feel any different after eating " + Owner.Name + "'s brain.",
							from.NetState);
					}
					else if (Owner.RawInt < from.RawInt)
					{
						from.PrivateOverheadMessage(
							MessageType.Label,
							54,
							true,
							"You're pretty sure eating " + Owner.Name + "'s brain has made you not smart so good anymore.",
							from.NetState);

						//SpellHelper.AddStatCurse(from, from, StatType.Int, false);
					}
				}
				// Play a random "eat" sound
				from.PlaySound(Utility.Random(0x3A, 3));

				if (from.Body.IsHuman && !from.Mounted)
				{
					from.Animate(34, 5, 1, true, false, 0);
				}

				if (Poison != null)
				{
					from.ApplyPoison(Poisoner, Poison);
				}

				//EventSink.InvokeOnConsume(new OnConsumeEventArgs(from, this, from.Hunger - oldHunger));

                if (from is PlayerMobile)
                {
                    Conquests.CheckProgress<ItemConquest>((PlayerMobile)from, this, from.Hunger - oldHunger);

                    //CheckProgress<ConsumeItemConquest>((PlayerMobile)e.Consumer, e);
                }

				Consume();

				return true;
			}

			return false;
		}
Esempio n. 42
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                TrapRemovalKit kit = ( from.Backpack == null ? null : from.Backpack.FindItemByType( typeof( TrapRemovalKit ) ) as TrapRemovalKit );

                if ( kit == null )
                {
                    from.SendMessage( "You need a trap removal kit to disarm that." );
                }
                else if ( targeted is Mobile )
                {
                    from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
                }
                else if ( targeted is TrapableContainer )
                {
                    TrapableContainer targ = (TrapableContainer)targeted;

                    from.Direction = from.GetDirectionTo( targ );

                    if ( targ.TrapType == TrapType.None )
                    {
                        from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
                        return;
                    }

                    from.PlaySound( 0x241 );

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30 ) )
                    {
                        targ.TrapPower = 0;
                        targ.TrapLevel = 0;
                        targ.TrapType = TrapType.None;
                        from.SendLocalizedMessage( 502377 ); // You successfully render the trap harmless
                        kit.ConsumeCharge( from );
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
                    }
                }
                else if ( targeted is BaseMine )
                {
                    BaseMine trap = (BaseMine) targeted;

                    bool isOwner = trap.Placer == from;

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, trap, 80.0, 100.0 ) && from.CheckTargetSkill( SkillName.Tinkering, trap, 80.0, 100.0 ) )
                    {
                        from.PrivateOverheadMessage( MessageType.Regular, trap.MessageHue, trap.DisarmMessage, from.NetState );
                        trap.Delete();
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
                    }

                    kit.ConsumeCharge( from );
                }
                else
                {
                    from.SendLocalizedMessage( 502373 ); // That does'nt appear to be trapped
                }
            }
			protected override void OnTarget( Mobile from, object o )
			{
				int itemID = 0;
				if (o is LandTarget)
				{
				if (from.Map == Map.Malas || from.Map == Map.Ilshenar)
					{
					from.PrivateOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca.", from.NetState);
					return;
					}
				Point3D p = new Point3D( o as IPoint3D );
				itemID = from.Map.Tiles.GetLandTile( ((LandTarget)o).X, ((LandTarget)o).Y ).ID & 0x3FFF;
				bool goodspot = false;
				int effect = 0;
				for ( int i = 0; i < m_DirtIDs.Length; i += 2 )
					{
					if ( itemID >= m_DirtIDs[i] && itemID <= m_DirtIDs[i + 1] )
						{
						goodspot = true;
						effect = 1;
						}
					}
				for ( int i = 0; i < m_SwampIDs.Length; i += 2 )
					{
					if ( itemID >= m_SwampIDs[i] && itemID <= m_SwampIDs[i + 1] )
						{
						goodspot = true;
						effect = 2;
						}
					}
				for ( int i = 0; i < m_SandIDs.Length; i += 2 )
					{
					if ( itemID >= m_SandIDs[i] && itemID <= m_SandIDs[i + 1] )
						{
						goodspot = true;
						effect = 3;
						}
					}
				for ( int i = 0; i < m_SnowIDs.Length; i += 2 )
					{
					if ( itemID >= m_SnowIDs[i] && itemID <= m_SnowIDs[i + 1] )
						{
						goodspot = true;
						effect = 4;
						}
					}
				for ( int i = 0; i < m_FurrowsIDs.Length; i += 2 )
					{
					if ( itemID >= m_FurrowsIDs[i] && itemID <= m_FurrowsIDs[i + 1] )
						{
						goodspot = true;
						effect = 5;
						}
					}
				if ( goodspot )
					{
					m_GreenThorn.Consume();
					from.LocalOverheadMessage( MessageType.Emote, 0x2B2, 1061914 ); // * You push the strange green thorn into the ground *
					from.NonlocalOverheadMessage( MessageType.Emote, 0x2B2, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *
					from.PlaySound(0x106);
					Effects.SendLocationParticles( EffectItem.Create( p, from.Map, EffectItem.DefaultDuration ), 0x3735, 1, 182, 0xBE3 );
					new ThornEffectTimer( from, p, effect ).Start();
					new DelayTimer(from).Start();
					}
				else
					{
					from.SendLocalizedMessage( 1061913 ); // * You sense it would be useless to plant a green thorn there. *
					from.EndAction( typeof( GreenThorn ) );
					}
				}
				else
					{
					from.SendLocalizedMessage( 1061912 ); // * You cannot plant a green thorn there! *
					from.EndAction( typeof( GreenThorn ) );
					}
			}
Esempio n. 44
0
			protected override void OnTarget( Mobile from, object targeted )
			{
                IEntity entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.RemoveTrap, from.Skills[SkillName.RemoveTrap].Value))
                {
                    return;
                }
                
                if ( targeted is Mobile )
					from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
				else if ( targeted is TrapableContainer )
				{
					TrapableContainer targ = (TrapableContainer)targeted;

					from.Direction = from.GetDirectionTo( targ );

					if ( targ.TrapType == TrapType.None )
					{
						from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
						return;
					}

					from.PlaySound( 0x241 );
                    // treasurechestlevel6 TrapPower is 6 x (20 to 54) = min 120, max 324
                    // treasurechestlevel5 TrapPower is 5 x (20 to 54) = min 100, max 270
                    // treasurechestlevel4 TrapPower is 4 x (10 to 34) = min 40, max 136
                    // treasurechestLevel3 TrapPower is 3 x (1 to 24) = min 3, max 72
                    // treasurechestLevel2 TrapPower is 2 x (1 to 24) = min 2, max 48
                    //... I don't think trap power is the way to go here, I think we have to handle
                    // each type of trap separately
                    double minSkill = targ.TrapPower;
                    double maxSkill = targ.TrapPower + 30.0;
                    if (targ is TreasureChestLevel6) { minSkill = 95; maxSkill = 110; } // 1/3 chance at GM
                    else if (targ is TreasureChestLevel5) { minSkill = 95; maxSkill = 102; } // 2/3 chance at GM
                    else if (targ is TreasureChestLevel4) { minSkill = 80; maxSkill = 105; } // 4/5 chance at GM
                    else if (targ is TreasureMapChest && ((TreasureMapChest)targ).Level >= 4)
                    {
                        int level = ((TreasureMapChest)targ).Level;
                        if (level >= 6) { minSkill = 95; maxSkill = 110; } // 1/3 chance at GM
                        else if (level == 5) { minSkill = 95; maxSkill = 102; } // 2/3 chance at GM
                        else if (level == 4) { minSkill = 80; maxSkill = 105; } // 4/5 chance at GM
                    }
                    else // any other trapable thing, GM remove traps will always get it
                    {
                        if (minSkill > 95.0)
                            minSkill = 95.0;
                        if (maxSkill > 100.0)
                            maxSkill = 100.0;
                    }

					//if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30 ) ) // lol, with this formula, many level 4's and all level 5 and 6: removetrap = useless
                    if (from.CheckTargetSkill(SkillName.RemoveTrap, targ, minSkill, maxSkill))
					{
						targ.TrapPower = 0;
						targ.TrapLevel = 0;
                        if (targ.TrapType == TrapType.ExplosionTrap)
                            from.SendLocalizedMessage(502374); // You carefully remove the trigger for the purple potion.
                        else if (targ.TrapType == TrapType.DartTrap)
                            from.SendLocalizedMessage(502375); // You carefully remove the dart from the firing mechanism.
                        else if (targ.TrapType == TrapType.PoisonTrap)
                            from.SendLocalizedMessage(502376); // The poison leaks harmlessly away due to your deft touch.
                        else
                            from.SendLocalizedMessage(502377); // You successfully render the trap harmless.
						targ.TrapType = TrapType.None;
					}
					else
					{
						from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
					}
				}
				else if ( targeted is BaseFactionTrap )
				{
					BaseFactionTrap trap = (BaseFactionTrap) targeted;
					Faction faction = Faction.Find( from );

					FactionTrapRemovalKit kit = ( from.Backpack == null ? null : from.Backpack.FindItemByType( typeof( FactionTrapRemovalKit ) ) as FactionTrapRemovalKit );

					bool isOwner = ( trap.Placer == from || ( trap.Faction != null && trap.Faction.IsCommander( from ) ) );

					if ( faction == null )
						from.SendLocalizedMessage( 1010538 ); // You may not disarm faction traps unless you are in an opposing faction
					else if ( faction == trap.Faction && trap.Faction != null && !isOwner )
						from.SendLocalizedMessage( 1010537 ); // You may not disarm traps set by your own faction!
					else if ( !isOwner && kit == null )
						from.SendLocalizedMessage( 1042530 ); // You must have a trap removal kit at the base level of your pack to disarm a faction trap.
					else
					{
						//if ( (Core.ML && isOwner) || (from.CheckTargetSkill( SkillName.RemoveTrap, trap, 0.0, 100.0 ))) // && from.CheckTargetSkill( SkillName.Tinkering, trap, 80.0, 100.0 )) )
                        if (Utility.RandomDouble() < 0.25 || from.CheckTargetSkill(SkillName.RemoveTrap, trap, 1.0, 100.0)) // 25% chance or if they have remove trap skill, use that
						{
							from.PrivateOverheadMessage( MessageType.Regular, trap.MessageHue, trap.DisarmMessage, from.NetState );

							if ( !isOwner )
							{
								//int silver = faction.AwardSilver( from, trap.SilverFromDisarm );

								//if ( silver > 0 )
								//	from.SendLocalizedMessage( 1008113, true, silver.ToString( "N0" ) ); // You have been granted faction silver for removing the enemy trap :
							}

							trap.Delete();
						}
						else
							from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off

						if ( !isOwner && kit != null )
							kit.ConsumeCharge( from );
					}
				}
				else
					from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
			}
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Mobile )
					from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
				else if ( targeted is TrapableContainer )
				{

					if ( from.Skills[SkillName.Lockpicking].Value < 50 )
					{
						from.SendLocalizedMessage( 502366 ); // You do not know enough about locks.  Become better at picking locks.
						return;
					}
					else if ( from.Skills[SkillName.DetectHidden].Value < 50 )
					{
						from.SendLocalizedMessage( 502367 ); // You are not perceptive enough.  Become better at detect hidden.
						return;
					}

					TrapableContainer targ = (TrapableContainer)targeted;

					from.Direction = from.GetDirectionTo( targ );

					if ( targ.TrapType == TrapType.None )
					{
						from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
						return;
					}

					from.PlaySound( 0x241 );

					int minskill;
					int maxskill;
					LockableContainer lc = targ as LockableContainer;
					if (lc != null && (targ.TrapType == TrapType.ExplosionTrap || targ.TrapType == TrapType.PoisonTrap))
					{
						// values used for tinkertraps
						maxskill = targ.TrapPower;
						minskill = (int)(targ.TrapPower * 0.8);
					}
					else // original values
					{
						maxskill = targ.TrapPower + 30;
						minskill = targ.TrapPower;
					}

					if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, minskill, maxskill) )
					{
						targ.TrapPower = 0;
						targ.TrapType = TrapType.None;

//						if (lc != null)
//							lc.TinkerTrapCreator = null;

						from.SendLocalizedMessage( 502377 ); // You successfully render the trap harmless
					}
					else
					{
						from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
					}
				}
				else if ( targeted is BaseFactionTrap )
				{
					BaseFactionTrap trap = (BaseFactionTrap) targeted;
					Faction faction = Faction.Find( from );

					FactionTrapRemovalKit kit = ( from.Backpack == null ? null : from.Backpack.FindItemByType( typeof( FactionTrapRemovalKit ) ) as FactionTrapRemovalKit );

					bool commander = trap.Faction != null && trap.Faction.IsCommander( from );

					bool isOwner = ( trap.Placer == from || commander );


					if ( !commander && from.Skills[SkillName.Lockpicking].Value < 50 )
						from.SendLocalizedMessage( 502366 ); // You do not know enough about locks.  Become better at picking locks.
					else if ( !commander && from.Skills[SkillName.DetectHidden].Value < 50 )
						from.SendLocalizedMessage( 502367 ); // You are not perceptive enough.  Become better at detect hidden.
					else if ( faction == null )
						from.SendLocalizedMessage( 1010538 ); // You may not disarm faction traps unless you are in an opposing faction
					else if ( faction == trap.Faction /*&& trap.Faction != null*/ && !isOwner )
						from.SendLocalizedMessage( 1010537 ); // You may not disarm traps set by your own faction!
					else if ( trap.Faction != null && kit == null )
						from.SendLocalizedMessage( 1042530 ); // You must have a trap removal kit at the base level of your pack to disarm a faction trap.
					else
					{
						if ( from.CheckTargetSkill( SkillName.RemoveTrap, trap, 80.0, 100.0 ) || commander )
						{
							from.PrivateOverheadMessage( MessageType.Regular, trap.MessageHue, trap.DisarmMessage, from.NetState );

							if ( !isOwner )
							{
								int silver = faction.AwardSilver( from, trap.SilverFromDisarm );

								if ( silver > 0 )
									from.SendLocalizedMessage( 1008113, true, silver.ToString( "N0" ) ); // You have been granted faction silver for removing the enemy trap :
							}

							trap.Delete();
						}
						else
							from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off

						if ( !isOwner && kit != null )
							kit.ConsumeCharge( from );
					}
				}
				else
					from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
			}
Esempio n. 46
0
            public void AbortAction(Mobile from)
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x3b2, true, "You fail to produce any wool.", from.NetState);

                if (from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();

                Stop();
            }
Esempio n. 47
0
			protected override void OnTarget(Mobile m, object o)
			{
				IPoint3D p = o as IPoint3D;

				if ( p == null )
					return;

				IPoint3D orig = p;
				Point3D to = new Point3D( p );
				Map map = m_Mobile.Map;

				SpellHelper.GetSurfaceTop(ref p);

				CustomRegion customregion = m.Region as CustomRegion;
				CustomRegion tregion = CustomRegion.Find( to, map ) as CustomRegion;

				if ( m_Owner.AbilityCharges <= 0 )
					m_Mobile.SendMessage( "This is out of charges." );
                else if (o is Item && ((Item)o).Parent != null)
                {
                    GeneralLogging.WriteLine("TeleportRingBuguse",
                        "{0} ({1}/{2} hits, criminal: {3}) tried to teleport target an item inside container {4} using item {5}.",
                        m, m.Hits, m.HitsMax, m.Criminal, ((Item)o).Parent, m_Owner);
                    m.PrivateOverheadMessage(MessageType.Regular, 0x26, false, "This incident has been logged.", m.NetState);
                    m_Owner.Delete();
                    return;
                }
                else if (customregion != null && customregion.Controller != null && customregion.Controller.IsRestrictedSpell(typeof(TeleportSpell)))
					m_Mobile.SendMessage( "You cannot teleport here." );
				else if ( tregion != null && tregion.Controller != null && tregion.Controller.IsRestrictedSpell( typeof( TeleportSpell ) ) )
					m_Mobile.SendMessage( "You cannot teleport there." );
				else if ( PokerDealer.IsPokerPlayer(m_Mobile) >= 0 )
					m_Mobile.SendMessage( "You cannot travel while playing poker." );
				else if ( m_Mobile is PlayerMobile && (((PlayerMobile)m_Mobile).LastTeleTime + TimeSpan.FromSeconds( 3.0 )) > DateTime.Now )
					m_Mobile.SendMessage( "You must wait 3 seconds before using this item again." );
				else if ( Server.Factions.Sigil.ExistsOn(m_Mobile) )
					m_Mobile.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
				else if ( Server.Misc.WeightOverloading.IsOverloaded(m_Mobile) )
					m_Mobile.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
				else if ( !SpellHelper.CheckTravel(m_Mobile, TravelCheckType.TeleportFrom) )
				{
				}
				else if ( !SpellHelper.CheckTravel(m_Mobile, map, to, TravelCheckType.TeleportTo) )
				{
				}
				//Al: Fix for Teleport on SnowPile. Has to be done here because
				//      CanSpawnMobile is a core function.
				else if ( o is SnowPile || o is SnowEventPile )
					m_Mobile.SendLocalizedMessage(501942); // That location is blocked.
				else if ( map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z) )
					m_Mobile.SendLocalizedMessage(501942); // That location is blocked.
				else if ( SpellHelper.CheckMulti(new Point3D(p), map) )
					m_Mobile.SendLocalizedMessage(501942); // That location is blocked.
				else if ( m_Mobile.Alive && m_Mobile.Items.Contains(m_Owner) )
				{
					Server.Spells.SpellHelper.Turn(m_Mobile, orig);

					Point3D from = m.Location;

					m.Location = to;
					m.ProcessDelta();

					if ( m.Player )
					{
						Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
						Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
					}
					else
						m.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);

					m.PlaySound(0x1FE);

					if( m is PlayerMobile )
					   ((PlayerMobile)m).LastTeleTime = DateTime.Now;

					m_Owner.AbilityCharges--;
				}
			}
Esempio n. 48
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Quest.Deleted )
					return;

				if (!(targeted is Corpse))
				{
					from.SendLocalizedMessage( 1042600 ); // That is not a corpse!
				}
				else if ( !m_Quest.IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				}
				else
				{
					object obj = targeted;

					Corpse c = (Corpse)targeted;

					Type M_Type = typeof(Orc);

					int nSpot = 0;



					// SECTION - MNTP1 ////////////////////////////////////////////////////////////////////////

					// THIS SECTION FINDS THE TYPES OF MONSTERS...SINCE I CANNOT SEEM TO CONVERT THE NAMES

					if ( m_Quest.NMonsterType == "Bull Frog" ) { M_Type = typeof(BullFrog); }
					else if ( m_Quest.NMonsterType == "Giant Rat" ) { M_Type = typeof(GiantRat); }
					else if ( m_Quest.NMonsterType == "Lizardman" ) { M_Type = typeof(Lizardman); }
					else if ( m_Quest.NMonsterType == "Mongbat" ) { M_Type = typeof(Mongbat); }
					else if ( m_Quest.NMonsterType == "Orc" ) { M_Type = typeof(Orc); }
					else if ( m_Quest.NMonsterType == "Ratman" ) { M_Type = typeof(Ratman); }
					else if ( m_Quest.NMonsterType == "Sewer Rat" ) { M_Type = typeof(Sewerrat); }
					else if ( m_Quest.NMonsterType == "Skeleton" ) { M_Type = typeof(Skeleton); }
					else if ( m_Quest.NMonsterType == "Slime" ) { M_Type = typeof(Slime); }
					else if ( m_Quest.NMonsterType == "Zombie" ) { M_Type = typeof(Zombie); }
					else if ( m_Quest.NMonsterType == "Brigand" ) { M_Type = typeof(Brigand); }
					else if ( m_Quest.NMonsterType == "Earth Elemental" ) { M_Type = typeof(EarthElemental); }
					else if ( m_Quest.NMonsterType == "Ettin" ) { M_Type = typeof(Ettin); }
					else if ( m_Quest.NMonsterType == "Gazer Larva" ) { M_Type = typeof(GazerLarva); }
					else if ( m_Quest.NMonsterType == "Ghoul" ) { M_Type = typeof(Ghoul); }
					else if ( m_Quest.NMonsterType == "Giant Spider" ) { M_Type = typeof(GiantSpider); }
					else if ( m_Quest.NMonsterType == "Giant Toad" ) { M_Type = typeof(GiantToad); }
					else if ( m_Quest.NMonsterType == "Harpy" ) { M_Type = typeof(Harpy); }
					else if ( m_Quest.NMonsterType == "Headless One" ) { M_Type = typeof(HeadlessOne); }
					else if ( m_Quest.NMonsterType == "Orc Bomber" ) { M_Type = typeof(OrcBomber); }
					else if ( m_Quest.NMonsterType == "Scorpion" ) { M_Type = typeof(Scorpion); }
					else if ( m_Quest.NMonsterType == "Shade" ) { M_Type = typeof(Shade); }
					else if ( m_Quest.NMonsterType == "Spectre" ) { M_Type = typeof(Spectre); }
					else if ( m_Quest.NMonsterType == "Wraith" ) { M_Type = typeof(Wraith); }
					else if ( m_Quest.NMonsterType == "Agapite Elemental" ) { M_Type = typeof(AgapiteElemental); }
					else if ( m_Quest.NMonsterType == "Air Elemental" ) { M_Type = typeof(AirElemental); }
					else if ( m_Quest.NMonsterType == "Ant Lion" ) { M_Type = typeof(AntLion); }
					else if ( m_Quest.NMonsterType == "Beetle" ) { M_Type = typeof(Beetle); }
					else if ( m_Quest.NMonsterType == "Bogle" ) { M_Type = typeof(Bogle); }
					else if ( m_Quest.NMonsterType == "Bogling" ) { M_Type = typeof(Bogling); }
					else if ( m_Quest.NMonsterType == "Bone Knight" ) { M_Type = typeof(BoneKnight); }
					else if ( m_Quest.NMonsterType == "Bone Magi" ) { M_Type = typeof(BoneMagi); }
					else if ( m_Quest.NMonsterType == "Bronze Elemental" ) { M_Type = typeof(BronzeElemental); }
					else if ( m_Quest.NMonsterType == "Copper Elemental" ) { M_Type = typeof(CopperElemental); }
					else if ( m_Quest.NMonsterType == "Corpser" ) { M_Type = typeof(Corpser); }
					else if ( m_Quest.NMonsterType == "Crystal Elemental" ) { M_Type = typeof(CrystalElemental); }
					else if ( m_Quest.NMonsterType == "Cyclops" ) { M_Type = typeof(Cyclops); }
					else if ( m_Quest.NMonsterType == "Deathwatch Beetle" ) { M_Type = typeof(DeathwatchBeetle); }
					else if ( m_Quest.NMonsterType == "Deathwatch Beetle Hatchling" ) { M_Type = typeof(DeathwatchBeetleHatchling); }
					else if ( m_Quest.NMonsterType == "Dull Copper Elemental" ) { M_Type = typeof(DullCopperElemental); }
					else if ( m_Quest.NMonsterType == "Fire Beetle" ) { M_Type = typeof(FireBeetle); }
					else if ( m_Quest.NMonsterType == "Fire Elemental" ) { M_Type = typeof(FireElemental); }
					else if ( m_Quest.NMonsterType == "Flesh Golem" ) { M_Type = typeof(FleshGolem); }
					else if ( m_Quest.NMonsterType == "Frost Ooze" ) { M_Type = typeof(FrostOoze); }
					else if ( m_Quest.NMonsterType == "Frost Spider" ) { M_Type = typeof(FrostSpider); }
					else if ( m_Quest.NMonsterType == "Frost Troll" ) { M_Type = typeof(FrostTroll); }
					else if ( m_Quest.NMonsterType == "Gargoyle" ) { M_Type = typeof(Gargoyle); }
					else if ( m_Quest.NMonsterType == "Gazer" ) { M_Type = typeof(Gazer); }
					else if ( m_Quest.NMonsterType == "Giant Serpent" ) { M_Type = typeof(GiantSerpent); }
					else if ( m_Quest.NMonsterType == "Golden Elemental" ) { M_Type = typeof(GoldenElemental); }
					else if ( m_Quest.NMonsterType == "Gore Fiend" ) { M_Type = typeof(GoreFiend); }
					else if ( m_Quest.NMonsterType == "Hell Hound" ) { M_Type = typeof(HellHound); }
					else if ( m_Quest.NMonsterType == "Ice Elemental" ) { M_Type = typeof(IceElemental); }
					else if ( m_Quest.NMonsterType == "Ice Snake" ) { M_Type = typeof(IceSnake); }
					else if ( m_Quest.NMonsterType == "Imp" ) { M_Type = typeof(Imp); }
					else if ( m_Quest.NMonsterType == "Lava Snake" ) { M_Type = typeof(LavaSnake); }
					else if ( m_Quest.NMonsterType == "Minotaur" ) { M_Type = typeof(Minotaur); }
					else if ( m_Quest.NMonsterType == "Ogre" ) { M_Type = typeof(Ogre); }
					else if ( m_Quest.NMonsterType == "Ophidian Knight" ) { M_Type = typeof(OphidianKnight); }
					else if ( m_Quest.NMonsterType == "Ophidian Warrior" ) { M_Type = typeof(OphidianWarrior); }
					else if ( m_Quest.NMonsterType == "Orc Brute" ) { M_Type = typeof(OrcBrute); }
					else if ( m_Quest.NMonsterType == "Orc Captain" ) { M_Type = typeof(OrcCaptain); }
					else if ( m_Quest.NMonsterType == "Orcish Lord" ) { M_Type = typeof(OrcishLord); }
					else if ( m_Quest.NMonsterType == "Orcish Mage" ) { M_Type = typeof(OrcishMage); }
					else if ( m_Quest.NMonsterType == "Patchwork Skeleton" ) { M_Type = typeof(PatchworkSkeleton); }
					else if ( m_Quest.NMonsterType == "Ratman Archer" ) { M_Type = typeof(RatmanArcher); }
					else if ( m_Quest.NMonsterType == "Ratman Mage" ) { M_Type = typeof(RatmanMage); }
					else if ( m_Quest.NMonsterType == "Ridgeback" ) { M_Type = typeof(Ridgeback); }
					else if ( m_Quest.NMonsterType == "Sand Vortex" ) { M_Type = typeof(SandVortex); }
					else if ( m_Quest.NMonsterType == "Savage" ) { M_Type = typeof(Savage); }
					else if ( m_Quest.NMonsterType == "Savage Rider" ) { M_Type = typeof(SavageRider); }
					else if ( m_Quest.NMonsterType == "Savage Shaman" ) { M_Type = typeof(SavageShaman); }
					else if ( m_Quest.NMonsterType == "Shadow Iron Elemental" ) { M_Type = typeof(ShadowIronElemental); }
					else if ( m_Quest.NMonsterType == "Skeletal Knight" ) { M_Type = typeof(SkeletalKnight); }
					else if ( m_Quest.NMonsterType == "Skeletal Mage" ) { M_Type = typeof(SkeletalMage); }
					else if ( m_Quest.NMonsterType == "Snow Elemental" ) { M_Type = typeof(SnowElemental); }
					else if ( m_Quest.NMonsterType == "Stone Gargoyle" ) { M_Type = typeof(StoneGargoyle); }
					else if ( m_Quest.NMonsterType == "Stone Harpy" ) { M_Type = typeof(StoneHarpy); }
					else if ( m_Quest.NMonsterType == "Terathan Drone" ) { M_Type = typeof(TerathanDrone); }
					else if ( m_Quest.NMonsterType == "Terathan Warrior" ) { M_Type = typeof(TerathanWarrior); }
					else if ( m_Quest.NMonsterType == "Troll" ) { M_Type = typeof(Troll); }
					else if ( m_Quest.NMonsterType == "Valorite Elemental" ) { M_Type = typeof(ValoriteElemental); }
					else if ( m_Quest.NMonsterType == "Vampire Bat" ) { M_Type = typeof(VampireBat); }
					else if ( m_Quest.NMonsterType == "Verite Elemental" ) { M_Type = typeof(VeriteElemental); }
					else if ( m_Quest.NMonsterType == "Wailing Banshee" ) { M_Type = typeof(WailingBanshee); }
					else if ( m_Quest.NMonsterType == "Water Elemental" ) { M_Type = typeof(WaterElemental); }
					else if ( m_Quest.NMonsterType == "Bog Thing" ) { M_Type = typeof(BogThing); }
					else if ( m_Quest.NMonsterType == "Centaur" ) { M_Type = typeof(Centaur); }
					else if ( m_Quest.NMonsterType == "Drake" ) { M_Type = typeof(Drake); }
					else if ( m_Quest.NMonsterType == "Dread Spider" ) { M_Type = typeof(DreadSpider); }
					else if ( m_Quest.NMonsterType == "Elite Ninja" ) { M_Type = typeof(EliteNinja); }
					else if ( m_Quest.NMonsterType == "Evil Mage" ) { M_Type = typeof(EvilMage); }
					else if ( m_Quest.NMonsterType == "Exodus Minion" ) { M_Type = typeof(ExodusMinion); }
					else if ( m_Quest.NMonsterType == "Exodus Overseer" ) { M_Type = typeof(ExodusOverseer); }
					else if ( m_Quest.NMonsterType == "Fan Dancer" ) { M_Type = typeof(FanDancer); }
					else if ( m_Quest.NMonsterType == "Fire Gargoyle" ) { M_Type = typeof(FireGargoyle); }
					else if ( m_Quest.NMonsterType == "Gargoyle Destroyer" ) { M_Type = typeof(GargoyleDestroyer); }
					else if ( m_Quest.NMonsterType == "Gargoyle Enforcer" ) { M_Type = typeof(GargoyleEnforcer); }
					else if ( m_Quest.NMonsterType == "Giant Black Widow" ) { M_Type = typeof(GiantBlackWidow); }
					else if ( m_Quest.NMonsterType == "Golem" ) { M_Type = typeof(Golem); }
					else if ( m_Quest.NMonsterType == "Golem Controller" ) { M_Type = typeof(GolemController); }
					else if ( m_Quest.NMonsterType == "Ice Serpent" ) { M_Type = typeof(IceSerpent); }
					else if ( m_Quest.NMonsterType == "Lava Lizard" ) { M_Type = typeof(LavaLizard); }
					else if ( m_Quest.NMonsterType == "Lava Serpent" ) { M_Type = typeof(LavaSerpent); }
					else if ( m_Quest.NMonsterType == "Lich" ) { M_Type = typeof(Lich); }
					else if ( m_Quest.NMonsterType == "Minotaur Scout" ) { M_Type = typeof(MinotaurScout); }
					else if ( m_Quest.NMonsterType == "Mummy" ) { M_Type = typeof(Mummy); }
					else if ( m_Quest.NMonsterType == "Ogre Lord" ) { M_Type = typeof(OgreLord); }
					else if ( m_Quest.NMonsterType == "Ophidian Archmage" ) { M_Type = typeof(OphidianArchmage); }
					else if ( m_Quest.NMonsterType == "Ophidian Mage" ) { M_Type = typeof(OphidianMage); }
					else if ( m_Quest.NMonsterType == "Ophidian Matriarch" ) { M_Type = typeof(OphidianMatriarch); }
					else if ( m_Quest.NMonsterType == "Phoenix" ) { M_Type = typeof(Phoenix); }
					else if ( m_Quest.NMonsterType == "Plague Spawn" ) { M_Type = typeof(PlagueSpawn); }
					else if ( m_Quest.NMonsterType == "Quagmire" ) { M_Type = typeof(Quagmire); }
					else if ( m_Quest.NMonsterType == "Restless Soul" ) { M_Type = typeof(RestlessSoul); }
					else if ( m_Quest.NMonsterType == "Ronin" ) { M_Type = typeof(Ronin); }
					else if ( m_Quest.NMonsterType == "Rune Beetle" ) { M_Type = typeof(RuneBeetle); }
					else if ( m_Quest.NMonsterType == "Sea Serpent" ) { M_Type = typeof(SeaSerpent); }
					else if ( m_Quest.NMonsterType == "Shadow Fiend" ) { M_Type = typeof(ShadowFiend); }
					else if ( m_Quest.NMonsterType == "Swamp Dragon" ) { M_Type = typeof(SwampDragon); }
					else if ( m_Quest.NMonsterType == "Swamp Tentacle" ) { M_Type = typeof(SwampTentacle); }
					else if ( m_Quest.NMonsterType == "Terathan Avenger" ) { M_Type = typeof(TerathanAvenger); }
					else if ( m_Quest.NMonsterType == "Terathan Matriarch" ) { M_Type = typeof(TerathanMatriarch); }
					else if ( m_Quest.NMonsterType == "Titan" ) { M_Type = typeof(Titan); }
					else if ( m_Quest.NMonsterType == "Wyvern" ) { M_Type = typeof(Wyvern); }
					else if ( m_Quest.NMonsterType == "Arctic Ogre Lord" ) { M_Type = typeof(ArcticOgreLord); }
					else if ( m_Quest.NMonsterType == "Blood Elemental" ) { M_Type = typeof(BloodElemental); }
					else if ( m_Quest.NMonsterType == "Daemon" ) { M_Type = typeof(Daemon); }
					else if ( m_Quest.NMonsterType == "Efreet" ) { M_Type = typeof(Efreet); }
					else if ( m_Quest.NMonsterType == "Elder Gazer" ) { M_Type = typeof(ElderGazer); }
					else if ( m_Quest.NMonsterType == "Evil Mage Lord" ) { M_Type = typeof(EvilMageLord); }
					else if ( m_Quest.NMonsterType == "Fire Steed" ) { M_Type = typeof(FireSteed); }
					else if ( m_Quest.NMonsterType == "Ice Fiend" ) { M_Type = typeof(IceFiend); }
					else if ( m_Quest.NMonsterType == "Juggernaut" ) { M_Type = typeof(Juggernaut); }
					else if ( m_Quest.NMonsterType == "Lich Lord" ) { M_Type = typeof(LichLord); }
					else if ( m_Quest.NMonsterType == "Minotaur Captain" ) { M_Type = typeof(MinotaurCaptain); }
					else if ( m_Quest.NMonsterType == "Nightmare" ) { M_Type = typeof(Nightmare); }
					else if ( m_Quest.NMonsterType == "Plague Beast" ) { M_Type = typeof(PlagueBeast); }
					else if ( m_Quest.NMonsterType == "Poison Elemental" ) { M_Type = typeof(PoisonElemental); }
					else if ( m_Quest.NMonsterType == "Rotting Corpse" ) { M_Type = typeof(RottingCorpse); }
					else if ( m_Quest.NMonsterType == "Serpentine Dragon" ) { M_Type = typeof(SerpentineDragon); }
					else if ( m_Quest.NMonsterType == "Silver Serpent" ) { M_Type = typeof(SilverSerpent); }
					else if ( m_Quest.NMonsterType == "Ancient Lich" ) { M_Type = typeof(AncientLich); }
					else if ( m_Quest.NMonsterType == "Ancient Wyrm" ) { M_Type = typeof(AncientWyrm); }
					else if ( m_Quest.NMonsterType == "Balron" ) { M_Type = typeof(Balron); }
					else if ( m_Quest.NMonsterType == "Deep Sea Serpent" ) { M_Type = typeof(DeepSeaSerpent); }
					else if ( m_Quest.NMonsterType == "Dragon" ) { M_Type = typeof(Dragon); }
					else if ( m_Quest.NMonsterType == "Kraken" ) { M_Type = typeof(Kraken); }
					else if ( m_Quest.NMonsterType == "Shadow Wyrm" ) { M_Type = typeof(ShadowWyrm); }
					else if ( m_Quest.NMonsterType == "Skeletal Dragon" ) { M_Type = typeof(SkeletalDragon); }
					else if ( m_Quest.NMonsterType == "Succubus" ) { M_Type = typeof(Succubus); }
					else if ( m_Quest.NMonsterType == "White Wyrm" ) { M_Type = typeof(WhiteWyrm); }

					// END OF SECTION - MNTP1 /////////////////////////////////////////////////////////////////



					// SECTION - LCXY1 ////////////////////////////////////////////////////////////////////////

					// THIS SECTION DEFINES MY LOCATIONS INTO MAP AND XY COORDINATES

					if (
					( m_Quest.NLocation == "the Hedge Maze" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 1032 && from.Y >= 2159 && from.X <= 1256 && from.Y <= 2304 ) ||
					( m_Quest.NLocation == "Dungeon Destard" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5121 && from.Y >= 769 && from.X <= 5372 && from.Y <= 1020 ) ||
					( m_Quest.NLocation == "the Britain Cemetery" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 1336 && from.Y >= 1443 && from.X <= 1390 && from.Y <= 1493 ) ||
					( m_Quest.NLocation == "the Britain Cemetery" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 1336 && from.Y >= 1487 && from.X <= 1375 && from.Y <= 1510 ) ||
					( m_Quest.NLocation == "Dungeon Shame (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5376 && from.Y >= 0 && from.X <= 5503 && from.Y <= 127 ) ||
					( m_Quest.NLocation == "Dungeon Shame (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5505 && from.Y >= 0 && from.X <= 5363 && from.Y <= 127 ) ||
					( m_Quest.NLocation == "Dungeon Shame (Level 3)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5376 && from.Y >= 131 && from.X <= 5630 && from.Y <= 256 ) ||
					( m_Quest.NLocation == "Dungeon Shame (Level 5)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5636 && from.Y >= 0 && from.X <= 5893 && from.Y <= 126 ) ||
					( m_Quest.NLocation == "Dungeon Shame Mage Towers" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5431 && from.Y >= 175 && from.X <= 5455 && from.Y <= 199 ) ||
					( m_Quest.NLocation == "Dungeon Shame Mage Towers" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5567 && from.Y >= 183 && from.X <= 5591 && from.Y <= 207 ) ||
					( m_Quest.NLocation == "the Ice Dungeon" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5663 && from.Y >= 128 && from.X <= 5892 && from.Y <= 263 ) ||
					( m_Quest.NLocation == "the Ice Demon Lair" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5650 && from.Y >= 319 && from.X <= 5774 && from.Y <= 370 ) ||
					( m_Quest.NLocation == "the Ratman Fort" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5795 && from.Y >= 313 && from.X <= 5866 && from.Y <= 384 ) ||
					( m_Quest.NLocation == "Dungeon Hythloth (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5889 && from.Y >= 0 && from.X <= 6005 && from.Y <= 117 ) ||
					( m_Quest.NLocation == "Dungeon Hythloth (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5905 && from.Y >= 136 && from.X <= 6002 && from.Y <= 244 ) ||
					( m_Quest.NLocation == "Dungeon Hythloth (Level 3)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 6025 && from.Y >= 134 && from.X <= 6133 && from.Y <= 237 ) ||
					( m_Quest.NLocation == "Dungeon Hythloth (Level 4)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 6037 && from.Y >= 22 && from.X <= 6125 && from.Y <= 110 ) ||
					( m_Quest.NLocation == "Dungeon Deceit (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5128 && from.Y >= 521 && from.X <= 5239 && from.Y <= 642 ) ||
					( m_Quest.NLocation == "Dungeon Deceit (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5270 && from.Y >= 523 && from.X <= 5356 && from.Y <= 636 ) ||
					( m_Quest.NLocation == "Dungeon Deceit (Level 3)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5124 && from.Y >= 644 && from.X <= 5233 && from.Y <= 768 ) ||
					( m_Quest.NLocation == "Dungeon Deceit (Level 4)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5249 && from.Y >= 640 && from.X <= 5339 && from.Y <= 764 ) ||
					( m_Quest.NLocation == "Dungeon Despise (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5377 && from.Y >= 511 && from.X <= 5517 && from.Y <= 639 ) ||
					( m_Quest.NLocation == "Dungeon Despise (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5377 && from.Y >= 640 && from.X <= 5529 && from.Y <= 767 ) ||
					( m_Quest.NLocation == "Dungeon Despise (Level 3)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5375 && from.Y >= 768 && from.X <= 5633 && from.Y <= 1022 ) ||
					( m_Quest.NLocation == "Dungeon Wrong (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5775 && from.Y >= 512 && from.X <= 5892 && from.Y <= 634 ) ||
					( m_Quest.NLocation == "Dungeon Wrong (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5635 && from.Y >= 506 && from.X <= 5745 && from.Y <= 588 ) ||
					( m_Quest.NLocation == "Dungeon Wrong (Level 3)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5682 && from.Y >= 612 && from.X <= 5724 && from.Y <= 673 ) ||
					( m_Quest.NLocation == "Dungeon Khaldun" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5377 && from.Y >= 1281 && from.X <= 5627 && from.Y <= 1512 ) ||
					( m_Quest.NLocation == "the Trinsic Passage" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5886 && from.Y >= 1274 && from.X <= 6047 && from.Y <= 1414 ) ||
					( m_Quest.NLocation == "the Fire Dungeon (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5765 && from.Y >= 1281 && from.X <= 5884 && from.Y <= 1417 ) ||
					( m_Quest.NLocation == "the Fire Dungeon (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5666 && from.Y >= 1402 && from.X <= 5887 && from.Y <= 1520 ) ||
					( m_Quest.NLocation == "the Fire Dungeon (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5633 && from.Y >= 1274 && from.X <= 5763 && from.Y <= 1398 ) ||
					( m_Quest.NLocation == "the Fire Dungeon (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5630 && from.Y >= 1383 && from.X <= 5664 && from.Y <= 1456 ) ||
					( m_Quest.NLocation == "the Sewers" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 6019 && from.Y >= 1418 && from.X <= 6132 && from.Y <= 1520 ) ||
					( m_Quest.NLocation == "Terathan Keep" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5124 && from.Y >= 1532 && from.X <= 5376 && from.Y <= 1784 ) ||
					( m_Quest.NLocation == "the Solen Hive" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5639 && from.Y >= 1780 && from.X <= 5934 && from.Y <= 2037 ) ||
					( m_Quest.NLocation == "Dungeon Covetous (Level 1)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5373 && from.Y >= 1843 && from.X <= 5508 && from.Y <= 1942 ) ||
					( m_Quest.NLocation == "Dungeon Covetous (Level 2)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5374 && from.Y >= 1951 && from.X <= 5622 && from.Y <= 2045 ) ||
					( m_Quest.NLocation == "Dungeon Covetous (Level 3)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5533 && from.Y >= 1821 && from.X <= 5630 && from.Y <= 1937 ) ||
					( m_Quest.NLocation == "Dungeon Covetous (Jail Cells)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5491 && from.Y >= 1791 && from.X <= 5556 && from.Y <= 1821 ) ||
					( m_Quest.NLocation == "Dungeon Covetous (Lake Cave)" && (from.Map == Map.Trammel || from.Map == Map.Felucca) && from.X >= 5390 && from.Y >= 1780 && from.X <= 5486 && from.Y <= 1838 ) ||
					( m_Quest.NLocation == "Dungeon Doom" && from.Map == Map.Malas && from.X >= 249 && from.Y >= 0 && from.X <= 515 && from.Y <= 257 ) ||
					( m_Quest.NLocation == "Bedlam" && from.Map == Map.Malas && from.X >= 71 && from.Y >= 1564 && from.X <= 211 && from.Y <= 1690 ) ||
					( m_Quest.NLocation == "the Sorcerer`s Dungeon (Level 1)" && from.Map == Map.Ilshenar && from.X >= 365 && from.Y >= 0 && from.X <= 483 && from.Y <= 116 ) ||
					( m_Quest.NLocation == "the Sorcerer`s Dungeon (Level 2)" && from.Map == Map.Ilshenar && from.X >= 196 && from.Y >= 0 && from.X <= 363 && from.Y <= 101 ) ||
					( m_Quest.NLocation == "the Sorcerer`s Dungeon (Level 3)" && from.Map == Map.Ilshenar && from.X >= 52 && from.Y >= 0 && from.X <= 185 && from.Y <= 134 ) ||
					( m_Quest.NLocation == "the Sorcerer`s Dungeon (Jail Cells)" && from.Map == Map.Ilshenar && from.X >= 218 && from.Y >= 104 && from.X <= 251 && from.Y <= 147 ) ||
					( m_Quest.NLocation == "the Ancient Cave" && from.Map == Map.Ilshenar && from.X >= 13 && from.Y >= 658 && from.X <= 134 && from.Y <= 760 ) ||
					( m_Quest.NLocation == "the Kirin Passage" && from.Map == Map.Ilshenar && from.X >= 0 && from.Y >= 805 && from.X <= 187 && from.Y <= 1198 ) ||
					( m_Quest.NLocation == "Dungeon Ankh" && from.Map == Map.Ilshenar && from.X >= 0 && from.Y >= 1247 && from.X <= 183 && from.Y <= 1584 ) ||
					( m_Quest.NLocation == "the Serpentine Passage" && from.Map == Map.Ilshenar && from.X >= 382 && from.Y >= 1497 && from.X <= 542 && from.Y <= 1596 ) ||
					( m_Quest.NLocation == "the Wisp Dungeon (Level 3)" && from.Map == Map.Ilshenar && from.X >= 815 && from.Y >= 1446 && from.X <= 913 && from.Y <= 1584 ) ||
					( m_Quest.NLocation == "the Wisp Dungeon (Level 5)" && from.Map == Map.Ilshenar && from.X >= 917 && from.Y >= 1456 && from.X <= 1017 && from.Y <= 1578 ) ||
					( m_Quest.NLocation == "the Wisp Dungeon (Level 7)" && from.Map == Map.Ilshenar && from.X >= 740 && from.Y >= 1509 && from.X <= 815 && from.Y <= 1585 ) ||
					( m_Quest.NLocation == "the Wisp Dungeon (Level 8)" && from.Map == Map.Ilshenar && from.X >= 746 && from.Y >= 1460 && from.X <= 792 && from.Y <= 1495 ) ||
					( m_Quest.NLocation == "the Ratman Mines (Level 1)" && from.Map == Map.Ilshenar && from.X >= 1263 && from.Y >= 1460 && from.X <= 1355 && from.Y <= 1574 ) ||
					( m_Quest.NLocation == "the Ratman Mines (Level 2)" && from.Map == Map.Ilshenar && from.X >= 1151 && from.Y >= 1460 && from.X <= 1259 && from.Y <= 1558 ) ||
					( m_Quest.NLocation == "the Spider Cave" && from.Map == Map.Ilshenar && from.X >= 1749 && from.Y >= 941 && from.X <= 1870 && from.Y <= 1003 ) ||
					( m_Quest.NLocation == "the Spectre Dungeon" && from.Map == Map.Ilshenar && from.X >= 1940 && from.Y >= 1006 && from.X <= 2022 && from.Y <= 1113 ) ||
					( m_Quest.NLocation == "Dungeon Blood" && from.Map == Map.Ilshenar && from.X >= 2048 && from.Y >= 825 && from.X <= 2195 && from.Y <= 1060 ) ||
					( m_Quest.NLocation == "the Rock Dungeon" && from.Map == Map.Ilshenar && from.X >= 2084 && from.Y >= 0 && from.X <= 2244 && from.Y <= 183 ) ||
					( m_Quest.NLocation == "Dungeon Exodus" && from.Map == Map.Ilshenar && from.X >= 1836 && from.Y >= 9 && from.X <= 2082 && from.Y <= 210 )
					)
					{
						nSpot = 1;
					}

					// END OF SECTION - LCXY1 /////////////////////////////////////////////////////////////////



					if ( c.Owner == null )
					{
						if ( m_Quest.NType == 1 )
						{
							from.SendMessage( "It is too late to claim credit for this!" );
						}
						else
						{
							from.SendMessage( "Your search turns up nothing!" );
						}

						return;
					}

					if ( obj is Corpse )
					{
						obj = ((Corpse)obj).Owner;

						if ( ( M_Type == obj.GetType() ) && ( m_Quest.NType == 1 ) )
						{
							from.SendMessage( "You claim this toward your quest." );

							c.Delete();

							m_Quest.NGot = m_Quest.NGot + 1;

							if ( m_Quest.NGot >= m_Quest.NNeed )
							{
								from.PrivateOverheadMessage(MessageType.Regular, 0x44, false, "Quest Complete!", from.NetState);
								m_Quest.Name = "COMPLETE - Slay a " + m_Quest.NMonsterType + " (" + m_Quest.NGot.ToString() + " of " + m_Quest.NNeed.ToString() + ")";
								m_Quest.Hue = 1258;
							}
							else
							{
								m_Quest.Name = "Slay a " + m_Quest.NMonsterType + " (" + m_Quest.NGot.ToString() + " of " + m_Quest.NNeed.ToString() + ")";
							}
						}

						else if ( ( nSpot == 1 ) && ( m_Quest.NType == 2 ) )
						{
							if ( m_Quest.NChance > Utility.Random( 100 ) )
							{
								from.PrivateOverheadMessage(MessageType.Regular, 0x44, false, "I found " + m_Quest.NItemName + "!", from.NetState);
								from.SendMessage( "You have found " + m_Quest.NItemName + "!" );
								c.Delete();
								m_Quest.NGot = m_Quest.NGot + 1;
								m_Quest.Name = "COMPLETE - Seek " + m_Quest.NItemName;
								m_Quest.Hue = 1258;
							}
							else
							{
								from.SendMessage( "You did not find the item you seek!" );
								c.Delete();
							}
						}
						else
						{
							from.SendMessage( "That has nothing to do with your quest!" );
						}

						return;
					}

					from.SendMessage( "That has nothing to do with your quest!" );
				}
			}
Esempio n. 49
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                var p = targeted as IPoint3D;
                Map map = from.Map;

                if (p == null || map == null || Hammer.Deleted)
                {
                    return;
                }

                if (Hammer.IsChildOf(from.Backpack) && Book.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = new SoulForgeAddon();

                    SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse house = null;

                    var res = AddonFitResult.Valid;
                    if (from.AccessLevel < AccessLevel.GameMaster)
                    {
                        res = addon.CouldFit(p, map, from, ref house);
                    }
                    else
                    {
                        house = BaseHouse.FindHouseAt(new Point3D(p), map, p.Z);
                        if (house == null)
                        {
                            res = AddonFitResult.NotInHouse;
                        }
                    }

                    if (res == AddonFitResult.Valid)
                    {
                        addon.MoveToWorld(new Point3D(p), map);
                    }
                    else if (res == AddonFitResult.Blocked)
                    {
                        from.SendLocalizedMessage(500269); // You cannot build that there.
                    }
                    else if (res == AddonFitResult.NotInHouse)
                    {
                        from.SendLocalizedMessage(500274); // You can only place this in a house that you own!
                    }
                    else if (res == AddonFitResult.DoorTooClose)
                    {
                        from.SendLocalizedMessage(500271); // You cannot build near the door.
                    }
                    else if (res == AddonFitResult.NoWall)
                    {
                        from.SendLocalizedMessage(500268); // This object needs to be mounted on something.
                    }

                    if (res == AddonFitResult.Valid && house != null && TryConsumeSfMaterials(from))
                    {
                        Conquests.Conquests.CheckProgress<ItemConquest>(from as PlayerMobile, this);
                        from.PrivateOverheadMessage(MessageType.Label, 2049, true,
                            "*You begin crafting the Soulforge*",
                            from.NetState);
                        Timer.DelayCall(TimeSpan.FromSeconds(1), SFCreate_Callback, Tuple.Create(0, from, p));
                        from.Frozen = true;
                        Hammer.Delete();
                        Book.Delete();
                        house.Addons.Add(addon);
                    }
                    else
                    {
                        addon.Delete();
                        from.SendMessage(54, "You did not have the required materials to create the Soulforge.");
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }
Esempio n. 50
0
        public void DoEffect(Mobile from)
        {
            int effect = Utility.Random(15);
            string flavour = "de rien";

            switch(effect)
            {
                case 0: flavour = "de pomme"; break;
                case 1: flavour = "de pêche"; break;
                case 2: flavour = "de poire"; break;
                case 3: flavour = "de melon"; break;
                case 4: flavour = "de citron"; break;
                case 5: flavour = "de lime"; break;
                case 6: flavour = "de raisin"; break;
                case 7: flavour = "de banane"; break;
                case 8: flavour = "de noix de coco"; break;
                case 9: flavour = "de dattes"; break;
                case 10: flavour = "de terre"; break;
                case 11: flavour = "de carotte"; break;
                case 12: flavour = "d'ail"; break;
                case 13: flavour = "de sang"; break;
                case 14: flavour = "de vomi"; break;
            }

            Charges--;
            from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "Celle-ci avait le goût " + flavour, from.NetState);

            if (Charges <= 0)
                this.Consume();
        }
Esempio n. 51
0
		public override void OnDoubleClick( Mobile from )
		{
			if( m_HasLinkedDoor )
			{
				if( m_LinkedDoor == null || m_LinkedDoor.Deleted )
				{
					m_HasLinkedDoor = false;
					m_LinkedDoor = null;
					return;
				}

				if( from.InRange( GetWorldLocation(), 5 ) && from.InLOS(this) )
				{
					if( m_HasMessage )
						if( m_SayOverhead )
							PublicOverheadMessage( MessageType.Regular, 0, false, m_Message );
						else
							from.PrivateOverheadMessage( MessageType.Regular, 0, false, m_Message, from.NetState );

					if( m_HasOnItemId )
						ItemID = ( ItemID == m_OnItemId ) ? m_OffItemId : m_OnItemId;

					m_LinkedDoor.Open = !m_LinkedDoor.Open;
				}
				else
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
			}
		}
Esempio n. 52
0
		public override void OnDoubleClick(Mobile from)
		{
		    var p = from as PlayerMobile;

			if (!_MActive)
			{
				from.SendMessage(0x9A, "This table is inactive");
			}
			else if (!InRange(from.Location, 8))
			{
				from.PrivateOverheadMessage(MessageType.Regular, 0x22, true, "I am too far away to do that", from.NetState);
			}
			else if (MinBuyIn == 0 || MaxBuyIn == 0)
			{
				from.SendMessage(0x9A, "This table is inactive");
			}
			else if (MinBuyIn > MaxBuyIn)
			{
				from.SendMessage(0x9A, "This table is inactive");
			}
			else if (p != null && p.PokerGame != null && Game != p.PokerGame)
			{
				from.SendMessage(0x9A, "You cannot join two poker games at the same time.");
			}
            else if (Seats.Count < _MMaxPlayers)
            {
                from.SendMessage(0x9A, "This table is inactive");
            }
			else if (Game.GetIndexFor(from) != -1)
			{
                from.CloseGump(typeof(PokerRebuy));
                from.SendGump(new PokerRebuy(from, Game));
			}
			else if (Game.Players.Count >= _MMaxPlayers)
			{
				from.SendMessage(0x22, "This table is full");
				base.OnDoubleClick(from);
			}
			else if (Game.Players.Count < _MMaxPlayers && from.Alive)
			{
			    if (Game.Players.Players.Any(player => player.Mobile.NetState != null && @from.NetState != null &&
			                                           player.Mobile.NetState.Address.Equals(@from.NetState.Address)))
			    {
                    if (from.AccessLevel <= AccessLevel.Player)
			            return;
			    }
				from.CloseGump(typeof(PokerJoinGump));
				from.SendGump(new PokerJoinGump(from, Game));
			}
		}
Esempio n. 53
0
		public override bool Eat(Mobile from)
		{
			int oldHunger = from.Hunger;

			// Fill the Mobile with FillFactor
			if (CheckHunger(from))
			{
				if (Owner != null)
				{
					if (Owner.RawStr > from.RawStr)
					{
						from.PrivateOverheadMessage(
							MessageType.Label,
							54,
							true,
							"Even though " + Owner.Name +
							"flesh is tough, stringy and not very taste, you feel quite energized after the meal.",
							from.NetState);
						//SpellHelper.AddStatBonus(from, from, StatType.Str, true);
					}
					else if (Owner.RawStr == from.RawStr)
					{
						from.PrivateOverheadMessage(
							MessageType.Label,
							54,
							true,
							"You marvel at the flavour of " + Owner.Name +
							"'s flesh.  What they lacked in fighting prowess was made up for in their succulent taste.",
							from.NetState);
					}
					else if (Owner.RawStr < from.RawStr)
					{
						from.PrivateOverheadMessage(
							MessageType.Label,
							54,
							true,
							Owner.Name + " was quite the tubby fellow.  While delicious, his flesh wasn't very nutritious.",
							from.NetState);

						//SpellHelper.AddStatCurse(from, from, StatType.Str, false);
					}
				}
				// Play a random "eat" sound
				from.PlaySound(Utility.Random(0x3A, 3));

				if (from.Body.IsHuman && !from.Mounted)
				{
					from.Animate(34, 5, 1, true, false, 0);
				}

				if (Poison != null)
				{
					from.ApplyPoison(Poisoner, Poison);
				}

				//EventSink.InvokeOnConsume(new OnConsumeEventArgs(from, this, from.Hunger - oldHunger));

                if (from is PlayerMobile)
                {
                    Conquests.CheckProgress<ItemConquest>((PlayerMobile)from, this, from.Hunger - oldHunger);

                    //CheckProgress<ConsumeItemConquest>((PlayerMobile)e.Consumer, e);
                }

				Consume();

				return true;
			}

			return false;
		}
Esempio n. 54
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is Mobile )
                {
                    from.SendAsciiMessage("You feel that such an action would be inappropriate."); // You feel that such an action would be inappropriate
                }
                else if ( targeted is TrapableContainer )
                {
                    TrapableContainer targ = (TrapableContainer)targeted;

                    from.Direction = from.GetDirectionTo( targ );

                    if ( targ.TrapType == TrapType.None )
                    {
                        from.SendAsciiMessage("That doesn't appear to be trapped"); // That doesn't appear to be trapped
                        return;
                    }

                    from.PlaySound( 0x241 );

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30 ) )
                    {
                        targ.TrapPower = 0;
                        targ.TrapLevel = 0;
                        targ.TrapType = TrapType.None;
                        from.SendAsciiMessage("You successfully render the trap harmless"); // You successfully render the trap harmless
                    }
                    else
                    {
                        from.SendAsciiMessage("You fail to disarm the trap... but you don't set it off."); // You fail to disarm the trap... but you don't set it off
                    }
                }
                else if ( targeted is BaseFactionTrap )
                {
                    BaseFactionTrap trap = (BaseFactionTrap) targeted;
                    Faction faction = Faction.Find( from );

                    FactionTrapRemovalKit kit = ( from.Backpack == null ? null : from.Backpack.FindItemByType( typeof( FactionTrapRemovalKit ) ) as FactionTrapRemovalKit );

                    bool isOwner = ( trap.Placer == from || ( trap.Faction != null && trap.Faction.IsCommander( from ) ) );

                    if ( faction == null )
                    {
                        from.SendLocalizedMessage( 1010538 ); // You may not disarm faction traps unless you are in an opposing faction
                    }
                    else if ( faction == trap.Faction && trap.Faction != null && !isOwner )
                    {
                        from.SendLocalizedMessage( 1010537 ); // You may not disarm traps set by your own faction!
                    }
                    else if ( !isOwner && kit == null )
                    {
                        from.SendLocalizedMessage( 1042530 ); // You must have a trap removal kit at the base level of your pack to disarm a faction trap.
                    }
                    else
                    {
                        if ( from.CheckTargetSkill( SkillName.RemoveTrap, trap, 80.0, 100.0 ) && from.CheckTargetSkill( SkillName.Tinkering, trap, 80.0, 100.0 ) )
                        {
                            from.PrivateOverheadMessage( MessageType.Regular, trap.MessageHue, trap.DisarmMessage, from.NetState );

                            if ( !isOwner )
                            {
                                int silver = faction.AwardSilver( from, trap.SilverFromDisarm );

                                if ( silver > 0 )
                                    from.SendLocalizedMessage( 1008113, true, silver.ToString( "N0" ) ); // You have been granted faction silver for removing the enemy trap :
                            }

                            trap.Delete();
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
                        }

                        if ( !isOwner && kit != null )
                            kit.ConsumeCharge( from );
                    }
                }
                else
                {
                    from.SendAsciiMessage( "That doesn't appear to be trapped." ); // That does'nt appear to be trapped
                }
            }
Esempio n. 55
0
		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 ) );
			}
		}
			public static void MOBCLICKMSG(TriggerObject trigObject, Mobile from, Mobile clickedMob, string message)
			{
				if (from != null && clickedMob != null && message != null && from.NetState != null)
				{
					clickedMob.PrivateOverheadMessage(
						MessageType.Label,
						clickedMob.NameHue != -1 ? clickedMob.NameHue : Notoriety.GetHue(Notoriety.Compute(from, clickedMob)),
						Mobile.AsciiClickMessage,
						message,
						from.NetState);
				}
			}
Esempio n. 57
0
 /// <summary>
 ///     Send a message to all poker players of the last persons move. For increase visibility, also display it over their
 ///     head.
 /// </summary>
 public void PokerMessage(Mobile from, string message)
 {
     foreach (var player in Players.ToArray())
     {
         from.PrivateOverheadMessage(MessageType.Regular, 0x9A, true, message, player.Owner.NetState);
         if (player.Owner != null)
         {
             player.Owner.SendMessage(0x9A, "[{0}]: {1}", from.Name, message);
         }
     }
 }
Esempio n. 58
0
		public override void OnDoubleClick(Mobile m)
		{
			if (!this.CheckDoubleClick(m, true, false, 2, true) || !(m is PlayerMobile))
			{
				return;
			}

			if (TitleHue == null)
			{
				m.SendMessage(0x22, "This ancient scroll has lost whatever power it once had.");
				m.PrivateOverheadMessage(MessageType.Label, 1287, true, "*The scroll disintegrates in your hands*", m.NetState);

				LoggingCustom.Log("HueScrollsInvalid.txt", String.Format("{0} -> {1} ({2})", m, this, TitleHue));

				Delete();

				return;
			}

			if (!CanConsume((PlayerMobile)m, true))
			{
				return;
			}

			var pm = (PlayerMobile)m;

			TitleProfile p = CustomTitles.EnsureProfile(pm);

			if (p == null)
			{
				return;
			}

			if (_Gump != null)
			{
				_Gump.Close(true);
				_Gump = null;
			}

			_Gump = SuperGump.Send(
				new ScrollConfirmGump(
					pm,
					null,
					TitleHue,
					b => GrantHue(pm, p),
					b =>
					{
						pm.SendMessage(0x55, "You choose to not use the title hue scroll.");
						_Gump = null;
					}));
		}
Esempio n. 59
0
        public override bool Eat(Mobile from)
        {

            if (FillHunger(from, FillFactor))
            {
                string tastemsg;
                int RatChances = (int)Taste;
                if (Poisoner == null)
                {
                    if (RatChances > Utility.Random(8))
                    {
                        BaseCreature rat = new Rat();
                        rat.MoveToWorld(from.Location, from.Map);
                        switch (Utility.Random(4))
                        {
                            case 2:
                                {
                                    rat.FocusMob = from;
                                    rat.AI = AIType.AI_Predator;
                                    rat.Say("*Semble jaloux de votre fromage*");
                                    break;
                                }
                            default:
                                {
                                    rat.Controlled = true;
                                    rat.ControlMaster = from;
                                    rat.ControlOrder = OrderType.Come;
                                    rat.Say("*Couinant amoureusement près de vous*");
                                    break;
                                }
                        }
                    }

                    string paste = "Vous mangez";
                    string taste = "";

                    switch (Paste)
                    {
                        case CheesePaste.Molle: paste = "Vous laissez fondre"; break;
                        case CheesePaste.Normale: paste = "Vous dégustez"; break;
                        case CheesePaste.Dure: paste = "Vous grignottez"; break;
                    }

                    switch (Taste)
                    {
                        case CheeseTaste.Faible: taste = "au goût subtil"; break;
                        case CheeseTaste.Leger: taste = "au goût délicat"; break;
                        case CheeseTaste.Modere: taste = "au goût agréable"; break;
                        case CheeseTaste.Prononce: taste = "au goût bien présent"; break;
                        case CheeseTaste.Fort: taste = "au goût persistant"; break;
                    }

                    tastemsg = String.Format("{0} ce fromage {1}", paste, taste);
                    if (Quality == CheeseQuality.Exceptionnal)
                        from.Say("*Semble subjugué{0} par le goût de ce fromage*", from.Female ? "e" : "");
                }
                else
                {
                    tastemsg = "Le goût de la moisissure vous dégoûte au plus haut point";
                    from.PlaySound(from.Female ? 813 : 1087);

                    Point3D p = new Point3D(from.Location);
                    switch (from.Direction)
                    {
                        case Direction.North:
                            p.Y--; break;
                        case Direction.South:
                            p.Y++; break;
                        case Direction.East:
                            p.X++; break;
                        case Direction.West:
                            p.X--; break;
                        case Direction.Right:
                            p.X++; p.Y--; break;
                        case Direction.Down:
                            p.X++; p.Y++; break;
                        case Direction.Left:
                            p.X--; p.Y++; break;
                        case Direction.Up:
                            p.X--; p.Y--; break;
                        default:
                            break;
                    }
                    p.Z = from.Map.GetAverageZ(p.X, p.Y);

                    bool canFit = Server.Spells.SpellHelper.AdjustField(ref p, from.Map, 12, false);

                    if (canFit)
                    {
                        Puke puke = new Puke();
                        puke.Map = from.Map;
                        puke.Location = p;
                    }
                    from.Say("*Recrache le fromage, l'air malade*");
                }

                from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, tastemsg, from.NetState);


                // Play a random "eat" sound
                from.PlaySound(Utility.Random(0x3A, 3));

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

                if (Poison != null)
                    from.ApplyPoison(Poisoner, Poison);

                Consume();

                return true;
            }

            return false;
        }
Esempio n. 60
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is Mobile )
                {
                    from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
                }
                else if ( targeted is TrapableContainer )
                {
                    TrapableContainer targ = (TrapableContainer) targeted;

                    from.Direction = from.GetDirectionTo( targ );

                    if ( targ.TrapType == TrapType.None )
                    {
                        from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
                        return;
                    }

                    from.PlaySound( 0x241 );

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30 ) )
                    {
                        switch ( targ.TrapType )
                        {
                            case TrapType.ExplosionTrap:
                                from.LocalOverheadMessage( Network.MessageType.Regular, 0x78, 502374 ); // You carefully remove the trigger for the purple potion.
                                break;
                            case TrapType.DartTrap:
                                from.LocalOverheadMessage( Network.MessageType.Regular, 0x62, 502375 ); // You carefully remove the dart from the firing mechanism.
                                break;
                            case TrapType.PoisonTrap:
                                from.LocalOverheadMessage( Network.MessageType.Regular, 0x44, 502376 ); // The poison leaks harmlessly away due to your deft touch.
                                break;
                            default:
                                from.LocalOverheadMessage( Network.MessageType.Regular, 0x53, 502377 ); // You successfully render the trap harmless
                                break;
                        }

                        targ.TrapEnabled = false;
                        targ.TrapPower = 0;
                        targ.TrapLevel = 0;
                        targ.TrapType = TrapType.None;
                    }
                    else
                    {
                        if ( Utility.RandomDouble() <= 0.2 )
                        {
                            from.SendLocalizedMessage( 502370 ); // Oops.

                            targ.ExecuteTrap( from );
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502371 ); // You breathe a sigh of relief, as you fail to disarm the trap, but don't set it off.
                        }
                    }
                }
                else if ( targeted is BaseFactionTrap )
                {
                    BaseFactionTrap trap = (BaseFactionTrap) targeted;
                    Faction faction = Faction.Find( from );

                    FactionTrapRemovalKit kit = ( from.Backpack == null ? null : from.Backpack.FindItemByType( typeof( FactionTrapRemovalKit ) ) as FactionTrapRemovalKit );

                    bool isOwner = ( trap.Placer == from || ( trap.Faction != null && trap.Faction.IsCommander( from ) ) );

                    if ( faction == null )
                    {
                        from.SendLocalizedMessage( 1010538 ); // You may not disarm faction traps unless you are in an opposing faction
                    }
                    else if ( faction == trap.Faction && trap.Faction != null && !isOwner )
                    {
                        from.SendLocalizedMessage( 1010537 ); // You may not disarm traps set by your own faction!
                    }
                    else if ( !isOwner && kit == null )
                    {
                        from.SendLocalizedMessage( 1042530 ); // You must have a trap removal kit at the base level of your pack to disarm a faction trap.
                    }
                    else
                    {
                        if ( isOwner || ( from.CheckTargetSkill( SkillName.RemoveTrap, trap, 80.0, 100.0 ) && from.CheckTargetSkill( SkillName.Tinkering, trap, 80.0, 100.0 ) ) )
                        {
                            from.PrivateOverheadMessage( MessageType.Regular, trap.MessageHue, trap.DisarmMessage, from.Client );

                            if ( !isOwner )
                            {
                                int silver = faction.AwardSilver( from, trap.SilverFromDisarm );

                                if ( silver > 0 )
                                    from.SendLocalizedMessage( 1008113, true, silver.ToString( "N0" ) ); // You have been granted faction silver for removing the enemy trap :
                            }

                            trap.Delete();
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
                        }

                        if ( !isOwner && kit != null )
                            kit.ConsumeCharge( from );
                    }
                }
                else if ( targeted is GoblinTrap )
                {
                    GoblinTrap targ = (GoblinTrap) targeted;

                    from.Direction = from.GetDirectionTo( targ );
                    from.PlaySound( 0x241 );

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, 0.0, 100.0 ) )
                    {
                        from.LocalOverheadMessage( Network.MessageType.Regular, 0x53, 502377 ); // You successfully render the trap harmless
                        GoblinTrapGenerator.DisableTrap( from, targ );
                    }
                    else
                    {
                        if ( Utility.RandomDouble() <= 0.2 )
                        {
                            from.SendLocalizedMessage( 502370 ); // Oops.
                            targ.ExecuteTrap( from );
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502371 ); // You breathe a sigh of relief, as you fail to disarm the trap, but don't set it off.
                        }
                    }
                }
                else if ( targeted is FloorTrap )
                {
                    FloorTrap targ = (FloorTrap) targeted;

                    from.Direction = from.GetDirectionTo( targ );
                    from.PlaySound( 0x241 );

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TinkerLevel, 110.0 ) )
                    {
                        new FloorTrapKit().MoveToWorld( targ.Location, targ.Map );

                        from.LocalOverheadMessage( Network.MessageType.Regular, 0x53, 502377 ); // You successfully render the trap harmless
                        targ.Expire();
                    }
                    else
                    {
                        if ( Utility.RandomDouble() <= 0.2 )
                        {
                            from.SendLocalizedMessage( 502370 ); // Oops.
                            targ.ExecuteTrap( from );
                        }
                        else
                        {
                            targ.FailedRemoveTrapAttempt();
                            from.SendLocalizedMessage( 502371 ); // You breathe a sigh of relief, as you fail to disarm the trap, but don't set it off.
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 502373 ); // That does'nt appear to be trapped
                }
            }