예제 #1
0
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            Mobile m = e.Mobile;

            ArrayList killers = new ArrayList();
            ArrayList toGive  = new ArrayList();

            foreach (AggressorInfo ai in m.Aggressors)
            {
//bounty system edit
// orig if ( ai.Attacker.Player && ai.CanReportMurder && !ai.Reported )
                if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported &&
                    !BountyBoard.Attackable(ai.Attacker, e.Mobile))                        // end bounty system edit
                {
                    killers.Add(ai.Attacker);
                    ai.Reported = true;
                }

                if (ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker))
                {
                    toGive.Add(ai.Attacker);
                }
            }

            foreach (AggressorInfo ai in m.Aggressed)
            {
                if (ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender))
                {
                    toGive.Add(ai.Defender);
                }
            }

            foreach (Mobile g in toGive)
            {
                int n = Notoriety.Compute(g, m);

                int  theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = (n == Notoriety.Innocent);
                bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer);

                int fameAward  = m.Fame / 200;
                int karmaAward = 0;

                if (innocent)
                {
                    karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100));
                }
                else if (criminal)
                {
                    karmaAward = 50;
                }

                Titles.AwardFame(g, fameAward, false);
                Titles.AwardKarma(g, karmaAward, true);
            }

            if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild)
            {
                return;
            }

            if (killers.Count > 0)
            {
                new GumpTimer(m, killers).Start();
            }
        }
