Beispiel #1
0
        public bool CheckInstrument()
        {
            BaseInstrument inst = BaseInstrument.GetInstrument(this.m_Mobile);

            if (inst != null)
                return true;

            if (this.m_Mobile.Debug)
                this.m_Mobile.Say(1162, "I need an instrument, fixing my problem.");

            if (this.m_Mobile.Backpack == null)
                return false;

            inst = (BaseInstrument)this.m_Mobile.Backpack.FindItemByType(typeof(BaseInstrument));

            if (inst == null)
            {
                inst = new Harp();
                inst.SuccessSound = 0x58B;
                inst.FailureSound = 0x58C;
                // Got Better Music?
                // inst.DiscordSound = inst.PeaceSound = 0x58B;
                // inst.ProvocationSound = 0x58A;
            }

            BaseInstrument.SetInstrument(this.m_Mobile, inst);
            return true;
        }
Beispiel #2
0
        // Warning: Untested
        public static bool CheckBarding(BaseCreature from)
        {
            var inst = BaseInstrument.GetInstrument(from);

            if (inst == null)
            {
                if (from.Backpack == null)
                    return false;

                inst = (BaseInstrument) from.Backpack.FindItemByType(typeof (BaseInstrument));

                if (inst == null)
                {
                    inst = new Harp();
                    inst.SuccessSound = 0x58B;
                    // inst.DiscordSound = inst.PeaceSound = 0x58B;
                    // inst.ProvocationSound = 0x58A;
                    inst.FailureSound = 0x58C;
                }
            }

            BaseInstrument.SetInstrument(from, inst);

            if (from.Skills[SkillName.Discordance].Base == 0)
                from.Skills[SkillName.Discordance].Base = 100.0;

            if (from.Skills[SkillName.Peacemaking].Base == 0)
                from.Skills[SkillName.Peacemaking].Base = 100.0;

            if (from.Skills[SkillName.Provocation].Base == 0)
                from.Skills[SkillName.Provocation].Base = 100.0;

            return true;
        }
Beispiel #3
0
        /// <summary>
        /// Auto Checks creature for an instrument. Creates if none in pack, and sets for barding skills.
        /// </summary>
        /// <returns></returns>
        public BaseInstrument CheckInstrument()
        {
            BaseInstrument inst = BaseInstrument.GetInstrument(this);

            if (inst == null)
            {
                if (this.Backpack == null)
                    return null;

                inst = this.Backpack.FindItemByType(typeof(BaseInstrument)) as BaseInstrument;

                if (inst == null)
                {
                    inst = new Harp();
                    inst.SuccessSound = 0x58B;
                    inst.FailureSound = 0x58C;
                    inst.Movable = false;
                    PackItem(inst);
                }
            }

            BaseInstrument.SetInstrument(this, inst);

            return inst;
        }
