Exemple #1
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            base.OnGotMeleeAttack(attacker);

            if (attacker != m_LastQuester)
            {
                if (attacker is BaseCreature)
                {
                    BaseCreature bc = (BaseCreature)attacker;
                    if (bc.ControlMaster != m_LastQuester && bc.ControlMaster != null)
                    {
                        if (bc.ControlMaster is PlayerMobile)
                        {
                            PlayerMobile cm = (PlayerMobile)bc.ControlMaster;
                            QuestSystem  qs = cm.Quest;

                            if (qs is TheGraveDiggerQuest)
                            {
                                QuestObjective obj = qs.FindObjective(typeof(FindYeastObjective));

                                if (obj != null && !obj.Completed)
                                {
                                    m_LastQuester = cm;
                                    cm.SendMessage("農民開始大聲吆喝起來.");
                                    switch (Utility.Random(3))
                                    {
                                    case 0:
                                        this.Say("救命! 救命! 我被人攻擊了!");
                                        break;

                                    case 1:
                                        this.Say("啊哈! 你竟然想在我的地盤上搞鬼,你太年輕了,小鬼!");
                                        break;

                                    case 2:
                                        this.Say("你有病啊,以爲我只有一個人嗎!");
                                        break;
                                    }

                                    int x1 = cm.X + Utility.RandomMinMax(3, 10);
                                    int y1 = cm.Y - Utility.RandomMinMax(3, 10);
                                    int x2 = cm.X - Utility.RandomMinMax(3, 10);
                                    int y2 = cm.Y + Utility.RandomMinMax(3, 10);

                                    FarmHand fh1 = new FarmHand();
                                    fh1.X         = x1;
                                    fh1.Y         = y1;
                                    fh1.Z         = cm.Z;
                                    fh1.Map       = cm.Map;
                                    fh1.Combatant = cm;
                                    World.AddMobile(fh1);

                                    fh1.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                                    FarmHand fh2 = new FarmHand();
                                    fh2.X         = x2;
                                    fh2.Y         = y2;
                                    fh2.Z         = cm.Z;
                                    fh2.Map       = cm.Map;
                                    fh2.Combatant = cm;
                                    World.AddMobile(fh2);

                                    fh2.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                                    cm.PlaySound(510);
                                }
                            }
                        }
                    }
                }
                else if (attacker is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)attacker;
                    QuestSystem  qs = pm.Quest;

                    if (qs is TheGraveDiggerQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(FindYeastObjective));

                        if (obj != null && !obj.Completed)
                        {
                            m_LastQuester = pm;
                            pm.SendMessage("農民開始大聲吆喝起來.");
                            switch (Utility.Random(3))
                            {
                            case 0:
                                this.Say("救命! 救命! 我被人攻擊了!");
                                break;

                            case 1:
                                this.Say("啊哈! 你竟然想在我的地盤上搞鬼,你太年輕了,小鬼!");
                                break;

                            case 2:
                                this.Say("你有病啊,以爲我只有一個人嗎!");
                                break;
                            }

                            int x1 = pm.X + Utility.RandomMinMax(3, 10);
                            int y1 = pm.Y - Utility.RandomMinMax(3, 10);
                            int x2 = pm.X - Utility.RandomMinMax(3, 10);
                            int y2 = pm.Y + Utility.RandomMinMax(3, 10);

                            FarmHand fh1 = new FarmHand();
                            fh1.X         = x1;
                            fh1.Y         = y1;
                            fh1.Z         = pm.Z;
                            fh1.Map       = pm.Map;
                            fh1.Combatant = pm;
                            World.AddMobile(fh1);

                            fh1.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                            FarmHand fh2 = new FarmHand();
                            fh2.X         = x2;
                            fh2.Y         = y2;
                            fh2.Z         = pm.Z;
                            fh2.Map       = pm.Map;
                            fh2.Combatant = pm;
                            World.AddMobile(fh2);

                            fh2.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                            pm.PlaySound(510);
                        }
                    }
                }
            }
        }