예제 #2
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            Mobile       m      = from;
            PlayerMobile mobile = m as PlayerMobile;

            if (mobile != null)
            {
                Item reward;
                int  gold, fame;
                if (dropped is SmallSmithBOD && !((SmallSmithBOD)dropped).Complete)
                {
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendAsciiMessage(0x3F, "I guess you think your funny with that unfilled small smithing bod."); break;

                    case 1: from.SendAsciiMessage(0x3E, "That is not even close to a filled small smithing bod"); break;

                    case 2: from.SendAsciiMessage(0x3D, "Hey! You tried to sneak that small smithing bod in when I wasn't looking!"); break;

                    case 3: from.SendAsciiMessage(0x3C, "Don't even think about passing that off as a filled small smithing bod, cause it wont work?"); break;

                    case 4: from.SendAsciiMessage(0x3B, "Stop thief, just like a diplomatic voucher, unfilled small smithing bods never work!"); break;

                    case 5: from.SendAsciiMessage(0x3A, "Why dont you use Vhaeruns Painting 1.9 rar and paint a picture of me, that way you can stick unfilled small smithing bods into it!"); break;

                    case 6: from.SendAsciiMessage(0x39, "This isn't a freebie genie like in Aladdin, come back when you have a filled small smithing bod!"); break;
                    }
                    return(false);
                }
                else if (dropped is SmallSmithBOD)
                {
                    ((SmallSmithBOD)dropped).GetRewards(out reward, out gold, out fame);
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(5))
                    {
                    case 0: from.SendAsciiMessage(0x53, "You touched me! Ohhh but you have a filled small smithing bod!"); break;

                    case 1: from.SendAsciiMessage(0x52, "Well now ain't that a site for sore wait I dont have eyes but nice small smithing bod!"); break;

                    case 2: from.SendAsciiMessage(0x51, "Take your reward for this small smithing bod before you end up imprissoned!"); break;

                    case 3: from.SendAsciiMessage(0x50, "I was happier when small smithing bods were turned into the vendors."); break;

                    case 4: from.SendAsciiMessage(0x4F, "What! Not one thank you!,sheesh just give me that filled small smithing bod before I gobble you up!"); break;
                    }
                    from.AddToBackpack(new Moonitecoin(Utility.RandomMinMax(100, 1000)));
                    from.AddToBackpack(new BankCheck(Utility.RandomMinMax(100, 100)));
                    Titles.AwardFame(from, fame, true);
                    dropped.Delete();
                    return(true);
                }
                if (dropped is LargeSmithBOD && !((LargeSmithBOD)dropped).Complete)
                {
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendAsciiMessage(0x3F, "In case you have not noticed, this is not a filled large smithing bod..DUH!"); break;

                    case 1: from.SendAsciiMessage(0x3E, "Wait!, did you hear that, it sounded like Moonite coins falling...oh guess not since that is not a filled large smithing bod!"); break;

                    case 2: from.SendAsciiMessage(0x3D, "W.o.W, even World of Warcrack couldnt be this stupid on turn ins, bwahahahaha, come back when you have a filled large smithing bod!"); break;

                    case 3: from.SendAsciiMessage(0x3C, "Gee Mister/Miss, use your brain much! That is still not a filled large smithing bod?"); break;

                    case 4: from.SendAsciiMessage(0x3B, "Wanna know a secret, yeah you, come closer....THAT IS NOT A FILLED LARGE SMITHING BOD!!"); break;

                    case 5: from.SendAsciiMessage(0x3A, "Hey did you hear the one about the large smithing bod that got away,,yeah cause you didnt fill it yet!!!"); break;

                    case 6: from.SendAsciiMessage(0x39, "Attention all players! This fool just tried sticking a large smithing bod into me without filling it first...Its Okay To L.O.L!"); break;
                    }
                    return(false);
                }
                else if (dropped is LargeSmithBOD)
                {
                    ((LargeSmithBOD)dropped).GetRewards(out reward, out gold, out fame);
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(5))
                    {
                    case 0: from.SendAsciiMessage(0x53, "Right On! you finally got it filled, well now dont you feel smarter?"); break;

                    case 1: from.SendAsciiMessage(0x52, "Wait! did you hear that, it sounded like Moonite Coins oh my gosh you did finish that bod here you go then."); break;

                    case 2: from.SendAsciiMessage(0x51, "Thank you for your deposit, unfortunately we are all out of Moonite Coins at this time...Just Kidding!"); break;

                    case 3: from.SendAsciiMessage(0x50, "Sometimes we loose and sometimes we win, and today is your lucky day."); break;

                    case 4: from.SendAsciiMessage(0x4F, "Ching, Ching, the sound of Moonite Coins upchucking from my belly. Well now you can buy some Bling, Bling!"); break;
                    }
                    from.AddToBackpack(new Moonitecoin(Utility.RandomMinMax(1000, 2500)));
                    from.AddToBackpack(new BankCheck(Utility.RandomMinMax(500, 500)));
                    Titles.AwardFame(from, fame, true);
                    dropped.Delete();
                    return(true);
                }



                if (dropped is SmallMobileBOD && !((SmallMobileBOD)dropped).Complete)//This is actually Taming Bods but FSATS called it Mobile Instead.....
                {
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendAsciiMessage(0x3F, "Your Message Here"); break;

                    case 1: from.SendAsciiMessage(0x3E, "Your Message Here"); break;

                    case 2: from.SendAsciiMessage(0x3D, "Your Message Here"); break;

                    case 3: from.SendAsciiMessage(0x3C, "It would help if you opened your eyes when inserting objects of unfinished values such as that small taming bod?"); break;

                    case 4: from.SendAsciiMessage(0x3B, "You will never take me alive Johnny! And that might come soon if I dont get some food since your attempting to place an unfilled small taming bod into my mouth."); break;

                    case 5: from.SendAsciiMessage(0x3A, "Quit poking me with that small taming unfilled bod, it wont go in!"); break;

                    case 6: from.SendAsciiMessage(0x39, "Just a little F.Y.I Advance your skill...tame the creature.....fill the small taming bod....then come try to use it!"); break;
                    }
                    return(false);
                }
                else if (dropped is SmallTamingBOD)
                {
                    ((SmallMobileBOD)dropped).GetRewards(out reward, out gold, out fame);
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(5))
                    {
                    case 0: from.SendAsciiMessage(0x53, "Have you seen my wife, she was here a second ago, yeah she is a small taming bod. haha"); break;

                    case 1: from.SendAsciiMessage(0x52, "Thank you for your deepest contribution, but um next time bring more."); break;

                    case 2: from.SendAsciiMessage(0x51, "Your Message Here"); break;

                    case 3: from.SendAsciiMessage(0x50, "Come back again ya here! Yippi kia yia a."); break;

                    case 4: from.SendAsciiMessage(0x4F, "Thank you for coming to the bod Reward store, I hope you enjoyed your stay."); break;
                    }
                    from.AddToBackpack(new Moonitecoin(Utility.RandomMinMax(500, 1500)));
                    from.AddToBackpack(new BankCheck(Utility.RandomMinMax(100, 300)));
                    Titles.AwardFame(from, fame, true);
                    dropped.Delete();
                    return(true);
                }
                if (dropped is LargeMobileBOD && !((LargeMobileBOD)dropped).Complete)// This is actually the Taming BulkOrders but FSATS changed the name to Mobile instead of just keeping it simple like Taming.........
                {
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendAsciiMessage(0x3F, "I reject your reality to use a large taming bod on me and substitute my own You Stink!"); break;

                    case 1: from.SendAsciiMessage(0x3E, "Didnt your mother in that cottage teach you to read, caues um hehe your using an unfilled large taming bod on me."); break;

                    case 2: from.SendAsciiMessage(0x3D, "What's for lunch? Because if it were upto you we would all starve! Unfinished Large Taming Bod"); break;

                    case 3: from.SendAsciiMessage(0x3C, "Didn't this game come with Instructions, well how the hell did you learn cause your still trying to stick an unfilled large taming bod in here!"); break;

                    case 4: from.SendAsciiMessage(0x3B, "Try try try to understand, I'm a Ma--gic Chest, one that needs to eat filled large taming bods please."); break;

                    case 5: from.SendAsciiMessage(0x3A, "If BODS were like Tokens then you would be rich, since you still cant find the time to fill that large taming bod!"); break;

                    case 6: from.SendAsciiMessage(0x39, "If you would like to place a bod, please hang up and try to fill that large taming bod again!"); break;
                    }
                    return(false);
                }
                else if (dropped is LargeMobileBOD)
                {
                    ((LargeMobileBOD)dropped).GetRewards(out reward, out gold, out fame);
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(5))
                    {
                    case 0: from.SendAsciiMessage(0x53, "I dont think were in Kansas anymore Froto...."); break;

                    case 1: from.SendAsciiMessage(0x52, "Well isnt that neat you put a bod in me and you get a treat."); break;

                    case 2: from.SendAsciiMessage(0x51, "I was made for bod chommping and thats just what I'll do, and one of these days I might just chomp all over you."); break;

                    case 3: from.SendAsciiMessage(0x50, "My bods are always bouncing to the left and to the right, but you've got the biggest BODS of them all!"); break;

                    case 4: from.SendAsciiMessage(0x4F, "Don't be so quick to judge me as I wont cheat, To prove to you that this is true, I cannot go anywhere as I have no feet."); break;
                    }
                    from.AddToBackpack(new Moonitecoin(Utility.RandomMinMax(1250, 3000)));
                    from.AddToBackpack(new BankCheck(Utility.RandomMinMax(300, 600)));
                    Titles.AwardFame(from, fame, true);
                    dropped.Delete();
                    return(true);
                }
                if (dropped is SmallTailorBOD && !((SmallTailorBOD)dropped).Complete)
                {
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendAsciiMessage(0x3F, "Well I certainly hope your better at wood crafting then you are at this small unfilled tailoring bod."); break;

                    case 1: from.SendAsciiMessage(0x3E, "Maybe you might want to concider another profession, because you really are not that great at filling small tailoring bods"); break;

                    case 2: from.SendAsciiMessage(0x3D, "So how have you been? Been doing much tailoring lately, oh guess not since this is an empty small tailoring bod!"); break;

                    case 3: from.SendAsciiMessage(0x3C, "Would you like me to explain yet again that your not using a filled small tailoring bod hmmmmm.?"); break;

                    case 4: from.SendAsciiMessage(0x3B, "Whatsssss Upppppp! Obviously not your stats or your intelligence would be high enough to realize this is an empty small tailoring bod"); break;

                    case 5: from.SendAsciiMessage(0x3A, "Wait Come Back, I was only teasing here have some reward tokens on the house...NOT haha go fill that small tailoring bod then come back biotch!"); break;

                    case 6: from.SendAsciiMessage(0x39, "Even if that bod was half done I still would'nt give you half the reward tokens for it, please just fill that small tailoring bod thank you!"); break;
                    }
                    return(false);
                }
                else if (dropped is SmallTailorBOD)
                {
                    ((SmallTailorBOD)dropped).GetRewards(out reward, out gold, out fame);
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(5))
                    {
                    case 0: from.SendAsciiMessage(0x53, "Ouch! Geez you dont have to kick me, I'm not a fricken Vending Machine."); break;

                    case 1: from.SendAsciiMessage(0x52, "To be or Not To be that is the question, but I dont have time for that just feed me Seymore feed me!"); break;

                    case 2: from.SendAsciiMessage(0x51, "Looks to me like you have truly earned this reward."); break;

                    case 3: from.SendAsciiMessage(0x50, "Well of course I want that BOD I am sooooooo hungry baby, if you know what I mean.WINK WINK!!"); break;

                    case 4: from.SendAsciiMessage(0x4F, "You know its players like you that make me...Ewww that's goooood and tasty, oh yeah!"); break;
                    }
                    from.AddToBackpack(new Moonitecoin(Utility.RandomMinMax(500, 1500)));
                    from.AddToBackpack(new BankCheck(Utility.RandomMinMax(100, 100)));
                    Titles.AwardFame(from, fame, true);
                    dropped.Delete();
                    return(true);
                }
                if (dropped is LargeTailorBOD && !((LargeTailorBOD)dropped).Complete)
                {
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(7))
                    {
                    case 0: from.SendAsciiMessage(0x3F, "I would really like to help you out but I have five starving small crates at home to feed, fill those large tailoring bods then come back."); break;

                    case 1: from.SendAsciiMessage(0x3E, "My mamma always said stupid is as stupid does, now fill that large tailoring bod and then place it on me."); break;

                    case 2: from.SendAsciiMessage(0x3D, "Roses are Red, Violets are Blue, I would like to be fed, but you seem to stuck like glue, Unfilled Tailoring Bod!"); break;

                    case 3: from.SendAsciiMessage(0x3C, "Here Ye here ye, all available large tailoring bods please come to me. No yours are unfilled?"); break;

                    case 4: from.SendAsciiMessage(0x3B, "Do you know the meaning of brain flatulence? Yeah its where you try to stick that unfilled large tailoring bod on me!"); break;

                    case 5: from.SendAsciiMessage(0x3A, "If you couldnt stick that small tailoring unfinished bod on me what the hell are you trying to place that large bod on me for!"); break;

                    case 6: from.SendAsciiMessage(0x39, "This one time at band camp, this girl stuck a flute in me and....oh you know the story just give me a filled large tailoring bod!"); break;
                    }
                    return(false);
                }
                else if (dropped is LargeTailorBOD)
                {
                    ((LargeTailorBOD)dropped).GetRewards(out reward, out gold, out fame);
                    from.PlaySound(Utility.RandomList(m_Sounds));
                    switch (Utility.Random(5))
                    {
                    case 0: from.SendAsciiMessage(0x53, "Were off to eat some real BODs some wonderful Large Tailoring BODs."); break;

                    case 1: from.SendAsciiMessage(0x52, "Don't slip on some Crack, or you'll be feeling really Whack! Just feed me already!"); break;

                    case 2: from.SendAsciiMessage(0x51, "Sniff...Sniff...Oh sorry about that just allergies man..you know what I am saying..."); break;

                    case 3: from.SendAsciiMessage(0x50, "Calling all BODs, Calling all BODs, be on the lookout for a large filled tailoring bod, its green and square."); break;

                    case 4: from.SendAsciiMessage(0x4F, "You make me want to Shout, Kick my heels up and....Oh damn I dont have any feet. Stupid Scriptor......"); break;
                    }
                    from.AddToBackpack(new Moonitecoin(Utility.RandomMinMax(1250, 3000)));
                    from.AddToBackpack(new BankCheck(Utility.RandomMinMax(3000, 6000)));
                    Titles.AwardFame(from, fame, true);
                    dropped.Delete();
                    return(true);
                }
            }
            return(base.OnDragDrop(from, dropped));
        }
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            Mobile m = e.Mobile;

            List <Mobile> killers = new List <Mobile>();
            List <Mobile> toGive  = new List <Mobile>();

            foreach (AggressorInfo ai in m.Aggressors)
            {
                CustomRegion region = Region.Find(m.Location, m.Map) as CustomRegion;

                bool nocountsregion = region != null && region.Controller.NoMurderCounts;

                if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && !nocountsregion)
                {
                    killers.Add(ai.Attacker);
                    ai.Reported = true;
                }
                if (ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker))
                {
                    toGive.Add(ai.Attacker);
                }
            }

            foreach (AggressorInfo ai in m.Aggressed)
            {
                if (ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender))
                {
                    toGive.Add(ai.Defender);
                }
            }

            foreach (Mobile g in toGive)
            {
                int n = Notoriety.Compute(g, m);

                int  theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = (n == Notoriety.Innocent);
                bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer);

                int fameAward  = m.Fame / 200;
                int karmaAward = 0;

                if (innocent)
                {
                    karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100));
                }
                else if (criminal)
                {
                    karmaAward = 50;
                }

                Titles.AwardFame(g, fameAward, false);
                Titles.AwardKarma(g, karmaAward, true);
            }

            if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild)
            {
                return;
            }

            if (killers.Count > 0)
            {
                new GumpTimer(m, killers, m.Location, m.Map).Start();
            }

            /*
             * TODO:    Check entire combatant system and see if the
             *      cobatant lists should be handled a different
             *      way, and  change it accordingly.  This is a
             *      small-scope patch to prevent an exploit.
             */

            for (int i = m.Aggressors.Count - 1; i >= 0; --i)
            {
                m.Aggressors.RemoveAt(i);
            }
        }
