Inheritance: BaseItem
Esempio n. 1
0
        public static void ApplyAttributesTo(FishingPole pole, bool isRunicTool, int luckChance, int attributeCount, int min, int max)
        {
            m_IsRunicTool = isRunicTool;
            m_LuckChance  = luckChance;

            AosAttributes   primary = pole.Attributes;
            AosSkillBonuses skills  = pole.SkillBonuses;

            m_Props.SetAll(false);

            for (int i = 0; i < attributeCount; ++i)
            {
                int random = GetUniqueRandom(21);

                switch (random)
                {
                case 0: ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15); break;

                case 1: ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1); break;

                case 2: ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 1); break;

                case 3: ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15); break;

                case 4: ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100); break;

                case 5: ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1); break;

                case 6: ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2); break;

                case 7: ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2); break;

                case 8: ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3); break;

                case 9: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 8); break;

                case 10: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8); break;

                case 11: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8); break;

                case 12: ApplyAttribute(primary, min, max, AosAttribute.BonusStr, 1, 8); break;

                case 13: ApplyAttribute(primary, min, max, AosAttribute.BonusDex, 1, 8); break;

                case 14: ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8); break;

                case 15: ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12); break;

                case 16: ApplySkillBonus(skills, min, max, 0, 1, 15); break;

                case 17: ApplySkillBonus(skills, min, max, 1, 1, 15); break;

                case 18: ApplySkillBonus(skills, min, max, 2, 1, 15); break;

                case 19: ApplySkillBonus(skills, min, max, 3, 1, 15); break;

                case 20: ApplySkillBonus(skills, min, max, 4, 1, 15); break;
                }
            }
        }
		public OldFisherman()
		{
			Name = "James";
            Title = "Quest Giver";
            Body = 0x190;
			CantWalk = true;
			Hue = 0x83F8;
			AddItem( new Server.Items.Boots( 1138 ) );
			AddItem( new Server.Items.Shirt( 969 ) );
			AddItem( new Server.Items.ShortPants( 1118 ) );
			AddItem( new Server.Items.FloppyHat( 1138 ) );
			
			FishingPole fp = new FishingPole();
			fp.Hue = 1150;
			fp.Name = "Ancient Fishing Pole";
                        AddItem( fp );
			

                        int hairHue = 1150;

			switch ( Utility.Random( 1 ) )
			{
				case 0: AddItem( new ShortHair( hairHue ) ); break;
			} 
			
			Blessed = true;
			
			}
Esempio n. 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is FishingPole)
                {
                    FishingPole pole = (FishingPole)targeted;

                    if (pole.HookType != HookType.None)
                    {
                        Item hook = null;

                        switch (pole.HookType)
                        {
                        case HookType.None: break;

                        case HookType.Lava: hook = new LavaHook(pole.HookUses); break;

                        case HookType.Dredging: hook = new DredgingHook(pole.HookUses); break;

                        case HookType.JunkProof: hook = new JunkProofHook(pole.HookUses); break;
                        }

                        if (hook != null)
                        {
                            from.AddToBackpack(hook);
                        }
                    }

                    pole.HookType    = m_Hook.HookType;
                    pole.HookUses    = m_Hook.Uses;
                    pole.OriginalHue = pole.Hue;
                    pole.Hue         = m_Hook.Hue;
                    from.SendLocalizedMessage(1150884); //You tie the hook to the fishing line.
                    m_Hook.Delete();
                }
            }
Esempio n. 4
0
        public void ApplyAttributesTo(FishingPole pole)
        {
            CraftResourceInfo resInfo = CraftResources.GetInfo(m_Resource);

            if (resInfo == null)
            {
                return;
            }

            CraftAttributeInfo attrs = resInfo.AttributeInfo;

            int attributeCount = Utility.RandomMinMax(attrs.RunicMinAttributes, attrs.RunicMaxAttributes);
            int min            = attrs.RunicMinIntensity;
            int max            = attrs.RunicMaxIntensity;

            ApplyAttributesTo(pole, true, 0, attributeCount, min, max);
        }
