Beispiel #1
0
        public static Room.Room TempleOfTyr()
        {
            var room = new Room.Room
            {
                region      = "Tutorial",
                area        = "Tutorial",
                areaId      = 11,
                title       = "Temple of Tyr",
                description = "<p>A circular blue mosaic covers the centre of the temple with a gold fist and star underneath in the centre. Above is a dome roof with yellow tinted glass giving the area a golden glow. An Alter to Tyr is at the back with a large blue banner hanging from the wall with the same golden fist above the star. To the south the entrance to the Temple</p>",

                //Defaults
                exits    = new List <Exit>(),
                items    = new List <Item.Item>(),
                mobs     = new List <PlayerSetup.Player>(),
                terrain  = Room.Room.Terrain.Field,
                keywords = new List <RoomObject>(),
                corpses  = new List <PlayerSetup.Player>(),
                players  = new List <PlayerSetup.Player>(),
                fighting = new List <string>(),
                clean    = true,
            };

            var mortem = new PlayerSetup.Player
            {
                NPCId             = Guid.NewGuid(),
                Name              = "Mortem",
                NPCLongName       = "Mortem",
                KnownByName       = true,
                Type              = PlayerSetup.Player.PlayerTypes.Mob,
                Description       = "A blue cape of Tyr hangs down Mortems back who is covered in full plate mail except for his heads and hands. A golden mace hangs upside down from his belt.",
                Strength          = 14,
                Dexterity         = 16,
                Constitution      = 18,
                Intelligence      = 12,
                Wisdom            = 18,
                Charisma          = 14,
                MaxHitPoints      = 300,
                HitPoints         = 300,
                Level             = 20,
                Gold              = 450,
                Status            = PlayerSetup.Player.PlayerStatus.Standing,
                Skills            = new List <Skill>(),
                Inventory         = new List <Item.Item>(),
                DialogueTree      = new List <DialogTree>(),
                Greet             = false,
                Emotes            = new List <string>(),
                EventOnComunicate = new Dictionary <string, string>(),
                EventWake         = "awakening awake",
                EventWear         = "awakening awake"
            };

            var plainTop      = ClothingBody.PlainTop();
            var plainTrousers = ClothingLegs.PlainTrousers();

            var breastPlateTyr = FullPlateBody.BreastPlateOfTyr();

            breastPlateTyr.location = Item.Item.ItemLocation.Worn;

            mortem.Inventory.Add(plainTop);
            mortem.Inventory.Add(plainTrousers);
            mortem.Inventory.Add(breastPlateTyr);

            mortem.Equipment.Body = breastPlateTyr.name;

            var intro = new DialogTree()
            {
                GiveQuest = true,
                QuestId   = 0,
                Message   = ""
            };


            var south = new Exit
            {
                name     = "South",
                area     = "Anker",
                region   = "Anker",
                areaId   = 17,
                keywords = new List <string>(),
                hidden   = false,
                locked   = false
            };

            room.exits.Add(south);


            // create item for platemail / cape / mace / set to worn
            //top and trousers for player


            room.mobs.Add(mortem);

            return(room);
        }