예제 #4
0
        public static void EventSink_PlayerDeath(Mobile m, Mobile killer, Container cont)
        {
            List <Mobile> killers = new List <Mobile>();
            List <Mobile> toGive  = new List <Mobile>();

            foreach (AggressorInfo ai in m.Aggressors)
            {
                if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported)
                {
                    if (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker))
                    {
                        killers.Add(ai.Attacker);
                        ai.Reported        = true;
                        ai.CanReportMurder = false;
                    }
                }

                if (ai.Attacker.Player && (DateTime.UtcNow - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker))
                {
                    toGive.Add(ai.Attacker);
                }
            }

            foreach (AggressorInfo ai in m.Aggressed)
            {
                if (ai.Defender.Player && (DateTime.UtcNow - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender))
                {
                    toGive.Add(ai.Defender);
                }
            }

            foreach (Mobile g in toGive)
            {
                int n = Notoriety.Compute(g, m);

                int  theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = (n == Notoriety.Innocent);
                bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer);

                int fameAward  = m.Fame / 200;
                int karmaAward = 0;

                if (innocent)
                {
                    karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100));
                }
                else if (criminal)
                {
                    karmaAward = 50;
                }

                Titles.AwardFame(g, fameAward, false);
                Titles.AwardKarma(g, karmaAward, true);

                if (killers.Contains(g))
                {
                    EventSink.InvokeOnPlayerMurdered(g, m);
                }
            }

            if (m is PlayerMobile mobile && mobile.NpcGuild == NpcGuild.ThievesGuild)
            {
                return;
            }

            if (killers.Count > 0)
            {
                new GumpTimer(m, killers).Start();
            }
        }
예제 #5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                int number = -1;

                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    if ((targ == from) && (from is PlayerMobile))
                    {
                        CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(from);

                        if (DB.CharacterBegging == 0)
                        {
                            DB.CharacterBegging = 1;
                            from.SendMessage(68, "You set your demeanor to begging.");
                        }
                        else
                        {
                            DB.CharacterBegging = 0;
                            from.SendMessage(38, "You cease your demeanor of begging.");
                        }
                    }
                    else if (IsGonnaAttack(targ) && from != targ)                       // BEG ENEMIES TO STOP ATTACKING YOU ////////////////////////////////////////
                    {
                        from.CheckSkill(SkillName.Begging, 0, 100);
                        switch (Utility.RandomMinMax(0, 8))
                        {
                        case 0: from.Say("Leave me alone!"); break;

                        case 1: from.Say("Have mercy!"); break;

                        case 2: from.Say("Please, I am but a puny worm!"); break;

                        case 3: from.Say("Go away!"); break;

                        case 4: from.Say("I submit to your might!"); break;

                        case 5: from.Say("Your power has me scared!"); break;

                        case 6: from.Say("Leave me be!"); break;

                        case 7: from.Say("I didn't want to hurt you!"); break;

                        case 8: from.Say("Don't hurt me!"); break;
                        }

                        if (targ is BaseCreature && ((BaseCreature)targ).Uncalmable)
                        {
                            from.SendMessage("You had no chance at begging this creature from hurting you.");
                        }
                        else if (targ is BaseCreature && ((BaseCreature)targ).BardPacified)
                        {
                            from.SendMessage("This creature is already leaving you alone.");
                        }
                        else
                        {
                            double diff   = GetBaseDifficulty(targ) - 10.0;
                            double beggar = from.Skills[SkillName.Begging].Value;

                            if (beggar > 100.0)
                            {
                                diff -= (beggar - 100.0) * 0.5;
                            }

                            if (!from.CheckTargetSkill(SkillName.Begging, targ, diff - 25.0, diff + 25.0))
                            {
                                from.SendMessage("You fail to convince them to leave you alone.");
                            }
                            else
                            {
                                from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(5.0);
                                if (targ is BaseCreature)
                                {
                                    BaseCreature bc = (BaseCreature)targ;

                                    from.SendMessage("You beg and plead enough for them to leave you alone.");

                                    targ.Combatant = null;
                                    targ.Warmode   = false;

                                    double seconds = 100 - (diff / 1.5);

                                    if (seconds > 120)
                                    {
                                        seconds = 120;
                                    }
                                    else if (seconds < 10)
                                    {
                                        seconds = 10;
                                    }

                                    bc.Pacify(from, DateTime.Now + TimeSpan.FromSeconds(seconds));
                                }
                                else
                                {
                                    from.SendMessage("You beg and plead enough for them to leave you alone.");
                                    targ.SendMessage("They somehow begged and pleaded, convincing you to leave them alone.");
                                    targ.Combatant = null;
                                    targ.Warmode   = false;
                                }
                            }
                        }
                        from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0);
                        m_SetSkillTime     = false;
                        if (from.Karma > -2459)
                        {
                            Titles.AwardKarma(from, -40, true);
                        }
                        if (from.Fame > -2459)
                        {
                            Titles.AwardFame(from, -40, true);
                        }
                    }
                    else if (targ.Player)                       // We can't beg from players
                    {
                        number = 500398;                        // Perhaps just asking would work better.
                    }
                    else if (!targ.Body.IsHuman)                // Make sure the NPC is human
                    {
                        number = 500399;                        // There is little chance of getting money from that!
                    }
                    else if (!from.InRange(targ, 2))
                    {
                        if (!targ.Female)
                        {
                            number = 500401;                             // You are too far away to beg from him.
                        }
                        else
                        {
                            number = 500402;                             // You are too far away to beg from her.
                        }
                    }
                    else
                    {
                        // Face eachother
                        from.Direction = from.GetDirectionTo(targ);
                        targ.Direction = targ.GetDirectionTo(from);

                        from.Animate(32, 5, 1, true, false, 0);                           // Bow

                        new InternalTimer(from, targ).Start();

                        m_SetSkillTime = false;
                    }
                }
                else                 // Not a Mobile
                {
                    number = 500399; // There is little chance of getting money from that!
                }

                if (number != -1)
                {
                    from.SendLocalizedMessage(number);
                }
            }
