コード例 #1
0
        public HttpResponseMessage Put([FromBody] PukeMessage puckMessage)
        {
            var place = _dataContext.Set <Place>().Where(x => x.Id == puckMessage.PlaceId).FirstOrDefault();
            var puck  = new Puke((Severity)puckMessage.PukeVal, string.Empty);

            place.Pukes.Add(puck);

            try {
                _dataContext.SaveChanges();
            } catch (DbUpdateException) {
                throw;
            }
            return(Request.CreateResponse(HttpStatusCode.Created, puck));
        }
コード例 #2
0
ファイル: ReverseStructure.cs プロジェクト: zravi/Algorithm
        public void Reverse()
        {
            Stack <Puke> stack = new Stack <Puke>();
            Puke         puke  = new Puke("1");

            stack.Push(puke);

            stack.Pop();

            for (int i = 0; i < 100; i++)
            {
                puke = new Puke(i);
                stack.Push(puke);
            }

            //puke=new Puke("2");

            //stack.Push(puke);

            //puke=new Puke("3");

            //stack.Push(puke);

            //puke=new Puke("4");

            //stack.Push(puke);

            //puke=new Puke("5");

            //stack.Push(puke);

            Algorithm.Model.ReverseStructure.RecursionReverse(stack);

            // string str="";

            //while (stack.Count!=0)
            //{
            // str+=stack.Pop().Paimian + " ";

            //}
            int n = stack.Count;

            for (int i = 0; i < n; i++)
            {
                Assert.AreEqual(i, stack.Pop().n);
            }
        }
コード例 #3
0
ファイル: Emote.cs プロジェクト: justdanofficial/khaeros
        public ESound(Mobile pm, int SoundMade)
        {
            switch (SoundMade)
            {
                case 1:
                    pm.PlaySound(pm.Female ? 778 : 1049);
                    pm.Say("*ah!*");
                    break;
                case 2:
                    pm.PlaySound(pm.Female ? 779 : 1050);
                    pm.Say("*ah ha!*");
                    break;
                case 3:
                    pm.PlaySound(pm.Female ? 780 : 1051);
                    pm.Say("*applauds*");
                    break;
                case 4:
                    pm.PlaySound(pm.Female ? 781 : 1052);
                    pm.Say("*blows nose*");
                    if (!pm.Mounted)
                        pm.Animate(34, 5, 1, true, false, 0);
                    break;
                case 5:
                    pm.Say("*bows*");
                    if (!pm.Mounted)
                        pm.Animate(32, 5, 1, true, false, 0);
                    break;
                case 6:
                    pm.PlaySound(pm.Female ? 786 : 1057);
                    pm.Say("*bs cough*");
                    break;
                case 7:
                    pm.PlaySound(pm.Female ? 782 : 1053);
                    pm.Say("*burp!*");
                    if (!pm.Mounted)
                        pm.Animate(33, 5, 1, true, false, 0);
                    break;
                case 8:
                    pm.PlaySound(pm.Female ? 0x310 : 1055);
                    pm.Say("*clears throat*");
                    if (!pm.Mounted)
                        pm.Animate(33, 5, 1, true, false, 0);
                    break;
                case 9:
                    pm.PlaySound(pm.Female ? 785 : 1056);
                    pm.Say("*cough!*");
                    if (!pm.Mounted)
                        pm.Animate(33, 5, 1, true, false, 0);
                    break;
                case 10:
                    pm.PlaySound(pm.Female ? 787 : 1058);
                    pm.Say("*cries*");
                    break;
                case 11:
                    if (!pm.Mounted)
                        Faint(pm as PlayerMobile);
            else pm.Say("*faints*");
                    break;
                case 12:
                    pm.PlaySound(pm.Female ? 792 : 1064);
                    pm.Say("*farts*");
                    break;
                case 13:
                    pm.PlaySound(pm.Female ? 793 : 1065);
                    pm.Say("*gasp!*");
                    break;
                case 14:
                    pm.PlaySound(pm.Female ? 794 : 1066);
                    pm.Say("*giggles*");
                    break;
                case 15:
                    pm.PlaySound(pm.Female ? 795 : 1067);
                    pm.Say("*groans*");
                    break;
                case 16:
                    pm.PlaySound(pm.Female ? 796 : 1068);
                    pm.Say("*growls*");
                    break;
                case 17:
                    pm.PlaySound(pm.Female ? 797 : 1069);
                    pm.Say("*hey!*");
                    break;
                case 18:
                    pm.PlaySound(pm.Female ? 798 : 1070);
                    pm.Say("*hiccup!*");
                    break;
                case 19:
                    pm.PlaySound(pm.Female ? 799 : 1071);
                    pm.Say("*huh?*");
                    break;
                case 20:
                    pm.PlaySound(pm.Female ? 800 : 1072);
                    pm.Say("*kisses*");
                    break;
                case 21:
                    pm.PlaySound(pm.Female ? 801 : 1073);
                    pm.Say("*laughs*");
                    break;
                case 22:
                    pm.PlaySound(pm.Female ? 802 : 1074);
                    pm.Say("*no!*");
                    break;
                case 23:
                    pm.PlaySound(pm.Female ? 803 : 1075);
                    pm.Say("*oh!*");
                    break;
                case 24:
                    pm.PlaySound(pm.Female ? 811 : 1085);
                    pm.Say("*oooh*");
                    break;
                case 25:
                    pm.PlaySound(pm.Female ? 812 : 1086);
                    pm.Say("*oops*");
                    break;
                case 26:
                    pm.PlaySound(pm.Female ? 813 : 1087);
                    pm.Say("*pukes*");
                    if (!pm.Mounted)
                        pm.Animate(32, 5, 1, true, false, 0);
                    Point3D p = new Point3D(pm.Location);
                    switch (pm.Direction)
                    {
                        case Direction.North:
                            p.Y--; break;
                        case Direction.South:
                            p.Y++; break;
                        case Direction.East:
                            p.X++; break;
                        case Direction.West:
                            p.X--; break;
                        case Direction.Right:
                            p.X++; p.Y--; break;
                        case Direction.Down:
                            p.X++; p.Y++; break;
                        case Direction.Left:
                            p.X--; p.Y++; break;
                        case Direction.Up:
                            p.X--; p.Y--; break;
                        default:
                            break;
                    }
                    p.Z = pm.Map.GetAverageZ(p.X, p.Y);

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

                    if (canFit)
                    {
                        Puke puke = new Puke();
                        puke.Map = pm.Map;
                        puke.Location = p;
                    }
                    /*else
                        pm.SendMessage( "your puke won't fit!" ); /* Debug testing */
                    break;
                case 27:
                    pm.PlaySound(315);
                    pm.Say("*punches*");
                    if (!pm.Mounted)
                        pm.Animate(31, 5, 1, true, false, 0);
                    break;
                case 28:
                    pm.PlaySound(pm.Female ? 814 : 1088);
                    pm.Say("*ahhhh!*");
                    break;
                case 29:
                    pm.PlaySound(pm.Female ? 815 : 1089);
                    pm.Say("*shhh!*");
                    break;
                case 30:
                    pm.PlaySound(pm.Female ? 816 : 1090);
                    pm.Say("*sigh*");
                    break;
                case 31:
                    pm.PlaySound(948);
                    pm.Say("*slaps*");
                    if (!pm.Mounted)
                        pm.Animate(11, 5, 1, true, false, 0);
                    break;
                case 32:
                    pm.PlaySound(pm.Female ? 817 : 1091);
                    pm.Say("*ahh-choo!*");
                    if (!pm.Mounted)
                        pm.Animate(32, 5, 1, true, false, 0);
                    break;
                case 33:
                    pm.PlaySound(pm.Female ? 818 : 1092);
                    pm.Say("*sniff*");
                    if (!pm.Mounted)
                        pm.Animate(34, 5, 1, true, false, 0);
                    break;
                case 34:
                    pm.PlaySound(pm.Female ? 819 : 1093);
                    pm.Say("*snore*");
                    break;
                case 35:
                    pm.PlaySound(pm.Female ? 820 : 1094);
                    pm.Say("*spits*");
                    if (!pm.Mounted)
                        pm.Animate(6, 5, 1, true, false, 0);
                    break;
                case 36:
                    pm.PlaySound(792);
                    pm.Say("*sticks out tongue*");
                    break;
                case 37:
                    pm.PlaySound(874);
                    pm.Say("*taps foot*");
                    if (!pm.Mounted)
                        pm.Animate(38, 5, 1, true, false, 0);
                    break;
                case 38:
                    pm.PlaySound(pm.Female ? 821 : 1095);
                    pm.Say("*whistles*");
                    if (!pm.Mounted)
                        pm.Animate(5, 5, 1, true, false, 0);
                    break;
                case 39:
                    pm.PlaySound(pm.Female ? 783 : 1054);
                    pm.Say("*woohoo!*");
                    break;
                case 40:
                    pm.PlaySound(pm.Female ? 822 : 1096);
                    pm.Say("*yawns*");
                    if (!pm.Mounted)
                        pm.Animate(17, 5, 1, true, false, 0);
                    break;
                case 41:
                    pm.PlaySound(pm.Female ? 823 : 1097);
                    pm.Say("*yea!*");
                    break;
                case 42:
                    pm.PlaySound(pm.Female ? 0x338 : 1098);
                    pm.Say("*yells*");
                    break;
            }
        }