Beispiel #2
0
        public static async Task AwakeningRescue(PlayerSetup.Player player, Room.Room room, string step, string calledBy)
        {
            //give player quest
            var findLance = new Quest()
            {
                Id          = 3,
                Name        = "Find and greet Lance",
                Description =
                    "Mortem has asked me to go find Lance the village elder who can be found in the main square, From the temple leave south and follow the hill path in to town." +
                    "<p class='RoomExits'>[Hint] Type greet lance to greet the Elder once you have found him</p>",
                QuestGiver   = "Mortem",
                QuestFindMob = Lance.VillageElderLance().Name,
                Type         = Quest.QuestType.FindMob,
                RewardXp     = 250,
                QuestHint    = "<h5>Hint:</h5><p>Lance is here, type greet Lance to interact with him.</p>",
                QuestTrigger = Lance.VillageElderLance().Name,
                RewardDialog = new DialogTree()
                {
                    Message       = "Yes I am Lance, well met $playerName",
                    ShowIfOnQuest = "Find and greet Lance"
                }
            };

            try
            {
                //to stop task firing twice
                if (player.QuestLog.FirstOrDefault(x => x.Name.Equals("Find and greet Lance")) != null)
                {
                    return;
                }

                var npc = room.mobs.FirstOrDefault(x => x.Name.Equals("Mortem"));

                if (npc == null)
                {
                    return;
                }

                if (step.Equals("wake", StringComparison.CurrentCultureIgnoreCase))
                {
                    //remove player from tutorial room
                    var oldRoom = Cache.ReturnRooms()
                                  .FirstOrDefault(
                        x => x.area.Equals("Tutorial") && x.areaId.Equals(1) && x.region.Equals("Tutorial"));

                    if (oldRoom != null && oldRoom.players.Contains(player))
                    {
                        PlayerManager.RemovePlayerFromRoom(oldRoom, player);
                    }


                    HubContext.SendToClient("<span class='sayColor'>" + npc.Name + " says \"Ah you are awake!\"</span>", player.HubGuid);

                    await Task.Delay(2000);

                    HubContext.SendToClient("<span class='sayColor'>" +
                                            npc.Name + " says \"You were in a bad way when we found you, I didn't think you would wake.\"</span>",
                                            player.HubGuid);

                    await Task.Delay(2000);

                    HubContext.SendToClient(npc.Name + " gets a pair of trousers, a plain top and hands them to you.",
                                            player.HubGuid);

                    player.Inventory.Add(ClothingBody.PlainTop());
                    player.Inventory.Add(ClothingLegs.PlainTrousers());

                    Score.UpdateUiInventory(player);

                    await Task.Delay(2000);

                    HubContext.SendToClient("<span class='sayColor'>" + npc.Name + " says \"Wear them, you can't walk around naked I am afraid.\"</span>",
                                            player.HubGuid);

                    await Task.Delay(2000);

                    HubContext.SendToClient(
                        "<p class='RoomExits'>[Hint] To view items you are carrying type Inventory or i for short</p>",
                        player.HubGuid);

                    HubContext.SendToClient(npc.Name + " smiles at you.", player.HubGuid);

                    await Task.Delay(2000);

                    HubContext.SendToClient(
                        "<p class='RoomExits'>[Hint] Type wear trousers and wear shirt or alternatively wear all</p>",
                        player.HubGuid);
                }

                if (step != null && step.Contains("plain"))
                {
                    if (player.QuestLog.FirstOrDefault(x => x.Name.Equals("Find and greet Lance")) != null)
                    {
                        return;
                    }



                    if (player.Equipment.Body.Equals(ClothingBody.PlainTop().name) &&
                        !player.Equipment.Legs.Equals(ClothingLegs.PlainTrousers().name))
                    {
                        HubContext.SendToClient("<span class='sayColor'>" +
                                                npc.Name + " says \"It fits well, don't forget to wear the trousers too.\"</span>",
                                                player.HubGuid);

                        await Task.Delay(2000);

                        return;
                    }

                    if (player.Equipment.Legs.Equals(ClothingLegs.PlainTrousers().name) &&
                        !player.Equipment.Body.Equals(ClothingBody.PlainTop().name))
                    {
                        HubContext.SendToClient("<span class='sayColor'>" + npc.Name + " says \"It fits well, don't forget to wear the top too.\"</span>",
                                                player.HubGuid);

                        await Task.Delay(2000);

                        return;
                    }

                    if (player.Equipment.Legs.Equals(ClothingLegs.PlainTrousers().name) &&
                        player.Equipment.Body.Equals(ClothingBody.PlainTop().name))
                    {
                        HubContext.SendToClient("<span class='sayColor'>" +
                                                npc.Name +
                                                " says \"Excellent, I have one request for you and that is to speak to Lance the Elder of the village.\"</span>",
                                                player.HubGuid);

                        HubContext.SendToClient("<span class='sayColor'>" +
                                                npc.Name +
                                                " says \"He wants to know if you remember anything about the attack that may help him? We have been raided a few times of late.\"</span>",
                                                player.HubGuid);

                        HubContext.SendToClient("<span class='sayColor'>" +
                                                npc.Name +
                                                " says \"You will found him in the Square of Anker just leave south and follow the hill path in to town you can't miss the Square.\"</span>",
                                                player.HubGuid);



                        player.QuestLog.Add(findLance);



                        HubContext.SendToClient(
                            "<span class='questColor'>New Quest added: <br />Find and greet Lance. <br />Type qlog to be reminded about quest information.</span>",
                            player.HubGuid);


                        HubContext.SendToClient(
                            npc.Name +
                            " waves to you, may Tyr bless you.",
                            player.HubGuid);
                    }
                }
            }
            catch (Exception ex)
            {
                var log = new Error.Error
                {
                    Date         = DateTime.Now,
                    ErrorMessage = ex.InnerException.ToString(),
                    MethodName   = "mortem"
                };

                Save.LogError(log);
            }
        }