Esempio n. 5
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Player == null)
            {
                return;
            }

            bool closeGump = true;

            CaptchaPersistance.CheckAndCreateCaptchaAccountEntry(m_Player);

            CaptchaAccountData captchaData = m_Player.m_CaptchaAccountData;

            switch (info.ButtonID)
            {
            //Guide
            case 1:
                closeGump = false;
                break;

            //Confirm
            case 2:
                if (captchaData.m_ConfirmPrompt)
                {
                    bool correct = false;

                    if (captchaData.m_Row1CorrectIndex == captchaData.m_SelectedRow1Index && captchaData.m_Row2CorrectIndex == captchaData.m_SelectedRow2Index && captchaData.m_Row3CorrectIndex == captchaData.m_SelectedRow3Index)
                    {
                        correct = true;
                    }

                    if (correct)
                    {
                        captchaData.m_NextCaptchaTime = DateTime.UtcNow + TimeSpan.FromMinutes((double)Utility.RandomMinMax(CaptchaAccountData.MinimumCaptchaDelay, CaptchaAccountData.MaximumCaptchaDelay));
                        captchaData.m_CaptchaRequired = false;
                        captchaData.m_CaptchaAttempt  = 0;
                        captchaData.m_ConfirmPrompt   = false;

                        m_Player.SendSound(0x5B6);

                        m_Player.SendMessage("Captcha successful.");

                        switch (captchaData.m_CaptchaSourceType)
                        {
                        case CaptchaSourceType.Fishing:
                            FishingPole fishingPole = m_Player.FindItemOnLayer(Layer.TwoHanded) as FishingPole;

                            if (fishingPole != null)
                            {
                                Fishing.System.StartHarvesting(m_Player, fishingPole, null, true);
                            }
                            break;

                        case CaptchaSourceType.Lumberjacking:
                            Hatchet hatchet = m_Player.FindItemOnLayer(Layer.TwoHanded) as Hatchet;

                            if (hatchet != null)
                            {
                                Lumberjacking.System.StartHarvesting(m_Player, hatchet, null, true);
                            }
                            break;

                        case CaptchaSourceType.Mining:
                            Pickaxe pickaxe = m_Player.FindItemOnLayer(Layer.OneHanded) as Pickaxe;

                            if (pickaxe != null)
                            {
                                Mining.System.StartHarvesting(m_Player, pickaxe, null, true);
                            }
                            break;

                        case CaptchaSourceType.DungeonChest:
                            Lockpick lockpick = (Lockpick)m_Player.Backpack.FindItemByType(typeof(Lockpick));

                            //TEST
                            if (lockpick != null)
                            {
                                lockpick.OnDoubleClick(m_Player);
                            }
                            break;
                        }

                        return;
                    }

                    else
                    {
                        captchaData.m_CaptchaAttempt++;

                        if (captchaData.m_CaptchaAttempt == 3)
                        {
                            string responseMessage = "";

                            if (captchaData.m_PreviousPenalty != CaptchaAccountData.PenaltyLevelType.None && captchaData.m_PenaltyProbationExpiration > DateTime.UtcNow)
                            {
                                switch (captchaData.m_PreviousPenalty)
                                {
                                case CaptchaAccountData.PenaltyLevelType.None:
                                    captchaData.m_CurrentPenalty           = CaptchaAccountData.PenaltyLevelType.Minor;
                                    captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty);

                                    captchaData.m_PreviousPenalty            = captchaData.m_CurrentPenalty;
                                    captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty);

                                    responseMessage  = "You have failed a captcha response and your account will now be prevented from gathering resources for ";
                                    responseMessage += Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + ".";

                                    m_Player.SendMessage(2115, responseMessage);
                                    break;

                                case CaptchaAccountData.PenaltyLevelType.Minor:
                                    captchaData.m_CurrentPenalty           = CaptchaAccountData.PenaltyLevelType.Major;
                                    captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty);

                                    captchaData.m_PreviousPenalty            = captchaData.m_CurrentPenalty;
                                    captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty);

                                    responseMessage  = "You have failed a second captcha response within one day, and your account will now be prevented from gathering resources for ";
                                    responseMessage += Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + ".";

                                    m_Player.SendMessage(2115, responseMessage);
                                    break;

                                case CaptchaAccountData.PenaltyLevelType.Major:
                                    captchaData.m_CurrentPenalty           = CaptchaAccountData.PenaltyLevelType.Epic;
                                    captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty);

                                    captchaData.m_PreviousPenalty            = captchaData.m_CurrentPenalty;
                                    captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty);

                                    responseMessage  = "You have failed a third captcha response within one week, and your account will now be prevented from gathering resources for ";
                                    responseMessage += Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + ".";

                                    m_Player.SendMessage(2115, responseMessage);
                                    break;

                                case CaptchaAccountData.PenaltyLevelType.Epic:
                                    captchaData.m_CurrentPenalty           = CaptchaAccountData.PenaltyLevelType.Permanent;
                                    captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty);

                                    captchaData.m_PreviousPenalty            = captchaData.m_CurrentPenalty;
                                    captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty);

                                    responseMessage = "You have failed a fourth captcha response within one month, and your account will now be permanently prevented from gathering resources.";

                                    m_Player.SendMessage(2115, responseMessage);
                                    break;

                                case CaptchaAccountData.PenaltyLevelType.Permanent:
                                    captchaData.m_CurrentPenalty           = CaptchaAccountData.PenaltyLevelType.Permanent;
                                    captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty);

                                    captchaData.m_PreviousPenalty            = captchaData.m_CurrentPenalty;
                                    captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty);

                                    responseMessage = "You have failed a fourth captcha response within one month, and your account will now be permanently prevented from gathering resources.";

                                    m_Player.SendMessage(2115, responseMessage);
                                    break;
                                }
                            }

                            else
                            {
                                captchaData.m_CurrentPenalty           = CaptchaAccountData.PenaltyLevelType.Minor;
                                captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty);

                                captchaData.m_PreviousPenalty            = captchaData.m_CurrentPenalty;
                                captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty);

                                responseMessage = "You have failed a captcha response and your account will now be blocked from gathering resources for " + Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + ".";

                                m_Player.SendMessage(2115, responseMessage);
                            }

                            captchaData.m_NextCaptchaTime = DateTime.UtcNow + TimeSpan.FromMinutes((double)Utility.RandomMinMax(CaptchaAccountData.MinimumCaptchaDelay, CaptchaAccountData.MaximumCaptchaDelay));
                            captchaData.m_CaptchaRequired = false;
                            captchaData.m_CaptchaAttempt  = 0;
                            captchaData.m_ConfirmPrompt   = false;

                            m_Player.SendSound(0x5B3);

                            return;
                        }

                        else
                        {
                            switch (captchaData.m_CaptchaAttempt)
                            {
                            case 1: m_Player.SendMessage(55, "Captcha response incorrect. You have two more attempts."); break;

                            case 2: m_Player.SendMessage(1256, "Captcha response incorrect. You have one more attempt."); break;
                            }

                            captchaData.m_NextCaptchaTime = DateTime.UtcNow + TimeSpan.FromMinutes((double)Utility.RandomMinMax(CaptchaAccountData.MinimumCaptchaDelay, CaptchaAccountData.MaximumCaptchaDelay));
                            captchaData.GenerateIDs();
                            captchaData.m_ConfirmPrompt = false;
                        }
                    }
                }

                else
                {
                    captchaData.m_ConfirmPrompt = true;
                }

                closeGump = false;
                break;

            //Row 1 Previous
            case 3:
                captchaData.m_SelectedRow1Index--;

                if (captchaData.m_SelectedRow1Index < 0)
                {
                    captchaData.m_SelectedRow1Index = CaptchaAccountData.ItemsPerRow - 1;
                }

                captchaData.m_ConfirmPrompt = false;

                m_Player.SendSound(SelectionSound);

                closeGump = false;
                break;

            //Row 1 Next
            case 4:
                captchaData.m_SelectedRow1Index++;

                if (captchaData.m_SelectedRow1Index >= CaptchaAccountData.ItemsPerRow)
                {
                    captchaData.m_SelectedRow1Index = 0;
                }

                captchaData.m_ConfirmPrompt = false;

                m_Player.SendSound(SelectionSound);

                closeGump = false;
                break;

            //Row 2 Previous
            case 5:
                captchaData.m_SelectedRow2Index--;

                if (captchaData.m_SelectedRow2Index < 0)
                {
                    captchaData.m_SelectedRow2Index = CaptchaAccountData.ItemsPerRow - 1;
                }

                captchaData.m_ConfirmPrompt = false;

                m_Player.SendSound(SelectionSound);

                closeGump = false;
                break;

            //Row 2 Next
            case 6:
                captchaData.m_SelectedRow2Index++;

                if (captchaData.m_SelectedRow2Index >= CaptchaAccountData.ItemsPerRow)
                {
                    captchaData.m_SelectedRow2Index = 0;
                }

                captchaData.m_ConfirmPrompt = false;

                m_Player.SendSound(SelectionSound);

                closeGump = false;
                break;

            //Row 3 Previous
            case 7:
                captchaData.m_SelectedRow3Index--;

                if (captchaData.m_SelectedRow3Index < 0)
                {
                    captchaData.m_SelectedRow3Index = CaptchaAccountData.ItemsPerRow - 1;
                }

                captchaData.m_ConfirmPrompt = false;

                m_Player.SendSound(SelectionSound);

                closeGump = false;
                break;

            //Row 3 Next
            case 8:
                captchaData.m_SelectedRow3Index++;

                if (captchaData.m_SelectedRow3Index >= CaptchaAccountData.ItemsPerRow)
                {
                    captchaData.m_SelectedRow3Index = 0;
                }

                captchaData.m_ConfirmPrompt = false;

                m_Player.SendSound(SelectionSound);

                closeGump = false;
                break;
            }

            if (!closeGump)
            {
                m_Player.CloseGump(typeof(CaptchaGump));
                m_Player.SendGump(new CaptchaGump(m_Player));
            }

            else
            {
                m_Player.SendSound(CloseGumpSound);
            }
        }