예제 #6
0
            private Item TryStealItem(Item toSteal, ref bool caught)
            {
                Item stolen = null;

                object root = toSteal.RootParent;

                StealableArtifactsSpawner.StealableInstance si = null;
                if (toSteal.Parent == null || !toSteal.Movable)
                {
                    si = StealableArtifactsSpawner.GetStealableInstance(toSteal);
                }

                /// WIZARD WANTS THEM TO BE ABLE TO STEAL THE DUNGEON CHESTS ///
                if (toSteal is DungeonChest)
                {
                    DungeonChest dBox = (DungeonChest)toSteal;

                    if (m_Thief.Blessed)
                    {
                        m_Thief.SendMessage("You cannot steal while in this state.");
                    }
                    else if (dBox.ItemID == 0x3582 || dBox.ItemID == 0x3583 || dBox.ItemID == 0x35AD || dBox.ItemID == 0x3868 || (dBox.ItemID >= 0x4B5A && dBox.ItemID <= 0x4BAB) || (dBox.ItemID >= 0xECA && dBox.ItemID <= 0xED2))
                    {
                        m_Thief.SendMessage("It is best to leave the dead be.");
                    }
                    else if (dBox.ItemID == 0x3564 || dBox.ItemID == 0x3565)
                    {
                        m_Thief.SendMessage("You have not use for this broken golem thing.");
                    }
                    else
                    {
                        if (m_Thief.CheckSkill(SkillName.Stealing, 0, 125))
                        {
                            m_Thief.SendMessage("You dump out the entire contents while stealing the item.");
                            StolenChest sBox   = new StolenChest();
                            int         dValue = 0;

                            dValue               = (dBox.ContainerLevel + 1) * 50;
                            sBox.ContainerID     = dBox.ContainerID;
                            sBox.ContainerGump   = dBox.ContainerGump;
                            sBox.ContainerHue    = dBox.ContainerHue;
                            sBox.ContainerFlip   = dBox.ContainerFlip;
                            sBox.ContainerWeight = dBox.ContainerWeight;
                            sBox.ContainerName   = dBox.ContainerName;

                            sBox.ContainerValue = dValue;

                            Item iBox = (Item)sBox;

                            iBox.ItemID = sBox.ContainerID;
                            iBox.Hue    = sBox.ContainerHue;
                            iBox.Weight = sBox.ContainerWeight;
                            iBox.Name   = sBox.ContainerName;

                            Bag oBox = (Bag)iBox;

                            oBox.GumpID = sBox.ContainerGump;

                            m_Thief.AddToBackpack(oBox);

                            Titles.AwardFame(m_Thief, dValue, true);
                            Titles.AwardKarma(m_Thief, -dValue, true);

                            LoggingFunctions.LogGeneric(m_Thief, "has stolen a " + iBox.Name + "");
                        }
                        else
                        {
                            m_Thief.SendMessage("You were not quick enough to steal it.");
                            m_Thief.RevealingAction();                             // REVEALING ONLY WHEN FAILED
                        }

                        Item spawnBox = new DungeonChestSpawner(dBox.ContainerLevel, (double)(Utility.RandomMinMax(45, 105)));
                        spawnBox.MoveToWorld(new Point3D(dBox.X, dBox.Y, dBox.Z), dBox.Map);

                        toSteal.Delete();
                    }
                }
                else if (toSteal is LandChest)
                {
                    m_Thief.SendMessage("It is best to leave the dead be.");
                }
                else if (!IsEmptyHanded(m_Thief))
                {
                    m_Thief.SendMessage("You cannot be wielding a weapon when trying to steal something.");
                }
                else if (root is Mobile && ((Mobile)root).Player && IsInnocentTo(m_Thief, (Mobile)root) && !IsInGuild(m_Thief))
                {
                    m_Thief.SendLocalizedMessage(1005596);                       // You must be in the thieves guild to steal from other players.
                }
                else if (toSteal is Coffer)
                {
                    Coffer coffer = (Coffer)toSteal;
                    bool   Pilfer = true;

                    if (m_Thief.Backpack.FindItemByType(typeof(ThiefNote)) != null)
                    {
                        Item      mail     = m_Thief.Backpack.FindItemByType(typeof(ThiefNote));
                        ThiefNote envelope = (ThiefNote)mail;

                        if (envelope.NoteOwner == m_Thief)
                        {
                            if (envelope.NoteItemArea == Server.Misc.Worlds.GetRegionName(m_Thief.Map, m_Thief.Location) && envelope.NoteItemGot == 0 && envelope.NoteItemCategory == coffer.CofferType)
                            {
                                envelope.NoteItemGot = 1;
                                m_Thief.LocalOverheadMessage(MessageType.Emote, 1150, true, "You found " + envelope.NoteItem + ".");
                                m_Thief.SendSound(0x3D);
                                envelope.InvalidateProperties();
                                Pilfer = false;
                            }
                        }
                    }

                    if (Pilfer)
                    {
                        if (coffer.CofferGold < 1)
                        {
                            m_Thief.SendMessage("There seems to be no gold in the coffer.");
                        }
                        else if (m_Thief.CheckSkill(SkillName.Stealing, 0, 100))
                        {
                            m_Thief.SendMessage("You slip out " + coffer.CofferGold + " gold from the coffer.");
                            m_Thief.SendSound(0x2E6);
                            m_Thief.AddToBackpack(new Gold(coffer.CofferGold));

                            Titles.AwardFame(m_Thief, (coffer.CofferGold * 2), true);
                            Titles.AwardKarma(m_Thief, -(coffer.CofferGold * 2), true);

                            coffer.CofferRobbed = 1;
                            coffer.CofferRobber = m_Thief.Name + " the " + Server.Misc.GetPlayerInfo.GetSkillTitle(m_Thief);
                            coffer.CofferGold   = 0;

                            LoggingFunctions.LogGeneric(m_Thief, "has stolen " + coffer.CofferGold + " gold from a " + coffer.CofferType + " in " + Server.Misc.Worlds.GetRegionName(m_Thief.Map, m_Thief.Location) + "");
                        }
                        else
                        {
                            m_Thief.SendMessage("You fingers slip, causing you to get noticed!");
                            m_Thief.RevealingAction();                             // REVEALING ONLY WHEN FAILED

                            if (!m_Thief.CheckSkill(SkillName.Snooping, 0, 150))
                            {
                                List <Mobile> spotters = new List <Mobile>();
                                foreach (Mobile m in m_Thief.GetMobilesInRange(10))
                                {
                                    if (m is BaseVendor && m.CanSee(m_Thief) && m.InLOS(m_Thief))
                                    {
                                        m_Thief.CriminalAction(false);
                                        m.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Stop! Thief!"));
                                    }
                                }
                            }
                        }
                    }
                }
                else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
                {
                    m_Thief.SendLocalizedMessage(1005598);                       // You can't steal from shopkeepers.
                }
                else if (root is PlayerVendor)
                {
                    m_Thief.SendLocalizedMessage(502709);                       // You can't steal from vendors.
                }
                else if (!m_Thief.CanSee(toSteal))
                {
                    m_Thief.SendLocalizedMessage(500237);                       // Target can not be seen.
                }
                else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
                {
                    m_Thief.SendLocalizedMessage(1048147);                       // Your backpack can't hold anything else.
                }
                else if (si == null && (toSteal.Parent == null || !toSteal.Movable))
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root))
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (Core.AOS && si == null && toSteal is Container)
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                {
                    m_Thief.SendLocalizedMessage(502703);                       // You must be standing next to an item to steal it.
                }
                else if (si != null && m_Thief.Skills[SkillName.Stealing].Value < 100.0)
                {
                    m_Thief.SendLocalizedMessage(1060025, "", 0x66D);                       // You're not skilled enough to attempt the theft of this item.
                }
                else if (toSteal.Parent is Mobile)
                {
                    m_Thief.SendLocalizedMessage(1005585);                       // You cannot steal items which are equipped.
                }
                else if (root == m_Thief)
                {
                    m_Thief.SendLocalizedMessage(502704);                       // You catch yourself red-handed.
                }
                else if (root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player)
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root))
                {
                }
                else if (root is Corpse)
                {
                    m_Thief.SendLocalizedMessage(502710);                       // You can't steal that!
                }
                else
                {
                    double w = toSteal.Weight + toSteal.TotalWeight;

                    if (w > 10)
                    {
                        m_Thief.SendMessage("That is too heavy to steal.");
                    }
                    else
                    {
                        if (toSteal.Stackable && toSteal.Amount > 1)
                        {
                            int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

                            if (maxAmount < 1)
                            {
                                maxAmount = 1;
                            }
                            else if (maxAmount > toSteal.Amount)
                            {
                                maxAmount = toSteal.Amount;
                            }

                            int amount = Utility.RandomMinMax(1, maxAmount);

                            if (amount >= toSteal.Amount)
                            {
                                int pileWeight = (int)Math.Ceiling(toSteal.Weight * toSteal.Amount);
                                pileWeight *= 10;

                                if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5))
                                {
                                    stolen = toSteal;
                                }
                            }
                            else
                            {
                                int pileWeight = (int)Math.Ceiling(toSteal.Weight * amount);
                                pileWeight *= 10;

                                if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5))
                                {
                                    stolen = Mobile.LiftItemDupe(toSteal, toSteal.Amount - amount);

                                    if (stolen == null)
                                    {
                                        stolen = toSteal;
                                    }
                                }
                            }
                        }
                        else
                        {
                            int iw = (int)Math.Ceiling(w);
                            iw *= 10;

                            if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5))
                            {
                                stolen = toSteal;
                            }
                        }

                        if (stolen != null)
                        {
                            m_Thief.SendLocalizedMessage(502724);                               // You successfully steal the item.

                            Titles.AwardKarma(m_Thief, -1000, true);

                            if (si != null)
                            {
                                toSteal.Movable = true;
                                si.Item         = null;
                            }
                        }
                        else
                        {
                            m_Thief.SendLocalizedMessage(502723);                  // You fail to steal the item.
                            m_Thief.RevealingAction();                             // REVEALING ONLY WHEN FAILED
                        }

                        caught = (m_Thief.Skills[SkillName.Stealing].Value < Utility.Random(150));
                    }
                }

                return(stolen);
            }