コード例 #4
0
ファイル: Emote_fra.cs プロジェクト: greeduomacro/vivre-uo
        public ESound(Mobile pm, int SoundMade)
        {
            switch (SoundMade)
            {
                case 1:
                    pm.PlaySound(pm.Female ? 778 : 1049);
                    pm.Say("*ha!*");
                    break;
                case 2:
                    pm.PlaySound(pm.Female ? 779 : 1050);
                    pm.Say("*ha! ha!*");
                    break;
                case 3:
                    pm.PlaySound(pm.Female ? 780 : 1051);
                    pm.Say("*applaudis*");
                    break;
                case 4:
                    pm.PlaySound(pm.Female ? 781 : 1052);
                    pm.Say("*se mouche*");
                    if (!pm.Mounted)
                        pm.Animate(34, 5, 1, true, false, 0);
                    break;
                case 5:
                    pm.Say("*salut*");
                    if (!pm.Mounted)
                        pm.Animate(32, 5, 1, true, false, 0);
                    break;
                case 6:
                    pm.PlaySound(pm.Female ? 786 : 1057);
                    pm.Say("*s'etrangle*");
                    break;
                case 7:
                    pm.PlaySound(pm.Female ? 782 : 1053);
                    pm.Say("*rot!*");
                    if (!pm.Mounted)
                        pm.Animate(33, 5, 1, true, false, 0);
                    break;
                case 8:
                    pm.PlaySound(pm.Female ? 784 : 1055);
                    pm.Say("*humhum!*");
                    if (!pm.Mounted)
                        pm.Animate(33, 5, 1, true, false, 0);
                    break;
                case 9:
                    pm.PlaySound(pm.Female ? 785 : 1056);
                    pm.Say("*tousse*");
                    if (!pm.Mounted)
                        pm.Animate(33, 5, 1, true, false, 0);
                    break;
                case 10:
                    pm.PlaySound(pm.Female ? 787 : 1058);
                    pm.Say("*pleure*");  //cries ??
                    break;
                case 11:
                    pm.PlaySound(pm.Female ? 791 : 1063);
                    pm.Say("*tombe*");
                    if (!pm.Mounted)
                        pm.Animate(22, 5, 1, true, false, 0);
                    break;
                case 12:
                    pm.PlaySound(pm.Female ? 792 : 1064);
                    pm.Say("*prout!*");
                    break;
                case 13:
                    pm.PlaySound(pm.Female ? 793 : 1065);
                    pm.Say("*gasp!*");
                    break;
                case 14:
                    pm.PlaySound(pm.Female ? 794 : 1066);
                    pm.Say("*mouahaha!*");
                    break;
                case 15:
                    pm.PlaySound(pm.Female ? 795 : 1067);
                    pm.Say("*jouis...*");
                    break;
                case 16:
                    pm.PlaySound(pm.Female ? 796 : 1068);
                    pm.Say("*grrr!*");
                    break;
                case 17:
                    pm.PlaySound(pm.Female ? 797 : 1069);
                    pm.Say("*hé!*");
                    break;
                case 18:
                    pm.PlaySound(pm.Female ? 798 : 1070);
                    pm.Say("*hic!*");
                    break;
                case 19:
                    pm.PlaySound(pm.Female ? 799 : 1071);
                    pm.Say("*hein?*");
                    break;
                case 20:
                    pm.PlaySound(pm.Female ? 800 : 1072);
                    pm.Say("*embrasse*");
                    break;
                case 21:
                    pm.PlaySound(pm.Female ? 801 : 1073);
                    pm.Say("*rire*");
                    break;
                case 22:
                    pm.PlaySound(pm.Female ? 802 : 1074);
                    pm.Say("*non!*");
                    break;
                case 23:
                    pm.PlaySound(pm.Female ? 803 : 1075);
                    pm.Say("*oh!*");
                    break;
                case 24:
                    pm.PlaySound(pm.Female ? 811 : 1085);
                    pm.Say("*hou!*");
                    break;
                case 25:
                    pm.PlaySound(pm.Female ? 812 : 1086);
                    pm.Say("*oups!*");
                    break;
                case 26:
                    pm.PlaySound(pm.Female ? 813 : 1087);
                    pm.Say("*vomis*");
                    if (!pm.Mounted)
                        pm.Animate(32, 5, 1, true, false, 0);
                    Point3D p = new Point3D(pm.Location);
                    switch (pm.Direction)
                    {
                        case Direction.North:
                            p.Y--; break;
                        case Direction.South:
                            p.Y++; break;
                        case Direction.East:
                            p.X++; break;
                        case Direction.West:
                            p.X--; break;
                        case Direction.Right:
                            p.X++; p.Y--; break;
                        case Direction.Down:
                            p.X++; p.Y++; break;
                        case Direction.Left:
                            p.X--; p.Y++; break;
                        case Direction.Up:
                            p.X--; p.Y--; break;
                        default:
                            break;
                    }
                    p.Z = pm.Map.GetAverageZ(p.X, p.Y);

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

                    if (canFit)
                    {
                        Puke puke = new Puke();
                        puke.Map = pm.Map;
                        puke.Location = p;
                    }
                    /*else
                        pm.SendMessage( "your puke won't fit!" ); /* Debug testing */
                    break;
                case 27:
                    pm.PlaySound(315);
                    pm.Say("*frappe*");
                    if (!pm.Mounted)
                        pm.Animate(31, 5, 1, true, false, 0);
                    break;
                case 28:
                    pm.PlaySound(pm.Female ? 814 : 1088);
                    pm.Say("*ahhhh!*");
                    break;
                case 29:
                    pm.PlaySound(pm.Female ? 815 : 1089);
                    pm.Say("*chute!*");
                    break;
                case 30:
                    pm.PlaySound(pm.Female ? 816 : 1090);
                    pm.Say("*pfff!*");
                    break;
                case 31:
                    pm.PlaySound(948);
                    pm.Say("*giffle*");
                    if (!pm.Mounted)
                        pm.Animate(11, 5, 1, true, false, 0);
                    break;
                case 32:
                    pm.PlaySound(pm.Female ? 817 : 1091);
                    pm.Say("*atchoum!*");
                    if (!pm.Mounted)
                        pm.Animate(32, 5, 1, true, false, 0);
                    break;
                case 33:
                    pm.PlaySound(pm.Female ? 818 : 1092);
                    pm.Say("*snif!*");
                    if (!pm.Mounted)
                        pm.Animate(34, 5, 1, true, false, 0);
                    break;
                case 34:
                    pm.PlaySound(pm.Female ? 819 : 1093);
                    pm.Say("*ronfle*");
                    break;
                case 35:
                    pm.PlaySound(pm.Female ? 820 : 1094);
                    pm.Say("*crache*");
                    if (!pm.Mounted)
                        pm.Animate(6, 5, 1, true, false, 0);
                    break;
                case 36:
                    pm.PlaySound(792);
                    pm.Say("*tire la langue*");
                    break;
                case 37:
                    pm.PlaySound(874);
                    pm.Say("*tape des pieds*");
                    if (!pm.Mounted)
                        pm.Animate(38, 5, 1, true, false, 0);
                    break;
                case 38:
                    pm.PlaySound(pm.Female ? 821 : 1095);
                    pm.Say("*siffle*");
                    if (!pm.Mounted)
                        pm.Animate(5, 5, 1, true, false, 0);
                    break;
                case 39:
                    pm.PlaySound(pm.Female ? 783 : 1054);
                    pm.Say("*felicite*");
                    break;
                case 40:
                    pm.PlaySound(pm.Female ? 822 : 1096);
                    pm.Say("*baille*");
                    if (!pm.Mounted)
                        pm.Animate(17, 5, 1, true, false, 0);
                    break;
                case 41:
                    pm.PlaySound(pm.Female ? 823 : 1097);
                    pm.Say("*ouais!*");
                    break;
                case 42:
                    pm.PlaySound(pm.Female ? 824 : 1098);
                    pm.Say("*crie*");
                    break;
            }
        }