Esempio n. 6
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted == m_Bait)
                {
                    return;
                }

                if (targeted is FishingPole)
                {
                    if (!m_Bait.IsFishBait())
                    {
                        from.SendMessage("Think again before applying lobster or crab bait to a fishing pole!");
                        return;
                    }

                    FishingPole pole = (FishingPole)targeted;

                    bool hasBait = pole.BaitType != null;

                    if (hasBait && pole.BaitType != m_Bait.BaitType)
                    {
                        from.SendMessage("You swap out the old bait for new.");
                    }

                    if (pole.BaitType == m_Bait.BaitType)
                    {
                        pole.BaitUses += m_Amount;
                    }
                    else
                    {
                        pole.BaitType  = m_Bait.BaitType;
                        pole.BaitUses += m_Amount;
                    }

                    if (m_Bait.Enhanced)
                    {
                        pole.EnhancedBait = true;
                    }

                    from.SendLocalizedMessage(1149759);  //You bait the hook.
                    m_Bait.UsesRemaining -= m_Amount;
                }
                else if (targeted is LobsterTrap)
                {
                    if (m_Bait.IsFishBait())
                    {
                        from.SendMessage("Think again before applying fish bait to a lobster trap!");
                        return;
                    }

                    LobsterTrap trap = (LobsterTrap)targeted;

                    bool hasBait = trap.BaitType != null;

                    trap.BaitType = m_Bait.BaitType;
                    //trap.Hue = m_Bait.Hue;

                    if (hasBait && trap.BaitType != m_Bait.BaitType)
                    {
                        from.SendMessage("You swap out the old bait for new.");
                    }

                    if (trap.BaitType == m_Bait.BaitType)
                    {
                        trap.BaitUses += m_Amount;
                    }
                    else
                    {
                        trap.BaitType  = m_Bait.BaitType;
                        trap.BaitUses += m_Amount;
                    }

                    if (m_Bait.Enhanced)
                    {
                        trap.EnhancedBait = true;
                    }

                    from.SendLocalizedMessage(1149760); //You bait the trap.
                    m_Bait.UsesRemaining -= m_Amount;
                }
                else if (targeted is Bait && ((Bait)targeted).IsChildOf(from.Backpack) && ((Bait)targeted).BaitType == m_Bait.BaitType)
                {
                    Bait bait = (Bait)targeted;

                    bait.UsesRemaining   += m_Amount;
                    m_Bait.UsesRemaining -= m_Amount;

                    if (m_Bait.UsesRemaining <= 0)
                    {
                        m_Bait.Delete();
                        from.SendLocalizedMessage(1116469); //You combine these baits into one cup and destroy the other cup.
                    }
                    else
                    {
                        from.SendMessage("You combine these baits into one cup.");
                    }

                    return;
                }

                if (m_Bait.UsesRemaining <= 0)
                {
                    m_Bait.Delete();
                    from.SendLocalizedMessage(1116467); //Your bait is used up so you destroy the container.
                }
            }
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            FishingPole pole = new FishingPole();
            BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100);
            c.DropItem(pole);

            c.DropItem(new MessageInABottle(c.Map));
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());

            #region TOL
            //SkillMasteryPrimer.CheckPrimerDrop(this);
            #endregion
        }
