Example #1
0
        public static void AppendEntranceReqs(Story story, string dungeonName, string[] reqString)
        {
            //if (DungeonManager.Dungeons[dungeonIndex].ScriptList.ContainsKey(2)) {


            StorySegment segment = new StorySegment();

            if (reqString.Length == 1)
            {
                string req   = GetRequirementString(reqString[0].Split(','));
                string start = req.Substring(0, 1).ToLower();
                segment.Action = Enums.StoryAction.Say;
                segment.AddParameter("Text", "Notice: In order to enter " + dungeonName + ", " + start + req.Substring(1, req.Length - 1));
                segment.AddParameter("Mugshot", "-1");
                segment.Parameters.Add("Speed", "0");
                segment.Parameters.Add("PauseLocation", "0");
                story.Segments.Add(segment);
                return;
            }
            else
            {
                segment.Action = Enums.StoryAction.Say;
                segment.AddParameter("Text", "Notice: You must meet certain requirements before entering " + dungeonName + ".");
                segment.AddParameter("Mugshot", "-1");
                segment.Parameters.Add("Speed", "0");
                segment.Parameters.Add("PauseLocation", "0");
                story.Segments.Add(segment);
            }



            for (int i = 0; i < reqString.Length; i++)
            {
                string req = GetRequirementString(reqString[i].Split(','));

                segment        = new StorySegment();
                segment.Action = Enums.StoryAction.Say;

                if (i == reqString.Length - 1)
                {
                    string start = req.Substring(0, 1).ToLower();
                    segment.AddParameter("Text", "Also, " + start + req.Substring(1, req.Length - 1));
                }
                else
                {
                    segment.AddParameter("Text", req + "..");
                }

                segment.AddParameter("Mugshot", "-1");
                segment.Parameters.Add("Speed", "0");
                segment.Parameters.Add("PauseLocation", "0");
                story.Segments.Add(segment);
            }


            //} else {
            //	return null;
            //}
        }
Example #2
0
        public static void AppendEntranceWarning(Story story, string dungeonName, string[] restrictionString)
        {
            //if (DungeonManager.Dungeons[dungeonIndex].ScriptList.ContainsKey(2)) {


            StorySegment segment = new StorySegment();

            if (restrictionString.Length == 1)
            {
                segment.Action = Enums.StoryAction.Say;
                segment.AddParameter("Text", "Caution!  " + GetWarningString(restrictionString[0].Split(',')));
                segment.AddParameter("Mugshot", "-1");
                segment.Parameters.Add("Speed", "0");
                segment.Parameters.Add("PauseLocation", "0");
                story.Segments.Add(segment);
                return;
            }
            else
            {
                segment.Action = Enums.StoryAction.Say;
                segment.AddParameter("Text", "Caution!  There are certain restrictions to entering " + dungeonName + ".");
                segment.AddParameter("Mugshot", "-1");
                segment.Parameters.Add("Speed", "0");
                segment.Parameters.Add("PauseLocation", "0");
                story.Segments.Add(segment);
            }



            for (int i = 0; i < restrictionString.Length; i++)
            {
                string warning = GetWarningString(restrictionString[i].Split(','));

                segment        = new StorySegment();
                segment.Action = Enums.StoryAction.Say;

                if (i == restrictionString.Length - 1)
                {
                    string start = warning.Substring(0, 1).ToLower();
                    segment.AddParameter("Text", "Also, " + start + warning.Substring(1, warning.Length - 1));
                }
                else
                {
                    segment.AddParameter("Text", warning + "..");
                }

                segment.AddParameter("Mugshot", "-1");
                segment.Parameters.Add("Speed", "0");
                segment.Parameters.Add("PauseLocation", "0");
                story.Segments.Add(segment);
            }


            //} else {
            //	return null;
            //}
        }
