public override void Accept()
        {
            base.Accept();

            AddConversation(
                new GenericConversation("Ok cool, go for it, kill the bunnies and be back for your reward")
                );

            AddObjective(new KillBunniesObjective());

            /* Create the rabbits */
            Point3D pt        = From.Location,
                    rabbitpos = new Point3D();

            int i;

            for (i = 0; i < 5; i++)
            {
                rabbitpos.X = pt.X + Utility.Random(6) - 3;
                rabbitpos.Y = pt.Y + Utility.Random(6) - 3;
                rabbitpos.Z = pt.Z;

                BobsRabbit br = new BobsRabbit();
                br.Home      = pt;
                br.RangeHome = 4;
                br.MoveToWorld(rabbitpos, Map.Trammel);
            }

            LoggedQuestSystem.questAccepted(From, (string)Name);
        }
Example #2
0
        public override void OnDeath(Container c)
        {
            Mobile       m  = this.FindMostRecentDamager(false);
            PlayerMobile pm = null;
            BobQuest     bq = null;

            bool ressurect = true;

            if (m is PlayerMobile)
            {
                pm = m as PlayerMobile;
            }
            else if (m is BaseCreature)
            {
                BaseCreature bc = m as BaseCreature;

                if (bc.Controlled == true)
                {
                    pm = bc.ControlMaster as PlayerMobile;
                }
            }

            if (pm != null)
            {
                bq = pm.Quest as BobQuest;
            }

            //Ok rabbit died by someone who's got the quest so it's all good
            if (bq != null)
            {
                if (bq.IsObjectiveInProgress(typeof(KillBunniesObjective)))
                {
                    ressurect = false;
                }
            }

            if (ressurect) //No marker or finished quest
            {
                BobsRabbit newrabbit = new BobsRabbit();

                Point3D nrpos = this.Location;

                nrpos.X += Utility.Random(8) - 4;
                nrpos.Y += Utility.Random(8) - 4;
                newrabbit.MoveToWorld(nrpos, Map.Trammel);

                if (pm != null)
                {
                    if (bq != null)
                    {
                        newrabbit.Say("You've killed enough rabbits don't you think ?");
                    }
                    else
                    {
                        //Look for the quest state
                        LoggedQuestState state = LoggedQuestSystem.getQuestState(pm, "Bunny Attack Quest");

                        //Switch on states
                        switch (state)
                        {
                        case LoggedQuestState.NOTINVOLVED:
                            this.Say("Stop it, go see bob if you want to play!");
                            break;

                        case LoggedQuestState.CANCELED:
                            this.Say("Stop it, you canceled, tough!");
                            break;

                        case LoggedQuestState.FINISHED:
                            this.Say("Stop it now, this is not your quest anymore");
                            break;

                        case LoggedQuestState.DECLINED:
                            this.Say("Stop it now, you declined, tough!");
                            break;

                        default:
                            break;
                        }
                    }
                }
            }

            base.OnDeath(c);
        }