Exemple #2
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            base.OnGotMeleeAttack(attacker);

            if (attacker != m_LastQuester)
            {
                if (attacker is BaseCreature)
                {
                    BaseCreature bc = (BaseCreature)attacker;
                    if (bc.ControlMaster != m_LastQuester && bc.ControlMaster != null)
                    {
                        if (bc.ControlMaster is PlayerMobile)
                        {
                            PlayerMobile cm = (PlayerMobile)bc.ControlMaster;
                            QuestSystem  qs = cm.Quest;

                            if (qs is TheGraveDiggerQuest)
                            {
                                QuestObjective obj = qs.FindObjective(typeof(FindYeastObjective));

                                if (obj != null && !obj.Completed)
                                {
                                    m_LastQuester = cm;
                                    cm.SendMessage("The yeast farmer calls for help.");
                                    switch (Utility.Random(3))
                                    {
                                    case 0:
                                        this.Say("HELP! HELP! I am being attacked!");
                                        break;

                                    case 1:
                                        this.Say("Ahhh! So you want to attack a farmer... Get'em Boys!");
                                        break;

                                    case 2:
                                        this.Say("Ill show you how we handle things around here!");
                                        break;
                                    }

                                    int x1 = cm.X + Utility.RandomMinMax(3, 10);
                                    int y1 = cm.Y - Utility.RandomMinMax(3, 10);
                                    int x2 = cm.X - Utility.RandomMinMax(3, 10);
                                    int y2 = cm.Y + Utility.RandomMinMax(3, 10);

                                    FarmHand fh1 = new FarmHand();
                                    fh1.X         = x1;
                                    fh1.Y         = y1;
                                    fh1.Z         = cm.Z;
                                    fh1.Map       = cm.Map;
                                    fh1.Combatant = cm;
                                    World.AddMobile(fh1);

                                    fh1.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                                    FarmHand fh2 = new FarmHand();
                                    fh2.X         = x2;
                                    fh2.Y         = y2;
                                    fh2.Z         = cm.Z;
                                    fh2.Map       = cm.Map;
                                    fh2.Combatant = cm;
                                    World.AddMobile(fh2);

                                    fh2.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                                    cm.PlaySound(510);
                                }
                            }
                        }
                    }
                }
                else if (attacker is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)attacker;
                    QuestSystem  qs = pm.Quest;

                    if (qs is TheGraveDiggerQuest)
                    {
                        QuestObjective obj = qs.FindObjective(typeof(FindYeastObjective));

                        if (obj != null && !obj.Completed)
                        {
                            m_LastQuester = pm;
                            pm.SendMessage("The yeast farmer calls for help.");
                            switch (Utility.Random(3))
                            {
                            case 0:
                                this.Say("HELP! HELP! I am being attacked!");
                                break;

                            case 1:
                                this.Say("Ahhh! So you want to attack a farmer... Get'em Boys!");
                                break;

                            case 2:
                                this.Say("Ill show you how we handle things around here!");
                                break;
                            }

                            int x1 = pm.X + Utility.RandomMinMax(3, 10);
                            int y1 = pm.Y - Utility.RandomMinMax(3, 10);
                            int x2 = pm.X - Utility.RandomMinMax(3, 10);
                            int y2 = pm.Y + Utility.RandomMinMax(3, 10);

                            FarmHand fh1 = new FarmHand();
                            fh1.X         = x1;
                            fh1.Y         = y1;
                            fh1.Z         = pm.Z;
                            fh1.Map       = pm.Map;
                            fh1.Combatant = pm;
                            World.AddMobile(fh1);

                            fh1.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                            FarmHand fh2 = new FarmHand();
                            fh2.X         = x2;
                            fh2.Y         = y2;
                            fh2.Z         = pm.Z;
                            fh2.Map       = pm.Map;
                            fh2.Combatant = pm;
                            World.AddMobile(fh2);

                            fh2.FixedParticles(14120, 10, 15, 5012, EffectLayer.Waist);

                            pm.PlaySound(510);
                        }
                    }
                }
            }
        }