Beispiel #4
0
        public static BaseInstrument CheckBarding(BaseCreature from)
        {
            BaseInstrument inst = BaseInstrument.GetInstrument(from);

            if (inst == null)
            {
                if (from.Backpack == null)
                    return null;

                inst = (BaseInstrument)from.Backpack.FindItemByType(typeof(BaseInstrument));

                if (inst == null)
                {
                    inst = new Harp();
                    inst.SuccessSound = 0x58B;
                    inst.FailureSound = 0x58C;
                    inst.Movable = false;
                    from.PackItem(inst);
                }
            }

            BaseInstrument.SetInstrument(from, inst);

            return inst;
        }
		public override void OnResponse( NetState sender, RelayInfo info)
		{
			if ( bsStand.Deleted )
				return;
			if ( info.ButtonID >= 100 && info.ButtonID < 150 ) //blacksmith
			{
				string sKey = BardsStand.Names[info.ButtonID-100];
				int itemID, well, bad;
				double weight;
				Harp  inst = new Harp();

				if		(info.IsSwitched(11)) {	itemID = 0xEB1;  well = 0x43;  bad = 0x44;  weight = 35.0; bsStand.LastChecked = 11; } //Standing Harp
				else if (info.IsSwitched(12)) { itemID = 0xE9C;  well = 0x38;  bad = 0x39;  weight = 4.0;  bsStand.LastChecked = 12; } //Drum
				else if (info.IsSwitched(13)) { itemID = 0xEB3;  well = 0x4C;  bad = 0x4D;  weight = 5.0;  bsStand.LastChecked = 13; } //Lute
				else if (info.IsSwitched(14)) { itemID = 0xE9D;  well = 0x52;  bad = 0x53;  weight = 1.0;  bsStand.LastChecked = 14; } //Tambourine
				else if (info.IsSwitched(15)) { itemID = 0x2805; well = 0x504; bad = 0x503; weight = 2.0;  bsStand.LastChecked = 15; } //Bamboo Flute
				else						  { itemID = 0xEB2;  well = 0x45;  bad = 0x46;  weight = 10.0; bsStand.LastChecked = 10; } //Lap Harp
				
				inst.ItemID = itemID;
				inst.SuccessSound = well;
				inst.FailureSound = bad;
				inst.Weight = weight;
				switch ( info.ButtonID )
				{
					case 100: inst.Quality = InstrumentQuality.Regular; break;
					case 101: inst.Quality = InstrumentQuality.Exceptional; break;
					case 102: inst.Slayer = SlayerName.Silver; break;
					case 103: inst.Slayer = SlayerName.OrcSlaying; break;
					case 104: inst.Slayer = SlayerName.TrollSlaughter; break;
					case 105: inst.Slayer = SlayerName.OgreTrashing; break;
					case 106: inst.Slayer = SlayerName.Repond; break;
					case 107: inst.Slayer = SlayerName.DragonSlaying; break;
					case 108: inst.Slayer = SlayerName.Terathan; break;
					case 109: inst.Slayer = SlayerName.SnakesBane; break;
					case 110: inst.Slayer = SlayerName.LizardmanSlaughter; break;
					case 111: inst.Slayer = SlayerName.ReptilianDeath; break;
					case 112: inst.Slayer = SlayerName.DaemonDismissal; break;
					case 113: inst.Slayer = SlayerName.GargoylesFoe; break;
					case 114: inst.Slayer = SlayerName.BalronDamnation; break;
					case 115: inst.Slayer = SlayerName.Exorcism; break;
					case 116: inst.Slayer = SlayerName.Ophidian; break;
					case 117: inst.Slayer = SlayerName.SpidersDeath; break;
					case 118: inst.Slayer = SlayerName.ScorpionsBane; break;
					case 119: inst.Slayer = SlayerName.ArachnidDoom; break;
					case 120: inst.Slayer = SlayerName.FlameDousing; break;
					case 121: inst.Slayer = SlayerName.WaterDissipation; break;
					case 122: inst.Slayer = SlayerName.Vacuum; break;
					case 123: inst.Slayer = SlayerName.ElementalHealth; break;
					case 124: inst.Slayer = SlayerName.EarthShatter; break;
					case 125: inst.Slayer = SlayerName.BloodDrinking; break;
					case 126: inst.Slayer = SlayerName.SummerWind; break;
					case 127: inst.Slayer = SlayerName.ElementalBan; break;
					case 128: inst.Slayer = SlayerName.Fey; break;
				}
				inst.UsesRemaining = (int)bsStand.Slayer[sKey];
				bsStand.Slayer[sKey] = 0;
				mFrom.AddToBackpack( inst );
				mFrom.SendMessage( 2118, "You extracted the instrument from the Bards Stand.");
				mFrom.SendGump( new BardsStandGump( mFrom, bsStand ) );
			}
			if ( info.ButtonID == 999 )//add
			{
				bsStand.BeginCombine( mFrom );
				mFrom.SendGump( new BardsStandGump( mFrom, bsStand ) );
			}
		}