예제 #7
0
        public bool CheckAtDestination()
        {
            if (Region.Name != "The Crypt" && Region.Name != "Newbie Dungeon" && ControlMaster != null)
            {
                Say("I'm sorry, I cannot wander too far from the crypt.  Come back and help me if you find the time.");
                CantWalk = true;
                Timer.DelayCall(TimeSpan.FromSeconds(3), DeleteMob);
                return(false);
            }

            Mobile escorter = GetEscorter();

            var player = escorter as PlayerMobile;

            if (player == null)
            {
                return(false);
            }

            if (MobKills >= 10 && !player.NewbieQuestCompleted)
            {
                Say(
                    "Vengeance makes for a bitter meal indeed. I cannot forgive what was done to me.  Perhaps you are better suited to these items than I. Farewell.");

                Container cont = escorter.Backpack;

                if (cont == null)
                {
                    cont = escorter.BankBox;
                }

                var candle = new CandleofForgiveness {
                    BoundMobile = escorter as PlayerMobile
                };

                if (!cont.TryDropItem(escorter, candle, false))
                {
                    candle.MoveToWorld(escorter.Location, escorter.Map);
                }

                var ring = new RingofForgiveness {
                    BoundMobile = escorter as PlayerMobile
                };

                if (!cont.TryDropItem(escorter, ring, false))
                {
                    ring.MoveToWorld(escorter.Location, escorter.Map);
                }

                player.NewbieQuestCompleted = true;

                CompleteMessage(escorter);
                StopFollow();
                Timer.DelayCall(TimeSpan.FromSeconds(10), DeleteMob);

                Titles.AwardFame(escorter, 10, true);

                return(true);
            }
            if (MobKills < 10 && DateTime.UtcNow >= SpeechTimer)
            {
                SpeechTimer = DateTime.UtcNow + TimeSpan.FromMinutes(1);
                Say(
                    "My spirit cannot rest while my killers are loose in this crypt.  Please, avenge my death.  Make my killers pay.");
            }

            return(false);
        }