Example #3
0
        public static Story CreatePreDungeonStory(Client client, string param1, string param2, string param3, bool random)
        {
            Story story = new Story();

            StorySegment segment = new StorySegment();

            segment.Action = Enums.StoryAction.PlayerPadlock;
            segment.AddParameter("MovementState", "Lock");
            story.Segments.Add(segment);

            if (param3 == "")
            {
                //continuing a dungeon

                segment        = new StorySegment();
                segment.Action = Enums.StoryAction.AskQuestion;
                segment.AddParameter("Question", "Will you go on?");
                segment.AddParameter("SegmentOnYes", (story.Segments.Count + 2).ToString());
                segment.AddParameter("SegmentOnNo", (story.Segments.Count + 3).ToString());
                segment.AddParameter("Mugshot", "-1");
                story.Segments.Add(segment);
            }
            else
            {
                string dungeonName       = "";
                string reqString         = "";
                string restrictionString = "";

                if (param3.IsNumeric())
                {
                    //official dungeon

                    dungeonName = DungeonManager.Dungeons[param3.ToInt() - 1].Name;

                    if (DungeonManager.Dungeons[param3.ToInt() - 1].ScriptList.ContainsKey(1))
                    {
                        reqString = DungeonManager.Dungeons[param3.ToInt() - 1].ScriptList[1];
                    }

                    if (DungeonManager.Dungeons[param3.ToInt() - 1].ScriptList.ContainsKey(2))
                    {
                        restrictionString = DungeonManager.Dungeons[param3.ToInt() - 1].ScriptList[2];
                    }
                }
                else
                {
                    //unofficial dungeon

                    dungeonName       = param3.Split(':')[0];
                    reqString         = param3.Split(':')[1];
                    restrictionString = param3.Split(':')[2];
                }


                if (CheckDungeonRequirements(client, reqString.Split(';')))
                {
                    if (restrictionString != "")
                    {
                        AppendEntranceWarning(story, dungeonName, restrictionString.Split(';'));

                        segment        = new StorySegment();
                        segment.Action = Enums.StoryAction.AskQuestion;
                        segment.AddParameter("Question", "Will you enter " + dungeonName + "?");
                        segment.AddParameter("SegmentOnYes", "3");
                        segment.AddParameter("SegmentOnNo", (story.Segments.Count + 4).ToString());
                        segment.AddParameter("Mugshot", "-1");
                        story.Segments.Insert(1, segment);


                        segment        = new StorySegment();
                        segment.Action = Enums.StoryAction.AskQuestion;
                        segment.AddParameter("Question", "Is that OK?");
                        segment.AddParameter("SegmentOnYes", (story.Segments.Count + 2).ToString());
                        segment.AddParameter("SegmentOnNo", (story.Segments.Count + 3).ToString());
                        segment.AddParameter("Mugshot", "-1");
                        story.Segments.Add(segment);
                    }
                    else
                    {
                        segment        = new StorySegment();
                        segment.Action = Enums.StoryAction.AskQuestion;
                        segment.AddParameter("Question", "Will you enter " + dungeonName + "?");
                        segment.AddParameter("SegmentOnYes", (story.Segments.Count + 2).ToString());
                        segment.AddParameter("SegmentOnNo", (story.Segments.Count + 3).ToString());
                        segment.AddParameter("Mugshot", "-1");
                        story.Segments.Insert(1, segment);
                    }
                }
                else
                {
                    AppendEntranceReqs(story, dungeonName, reqString.Split(';'));

                    segment        = new StorySegment();
                    segment.Action = Enums.StoryAction.GoToSegment;
                    segment.AddParameter("Segment", (story.Segments.Count + 3).ToString());

                    story.Segments.Add(segment);

                    segment        = new StorySegment();
                    segment.Action = Enums.StoryAction.AskQuestion;
                    segment.AddParameter("Question", "Will you enter " + dungeonName + "?");
                    segment.AddParameter("SegmentOnYes", "3");
                    segment.AddParameter("SegmentOnNo", (story.Segments.Count + 3).ToString());
                    segment.AddParameter("Mugshot", "-1");
                    story.Segments.Insert(1, segment);
                }
            }

            segment        = new StorySegment();
            segment.Action = Enums.StoryAction.RunScript;
            if (random)
            {
                segment.AddParameter("ScriptIndex", "42");
            }
            else
            {
                segment.AddParameter("ScriptIndex", "52");
            }
            segment.AddParameter("ScriptParam1", param1);
            segment.AddParameter("ScriptParam2", param2);
            segment.AddParameter("ScriptParam3", param3);
            segment.AddParameter("Pause", "1");
            story.Segments.Add(segment);


            segment        = new StorySegment();
            segment.Action = Enums.StoryAction.PlayerPadlock;
            segment.AddParameter("MovementState", "Unlock");
            story.Segments.Add(segment);

            foreach (StorySegment segments in story.Segments)
            {
                //Messenger.AdminMsg(segments.Action.ToString(), Text.Black);
            }

            return(story);
        }