Esempio n. 8
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            int drop = Utility.RandomMinMax(2, 5);

            for (int i = 0; i < drop; i++)
            {
                Type pieType = m_Pies[Utility.Random(m_Pies.Length)];

                Item pie = Loot.Construct(pieType);

                if (pie != null)
                    c.DropItem(pie);
            }

            drop = Utility.RandomMinMax(2, 5);

            for (int i = 0; i < drop; i++)
            {
                Type steakType = m_Steaks[Utility.Random(m_Steaks.Length)];

                Item steak = Loot.Construct(steakType);

                if (steak != null)
                    c.DropItem(steak);
            }

            c.DropItem(new MessageInABottle(c.Map));
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());
            c.DropItem(new SpecialFishingNet());

            FishingPole pole = new FishingPole();
            BaseRunicTool.ApplyAttributesTo(pole, false, 0, Utility.RandomMinMax(2, 5), 50, 100);
            c.DropItem(pole);

            #region TOL
            //SkillMasteryPrimer.CheckPrimerDrop(this);
            #endregion
        }
Esempio n. 9
0
        public static void ApplyAttributesTo(FishingPole pole, bool isRunicTool, int luckChance, int attributeCount, int min, int max)
        {
            m_IsRunicTool = isRunicTool;
            m_LuckChance = luckChance;

            AosAttributes primary = pole.Attributes;
            AosSkillBonuses skills = pole.SkillBonuses;

            m_Props.SetAll(false);

            for (int i = 0; i < attributeCount; ++i)
            {
                int random = GetUniqueRandom(21);

                switch (random)
                {
                    case 0: ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15); break;
                    case 1: ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1); break;
                    case 2: ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 1); break;
                    case 3: ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15); break;
                    case 4: ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100); break;
                    case 5: ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1); break;
                    case 6: ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2); break;
                    case 7: ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2); break;
                    case 8: ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3); break;
                    case 9: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 8); break;
                    case 10: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8); break;
                    case 11: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8); break;
                    case 12: ApplyAttribute(primary, min, max, AosAttribute.BonusStr, 1, 8); break;
                    case 13: ApplyAttribute(primary, min, max, AosAttribute.BonusDex, 1, 8); break;
                    case 14: ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8); break;
                    case 15: ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12); break;
                    case 16: ApplySkillBonus(skills, min, max, 0, 1, 15); break;
                    case 17: ApplySkillBonus(skills, min, max, 1, 1, 15); break;
                    case 18: ApplySkillBonus(skills, min, max, 2, 1, 15); break;
                    case 19: ApplySkillBonus(skills, min, max, 3, 1, 15); break;
                    case 20: ApplySkillBonus(skills, min, max, 4, 1, 15); break;
                }
            }
        }