コード例 #5
0
ファイル: RustyNails.cs プロジェクト: greeduomacro/vivre-uo
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int val = info.ButtonID - 1;
            if (val < 0)
                return;

            Mobile from = m_From;
            Mobile victim = m_Suffer;
            BaseVoodooDoll voodoodoll = m_Doll;
            int type = val % 15;
            int index = val / 15;

            string frommsg = "Vous piquez ";
            string victimmsg = "*Vous ressentez une douleur ";
            string publicmsg = null;
            int sound = victim.Female ? 814 : 1088;

            switch (index)
            {
                default: break;
                case 1:
                    {
                        frommsg += "son bras";
                        victimmsg += "au bras*";
                        publicmsg = "*Se prend le bras*";
                        victim.Animate(120, 5, 1, true, false, 0);

                        break;
                    }
                case 2:
                    {
                        frommsg += "sa main";
                        victimmsg += "à la main*";
                        if (from.Skills[SkillName.Anatomy].Value > Utility.Random(200))
                        {
                            Item item = victim.FindItemOnLayer(Layer.OneHanded);
                            if (item != null)
                            {
                                item.MoveToWorld(victim.Location);
                                publicmsg = "*Lâche ce qu'il tient sous la douleur*";
                                if (!victim.Mounted)
                                    victim.Animate(120, 5, 1, true, false, 0);
                            }
                            else
                                publicmsg = "*Se prend la main*";
                        }
                        else
                            publicmsg = "*Se prend le bras*";
                        break;
                    }
                case 3:
                    {
                        frommsg += "sa cuisse";
                        victimmsg += "à la cuisse*";
                        publicmsg = "*boite légèrement*";
                        break;
                    }
                case 4:
                    {
                        frommsg += "son pied";
                        victimmsg += "au pied*";
                        publicmsg = "*Sautille*";
                        if (!victim.Mounted)
                            victim.Animate(25, 5, 1, true, true, 3);
                        if (from.Skills[SkillName.Anatomy].Value > Utility.Random(150))
                        {
                            victim.CantWalk = true;
                            Timer.DelayCall(TimeSpan.FromSeconds(3), ChangeWalk, victim);
                        }
                        break;
                    }
                case 5:
                    {
                        frommsg += "son ventre";
                        victimmsg += "au ventre*";
                        if (from.Skills[SkillName.Anatomy].Value > Utility.Random(80))
                        {
                            sound = victim.Female ? 813 : 1087;

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

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

                            if (canFit)
                            {
                                Puke puke = new Puke();
                                puke.Map = victim.Map;
                                puke.Location = p;
                            }
                        }
                        else
                            publicmsg = "*Se tient le ventre*";
                        if (!victim.Mounted)
                            victim.Animate(32, 5, 1, true, false, 0);
                        break;
                    }
                case 6:
                    {
                        frommsg += "son dos";
                        victimmsg += "Au dos*";
                        publicmsg = "*Courbe l'échine*";
                        if (!victim.Mounted)
                            victim.Animate(32, 5, 1, true, true, 3);
                        break;
                    }
                case 7:
                    {
                        frommsg += "son nez";
                        victimmsg += "au nez*";
                        publicmsg = "*Éternue bruyamment*";
                        sound = victim.Female ? 817 : 1091;
                        if (!victim.Mounted)
                            victim.Animate(32, 5, 1, true, false, 0);
                        break;
                    }
                case 8:
                    {
                        frommsg += "ses yeux";
                        victimmsg += "aux yeux*";
                        publicmsg = "*Pleure abondamment*";
                        sound = victim.Female ? 787 : 1058;
                        break;
                    }
                case 9:
                    {
                        frommsg += "sa bouche";
                        victimmsg += "aux lèvres*";
                        publicmsg = "*Ses lèvres se closent*";
                        sound = victim.Female ? 784 : 1055;
                        if (!victim.Mounted)
                            victim.Animate(33, 5, 1, true, false, 0);
                        if (from.Skills[SkillName.Anatomy].Value > Utility.Random(150))
                        {
                            victim.Squelched = true;
                            Timer.DelayCall(TimeSpan.FromSeconds(5), ChangeSquelch, victim);
                        }
                        break;
                    }
                case 10:
                    {
                        frommsg += "ses fesses";
                        victimmsg += "aux fesses*";
                        publicmsg = "*Pète*";
                        sound = victim.Female ? 792 : 1064;
                        victim.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);
                        break;
                    }
            }
            from.CloseGump(typeof(EffectGump));

            from.SendMessage(frommsg);

            from.SendMessage("Vous perdez du Karma");
            from.Karma -= Utility.Random(100);

            victim.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, victimmsg, victim.NetState);

            if (publicmsg != null)
                victim.Say(publicmsg);

            victim.PlaySound(sound);

            voodoodoll.Charges--;

            if (voodoodoll.Charges <= 0)
            {
                from.SendMessage("La poupée perd ses cheveux, redevenant inutile");
                if (voodoodoll is VoodooDollFemale)
                    from.AddToBackpack(new PoupeeFemale());
                else
                    from.AddToBackpack(new PoupeeMale());

                voodoodoll.Delete();
            }

        }