예제 #8
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is PirateBounty)
            {
                if (IntelligentAction.GetMyEnemies(from, this, false) == true)
                {
                    string sSay = "You shouldn't be carrying that around with you.";
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sSay, from.NetState);
                }
                else
                {
                    PirateBounty bounty   = (PirateBounty)dropped;
                    int          fame     = (int)(bounty.BountyValue / 5);
                    int          karma    = -1 * fame;
                    int          gold     = bounty.BountyValue;
                    string       sMessage = "";
                    string       sReward  = "Here is " + gold.ToString() + " gold for you.";

                    switch (Utility.RandomMinMax(0, 9))
                    {
                    case 0: sReward = "Here is " + gold.ToString() + " gold for you.";                                                      break;

                    case 1: sReward = "Take this " + gold.ToString() + " gold for your trouble.";                           break;

                    case 2: sReward = "The reward is " + gold.ToString() + " gold.";                                                        break;

                    case 3: sReward = "Here is " + gold.ToString() + " gold for the bounty.";                                       break;

                    case 4: sReward = "The bounty is " + gold.ToString() + " gold for this one.";                           break;

                    case 5: sReward = "Here is your reward of " + gold.ToString() + " gold";                                        break;

                    case 6: sReward = "You can have this " + gold.ToString() + " gold for the bounty.";                     break;

                    case 7: sReward = "There is a reward of " + gold.ToString() + " gold for this one.";            break;

                    case 8: sReward = "This one was worth " + gold.ToString() + " gold for their crimes.";          break;

                    case 9: sReward = "Their crimes called for a bounty of " + gold.ToString() + " gold.";          break;
                    }

                    Titles.AwardKarma(from, karma, true);
                    Titles.AwardFame(from, fame, true);
                    from.SendSound(0x2E6);
                    from.AddToBackpack(new Gold(gold));

                    switch (Utility.RandomMinMax(0, 9))
                    {
                    case 0: sMessage = "We have been looking for this pirate. " + sReward;  break;

                    case 1: sMessage = "I have heard of this pirate before. " + sReward;    break;

                    case 2: sMessage = "I never thought I would see this pirate brought to justice. " + sReward;    break;

                    case 3: sMessage = "This pirate will plunder no more. " + sReward;      break;

                    case 4: sMessage = "Our galleons are safer now. " + sReward;    break;

                    case 5: sMessage = "The sea is safer because of you. " + sReward;       break;

                    case 6: sMessage = "The sailors at the docks will not believe this. " + sReward;        break;

                    case 7: sMessage = "I have only heard stories about this pirate. " + sReward;   break;

                    case 8: sMessage = "How did you come across this pirate? " + sReward;   break;

                    case 9: sMessage = "Where did you find this pirate? " + sReward;        break;
                    }
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState);
                    dropped.Delete();
                    return(true);
                }
            }
            else if (dropped is Head && !from.Blessed)
            {
                if (IntelligentAction.GetMyEnemies(from, this, false) == true)
                {
                    string sSay = "You shouldn't be carrying that around with you.";
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sSay, from.NetState);
                }
                else
                {
                    Head   head     = (Head)dropped;
                    int    karma    = 0;
                    int    gold     = 0;
                    string sMessage = "";
                    string sReward  = "Here is " + gold.ToString() + " gold for you.";

                    if (head.m_Job == "Thief")
                    {
                        karma = Utility.RandomMinMax(40, 60);
                        gold  = Utility.RandomMinMax(80, 120);
                    }
                    else if (head.m_Job == "Bandit")
                    {
                        karma = Utility.RandomMinMax(20, 30);
                        gold  = Utility.RandomMinMax(30, 40);
                    }
                    else if (head.m_Job == "Brigand")
                    {
                        karma = Utility.RandomMinMax(30, 40);
                        gold  = Utility.RandomMinMax(50, 80);
                    }
                    else if (head.m_Job == "Pirate")
                    {
                        karma = Utility.RandomMinMax(90, 110);
                        gold  = Utility.RandomMinMax(120, 160);
                    }
                    else if (head.m_Job == "Assassin")
                    {
                        karma = Utility.RandomMinMax(60, 80);
                        gold  = Utility.RandomMinMax(100, 140);
                    }

                    switch (Utility.RandomMinMax(0, 9))
                    {
                    case 0: sReward = "Here is " + gold.ToString() + " gold for you.";                                                      break;

                    case 1: sReward = "Take this " + gold.ToString() + " gold for your trouble.";                           break;

                    case 2: sReward = "The reward is " + gold.ToString() + " gold.";                                                        break;

                    case 3: sReward = "Here is " + gold.ToString() + " gold for the bounty.";                                       break;

                    case 4: sReward = "The bounty is " + gold.ToString() + " gold for this one.";                           break;

                    case 5: sReward = "Here is your reward of " + gold.ToString() + " gold";                                        break;

                    case 6: sReward = "You can have this " + gold.ToString() + " gold for the bounty.";                     break;

                    case 7: sReward = "There is a reward of " + gold.ToString() + " gold for this one.";            break;

                    case 8: sReward = "This one was worth " + gold.ToString() + " gold for their crimes.";          break;

                    case 9: sReward = "Their crimes called for a bounty of " + gold.ToString() + " gold.";          break;
                    }

                    if (head.m_Job == "Thief" || head.m_Job == "Bandit" || head.m_Job == "Brigand")
                    {
                        Titles.AwardKarma(from, karma, true);
                        from.SendSound(0x2E6);
                        from.AddToBackpack(new Gold(gold));

                        switch (Utility.RandomMinMax(0, 9))
                        {
                        case 0: sMessage = "We have been looking for this rogue. " + sReward;   break;

                        case 1: sMessage = "I have heard of this thief before. " + sReward;     break;

                        case 2: sMessage = "I never thought I would see this bandit brought to justice. " + sReward;    break;

                        case 3: sMessage = "This rouge will steal no more. " + sReward; break;

                        case 4: sMessage = "Our gold purses are safer now. " + sReward; break;

                        case 5: sMessage = "The land is safer because of you. " + sReward;      break;

                        case 6: sMessage = "The others at the guard house will not believe this. " + sReward;   break;

                        case 7: sMessage = "I have only heard stories about this rogue. " + sReward;    break;

                        case 8: sMessage = "How did you come across this thief? " + sReward;    break;

                        case 9: sMessage = "Where did you find this sneak? " + sReward; break;
                        }
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState);
                        dropped.Delete();
                        return(true);
                    }
                    else if (head.m_Job == "Pirate")
                    {
                        Titles.AwardKarma(from, karma, true);
                        from.SendSound(0x2E6);
                        from.AddToBackpack(new Gold(gold));

                        switch (Utility.RandomMinMax(0, 9))
                        {
                        case 0: sMessage = "We have been looking for this pirate. " + sReward;  break;

                        case 1: sMessage = "I have heard of this pirate before. " + sReward;    break;

                        case 2: sMessage = "I never thought I would see this pirate brought to justice. " + sReward;    break;

                        case 3: sMessage = "This pirate will plunder no more. " + sReward;      break;

                        case 4: sMessage = "Our galleons are safer now. " + sReward;    break;

                        case 5: sMessage = "The sea is safer because of you. " + sReward;       break;

                        case 6: sMessage = "The sailors at the docks will not believe this. " + sReward;        break;

                        case 7: sMessage = "I have only heard stories about this pirate. " + sReward;   break;

                        case 8: sMessage = "How did you come across this pirate? " + sReward;   break;

                        case 9: sMessage = "Where did you find this pirate? " + sReward;        break;
                        }
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState);
                        dropped.Delete();
                        return(true);
                    }
                    else if (head.m_Job == "Assassin")
                    {
                        Titles.AwardKarma(from, karma, true);
                        from.SendSound(0x2E6);
                        from.AddToBackpack(new Gold(gold));

                        switch (Utility.RandomMinMax(0, 9))
                        {
                        case 0: sMessage = "We have been living in fear of this one. " + sReward;       break;

                        case 1: sMessage = "I have heard others speak of this assassin. " + sReward;    break;

                        case 2: sMessage = "I never thought this assassin existed. " + sReward; break;

                        case 3: sMessage = "This assassin will kill no more. " + sReward;       break;

                        case 4: sMessage = "Our nobles are safer now. " + sReward;      break;

                        case 5: sMessage = "The shadows are less feared because of you. " + sReward;    break;

                        case 6: sMessage = "Those in the tavern will not believe this. " + sReward;     break;

                        case 7: sMessage = "I have only heard rumors about this assassin. " + sReward;  break;

                        case 8: sMessage = "It is good to see this assassin did not best you. " + sReward;      break;

                        case 9: sMessage = "How did you survive this assassin? " + sReward;     break;
                        }
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState);
                        dropped.Delete();
                        return(true);
                    }
                    else
                    {
                        this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I assume they done you harm. Let me rid you of this thing.", from.NetState);
                        dropped.Delete();
                        return(true);
                    }
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
예제 #9
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            var from = state.Mobile;

            from.CloseGump <ResurrectGump>();

            if (info.ButtonID != 1 && info.ButtonID != 2)
            {
                return;
            }

            if (from.Map?.CanFit(from.Location, 16, false, false) != true)
            {
                from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                return;
            }

            if (m_Price > 0)
            {
                if (info.IsSwitched(1))
                {
                    if (Banker.Withdraw(from, m_Price))
                    {
                        from.SendLocalizedMessage(
                            1060398,
                            m_Price.ToString()
                            ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                        from.SendLocalizedMessage(
                            1060022,
                            Banker.GetBalance(from).ToString()
                            ); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                    }
                    else
                    {
                        from.SendLocalizedMessage(
                            1060020
                            ); // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                        return;
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1060019); // You decide against paying the healer, and thus remain dead.
                    return;
                }
            }

            from.PlaySound(0x214);
            from.FixedEffect(0x376A, 10, 16);

            from.Resurrect();

            if (m_Healer != null && from != m_Healer)
            {
                var level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                from.Hits = level switch
                {
                    VirtueLevel.Seeker => AOS.Scale(from.HitsMax, 20),
                    VirtueLevel.Follower => AOS.Scale(from.HitsMax, 40),
                    VirtueLevel.Knight => AOS.Scale(from.HitsMax, 80),
                    _ => from.Hits
                };
            }

            if (m_FromSacrifice && from is PlayerMobile mobile)
            {
                mobile.AvailableResurrects -= 1;

                var pack   = mobile.Backpack;
                var corpse = mobile.Corpse;

                if (pack != null && corpse != null)
                {
                    var items = new List <Item>(corpse.Items);

                    for (var i = 0; i < items.Count; ++i)
                    {
                        var item = items[i];

                        if (item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable)
                        {
                            pack.DropItem(item);
                        }
                    }
                }
            }

            if (from.Fame > 0)
            {
                var amount = from.Fame / 10;

                Titles.AwardFame(from, -amount, true);
            }

            if (!Core.AOS && from.ShortTermMurders >= 5)
            {
                var loss = (100.0 - (4.0 + from.ShortTermMurders / 5.0)) / 100.0; // 5 to 15% loss

                if (loss < 0.85)
                {
                    loss = 0.85;
                }
                else if (loss > 0.95)
                {
                    loss = 0.95;
                }

                if (from.RawStr * loss > 10)
                {
                    from.RawStr = (int)(from.RawStr * loss);
                }
                if (from.RawInt * loss > 10)
                {
                    from.RawInt = (int)(from.RawInt * loss);
                }
                if (from.RawDex * loss > 10)
                {
                    from.RawDex = (int)(from.RawDex * loss);
                }

                for (var s = 0; s < from.Skills.Length; s++)
                {
                    if (from.Skills[s].Base * loss > 35)
                    {
                        from.Skills[s].Base *= loss;
                    }
                }
            }

            if (from.Alive && m_HitsScalar > 0)
            {
                from.Hits = (int)(from.HitsMax * m_HitsScalar);
            }
        }
    }