Beispiel #3
0
        public static async Task AwakeningRescue(PlayerSetup.Player player, Room.Room room, string step, string calledBy)
        {
            var npc = room.mobs.FirstOrDefault(x => x.Name.Equals("Mortem"));

            if (npc == null)
            {
                return;
            }

            if (step.Equals("wake", StringComparison.CurrentCultureIgnoreCase))
            {
                HubContext.SendToClient(npc.Name + " says Ah you are awake!", player.HubGuid);

                await Task.Delay(2000);

                HubContext.SendToClient(
                    npc.Name + " says You were in a bad way when we found you, I didn't think you would wake.",
                    player.HubGuid);

                await Task.Delay(2000);

                HubContext.SendToClient(npc.Name + " Gets a pair of trousers and a shirt and hands them to you",
                                        player.HubGuid);

                player.Inventory.Add(ClothingBody.PlainTop());
                player.Inventory.Add(ClothingLegs.PlainTrousers());

                Score.UpdateUiInventory(player);

                await Task.Delay(2000);

                HubContext.SendToClient(npc.Name + " says wear them, you can't walk around naked I am afraid.",
                                        player.HubGuid);

                await Task.Delay(2000);

                HubContext.SendToClient(
                    "<p class='RoomExits'>[Hint] To view items you are carrying type Inventory or i for short</p>",
                    player.HubGuid);

                HubContext.SendToClient(npc.Name + " smiles at you.", player.HubGuid);

                await Task.Delay(2000);

                HubContext.SendToClient(
                    "<p class='RoomExits'>[Hint] Type wear trousers and wear shirt or alternativily wear all</p>",
                    player.HubGuid);
            }

            if (step != null && step.Contains("plain"))
            {
                if (player.QuestLog.FirstOrDefault(x => x.Name.Equals("Find and greet Lance")) != null)
                {
                    return;
                }



                if (player.Equipment.Body.Equals(ClothingBody.PlainTop().name) && !player.Equipment.Legs.Equals(ClothingLegs.PlainTrousers().name))
                {
                    HubContext.SendToClient(npc.Name + " says it fits well, don't forget to wear the trousers too",
                                            player.HubGuid);

                    await Task.Delay(2000);

                    return;
                }

                if (player.Equipment.Legs.Equals(ClothingLegs.PlainTrousers().name) && !player.Equipment.Body.Equals(ClothingBody.PlainTop().name))
                {
                    HubContext.SendToClient(npc.Name + " says it fits well, don't forget to wear the top too",
                                            player.HubGuid);

                    await Task.Delay(2000);

                    return;
                }

                if (player.Equipment.Legs.Equals(ClothingLegs.PlainTrousers().name) && player.Equipment.Body.Equals(ClothingBody.PlainTop().name))
                {
                    HubContext.SendToClient(
                        npc.Name +
                        " says excellent, I have one request for you and that is to speak to Lance the Elder of the village.",
                        player.HubGuid);

                    HubContext.SendToClient(
                        npc.Name +
                        " says he wants to know if you remember anything about the attack that may help him? We have been raided a few times of late.",
                        player.HubGuid);

                    HubContext.SendToClient(
                        npc.Name +
                        " says You will found him in the Square of Anker just leave south and follow the hill path in to town you can't miss the Square.",
                        player.HubGuid);


                    //give player quest
                    var findLance = new Quest()
                    {
                        Id          = 3,
                        Name        = "Find and greet Lance",
                        Description =
                            "Mortem has asked me to go find Lance the village elder who can be found in the main square, From the temple leave south and follow the hill path in to town." +
                            "<p class='RoomExits'>[Hint] Type greet lance to greet the Elder once you have found him</p>",
                        QuestGiver   = "Mortem",
                        QuestFindMob = Lance.VillageElderLance().Name,
                        Type         = Quest.QuestType.FindMob,
                        RewardXp     = 250,
                        QuestHint    = "<h5>Hint:</h5><p>Lance is here, type greet Lance to interact with him.</p>",
                        QuestTrigger = Lance.VillageElderLance().Name,
                        RewardDialog = new DialogTree()
                        {
                            Message       = "Yes I am Lance, well met $playerName",
                            ShowIfOnQuest = "Find and greet Lance"
                        }
                    };

                    player.QuestLog.Add(findLance);



                    HubContext.SendToClient(
                        "New Quest added: Find and greet Lance. Type qlog to be reminded about quest information.",
                        player.HubGuid);


                    HubContext.SendToClient(
                        npc.Name +
                        " waves to you, may Tyr bless you.",
                        player.HubGuid);
                }
            }
        }