コード例 #6
0
        public void DoInjury(Injury inj)
        {
            if (m_Player == null || m_Player.Deleted)
            {
                Delete();
                return;
            }

            if (m_Player is PlayerMobile && (m_Player as PlayerMobile).RessSick)
                return;

            bool hasInjury = false;
            foreach (InjuryTimer iT in CurrentInjuries)
            {
                if (iT.Injury == inj)
                {
                    hasInjury = true;
                    continue;
                }
            }
            if (!hasInjury)
                return;

            switch (inj)
            {
                case Injury.Bloodied:
                    {
                        int dmg = Utility.RandomMinMax(1, 5);
                        if (m_Player.Hits - dmg < 1)
                            dmg = m_Player.Hits - (m_Player.Hits - 1);
                        m_Player.Damage(dmg);
                        Blood newBlood = new Blood();
                        newBlood.MoveToWorld(m_Player.Location, m_Player.Map);
                        m_Player.SendMessage(37, "You're bleeding.");
                        break;
                    }
                case Injury.BrokenBack:
                    {
                        int pMin = 120 - m_Player.StamMax - m_Player.ManaMax;
                        if (pMin < 15)
                            pMin = 15;
                        XmlParalyze newParalysis = new XmlParalyze(pMin);
                        newParalysis.Name = "Injury Paralysis";
                        XmlAttach.AttachTo(m_Player, newParalysis);
                        m_Player.SendMessage(37, "You are wracked with paralytic back spasms and cannot move!");
                        m_Player.Emote("*spasms!*");
                        break;
                    }
                case Injury.BrokenJaw:
                    {
                        ArrayList muteAtt = XmlAttach.FindAttachments(m_Player, typeof(XmlBackground));
                        bool attached = false;
                        foreach (XmlBackground att in muteAtt)
                        {
                            if (att.Background == BackgroundList.Mute)
                                attached = true;
                        }
                        if (!attached)
                        {
                            int muteTime = 180 - m_Player.StamMax - m_Player.ManaMax;
                            if (muteTime < 20)
                                muteTime = 20;
                            XmlBackground newMute = new XmlBackground(BackgroundList.Mute, 1, muteTime);
                            newMute.Name = "Injury Mute";
                            XmlAttach.AttachTo(m_Player, newMute);
                            m_Player.SendMessage(37, "Your jaw is broken, causing you great pain and rendering you unable to speak.");
                        }
                        break;
                    }
                case Injury.BrokenLeftArm:
                    {
                        Item LeftArmItem = m_Player.FindItemOnLayer(Layer.TwoHanded);
                        if (LeftArmItem != null && !LeftArmItem.Deleted && m_Player.Alive)
                        {
                            LeftArmItem.MoveToWorld(m_Player.Location, m_Player.Map);
                            m_Player.PlaySound(LeftArmItem.GetDropSound());
                            if (LeftArmItem.Name != null && LeftArmItem.Name != "")
                                m_Player.Emote("*drops " + LeftArmItem.Name + " due to " + (m_Player.Female ? "her" : "his") + " wounds*");
                        }
                        //Remainder is handled in PlayerMobile.cs
                        break;
                    }
                case Injury.BrokenLeftLeg:
                    {
                        ArrayList lameAtts = XmlAttach.FindAttachments(m_Player, typeof(XmlBackground));
                        bool attached = false;
                        foreach (XmlBackground att in lameAtts)
                        {
                            if (att.Background == BackgroundList.Lame)
                                attached = true;
                        }
                        if (!attached)
                        {
                            int lameTime = 100 - m_Player.StamMax - m_Player.ManaMax;
                            if (lameTime < 5)
                                lameTime = 5;
                            XmlBackground lameAtt = new XmlBackground(BackgroundList.Lame, 1, lameTime);
                            lameAtt.Name = "Injury Left Lame";
                            XmlAttach.AttachTo(m_Player, lameAtt);
                            m_Player.SendMessage(37, "Your left leg is broken, hindering your movement.");
                        }
                        break;
                    }
                case Injury.BrokenNeck:
                    {
                        if (Utility.RandomMinMax(1, 100) > Utility.RandomMinMax(1 + (m_Player.ManaMax / 2), 100 + m_Player.ManaMax))
                        {
                            int pMin = 120 - m_Player.StamMax - m_Player.ManaMax;
                            if (pMin < 15)
                                pMin = 15;
                            XmlParalyze parAtt = new XmlParalyze(pMin);
                            parAtt.Name = "Injury Paralysis Neck";
                            XmlAttach.AttachTo(m_Player, parAtt);
                            m_Player.SendMessage(37, "Your neck is broken, and your body is paralyzed with pain!");
                            m_Player.Emote("*spasms!*");
                        }
                        break;
                    }
                case Injury.BrokenRightArm:
                    {
                        Item RightArmItem = m_Player.FindItemOnLayer(Layer.OneHanded);
                        if (RightArmItem == null || RightArmItem.Deleted)
                            RightArmItem = m_Player.FindItemOnLayer(Layer.FirstValid);
                        if ((RightArmItem == null || RightArmItem.Deleted) && m_Player.FindItemOnLayer(Layer.TwoHanded) is BaseWeapon)
                            RightArmItem = m_Player.FindItemOnLayer(Layer.TwoHanded);

                        if (RightArmItem != null && !RightArmItem.Deleted && m_Player.Alive)
                        {
                            RightArmItem.MoveToWorld(m_Player.Location, m_Player.Map);
                            m_Player.PlaySound(RightArmItem.GetDropSound());
                            if (RightArmItem.Name != null && RightArmItem.Name != "")
                                m_Player.Emote("*drops " + RightArmItem.Name + " due to " + (m_Player.Female ? "her" : "his") + " wounds*");
                        }
                        //Remainder is handled in PlayerMobile.cs
                        break;
                    }
                case Injury.BrokenRightLeg:
                    {
                        ArrayList lameAtts = XmlAttach.FindAttachments(m_Player, typeof(XmlBackground));
                        bool attached = false;
                        foreach (XmlBackground att in lameAtts)
                        {
                            if (att.Background == BackgroundList.Lame)
                                attached = true;
                        }
                        if (!attached)
                        {
                            int lameTime = 100 - m_Player.StamMax - m_Player.ManaMax;
                            if (lameTime < 5)
                                lameTime = 5;
                            XmlBackground lameAtt = new XmlBackground(BackgroundList.Lame, 1, lameTime);
                            lameAtt.Name = "Injury Right Lame";
                            XmlAttach.AttachTo(m_Player, lameAtt);
                            m_Player.SendMessage(37, "Your right leg is broken, hindering your movement.");
                        }
                        break;
                    }
                case Injury.Bruised:
                    {
                        bool alreadyBruised = false;
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.ToLower().Contains("bruise"))
                            {
                                alreadyBruised = true;
                                continue;
                            }
                        }
                        if (!alreadyBruised)
                        {
                            int bruiseTime = 180 - m_Player.StamMax - m_Player.ManaMax;
                            if (bruiseTime < 20)
                                bruiseTime = 20;
                            XmlHits bruising = new XmlHits(Utility.RandomMinMax(1, 10) * -1, bruiseTime);
                            bruising.Name = "Bruise";
                            XmlAttach.AttachTo(m_Player, bruising);
                            m_Player.SendMessage("You are badly bruised.");
                        }
                        break;
                    }
                case Injury.DeepCut:
                    {
                        int HPLoss = m_Player.HitsMax / Utility.RandomMinMax(10, 20);

                        if (m_Player.Hits - HPLoss <= 0)
                            break;
                        else if ( m_Player.Hits - HPLoss > 0 )
                        {
                            m_Player.Damage(HPLoss);
                            m_Player.SendMessage(37, "You have been cut deeply, and continue to bleed.");
                            Blood newBlood = new Blood();
                            newBlood.MoveToWorld(m_Player.Location, m_Player.Map);
                            m_Player.PlaySound(0x050);
                        }
                        break;
                    }
                case Injury.Exhausted:
                    {
                        int StamLoss = 0;
                        if (m_Player is PlayerMobile)
                        {
                            double numerator = m_Player.StamMax;
                            StamLoss = (int)(numerator / (m_Player as PlayerMobile).Level);
                        }
                        else
                            StamLoss = Utility.Random(1, 10);
                        if (m_Player.StamMax - StamLoss < 1)
                            StamLoss = m_Player.Stam - 1;
                        m_Player.Stam -= StamLoss;
                        if(Utility.RandomMinMax(1,100) > 90)
                            m_Player.SendMessage(37, "You are exhausted, drained of " + StamLoss.ToString() + " stamina.");
                        break;
                    }
                case Injury.FracturedLeftArm:
                    {
                        //Handled in BaseWeapon and BaseShield.cs
                        break;
                    }
                case Injury.FracturedLeftLeg:
                    {
                        if (Utility.RandomBool() && m_Player.Stam - 1 > 0)
                            m_Player.Stam--;

                        //Handled in PlayerMobile.cs
                        break;
                    }
                case Injury.FracturedRibs:
                    {
                        int damage = Utility.RandomMinMax(1, 10);
                        if (m_Player.Hits - damage > 0)
                        {
                            m_Player.Damage(damage);
                            if(Utility.RandomMinMax(1,100) < 25)
                                m_Player.SendMessage(37, "Your ribs are fractured, making movement painful and even debilitating!");
                        }
                        break;
                    }
                case Injury.FracturedRightArm:
                    {
                        //Handled in BaseWeapon.cs
                        break;
                    }
                case Injury.FracturedRightLeg:
                    {
                        if (Utility.RandomBool() && m_Player.Stam - 1 > 0)
                            m_Player.Stam--;

                        //Handled in PlayerMobile.cs
                        break;
                    }
                case Injury.FracturedSkull:
                    {
                        m_Player.Mana = 0;
                        int intLoss = (-1 * (m_Player.RawInt - m_Player.ManaMax)) / 10;
                        if(intLoss > 0)
                            intLoss = 0;
                        XmlAttach.AttachTo(m_Player, new XmlInt(intLoss, InjuryLevel * 100));
                        m_Player.SendMessage(37, "Your skull is fractured, causing you to feel dizzy and confused!");
                        break;
                    }
                case Injury.InternalBleeding:
                    {
                        int HPLoss = m_Player.HitsMax / Utility.RandomMinMax(10, 20);
                        if (m_Player.Hits - HPLoss > 0)
                        {
                            m_Player.Damage(HPLoss);
                        }
                        m_Player.SendMessage(37, "You are bleeding internally!");

                        m_Player.PlaySound(m_Player.Female ? 813 : 1087);
                        m_Player.Say("*pukes*");
                        if (!m_Player.Mounted)
                            m_Player.Animate(32, 5, 1, true, false, 0);
                        Point3D p = new Point3D(m_Player.Location);
                        switch (m_Player.Direction)
                        {
                            case Direction.North:
                                p.Y--; break;
                            case Direction.South:
                                p.Y++; break;
                            case Direction.East:
                                p.X++; break;
                            case Direction.West:
                                p.X--; break;
                            case Direction.Right:
                                p.X++; p.Y--; break;
                            case Direction.Down:
                                p.X++; p.Y++; break;
                            case Direction.Left:
                                p.X--; p.Y++; break;
                            case Direction.Up:
                                p.X--; p.Y--; break;
                            default:
                                break;
                        }
                        p.Z = m_Player.Map.GetAverageZ(p.X, p.Y);

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

                        if (canFit)
                        {
                            Puke puke = new Puke();
                            puke.Name = "blood";
                            puke.Hue = Utility.RandomList(1157, 1609, 2206, 2778, 2795);
                            puke.Map = m_Player.Map;
                            puke.Location = p;
                        }

                        if (CombatSystemAttachment.GetCSA(m_Player).CruiseControl)
                        {
                            CombatSystemAttachment.GetCSA(m_Player).DisableAutoCombat();
                            m_Player.SendMessage("It is difficult for you focus on combat right now.");
                        }

                        break;
                    }
                case Injury.LaceratedTorso:
                    {
                        int HPLoss = m_Player.HitsMax / Utility.RandomMinMax(10, 20);
                        if (m_Player.Hits - HPLoss > 0)
                        {
                            m_Player.Damage(HPLoss);
                            m_Player.SendMessage(37, "You are severely injured!");
                        }
                        break;
                    }
                case Injury.MajorConcussion:
                    {
                        m_Player.Mana = 0;
                        if (m_Player.Warmode)
                            m_Player.Warmode = false;

                        if (m_Player.Mount != null && !(m_Player.Mount as BaseCreature).Deleted && Utility.RandomMinMax(1, 100) > ( 50 - ( m_Player.HitsMax - m_Player.Hits)))
                        {
                            IMount mount = m_Player.Mount;
                            mount.Rider = null;

                            if (m_Player is PlayerMobile)
                            {
                                PlayerMobile pm = m_Player as PlayerMobile;

                                if (pm.DismountedTimer != null)
                                    pm.DismountedTimer.Stop();

                                pm.DismountedTimer = new Misc.Dismount.DismountTimer(pm, 1);
                                pm.DismountedTimer.Start();

                                Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), pm, pm, Utility.RandomMinMax(1, 6));
                                pm.Emote("*falls from {0} mount*", pm.Female == true ? "her" : "his");
                            }
                            else
                            {
                                m_Player.Emote("*falls off " + (m_Player.Female == true ? "her" : "his") + " mount!*");
                                if (m_Player is Soldier)
                                    (mount as BaseCreature).Kill();
                            }
                        }

                        if (Utility.RandomMinMax(1, 100) > 95)
                        {
                            CombatSystemAttachment csa = CombatSystemAttachment.GetCSA(m_Player);
                            csa.DoTrip(1);
                        }

                        if (Utility.RandomMinMax(1, 100) > 25)
                            XmlAttach.AttachTo(m_Player, new XmlBackground(BackgroundList.Deaf, 1, 5));

                        if(Utility.RandomMinMax(1,100) > 95)
                            m_Player.SendMessage(37, "You are severely concussed!");

                        break;
                    }
                case Injury.MassiveBleeding:
                    {
                        foreach (Item item in m_Player.Items)
                        {
                            if (Utility.RandomMinMax(1, 100) > 75)
                            {
                                XmlAttach.AttachTo(item, new XmlHue(1157, 30));
                                continue;
                            }
                        }

                        XmlAttach.AttachTo(m_Player, new XmlHue(2419, 30));

                        XmlAttach.AttachTo(m_Player, new XmlHits(-1 * Utility.RandomMinMax(1, InjuryLevel), InjuryLevel * 100));
                        Blood newBlood = new Blood();
                        newBlood.MoveToWorld(m_Player.Location, m_Player.Map);

                        m_Player.Mana = 0;

                        break;
                    }
                case Injury.MinorConcussion:
                    {
                        m_Player.Mana = 0;
                        switch(Utility.RandomMinMax(1,3))
                        {
                            case 1:
                                if (m_Player.Warmode)
                                {
                                    m_Player.Warmode = false;
                                    if(Utility.RandomMinMax(1,100) > 90)
                                        m_Player.SendMessage(37, "You are concussed!");
                                }
                                break;
                            case 2:
                                {
                                    if (m_Player.Mount != null && !(m_Player.Mount as BaseCreature).Deleted && Utility.RandomMinMax(1, 100) > ( 50 - ( m_Player.HitsMax - m_Player.Hits)))
                                    {
                                        IMount mount = m_Player.Mount;
                                        mount.Rider = null;

                                        if (m_Player is PlayerMobile)
                                        {
                                            PlayerMobile pm = m_Player as PlayerMobile;

                                            if (pm.DismountedTimer != null)
                                                pm.DismountedTimer.Stop();

                                            pm.DismountedTimer = new Misc.Dismount.DismountTimer(pm, 1);
                                            pm.DismountedTimer.Start();

                                            Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), pm, pm, Utility.RandomMinMax(1, 6));
                                            pm.Emote("*falls from {0} mount*", pm.Female == true ? "her" : "his");
                                        }
                                        else
                                        {
                                            m_Player.Emote("*falls off " + (m_Player.Female == true ? "her" : "his") + " mount!*");
                                            if (m_Player is Soldier)
                                                (mount as BaseCreature).Kill();
                                        }
                                    }

                                    break;
                                }
                            case 3:
                                {
                                    if (Utility.RandomMinMax(1, 100) > 95)
                                    {
                                        CombatSystemAttachment csa = CombatSystemAttachment.GetCSA(m_Player);
                                        csa.DoTrip(1);
                                        m_Player.SendMessage(37, "You are concussed!");
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                case Injury.MinorCut:
                    {
                        int dmg = Utility.RandomMinMax(1, 3);
                        if (m_Player.Hits - dmg > 0)
                        {
                            m_Player.Damage(dmg);
                            m_Player.SendMessage(37, "You have been cut, and are still bleeding.");
                        }

                        break;
                    }
                case Injury.BrokenSkull:
                    {
                        m_Player.Mana = 0;
                        int intLoss = (-1 * (m_Player.RawInt - m_Player.ManaMax)) / 10;
                        if (intLoss > 0)
                            intLoss = 0;
                        XmlAttach.AttachTo(m_Player, new XmlInt(intLoss, InjuryLevel * 100));

                        new EyeRaking.EyeRakingTimer(m_Player, 10);
                        m_Player.SendMessage("You have been blinded!");

                        m_Player.SendMessage(37, "Your skull is broken, causing your perception to fade in and out!");

                        break;
                    }
                case Injury.Winded:
                    {
                        m_Player.Mana -= Utility.RandomMinMax(1, 10);

                        int stamDmg = Utility.RandomMinMax(1, 5);
                        if (m_Player.Stam - stamDmg > 0)
                            m_Player.Stam -= stamDmg;
                        else
                            m_Player.Stam = 1;

                        m_Player.SendMessage(37, "You're winded.");
                        break;
                    }
                default: break;
            }
        }