예제 #10
0
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            Mobile m = e.Mobile;

            List <Mobile> killers = new List <Mobile>();
            List <Mobile> toGive  = new List <Mobile>();

            foreach (AggressorInfo ai in m.Aggressors)
            {
                if (Ethic.Find(ai.Attacker) == null || Ethic.Find(m) == null)
                {                 //Allow people of the same ethic to flag each other as murderers?  Factioners can?
                    if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported && (!Core.SE || !((PlayerMobile)m).RecentlyReported.Contains(ai.Attacker)))
                    {
                        killers.Add(ai.Attacker);
                        ai.Reported        = true;
                        ai.CanReportMurder = false;
                    }

                    if (ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker))
                    {
                        toGive.Add(ai.Attacker);
                    }
                }
            }

            foreach (AggressorInfo ai in m.Aggressed)
            {
                if (ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender))
                {
                    toGive.Add(ai.Defender);
                }
            }

            foreach (Mobile g in toGive)
            {
                int n = Notoriety.Compute(g, m);

                int  theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = (n == Notoriety.Innocent);
                bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer);

                int fameAward  = m.Fame / 200;
                int karmaAward = 0;

                if (innocent)
                {
                    karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100));
                }
                else if (criminal)
                {
                    karmaAward = 50;
                }

                Titles.AwardFame(g, fameAward, false);
                Titles.AwardKarma(g, karmaAward, true);
            }

            if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild)
            {
                return;
            }

            if (killers.Count > 0)
            {
                new GumpTimer(m, killers, m.Location, m.Map).Start();
            }
        }
예제 #11
0
        static void Recall_OnCommand(CommandEventArgs e)
        {
            Mobile m = e.Mobile;

            if (!Config.AllowUsageIfIsOverloaded && WeightOverloading.IsOverloaded(m))
            {
                m.SendMessage("You can't recall because you are carrying too much weight!");
                return;
            }

            if (!Config.AllowUsageIfIsInCombat)
            {
                m.SendMessage("You can't recall during the heat of battle!");
                return;
            }

            m.MoveToWorld(Config.TargetLocation, Config.TargetMap);

            if (Config.BringFollowers)
            {
                PlayerMobile  master    = (PlayerMobile)m;
                List <Mobile> followers = master.AllFollowers;

                if (followers.Count > 0)
                {
                    foreach (var follower in followers)
                    {
                        var mount = follower as IMount;
                        if (mount != null)
                        {
                            if (mount.Rider == master)
                            {
                                continue;
                            }

                            mount.Rider = null;
                        }

                        if (Config.AffectOnlyControlledFollowers)
                        {
                            var baseCreature = follower as BaseCreature;
                            if (baseCreature != null)
                            {
                                if (!baseCreature.Controlled)
                                {
                                    continue;
                                }
                            }
                        }

                        follower.MoveToWorld(master.Location, master.Map);
                    }
                }
            }

            if (Config.SpecialEffects)
            {
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13);
                Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z - 1), m.Map, 0x3728, 13);

                m.PlaySound(0x228);

                m.Emote("*appears in a puff of smoke*");
            }

            if (Config.DecreaseFameIfUsedInCombat && SpellHelper.CheckCombat(m))
            {
                Titles.AwardFame(m, -(m.Fame / 20), true);
            }
        }