Beispiel #6
0
		private void Process( Mobile from )
		{
			Item rewardItem;

            switch( m_Skill.SkillID )
			{
				case 0: // alchemy
					rewardItem = new MortarPestle();
					break;
				case 7: // Blacksmithy
					rewardItem = new GMSmithHammer();
					break;
				case 8: // Bowcraft/fletching
					rewardItem = new Bow();
					break;
				case 11: // Carpentry
                    switch (m_Itemid)
                    {
                        case 4138:
                            rewardItem = new Hammer();
                            break;
                        case 4148:
                            rewardItem = new Saw();
                            break;
                        case 4146:
                            rewardItem = new SmoothingPlane();
                            break;
                        case 4325:
                            rewardItem = new Froe();
                            break;
                        case 4326:
                            rewardItem = new Inshave();
                            break;
                        case 4324:
                            rewardItem = new DrawKnife();
                            break;
                        default:
                            return;
                    }
			        break;
				case 23: // Inscription
					rewardItem = new ScribesPen();
					break;
				case 25: // Magery
					rewardItem = new Spellbook();
					( rewardItem as Spellbook ).Content = ulong.MaxValue;
                    (rewardItem as Spellbook).LootType = LootType.Blessed;
					break;
				case 34: // Tailoring
					rewardItem = new RewardDyeTub();
					break;
				case 35: // Animal Taming
					rewardItem = new ShepherdsCrook();
					break;
                case 44: //Lumberjacking
			        rewardItem = new Hatchet();
			        break;
                case 45: // Mining
                    rewardItem = new Pickaxe();
                    break;
                //Bardic skills
                case 9:
                case 15:
                case 22:
                case 29:
                    switch (m_Itemid)
                    {
                        case 3740:
                            rewardItem = new Drums();
                            break;
                        case 3761:
                            rewardItem = new Harp();
                            break;
                        case 3762:
                            rewardItem = new LapHarp();
                            break;
                        case 3763:
                            rewardItem = new Lute();
                            break;
                        case 3741:
                            rewardItem = new Tambourine();
                            break;
                        case 3742:
                            rewardItem = new TambourineTassel();
                            break;
                        default:
                            return;
                    }
			        break;
                //"Thieving" skills
                case 21:
                case 28:
                case 33:
                case 47:
			        rewardItem = new Cloak();
			        break;
				default:
					return;
			}

			rewardItem.Hue = m_CurrentHue;
			rewardItem.LootType = LootType.Blessed;

			if( m_Name != "" )
				rewardItem.Name = m_Name;

			if( rewardItem is RewardDyeTub )
			{
				var tub = (RewardDyeTub)rewardItem;
				tub.DyedHue = rewardItem.Hue;
                tub.Redyable = false;
                tub.LootType = LootType.Blessed;
                tub.Owner = from;

			}
			else if( rewardItem is GMSmithHammer )
			{
				var hammer = (GMSmithHammer)rewardItem;
				hammer.Owner = from;
			}

			from.AddToBackpack( rewardItem );

			// Log
			RewardLogging.WriteLine( from, m_Skill, m_Name, m_CurrentHue );
		}
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (bsStand.Deleted)
            {
                return;
            }
            if (info.ButtonID >= 100 && info.ButtonID < 150)               //blacksmith
            {
                string sKey = BardsStand.Names[info.ButtonID - 100];
                int    itemID, well, bad;
                double weight;
                Harp   inst = new Harp();

                if (info.IsSwitched(11))
                {
                    itemID = 0xEB1;  well = 0x43;  bad = 0x44;  weight = 35.0; bsStand.LastChecked = 11;
                }                                                                                                                                              //Standing Harp
                else if (info.IsSwitched(12))
                {
                    itemID = 0xE9C;  well = 0x38;  bad = 0x39;  weight = 4.0;  bsStand.LastChecked = 12;
                }                                                                                                                                      //Drum
                else if (info.IsSwitched(13))
                {
                    itemID = 0xEB3;  well = 0x4C;  bad = 0x4D;  weight = 5.0;  bsStand.LastChecked = 13;
                }                                                                                                                                      //Lute
                else if (info.IsSwitched(14))
                {
                    itemID = 0xE9D;  well = 0x52;  bad = 0x53;  weight = 1.0;  bsStand.LastChecked = 14;
                }                                                                                                                                      //Tambourine
                else if (info.IsSwitched(15))
                {
                    itemID = 0x2805; well = 0x504; bad = 0x503; weight = 2.0;  bsStand.LastChecked = 15;
                }                                                                                                                                      //Bamboo Flute
                else
                {
                    itemID = 0xEB2;  well = 0x45;  bad = 0x46;  weight = 10.0; bsStand.LastChecked = 10;
                }                                                                                                                                                          //Lap Harp

                inst.ItemID       = itemID;
                inst.SuccessSound = well;
                inst.FailureSound = bad;
                inst.Weight       = weight;
                switch (info.ButtonID)
                {
                case 100: inst.Quality = InstrumentQuality.Regular; break;

                case 101: inst.Quality = InstrumentQuality.Exceptional; break;

                case 102: inst.Slayer = SlayerName.Silver; break;

                case 103: inst.Slayer = SlayerName.OrcSlaying; break;

                case 104: inst.Slayer = SlayerName.TrollSlaughter; break;

                case 105: inst.Slayer = SlayerName.OgreTrashing; break;

                case 106: inst.Slayer = SlayerName.Repond; break;

                case 107: inst.Slayer = SlayerName.DragonSlaying; break;

                case 108: inst.Slayer = SlayerName.Terathan; break;

                case 109: inst.Slayer = SlayerName.SnakesBane; break;

                case 110: inst.Slayer = SlayerName.LizardmanSlaughter; break;

                case 111: inst.Slayer = SlayerName.ReptilianDeath; break;

                case 112: inst.Slayer = SlayerName.DaemonDismissal; break;

                case 113: inst.Slayer = SlayerName.GargoylesFoe; break;

                case 114: inst.Slayer = SlayerName.BalronDamnation; break;

                case 115: inst.Slayer = SlayerName.Exorcism; break;

                case 116: inst.Slayer = SlayerName.Ophidian; break;

                case 117: inst.Slayer = SlayerName.SpidersDeath; break;

                case 118: inst.Slayer = SlayerName.ScorpionsBane; break;

                case 119: inst.Slayer = SlayerName.ArachnidDoom; break;

                case 120: inst.Slayer = SlayerName.FlameDousing; break;

                case 121: inst.Slayer = SlayerName.WaterDissipation; break;

                case 122: inst.Slayer = SlayerName.Vacuum; break;

                case 123: inst.Slayer = SlayerName.ElementalHealth; break;

                case 124: inst.Slayer = SlayerName.EarthShatter; break;

                case 125: inst.Slayer = SlayerName.BloodDrinking; break;

                case 126: inst.Slayer = SlayerName.SummerWind; break;

                case 127: inst.Slayer = SlayerName.ElementalBan; break;

                case 128: inst.Slayer = SlayerName.Fey; break;
                }
                inst.UsesRemaining   = (int)bsStand.Slayer[sKey];
                bsStand.Slayer[sKey] = 0;
                mFrom.AddToBackpack(inst);
                mFrom.SendMessage(2118, "You extracted the instrument from the Bards Stand.");
                mFrom.SendGump(new BardsStandGump(mFrom, bsStand));
            }
            if (info.ButtonID == 999)              //add
            {
                bsStand.BeginCombine(mFrom);
                mFrom.SendGump(new BardsStandGump(mFrom, bsStand));
            }
        }