Esempio n. 10
0
        public void ApplyAttributesTo(FishingPole pole)
        {
            CraftResourceInfo resInfo = CraftResources.GetInfo(m_Resource);

            if (resInfo == null)
                return;

            CraftAttributeInfo attrs = resInfo.AttributeInfo;

            int attributeCount = Utility.RandomMinMax(attrs.RunicMinAttributes, attrs.RunicMaxAttributes);
            int min = attrs.RunicMinIntensity;
            int max = attrs.RunicMaxIntensity;

            ApplyAttributesTo(pole, true, 0, attributeCount, min, max);
        }
Esempio n. 11
0
        public static TimeSpan WarningDelay = TimeSpan.FromMinutes( 30.0 ); // Default 30 minutes, Can adjust to hours or whatever you want.

        #endregion Fields

        #region Methods

        public static void CheckTournament( Mobile from, Mobile fisher, Item dropped )
        {
            if ( !isRunning )
            {
                // Only giving a extra reward for 10+ fish

                from.SendMessage( "A reward has been placed in your bank box." );
                Bag bag = new Bag();
                bag.DropItem( new BankCheck( 250 * dropped.Amount ) );
                bag.DropItem( new Harpoon( Utility.RandomMinMax( 2, 5 ) ) );

                switch ( Utility.Random( 2 ) )
                {
                    case 0: bag.DropItem( new SpecialFishingNet() ); break;
                    case 1: bag.DropItem( new MessageInABottle() ); break;
                }

                if ( dropped.Amount > 19 )
                {
                    fisher.Say( "Wow! You caught {0}. You should have placed in the tournament! Better luck next time!", dropped.Amount.ToString() );
                    bag.DropItem( new PowerScroll( SkillName.Fishing, 105 ) );
                }
                else if ( dropped.Amount > 18 )
                {
                    fisher.Say( "Wow! You caught 19. You were so close! Better luck next time!" );
                    bag.DropItem( new FabledFishingNet() );
                }
                else if ( dropped.Amount > 17 )
                {
                    fisher.Say( "Wow! You caught 18. You did amazing. Better luck next time!" );

                    FloppyHat fh = new FloppyHat();
                    fh.Hue = Utility.RandomMinMax( 2498, 2640 );
                    fh.Name = "a designer fishing hat";
                    fh.LootType = LootType.Blessed;
                    bag.DropItem( fh );
                }
                else if ( dropped.Amount > 16 )
                {
                    fisher.Say( "Wow! You caught 17. Almost... Maybe next time!" );

                    Sandals s = new Sandals();
                    s.Hue = Utility.RandomMinMax( 1910, 2040 );
                    s.Name = "a designer fishing sandals";
                    s.LootType = LootType.Blessed;
                    bag.DropItem( s );
                }
                else if ( dropped.Amount > 15 )
                {
                    fisher.Say( "You caught 16. Thats not bad but you could have done better! Maybe next time!" );

                    FishingPole fp = new FishingPole();
                    fp.Hue = Utility.RandomMinMax( 1150, 1175 );
                    fp.Name = "a painted fishing pole";
                    bag.DropItem( fp );
                }
                else if ( dropped.Amount > 14 )
                {
                    fisher.Say( "You caught 15. Bad luck! Maybe next time!" );

                    Item junk = new Item( Utility.RandomList( 17784, 17785 ) );
                    junk.Name = "a sea horse statue";
                    bag.DropItem( junk );
                }
                else if ( dropped.Amount > 13 )
                {
                    fisher.Say( "You caught 14. Maybe try different waters next time!" );

                    Item junk = new Item( Utility.RandomList( 17786, 17787 ) );
                    junk.Name = "a mermaid statue";
                    bag.DropItem( junk );
                }
                else if ( dropped.Amount > 12 )
                {
                    fisher.Say( "You caught 13. Did you bring ale? You have to bring ale!" );

                    Spellbook sb = new Spellbook();
                    sb.Name = "Fishing For Dummies";
                    sb.Hue = 52;
                    bag.DropItem( sb );
                }
                else if ( dropped.Amount > 11 )
                {
                    fisher.Say( "You caught 12. Try different bait next time!" );

                    Item junk = new Item( Utility.RandomList( 0x1EA3, 0x1EA4, 0x1EA5, 0x1EA6 ) );
                    junk.Name = "a worn fishing net";
                    bag.DropItem( junk );
                }
                else if ( dropped.Amount > 10 )
                {
                    fisher.Say( "You caught 11..." );

                    Item junk = new Item( 0x154D );
                    junk.Name = "a barrel of fish (Not for shooting)";
                    bag.DropItem( junk );
                }
                else if ( dropped.Amount > 9 )
                {
                    fisher.Say( "You only caught 10. Half way... is still to far!" );
                }
                else if ( dropped.Amount > 8 )
                {
                    fisher.Say( "You only caught 9. Half way... is still to far!" );
                }
                else if ( dropped.Amount > 7 )
                {
                    fisher.Say( "You only caught 8... How long did you say you have been fishing?" );
                }
                else if ( dropped.Amount > 6 )
                {
                    fisher.Say( "You only caught 7... Find a lot of shoes do you?" );
                }
                else if ( dropped.Amount > 5 )
                {
                    fisher.Say( "You only caught 6... Ever consider taking up something more productivy like bird watching?" );
                }
                else if ( dropped.Amount > 4 )
                {
                    fisher.Say( "You only caught 5... Ever consider taking up something more exciting like... baskit weaving?" );
                }
                else if ( dropped.Amount > 3 )
                {
                    fisher.Say( "You caught 4!?! Was your cat on fire?" );
                }
                else if ( dropped.Amount > 2 )
                {
                    fisher.Say( "You caught 3!?! Were you sleeping all this time?" );
                }
                else if ( dropped.Amount > 1 )
                {
                    fisher.Say( "Two fish? Maybe you should keep them in a tank and hope they multiply!" );
                }
                else if ( dropped.Amount > 0 )
                {
                    fisher.Say( "One... One fish? Did someone hand this to you? Did you find this flopping around town? Tell me you didn't fish and catch this one lonely fish?" );
                }

                BankBox box = from.BankBox;
                box.DropItem( bag );
                dropped.Delete();
            }
            else if ( isRunning )
            {
                if ( DateTime.UtcNow.DayOfWeek == TournyOne )
                {
                    BankBox box = from.BankBox;

                    if ( from.Backpack.ConsumeTotal( typeof( ToxicTrout ), 20 ) &&  firstPlace == null )
                    {
                        firstPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has came in first in todays fishing tournament!", firstPlace );
                        fisher.Say( "Congrats! You are the first person to catch twenty toxic trout! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 1 ) );
                    }
                    else if ( from.Backpack.ConsumeTotal( typeof( ToxicTrout ), 20 ) &&  secondPlace == null )
                    {
                        secondPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has placed 2nd in todays fishing tournament!", firstPlace );
                        fisher.Say( "Congrats! You are the second person to catch twenty toxic trout! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                       	box.DropItem( GiveReward( from, 2 ) );
                    }
                    else if ( from.Backpack.ConsumeTotal( typeof( ToxicTrout ), 20 ) &&  thirdPlace == null )
                    {
                        isRunning = false;
                        thirdPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has placed 3rd in todays fishing tournament!", firstPlace );
                        World.Broadcast( 0x35, true, "The tournament is now over! Congratulations to todays winners!", firstPlace );
                        World.Broadcast( 0x35, true, "If you didnt win today bring what fish you gathered and drop them on a tournament master to claim a consolation prize!", firstPlace );
                        fisher.Say( "Congrats! You are the third person to catch twenty toxic trout! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 3 ) );
                    }
                    else
                    {
                        fisher.Say( "You need to catch and bring me twenty toxic trout before anyone else to win this tournament!" );
                        fisher.Say( "Why are you standing around here! Go fish!!!" );
                    }
                }
                else if ( DateTime.UtcNow.DayOfWeek == TournyTwo )
                {
                    BankBox box = from.BankBox;

                    if ( from.Backpack.ConsumeTotal( typeof( CottonCandySwordfish ), 20 ) &&  firstPlace == null )
                    {
                        firstPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has came in first in todays fishing tournament!", firstPlace );
                        fisher.Say( "Congrats! You are the first person to catch twenty cotton candy swordfish! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 1 ) );
                    }
                    else if ( from.Backpack.ConsumeTotal( typeof( CottonCandySwordfish ), 20 ) &&  secondPlace == null )
                    {
                        secondPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has placed 2nd in todays fishing tournament!", firstPlace );
                        fisher.Say( "Congrats! You are the second person to catch twenty cotton candy swordfish! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 2 ) );
                    }
                    else if ( from.Backpack.ConsumeTotal( typeof( CottonCandySwordfish ), 20 ) &&  thirdPlace == null )
                    {
                        isRunning = false;
                        thirdPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has placed 3rd in todays fishing tournament!", firstPlace );
                        World.Broadcast( 0x35, true, "The tournament is now over! Congratulations to todays winners!", firstPlace );
                        World.Broadcast( 0x35, true, "If you didnt win today bring what fish you gathered and drop them on a tournament master to claim a consolation prize!", firstPlace );
                        fisher.Say( "Congrats! You are the third person to catch twenty cotton candy swordfish! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 3 ) );
                    }
                    else
                    {
                        fisher.Say( "You need to catch and bring me twenty cotton candy swordfish before anyone else to win this tournament!" );
                        fisher.Say( "Why are you standing around here! Go fish!!!" );
                    }
                }
                else if ( DateTime.UtcNow.DayOfWeek == TournyThree )
                {
                    BankBox box = from.BankBox;

                    if ( from.Backpack.ConsumeTotal( typeof( MalasMoonfish ), 20 ) &&  firstPlace == null )
                    {
                        firstPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has came in first in todays fishing tournament!", firstPlace );
                        fisher.Say( "Congrats! You are the first person to catch twenty malas moonfish! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 1 ) );
                    }
                    else if ( from.Backpack.ConsumeTotal( typeof( MalasMoonfish ), 20 ) &&  secondPlace == null )
                    {
                        secondPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has placed 2nd in todays fishing tournament!", firstPlace );
                        fisher.Say( "Congrats! You are the second person to catch twenty malas moonfish! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 2 ) );
                    }
                    else if ( from.Backpack.ConsumeTotal( typeof( MalasMoonfish ), 20 ) &&  thirdPlace == null )
                    {
                        isRunning = false;
                        thirdPlace = from.Name;
                        World.Broadcast( 0x35, true, "{0} has placed 3rd in todays fishing tournament!", firstPlace );
                        World.Broadcast( 0x35, true, "The tournament is now over! Congratulations to todays winners!", firstPlace );
                        World.Broadcast( 0x35, true, "If you didnt win today bring what fish you gathered and drop them on a tournament master to claim a consolation prize!", firstPlace );
                        fisher.Say( "Congrats! You are the third person to catch twenty malas moonfish! Well done!" );
                        from.SendMessage( "Your reward has been placed into your bank box!" );
                        box.DropItem( GiveReward( from, 3 ) );
                    }
                    else
                    {
                        fisher.Say( "You need to catch and bring me twenty malas moonfish before anyone else to win this tournament!" );
                        fisher.Say( "Why are you standing around here! Go fish!!!" );
                    }
                }
                else // Why? Because thats the kinda world we live in...
                {
                    fisher.Say( "I am sorry, I musta got my days mixxed up!" );
                    isRunning = false;
                }
            }
            else
            {
                if ( firstPlace != null && secondPlace != null && thirdPlace != null )
                    fisher.Say( "Todays tournament has ended! Todays winners are {0}, {1), and {2}!", firstPlace, secondPlace, thirdPlace );
                else
                    fisher.Say( "Todays tournament has ended!" );
            }
        }