예제 #12
0
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            Mobile m = e.Mobile;

            List <Mobile> killers = new List <Mobile>();
            List <Mobile> toGive  = new List <Mobile>();

            foreach (AggressorInfo ai in m.Aggressors)
            {
                if (ai.Attacker.Player && ai.CanReportMurder && !ai.Reported)
                {
                    killers.Add(ai.Attacker);
                    ai.Reported = true;
                }

                if (ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Attacker))
                {
                    toGive.Add(ai.Attacker);
                }
            }

            foreach (AggressorInfo ai in m.Aggressed)
            {
                if (ai.Defender.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds(30.0) && !toGive.Contains(ai.Defender))
                {
                    toGive.Add(ai.Defender);
                }
            }

            foreach (Mobile g in toGive)
            {
                int n = Notoriety.Compute(g, m);

                int  theirKarma = m.Karma, ourKarma = g.Karma;
                bool innocent = (n == Notoriety.Innocent);
                bool criminal = (n == Notoriety.Criminal || n == Notoriety.Murderer);

                int fameAward  = m.Fame / 200;
                int karmaAward = 0;

                if (innocent)
                {
                    karmaAward = (ourKarma > -2500 ? -850 : -110 - (m.Karma / 100));
                }
                else if (criminal)
                {
                    karmaAward = 50;
                }

                Titles.AwardFame(g, fameAward, false);
                Titles.AwardKarma(g, karmaAward, true);
                // modification to support XmlQuest Killtasks of players
                Server.Items.XmlQuest.RegisterKill(m, g);
            }

            if (m is PlayerMobile && ((PlayerMobile)m).NpcGuild == NpcGuild.ThievesGuild)
            {
                return;
            }

            if (killers.Count > 0)
            {
                new GumpTimer(m, killers).Start();
            }
        }
예제 #13
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;

                if (info.ButtonID == 1)
                {
                    from.AddToBackpack(new Gold(m_Jail.PrisonerReward));
                    from.SendSound(0x0EF);
                    from.SendMessage("You free " + m_Jail.PrisonerName + " from their prison.");
                    LoggingFunctions.LogStandard(from, "has freed " + m_Jail.PrisonerName + " " + m_Jail.PrisonerTitle + ".");

                    Titles.AwardFame(from, ((int)((m_Jail.PrisonerReward) / 100)), true);
                    if (((PlayerMobile)from).KarmaLocked == true)
                    {
                        Titles.AwardKarma(from, -((int)((m_Jail.PrisonerReward) / 100)), true);
                    }
                    else
                    {
                        Titles.AwardKarma(from, ((int)((m_Jail.PrisonerReward) / 100)), true);
                    }

                    m_Jail.Delete();
                }
                else if (info.ButtonID == 2)
                {
                    int  gold    = from.TotalGold;
                    int  join    = m_Jail.PrisonerJoin;
                    bool begging = false;

                    if (Server.Mobiles.BaseVendor.BeggingPose(from) > 0)                       // LET US SEE IF THEY ARE BEGGING
                    {
                        int cut = (int)(from.Skills[SkillName.Begging].Value * 25);
                        if (cut > 3000)
                        {
                            cut = 3000;
                        }
                        join    = join - cut;
                        begging = true;
                    }

                    if (gold >= join)
                    {
                        Container cont = from.Backpack;
                        cont.ConsumeTotal(typeof(Gold), join);
                        from.SendSound(0x0EF);

                        if (begging)
                        {
                            from.SendMessage("You beg " + m_Jail.PrisonerName + " to join you as a henchman for only " + join + " gold.");
                        }
                        else
                        {
                            from.SendMessage("" + m_Jail.PrisonerName + " has joined you as a henchman.");
                        }

                        if (m_Jail.PrisonerType == 97)
                        {
                            HenchmanFighterItem fighter = new HenchmanFighterItem();
                            fighter.HenchName  = m_Jail.PrisonerName;
                            fighter.HenchTitle = m_Jail.PrisonerTitle;
                            fighter.HenchBody  = m_Jail.PrisonerBody;
                            from.AddToBackpack(fighter);
                        }
                        else if (m_Jail.PrisonerType == 98)
                        {
                            HenchmanArcherItem archer = new HenchmanArcherItem();
                            archer.HenchName  = m_Jail.PrisonerName;
                            archer.HenchTitle = m_Jail.PrisonerTitle;
                            archer.HenchBody  = m_Jail.PrisonerBody;
                            from.AddToBackpack(archer);
                        }
                        else if (m_Jail.PrisonerType == 99)
                        {
                            HenchmanWizardItem wizard = new HenchmanWizardItem();
                            wizard.HenchName  = m_Jail.PrisonerName;
                            wizard.HenchTitle = m_Jail.PrisonerTitle;
                            wizard.HenchBody  = m_Jail.PrisonerBody;
                            from.AddToBackpack(wizard);
                        }
                        else
                        {
                            HenchmanMonsterItem item = new HenchmanMonsterItem();

                            item.HenchTimer      = 300;
                            item.HenchWeaponID   = m_Jail.PrisonerType;
                            item.HenchShieldID   = m_Jail.PrisonerSound;
                            item.HenchHelmID     = 0;
                            item.HenchArmorType  = 0;
                            item.HenchWeaponType = 0;
                            item.HenchCloakColor = 0;
                            item.HenchCloak      = 0;
                            item.HenchRobe       = 0;
                            item.HenchHatColor   = 0;
                            item.HenchGloves     = 0;
                            item.HenchSpeech     = Utility.RandomDyedHue();
                            item.HenchDead       = 0;
                            item.HenchBody       = m_Jail.PrisonerBody;
                            item.HenchHue        = 0;
                            item.HenchHair       = 0;
                            item.HenchHairHue    = 0;
                            item.HenchGearColor  = 0;
                            item.HenchName       = m_Jail.PrisonerName;
                            item.HenchTitle      = m_Jail.PrisonerTitle;
                            item.HenchBandages   = 0;
                            from.AddToBackpack(item);
                        }

                        m_Jail.Delete();
                    }
                    else
                    {
                        from.SendMessage("You do not have enough gold to convince them to join you.");
                    }
                }
                else if (info.ButtonID == 3)
                {
                    switch (Utility.RandomMinMax(0, 4))
                    {
                    case 0: from.Say("I will leave you to your fate, " + m_Jail.PrisonerName + "!"); break;

                    case 1: from.Say("" + m_Jail.PrisonerName + ", stay here and rot!"); break;

                    case 2: from.Say("" + m_Jail.PrisonerName + ", the world is better with you in here!"); break;

                    case 3: from.Say("You are not the sort I wish to free, " + m_Jail.PrisonerName + "."); break;

                    case 4: from.Say("You must be here for a reason, " + m_Jail.PrisonerName + "."); break;
                    }
                }
            }
예제 #14
0
        static void OnCommand(CommandEventArgs e)
        {
            var m = e.Mobile;

            if (!Config.AllowUsageIfIsOverloaded && WeightOverloading.IsOverloaded(m))
            {
                m.SendMessage("You can't recall because you are carrying too much weight!");
                return;
            }

            if (!Config.AllowUsageIfIsInCombat && IsInCombat(m))
            {
                m.SendMessage("You can't recall during the heat of battle!");
                return;
            }

            SendSpecialEffects(m);

            m.MoveToWorld(Config.TargetLocation, Config.TargetMap);

            SendSpecialEffects(m);

            if (Config.DecreaseFameIfUsedInCombat && SpellHelper.CheckCombat(m))
            {
                Titles.AwardFame(m, -(m.Fame / 20), true);
            }

            if (Config.BringFollowers)
            {
                var master    = m as PlayerMobile;
                var followers = master.AllFollowers;

                if (followers.Count == 0)
                {
                    return;
                }

                foreach (var follower in followers)
                {
                    var mount = follower as IMount;

                    if (mount != null)
                    {
                        if (mount.Rider == master)
                        {
                            continue;
                        }

                        mount.Rider = null;
                    }

                    if (Config.AffectOnlyControlledFollowers)
                    {
                        var baseCreature = follower as BaseCreature;

                        if (baseCreature != null && !baseCreature.Controlled)
                        {
                            continue;
                        }
                    }

                    follower.MoveToWorld(master.Location, master.Map);
                }
            }
        }