コード例 #7
0
        public bool DoDisease(Disease dis)
        {
            if (m_Player == null || m_Player.Deleted || !m_Player.Alive || (m_Player is PlayerMobile && (m_Player as PlayerMobile).RessSick))
                return false;

            if (m_Player.Map == Map.Internal)
                return false;

            if (!HasDisease(dis))
                return false;

            switch (dis)
            {
                case Disease.Influenza:
                    {
                        List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[Influenza]"))
                                removeMod.Add(mod);

                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if(m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        int amount = (m_Player.StamMax / 2) * -1;
                        m_Player.Emote("*sweats profusely*");
                        XmlStam influenza = new XmlStam(amount, 300);
                        influenza.Name = " [Disease] [Influenza] ";
                        XmlAttach.AttachTo(m_Player, influenza);
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.HundredDaysCough:
                    {
                        List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[HundredDaysCough]"))
                                removeMod.Add(mod);

                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if(m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        m_Player.Emote("*cough cough cough!*");
                        if (m_Player.Female)
                        {
                            if (Utility.RandomBool())
                                m_Player.PlaySound(0x311);
                            else
                                m_Player.PlaySound(0x312);
                        }
                        else
                        {
                            if (Utility.RandomBool())
                                m_Player.PlaySound(0x420);
                            else
                                m_Player.PlaySound(0x421);
                        }
                        XmlStam cough = new XmlStam(-5, 60);
                        XmlHits ache = new XmlHits(-5, 300);
                        cough.Name = " [Disease] [HundredDaysCough] [1] ";
                        ache.Name = " [Disease] [HundredDaysCough] [2] ";
                        XmlAttach.AttachTo(m_Player, cough);
                        XmlAttach.AttachTo(m_Player, ache);
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.Diptheria:
                    {
                         List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[Diptheria]"))
                                removeMod.Add(mod);

                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if(m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        int amount = (m_Player.Dex / 3) * -1;
                        m_Player.Emote("*drools over " + (m_Player.Female ? "her" : "his") + " swollen neck*");
                        XmlDex diptheria = new XmlDex(amount, 600);
                        diptheria.Name = " [Disease] [Diptheria] ";
                        XmlAttach.AttachTo(m_Player, diptheria);
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.Dysentery:
                    {
                         List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[Dysentery]"))
                                removeMod.Add(mod);

                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if(m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        m_Player.Emote("*doubles over in pain!*");
                        m_Player.Hunger -= 10;
                        if (m_Player.Hunger < 0)
                            m_Player.Hunger = 0;
                        m_Player.Thirst -= 10;
                        if (m_Player.Thirst < 0)
                            m_Player.Thirst = 0;
                        XmlHits dysentery = new XmlHits(-10, 3600);
                        dysentery.Name = " [Disease] [Dysentery] ";
                        XmlAttach.AttachTo(m_Player, dysentery);
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.Consumption:
                    {
                         List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[Consumption]"))
                                removeMod.Add(mod);

                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if(m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        m_Player.Emote("*cough cough cough!*");
                        if (m_Player.Female)
                        {
                            if(Utility.RandomBool())
                                m_Player.PlaySound(0x311);
                            else
                                m_Player.PlaySound(0x312);
                        }
                        else
                        {
                            if (Utility.RandomBool())
                                m_Player.PlaySound(0x420);
                            else
                                m_Player.PlaySound(0x421);
                        }

                        int hitsamount = (m_Player.HitsMax / 4) * -1;
                        int stamamount = (m_Player.StamMax / 4) * -1;

                        XmlHits consumption1 = new XmlHits(hitsamount, 1200);
                        XmlStam consumption2 = new XmlStam(stamamount, 1200);
                        consumption1.Name = " [Disease] [Consumption] [1] ";
                        consumption2.Name = " [Disease] [Consumption] [2] ";
                        XmlAttach.AttachTo(m_Player, consumption1);
                        XmlAttach.AttachTo(m_Player, consumption2);

                        if (!m_Player.Mounted)
                            m_Player.Animate(32, 5, 1, true, false, 0);
                        Point3D p = new Point3D(m_Player.Location);
                        switch (m_Player.Direction)
                        {
                            case Direction.North:
                                p.Y--; break;
                            case Direction.South:
                                p.Y++; break;
                            case Direction.East:
                                p.X++; break;
                            case Direction.West:
                                p.X--; break;
                            case Direction.Right:
                                p.X++; p.Y--; break;
                            case Direction.Down:
                                p.X++; p.Y++; break;
                            case Direction.Left:
                                p.X--; p.Y++; break;
                            case Direction.Up:
                                p.X--; p.Y--; break;
                            default:
                                break;
                        }
                        p.Z = m_Player.Map.GetAverageZ(p.X, p.Y);

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

                        if (canFit)
                        {
                            Puke puke = new Puke();
                            puke.Name = "blood";
                            puke.Hue = Utility.RandomList(1157, 1609, 2206, 2778, 2795);
                            puke.Map = m_Player.Map;
                            puke.Location = p;
                        }
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.AzhuranFever:
                    {
                        List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[AzhuranFever]"))
                                removeMod.Add(mod);
                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if (m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        m_Player.Emote("*sweats profusely!*");
                        if(m_Player is PlayerMobile)
                            HallucinationEffect.BeginHallucinating(m_Player as PlayerMobile, 120);
                        XmlHue yellowFever = new XmlHue(1052, 120);

                        int stamamount =(m_Player.StamMax / 3) * -1;
                        int stramount = (m_Player.Str / 4) * -1;
                        XmlStam azhuranStam = new XmlStam(stamamount, 60);
                        XmlStr azhuranStr = new XmlStr(stramount, 60);

                        yellowFever.Name = " [Disease] [AzhuranFever] [1] ";
                        azhuranStam.Name = " [Disease] [AzhuranFever] [2] ";
                        azhuranStr.Name = " [Disease] [AzhuranFever] [3] ";

                        XmlAttach.AttachTo(m_Player, yellowFever);
                        XmlAttach.AttachTo(m_Player, azhuranStam);
                        XmlAttach.AttachTo(m_Player, azhuranStr);
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.Bile:
                    {
                        List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[Bile]"))
                                removeMod.Add(mod);
                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if (m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        m_Player.Emote("*doubles over in pain, losing control of " + (m_Player.Female ? "her" : "his") + " bodily functions*");
                        m_Player.Hunger -= 20;
                        if (m_Player.Hunger < 0)
                            m_Player.Hunger = 0;
                        m_Player.Thirst -= 20;
                        if (m_Player.Thirst < 0)
                            m_Player.Thirst = 0;
                        XmlHits dysentery = new XmlHits(-20, 3600);
                        dysentery.Name = " [Disease] [Bile] ";
                        XmlAttach.AttachTo(m_Player, dysentery);

                        if (!m_Player.Mounted)
                            m_Player.Animate(32, 5, 1, true, false, 0);
                        Point3D p = new Point3D(m_Player.Location);
                        switch (m_Player.Direction)
                        {
                            case Direction.North:
                                p.Y--; break;
                            case Direction.South:
                                p.Y++; break;
                            case Direction.East:
                                p.X++; break;
                            case Direction.West:
                                p.X--; break;
                            case Direction.Right:
                                p.X++; p.Y--; break;
                            case Direction.Down:
                                p.X++; p.Y++; break;
                            case Direction.Left:
                                p.X--; p.Y++; break;
                            case Direction.Up:
                                p.X--; p.Y--; break;
                            default:
                                break;
                        }
                        p.Z = m_Player.Map.GetAverageZ(p.X, p.Y);

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

                        if (canFit)
                        {
                            Puke puke = new Puke();
                            puke.Name = "vomit";
                            puke.Hue = 2964;
                            puke.Map = m_Player.Map;
                            puke.Location = p;

                            if (m_Player.Female)
                                m_Player.PlaySound(0x32D);
                            else
                                m_Player.PlaySound(0x43F);
                        }
                        if (m_Player.Female)
                            m_Player.PlaySound(0x318);
                        else
                            m_Player.PlaySound(0x428);
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.Leprosy:
                    {
                        XmlAosAttribute leprosy = new XmlAosAttribute(AosAttribute.RegenHits, -25, 15);
                        leprosy.Name = " [Disease] [Leprosy] ";
                        XmlAttach.AttachTo(m_Player, leprosy);
                        Disfigurement++;
                        DiseaseMessage(dis);
                        return true;
                    }
                case Disease.TyreanDisease:
                    {
                        List<StatMod> removeMod = new List<StatMod>();
                        foreach (StatMod mod in m_Player.StatMods)
                        {
                            if (mod.Name.Contains("[TyreanDisease]"))
                                removeMod.Add(mod);
                        }

                        for (int i = 0; i < removeMod.Count; i++)
                            if (m_Player.StatMods.Contains(removeMod[i]))
                                m_Player.StatMods.Remove(removeMod[i]);

                        XmlAosAttribute tyrean = new XmlAosAttribute(AosAttribute.RegenHits, -50, 15);
                        tyrean.Name = " [Disease] [TyreanDisease] ";
                        XmlAttach.AttachTo(m_Player, tyrean);

                        int amount = (m_Player.Int / 2) * -1;
                        XmlInt madness = new XmlInt(amount, 600);
                        madness.Name = " [Disease] [TyreanDisease] ";
                        XmlAttach.AttachTo(m_Player, madness);

                        Disfigurement++;
                        DiseaseMessage(dis);
                        return true;
                    }
            }

            return false;
        }