Пример #1
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Lycla", (eRealm)2);
            if (npcs.Length == 0)
            {
                Lycla       = new DOL.GS.GameNPC();
                Lycla.Model = 178;
                Lycla.Name  = "Lycla";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Lycla.Name + ", creating ...");
                }
                Lycla.GuildName       = "Part of " + questTitle + " Quest";
                Lycla.Realm           = eRealm.Midgard;
                Lycla.CurrentRegionID = 100;
                Lycla.Size            = 48;
                Lycla.Level           = 50;
                Lycla.MaxSpeedBase    = 191;
                Lycla.Faction         = FactionMgr.GetFactionByID(0);
                Lycla.X               = 749032;
                Lycla.Y               = 814613;
                Lycla.Z               = 4408;
                Lycla.Heading         = 170;
                Lycla.RespawnInterval = -1;
                Lycla.BodyType        = 0;


                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Lycla.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    Lycla.SaveIntoDatabase();
                }

                Lycla.AddToWorld();
            }
            else
            {
                Lycla = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Amora", (eRealm)2);
            if (npcs.Length == 0)
            {
                Amora       = new DOL.GS.GameNPC();
                Amora.Model = 216;
                Amora.Name  = "Amora";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Amora.Name + ", creating ...");
                }
                Amora.GuildName       = "Part of " + questTitle + " Quest";
                Amora.Realm           = eRealm.Midgard;
                Amora.CurrentRegionID = 100;
                Amora.Size            = 49;
                Amora.Level           = 28;
                Amora.MaxSpeedBase    = 191;
                Amora.Faction         = FactionMgr.GetFactionByID(0);
                Amora.X               = 747714;
                Amora.Y               = 814910;
                Amora.Z               = 4636;
                Amora.Heading         = 3456;
                Amora.RespawnInterval = -1;
                Amora.BodyType        = 0;


                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Amora.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    Amora.SaveIntoDatabase();
                }

                Amora.AddToWorld();
            }
            else
            {
                Amora = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Kari", (eRealm)2);
            if (npcs.Length == 0)
            {
                Kari       = new GameHealer();
                Kari.Model = 216;
                Kari.Name  = "Kari";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Kari.Name + ", creating ...");
                }
                Kari.GuildName       = "Part of " + questTitle + " Quest";
                Kari.Realm           = eRealm.Midgard;
                Kari.CurrentRegionID = 100;
                Kari.Size            = 51;
                Kari.Level           = 20;
                Kari.MaxSpeedBase    = 191;
                Kari.Faction         = FactionMgr.GetFactionByID(0);
                Kari.X               = 749114;
                Kari.Y               = 814019;
                Kari.Z               = 4408;
                Kari.Heading         = 3595;
                Kari.RespawnInterval = -1;
                Kari.BodyType        = 0;


                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Kari.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    Kari.SaveIntoDatabase();
                }

                Kari.AddToWorld();
            }
            else
            {
                Kari = npcs[0];
            }


            #endregion

            #region defineItems

            snakevenom = GameServer.Database.FindObjectByKey <ItemTemplate>("snakevenom");
            if (snakevenom == null)
            {
                snakevenom      = new ItemTemplate();
                snakevenom.Name = "Snake Venom";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + snakevenom.Name + ", creating it ...");
                }
                snakevenom.Level            = 1;
                snakevenom.Weight           = 1;
                snakevenom.Model            = 488;
                snakevenom.Object_Type      = 46;
                snakevenom.Item_Type        = -1;
                snakevenom.Id_nb            = "snakevenom";
                snakevenom.Hand             = 0;
                snakevenom.Price            = 0;
                snakevenom.IsPickable       = true;
                snakevenom.IsDropable       = true;
                snakevenom.IsTradable       = true;
                snakevenom.CanDropAsLoot    = true;
                snakevenom.Color            = 0;
                snakevenom.Bonus            = 0;      // default bonus
                snakevenom.Bonus1           = 0;
                snakevenom.Bonus1Type       = (int)0;
                snakevenom.Bonus2           = 0;
                snakevenom.Bonus2Type       = (int)0;
                snakevenom.Bonus3           = 0;
                snakevenom.Bonus3Type       = (int)0;
                snakevenom.Bonus4           = 0;
                snakevenom.Bonus4Type       = (int)0;
                snakevenom.Bonus5           = 0;
                snakevenom.Bonus5Type       = (int)0;
                snakevenom.Bonus6           = 0;
                snakevenom.Bonus6Type       = (int)0;
                snakevenom.Bonus7           = 0;
                snakevenom.Bonus7Type       = (int)0;
                snakevenom.Bonus8           = 0;
                snakevenom.Bonus8Type       = (int)0;
                snakevenom.Bonus9           = 0;
                snakevenom.Bonus9Type       = (int)0;
                snakevenom.Bonus10          = 0;
                snakevenom.Bonus10Type      = (int)0;
                snakevenom.ExtraBonus       = 0;
                snakevenom.ExtraBonusType   = (int)0;
                snakevenom.Effect           = 0;
                snakevenom.Emblem           = 0;
                snakevenom.Charges          = 0;
                snakevenom.MaxCharges       = 0;
                snakevenom.SpellID          = 0;
                snakevenom.ProcSpellID      = 0;
                snakevenom.Type_Damage      = 0;
                snakevenom.Realm            = 0;
                snakevenom.MaxCount         = 1;
                snakevenom.PackSize         = 1;
                snakevenom.Extension        = 0;
                snakevenom.Quality          = 100;
                snakevenom.Condition        = 100;
                snakevenom.MaxCondition     = 100;
                snakevenom.Durability       = 100;
                snakevenom.MaxDurability    = 100;
                snakevenom.PoisonCharges    = 0;
                snakevenom.PoisonMaxCharges = 0;
                snakevenom.PoisonSpellID    = 0;
                snakevenom.ProcSpellID1     = 0;
                snakevenom.SpellID1         = 0;
                snakevenom.MaxCharges1      = 0;
                snakevenom.Charges1         = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(snakevenom);
                }
            }


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(Amorasaidmistyc));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.Interact, null, Lycla);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "The lady Amora here in Fort Atla has been here for several weeks because she is [unable] to travel.", Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.Whisper, "unable", Lycla);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Her daughter, Magnild has fallen [ill].", Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.Whisper, "ill", Lycla);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "They have been staying in one of the homes here in town to keep the poor girl warm. Please help them, they are in great need.", Lycla);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), "The Lady Amora needs your help in curing her sick daughter.");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc));
            a.AddAction(eActionType.Talk, "No problem. See you.", Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Interact, null, Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Be still Magnild, all will be alright soon and you will be well once again.", Amora);
            a.AddAction(eActionType.Talk, "Hello stranger, may I ask your [name]?", Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Whisper, "name", Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "It is a pleasure to meet you. I am so glad you have come to aid me and [Magnild].", Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Whisper, "Magnild", Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Yes, my poor darling Magnild was bitten by a [water snake] while traveling into town. Unfortunately, the bite has not healed and she is not feeling very well at all.", Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Whisper, "water snake", Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Oh, it seems the venom of the snake was very powerful. I have sent word to t he healer and she has told me she needs five vials of [snake venom] to cure the child.", Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Whisper, "snake venom", Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "I do not feel right leaving Magnild [here alone] this ill, so I fear I can't hunt the snakes myself.", Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Whisper, "here alone", Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Please go outside the city and [collect] the five vials of venom and take them to Kari, the healer.", Amora);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Amora, -1);
            a.AddTrigger(eTriggerType.Whisper, "collect", Amora);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "I am indebted to you always if you do the for me.", Amora);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "water snake", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 2, (eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem, snakevenom, 4, (eComparator)1);
            a.AddAction(eActionType.GiveItem, snakevenom, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Lycla, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "water snake", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 2, (eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem, snakevenom, 4, (eComparator)3);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 3);
            a.AddAction(eActionType.GiveItem, snakevenom, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Kari, -1);
            a.AddTrigger(eTriggerType.Interact, null, Kari);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Ahh, you look as if you have been having a rough time. Have you brought me the vials of snake venom?", Kari);
            a.AddAction(eActionType.TakeItem, snakevenom, 5);
            a.AddAction(eActionType.Talk, "\"I shall begin [work] at once in making the potion to cure the sick girl, hopefully all my training will not fail me.", Kari);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Kari, -1);
            a.AddTrigger(eTriggerType.Whisper, "work", Kari);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "You have aided in this situation beyond what is expected. I thnk you.", Kari);
            a.AddAction(eActionType.GiveXP, 10, null);
            a.AddAction(eActionType.GiveGold, 42, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            Lycla.AddQuestToGive(typeof(Amorasaidmistyc));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #2
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Sir Quait", (eRealm)1);
            if (npcs.Length == 0)
            {
                SirQuait       = new DOL.GS.GameNPC();
                SirQuait.Model = 40;
                SirQuait.Name  = "Sir Quait";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + SirQuait.Name + ", creating ...");
                }
                SirQuait.GuildName       = "Part of " + questTitle + " Quest";
                SirQuait.Realm           = eRealm.Albion;
                SirQuait.CurrentRegionID = 1;
                SirQuait.Size            = 50;
                SirQuait.Level           = 10;
                SirQuait.MaxSpeedBase    = 100;
                SirQuait.Faction         = FactionMgr.GetFactionByID(0);
                SirQuait.X               = 531971;
                SirQuait.Y               = 478955;
                SirQuait.Z               = 0;
                SirQuait.Heading         = 3570;
                SirQuait.RespawnInterval = 0;
                SirQuait.BodyType        = 0;


                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                SirQuait.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    SirQuait.SaveIntoDatabase();
                }

                SirQuait.AddToWorld();
            }
            else
            {
                SirQuait = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Evil Thief of the Shadowclan", (eRealm)0);
            if (npcs.Length == 0)
            {
                EvilThiefoftheShadowclan       = new DOL.GS.GameNPC();
                EvilThiefoftheShadowclan.Model = 55;
                EvilThiefoftheShadowclan.Name  = "Evil Thief of the Shadowclan";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + EvilThiefoftheShadowclan.Name + ", creating ...");
                }
                EvilThiefoftheShadowclan.GuildName       = "Part of " + questTitle + " Quest";
                EvilThiefoftheShadowclan.Realm           = eRealm.None;
                EvilThiefoftheShadowclan.CurrentRegionID = 1;
                EvilThiefoftheShadowclan.Size            = 50;
                EvilThiefoftheShadowclan.Level           = 1;
                EvilThiefoftheShadowclan.MaxSpeedBase    = 100;
                EvilThiefoftheShadowclan.Faction         = FactionMgr.GetFactionByID(0);
                EvilThiefoftheShadowclan.X               = 532571;
                EvilThiefoftheShadowclan.Y               = 479055;
                EvilThiefoftheShadowclan.Z               = 2200;
                EvilThiefoftheShadowclan.Heading         = 3570;
                EvilThiefoftheShadowclan.RespawnInterval = 0;
                EvilThiefoftheShadowclan.BodyType        = 0;


                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                EvilThiefoftheShadowclan.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    EvilThiefoftheShadowclan.SaveIntoDatabase();
                }

                EvilThiefoftheShadowclan.AddToWorld();
            }
            else
            {
                EvilThiefoftheShadowclan = npcs[0];
            }


            #endregion

            #region defineItems

            SirQuaitsSword = GameServer.Database.FindObjectByKey <ItemTemplate>("SirQuaitsSword");
            if (SirQuaitsSword == null)
            {
                SirQuaitsSword      = new ItemTemplate();
                SirQuaitsSword.Name = "Sir Quait's Sword";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + SirQuaitsSword.Name + ", creating it ...");
                }
                SirQuaitsSword.Level            = 1;
                SirQuaitsSword.Weight           = 0;
                SirQuaitsSword.Model            = 847;
                SirQuaitsSword.Object_Type      = 0;
                SirQuaitsSword.Item_Type        = 0;
                SirQuaitsSword.Id_nb            = "SirQuaitsSword";
                SirQuaitsSword.Hand             = 0;
                SirQuaitsSword.Price            = 0;
                SirQuaitsSword.IsPickable       = false;
                SirQuaitsSword.IsDropable       = false;
                SirQuaitsSword.IsTradable       = true;
                SirQuaitsSword.CanDropAsLoot    = true;
                SirQuaitsSword.Color            = 0;
                SirQuaitsSword.Bonus            = 0; // default bonus
                SirQuaitsSword.Bonus1           = 0;
                SirQuaitsSword.Bonus1Type       = (int)0;
                SirQuaitsSword.Bonus2           = 0;
                SirQuaitsSword.Bonus2Type       = (int)0;
                SirQuaitsSword.Bonus3           = 0;
                SirQuaitsSword.Bonus3Type       = (int)0;
                SirQuaitsSword.Bonus4           = 0;
                SirQuaitsSword.Bonus4Type       = (int)0;
                SirQuaitsSword.Bonus5           = 0;
                SirQuaitsSword.Bonus5Type       = (int)0;
                SirQuaitsSword.Bonus6           = 0;
                SirQuaitsSword.Bonus6Type       = (int)0;
                SirQuaitsSword.Bonus7           = 0;
                SirQuaitsSword.Bonus7Type       = (int)0;
                SirQuaitsSword.Bonus8           = 0;
                SirQuaitsSword.Bonus8Type       = (int)0;
                SirQuaitsSword.Bonus9           = 0;
                SirQuaitsSword.Bonus9Type       = (int)0;
                SirQuaitsSword.Bonus10          = 0;
                SirQuaitsSword.Bonus10Type      = (int)0;
                SirQuaitsSword.ExtraBonus       = 0;
                SirQuaitsSword.ExtraBonusType   = (int)0;
                SirQuaitsSword.Effect           = 0;
                SirQuaitsSword.Emblem           = 0;
                SirQuaitsSword.Charges          = 0;
                SirQuaitsSword.MaxCharges       = 0;
                SirQuaitsSword.SpellID          = 0;
                SirQuaitsSword.ProcSpellID      = 0;
                SirQuaitsSword.Type_Damage      = 0;
                SirQuaitsSword.Realm            = 0;
                SirQuaitsSword.MaxCount         = 1;
                SirQuaitsSword.PackSize         = 1;
                SirQuaitsSword.Extension        = 0;
                SirQuaitsSword.Quality          = 1;
                SirQuaitsSword.Condition        = 1;
                SirQuaitsSword.MaxCondition     = 1;
                SirQuaitsSword.Durability       = 1;
                SirQuaitsSword.MaxDurability    = 1;
                SirQuaitsSword.PoisonCharges    = 0;
                SirQuaitsSword.PoisonMaxCharges = 0;
                SirQuaitsSword.PoisonSpellID    = 0;
                SirQuaitsSword.ProcSpellID1     = 0;
                SirQuaitsSword.SpellID1         = 0;
                SirQuaitsSword.MaxCharges1      = 0;
                SirQuaitsSword.Charges1         = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                GameServer.Database.AddObject(SirQuaitsSword);
            }


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(HelpSirQuait));
            QuestBehaviour a;
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Interact, null, SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
            a.AddAction(eActionType.Talk, "Hello adventurer, an [evil thief] has stolen my [sword], can [you help me] get it back?", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "sword", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "I really need it and if [you help me], I will give you a little reward!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "sword", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null);
            a.AddAction(eActionType.Talk, "I really need it I am so glad you are helping me!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "evil thief", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "This evil thief of the shadowclan bastard, he stole it! Kill him and get my [sword] back to me!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "you help me", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(HelpSirQuait), "Do you want to help Sir Quait?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Whisper, "find", SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null);
            a.AddAction(eActionType.Talk, "Really!? Please give it to me!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.Interact, null, SirQuait);
            a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null);
            a.AddAction(eActionType.Talk, "Did you [find] my [sword]?", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(HelpSirQuait));
            a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
            a.AddAction(eActionType.Talk, "Oh well, if you change your mind, please come back!", SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(HelpSirQuait));
            a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait);
            a.AddAction(eActionType.Talk, "Thank you! Please bring the [sword] back to me!", SirQuait);
            a.AddAction(eActionType.GiveQuest, typeof(HelpSirQuait), SirQuait);
            AddBehaviour(a);
            a = builder.CreateBehaviour(EvilThiefoftheShadowclan, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, null, EvilThiefoftheShadowclan);
            a.AddRequirement(eRequirementType.QuestStep, typeof(HelpSirQuait), 1, (eComparator)3);
            a.AddAction(eActionType.Message, "You defeated the evil thief and quickly pick up Sir Quait's sword!", (eTextType)1);
            a.AddAction(eActionType.GiveItem, SirQuaitsSword, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(SirQuait, -1);
            a.AddTrigger(eTriggerType.GiveItem, SirQuait, SirQuaitsSword);
            a.AddRequirement(eRequirementType.QuestStep, typeof(HelpSirQuait), 1, (eComparator)3);
            a.AddAction(eActionType.Message, "Sir Quait thanks you for bringing back his holy sword!", (eTextType)1);
            a.AddAction(eActionType.TakeItem, SirQuaitsSword, null);
            a.AddAction(eActionType.FinishQuest, typeof(HelpSirQuait), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            SirQuait.AddQuestToGive(typeof(HelpSirQuait));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #3
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.NPCKreimhilde"), (eRealm)2);
            if (npcs.Length == 0)
            {
                VikingKreimhilde       = new DOL.GS.GameNPC();
                VikingKreimhilde.Model = 218;
                VikingKreimhilde.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.NPCKreimhilde");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + VikingKreimhilde.Name + ", creating ...");
                }
                VikingKreimhilde.GuildName       = "Part of " + questTitle + " Quest";
                VikingKreimhilde.Realm           = eRealm.Midgard;
                VikingKreimhilde.CurrentRegionID = 100;
                VikingKreimhilde.Size            = 51;
                VikingKreimhilde.Level           = 50;
                VikingKreimhilde.MaxSpeedBase    = 191;
                VikingKreimhilde.Faction         = FactionMgr.GetFactionByID(0);
                VikingKreimhilde.X               = 803999;
                VikingKreimhilde.Y               = 726551;
                VikingKreimhilde.Z               = 4752;
                VikingKreimhilde.Heading         = 2116;
                VikingKreimhilde.RespawnInterval = -1;
                VikingKreimhilde.BodyType        = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                VikingKreimhilde.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    VikingKreimhilde.SaveIntoDatabase();
                }

                VikingKreimhilde.AddToWorld();
            }
            else
            {
                VikingKreimhilde = npcs[0];
            }


            #endregion

            #region defineItems

            silverringofhealth = GameServer.Database.FindObjectByKey <ItemTemplate>("silverringofhealth");
            if (silverringofhealth == null)
            {
                silverringofhealth      = new ItemTemplate();
                silverringofhealth.Name = "Silver Ring of Health";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + silverringofhealth.Name + ", creating it ...");
                }
                silverringofhealth.Level            = 5;
                silverringofhealth.Weight           = 5;
                silverringofhealth.Model            = 103;
                silverringofhealth.Object_Type      = 0;
                silverringofhealth.Item_Type        = 35;
                silverringofhealth.Id_nb            = "silverringofhealth";
                silverringofhealth.Hand             = 0;
                silverringofhealth.Price            = 0;
                silverringofhealth.IsPickable       = true;
                silverringofhealth.IsDropable       = true;
                silverringofhealth.IsTradable       = false;
                silverringofhealth.CanDropAsLoot    = false;
                silverringofhealth.Color            = 0;
                silverringofhealth.Bonus            = 5;      // default bonus
                silverringofhealth.Bonus1           = 12;
                silverringofhealth.Bonus1Type       = (int)10;
                silverringofhealth.Bonus2           = 0;
                silverringofhealth.Bonus2Type       = (int)0;
                silverringofhealth.Bonus3           = 0;
                silverringofhealth.Bonus3Type       = (int)0;
                silverringofhealth.Bonus4           = 0;
                silverringofhealth.Bonus4Type       = (int)0;
                silverringofhealth.Bonus5           = 0;
                silverringofhealth.Bonus5Type       = (int)0;
                silverringofhealth.Bonus6           = 0;
                silverringofhealth.Bonus6Type       = (int)0;
                silverringofhealth.Bonus7           = 0;
                silverringofhealth.Bonus7Type       = (int)0;
                silverringofhealth.Bonus8           = 0;
                silverringofhealth.Bonus8Type       = (int)0;
                silverringofhealth.Bonus9           = 0;
                silverringofhealth.Bonus9Type       = (int)0;
                silverringofhealth.Bonus10          = 0;
                silverringofhealth.Bonus10Type      = (int)0;
                silverringofhealth.ExtraBonus       = 0;
                silverringofhealth.ExtraBonusType   = (int)0;
                silverringofhealth.Effect           = 0;
                silverringofhealth.Emblem           = 0;
                silverringofhealth.Charges          = 0;
                silverringofhealth.MaxCharges       = 0;
                silverringofhealth.SpellID          = 0;
                silverringofhealth.ProcSpellID      = 0;
                silverringofhealth.Type_Damage      = 0;
                silverringofhealth.Realm            = 0;
                silverringofhealth.MaxCount         = 1;
                silverringofhealth.PackSize         = 1;
                silverringofhealth.Extension        = 0;
                silverringofhealth.Quality          = 100;
                silverringofhealth.Condition        = 100;
                silverringofhealth.MaxCondition     = 100;
                silverringofhealth.Durability       = 100;
                silverringofhealth.MaxDurability    = 100;
                silverringofhealth.PoisonCharges    = 0;
                silverringofhealth.PoisonMaxCharges = 0;
                silverringofhealth.PoisonSpellID    = 0;
                silverringofhealth.ProcSpellID1     = 0;
                silverringofhealth.SpellID1         = 0;
                silverringofhealth.MaxCharges1      = 0;
                silverringofhealth.Charges1         = 0;

                GameServer.Database.AddObject(silverringofhealth);
            }
            blackmaulercubpelt = GameServer.Database.FindObjectByKey <ItemTemplate>("blackmaulercubpelt");
            if (blackmaulercubpelt == null)
            {
                blackmaulercubpelt      = new ItemTemplate();
                blackmaulercubpelt.Name = "Black Mauler Cub Pelt";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + blackmaulercubpelt.Name + ", creating it ...");
                }
                blackmaulercubpelt.Level            = 1;
                blackmaulercubpelt.Weight           = 5;
                blackmaulercubpelt.Model            = 100;
                blackmaulercubpelt.Object_Type      = 0;
                blackmaulercubpelt.Item_Type        = 40;
                blackmaulercubpelt.Id_nb            = "blackmaulercubpelt";
                blackmaulercubpelt.Hand             = 0;
                blackmaulercubpelt.Price            = 0;
                blackmaulercubpelt.IsPickable       = true;
                blackmaulercubpelt.IsDropable       = true;
                blackmaulercubpelt.IsTradable       = true;
                blackmaulercubpelt.CanDropAsLoot    = false;
                blackmaulercubpelt.Color            = 0;
                blackmaulercubpelt.Bonus            = 35;      // default bonus
                blackmaulercubpelt.Bonus1           = 0;
                blackmaulercubpelt.Bonus1Type       = (int)0;
                blackmaulercubpelt.Bonus2           = 0;
                blackmaulercubpelt.Bonus2Type       = (int)0;
                blackmaulercubpelt.Bonus3           = 0;
                blackmaulercubpelt.Bonus3Type       = (int)0;
                blackmaulercubpelt.Bonus4           = 0;
                blackmaulercubpelt.Bonus4Type       = (int)0;
                blackmaulercubpelt.Bonus5           = 0;
                blackmaulercubpelt.Bonus5Type       = (int)0;
                blackmaulercubpelt.Bonus6           = 0;
                blackmaulercubpelt.Bonus6Type       = (int)0;
                blackmaulercubpelt.Bonus7           = 0;
                blackmaulercubpelt.Bonus7Type       = (int)0;
                blackmaulercubpelt.Bonus8           = 0;
                blackmaulercubpelt.Bonus8Type       = (int)0;
                blackmaulercubpelt.Bonus9           = 0;
                blackmaulercubpelt.Bonus9Type       = (int)0;
                blackmaulercubpelt.Bonus10          = 0;
                blackmaulercubpelt.Bonus10Type      = (int)0;
                blackmaulercubpelt.ExtraBonus       = 0;
                blackmaulercubpelt.ExtraBonusType   = (int)0;
                blackmaulercubpelt.Effect           = 0;
                blackmaulercubpelt.Emblem           = 0;
                blackmaulercubpelt.Charges          = 0;
                blackmaulercubpelt.MaxCharges       = 0;
                blackmaulercubpelt.SpellID          = 0;
                blackmaulercubpelt.ProcSpellID      = 0;
                blackmaulercubpelt.Type_Damage      = 0;
                blackmaulercubpelt.Realm            = 0;
                blackmaulercubpelt.MaxCount         = 1;
                blackmaulercubpelt.PackSize         = 1;
                blackmaulercubpelt.Extension        = 0;
                blackmaulercubpelt.Quality          = 99;
                blackmaulercubpelt.Condition        = 100;
                blackmaulercubpelt.MaxCondition     = 100;
                blackmaulercubpelt.Durability       = 100;
                blackmaulercubpelt.MaxDurability    = 100;
                blackmaulercubpelt.PoisonCharges    = 0;
                blackmaulercubpelt.PoisonMaxCharges = 0;
                blackmaulercubpelt.PoisonSpellID    = 0;
                blackmaulercubpelt.ProcSpellID1     = 0;
                blackmaulercubpelt.SpellID1         = 0;
                blackmaulercubpelt.MaxCharges1      = 0;
                blackmaulercubpelt.Charges1         = 0;

                GameServer.Database.AddObject(blackmaulercubpelt);
            }


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(Abearybadproblem));
            QuestBehaviour a;
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.Interact, null, VikingKreimhilde);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), VikingKreimhilde);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk1"), VikingKreimhilde);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk2"), VikingKreimhilde);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk3"), VikingKreimhilde);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.Talk4"), VikingKreimhilde);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.OfferQuest"));
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Abearybadproblem));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), VikingKreimhilde);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 1);
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Abearybadproblem));
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.EnemyKilled"), null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 1, (eComparator)3);
            a.AddAction(eActionType.GiveItem, blackmaulercubpelt, null);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(VikingKreimhilde, -1);
            a.AddTrigger(eTriggerType.Interact, null, VikingKreimhilde);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.GoodJob"), VikingKreimhilde);
            a.AddAction(eActionType.GiveXP, 22, null);
            a.AddAction(eActionType.GiveGold, 23, null);
            a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null);
            a.AddAction(eActionType.GiveItem, silverringofhealth, VikingKreimhilde);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Abearybadproblem), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            VikingKreimhilde.AddQuestToGive(typeof(Abearybadproblem));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #4
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Helen", (eRealm)2);
            if (npcs.Length == 0)
            {
                Helen       = new DOL.GS.GameNPC();
                Helen.Model = 193;
                Helen.Name  = "Helen";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Helen.Name + ", creating ...");
                }
                Helen.GuildName       = "Part of " + questTitle + " Quest";
                Helen.Realm           = eRealm.Midgard;
                Helen.CurrentRegionID = 100;
                Helen.Size            = 49;
                Helen.Level           = 41;
                Helen.MaxSpeedBase    = 191;
                Helen.Faction         = FactionMgr.GetFactionByID(0);
                Helen.X               = 805693;
                Helen.Y               = 701160;
                Helen.Z               = 4960;
                Helen.Heading         = 3470;
                Helen.RespawnInterval = -1;
                Helen.BodyType        = 0;


                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Helen.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    Helen.SaveIntoDatabase();
                }

                Helen.AddToWorld();
            }
            else
            {
                Helen = npcs[0];
            }


            #endregion

            #region defineItems

            smallmaulerskin = GameServer.Database.FindObjectByKey <ItemTemplate>("smallmaulerskin");
            if (smallmaulerskin == null)
            {
                smallmaulerskin      = new ItemTemplate();
                smallmaulerskin.Name = "Small Mauler Skin";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + smallmaulerskin.Name + ", creating it ...");
                }
                smallmaulerskin.Level            = 1;
                smallmaulerskin.Weight           = 5;
                smallmaulerskin.Model            = 100;
                smallmaulerskin.Object_Type      = 0;
                smallmaulerskin.Item_Type        = 40;
                smallmaulerskin.Id_nb            = "smallmaulerskin";
                smallmaulerskin.Hand             = 0;
                smallmaulerskin.Price            = 0;
                smallmaulerskin.IsPickable       = true;
                smallmaulerskin.IsDropable       = true;
                smallmaulerskin.IsTradable       = true;
                smallmaulerskin.CanDropAsLoot    = false;
                smallmaulerskin.Color            = 0;
                smallmaulerskin.Bonus            = 35;      // default bonus
                smallmaulerskin.Bonus1           = 0;
                smallmaulerskin.Bonus1Type       = (int)0;
                smallmaulerskin.Bonus2           = 0;
                smallmaulerskin.Bonus2Type       = (int)0;
                smallmaulerskin.Bonus3           = 0;
                smallmaulerskin.Bonus3Type       = (int)0;
                smallmaulerskin.Bonus4           = 0;
                smallmaulerskin.Bonus4Type       = (int)0;
                smallmaulerskin.Bonus5           = 0;
                smallmaulerskin.Bonus5Type       = (int)0;
                smallmaulerskin.Bonus6           = 0;
                smallmaulerskin.Bonus6Type       = (int)0;
                smallmaulerskin.Bonus7           = 0;
                smallmaulerskin.Bonus7Type       = (int)0;
                smallmaulerskin.Bonus8           = 0;
                smallmaulerskin.Bonus8Type       = (int)0;
                smallmaulerskin.Bonus9           = 0;
                smallmaulerskin.Bonus9Type       = (int)0;
                smallmaulerskin.Bonus10          = 0;
                smallmaulerskin.Bonus10Type      = (int)0;
                smallmaulerskin.ExtraBonus       = 0;
                smallmaulerskin.ExtraBonusType   = (int)0;
                smallmaulerskin.Effect           = 0;
                smallmaulerskin.Emblem           = 0;
                smallmaulerskin.Charges          = 0;
                smallmaulerskin.MaxCharges       = 0;
                smallmaulerskin.SpellID          = 0;
                smallmaulerskin.ProcSpellID      = 0;
                smallmaulerskin.Type_Damage      = 0;
                smallmaulerskin.Realm            = 0;
                smallmaulerskin.MaxCount         = 1;
                smallmaulerskin.PackSize         = 1;
                smallmaulerskin.Extension        = 0;
                smallmaulerskin.Quality          = 99;
                smallmaulerskin.Condition        = 100;
                smallmaulerskin.MaxCondition     = 100;
                smallmaulerskin.Durability       = 100;
                smallmaulerskin.MaxDurability    = 100;
                smallmaulerskin.PoisonCharges    = 0;
                smallmaulerskin.PoisonMaxCharges = 0;
                smallmaulerskin.PoisonSpellID    = 0;
                smallmaulerskin.ProcSpellID1     = 0;
                smallmaulerskin.SpellID1         = 0;
                smallmaulerskin.MaxCharges1      = 0;
                smallmaulerskin.Charges1         = 0;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(smallmaulerskin);
                }
            }


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(Bearskins));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.Interact, null, Helen);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Bearskins), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "I have lived in this village since I was a young girl. My father is a great bear hunter you know.", Helen);
            a.AddAction(eActionType.Talk, "In my years I have learned to work with all kinds of materials, specially [the skin of bears].", Helen);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.Whisper, "the skin of bears", Helen);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Bearskins), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Hmm...A new person here to Haggerfel. Let me offer you some [advice].", Helen);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.Whisper, "advice", Helen);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Bearskins), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Bearskins), "Helen has offered you the Bear skins quest.?Do you accept?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Bearskins));
            a.AddAction(eActionType.Talk, "No problem. See you", Helen);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Bearskins));
            a.AddAction(eActionType.Talk, "If you bring me the hide of a mauler cub I shall pay you well!", Helen);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "black mauler cub", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Bearskins), 1, (eComparator)3);
            a.AddAction(eActionType.GiveItem, smallmaulerskin, null);
            a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Bearskins), 2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Helen, -1);
            a.AddTrigger(eTriggerType.Interact, null, Helen);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Bearskins), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, "You have returned! Did you bring me the skin?", Helen);
            a.AddAction(eActionType.TakeItem, smallmaulerskin, null);
            a.AddAction(eActionType.Talk, "Wonderful, wonderful, you have done well, and brought a good hide.", Helen);
            a.AddAction(eActionType.Talk, "The hide is small yet sturdy. Here is some coin for your efforts. Thank you.", Helen);
            a.AddAction(eActionType.GiveXP, 10, null);
            a.AddAction(eActionType.GiveGold, 105, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Bearskins), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            Helen.AddQuestToGive(typeof(Bearskins));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #5
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar"), (eRealm)2);

            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                    BarkeepNognar       = new DOL.GS.GameMerchant();
                    BarkeepNognar.Model = 212;
                    BarkeepNognar.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar");
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + BarkeepNognar.Name + ", creating ...");
                    }
                    BarkeepNognar.GuildName       = "Part of " + questTitle + " Quest";
                    BarkeepNognar.Realm           = eRealm.Midgard;
                    BarkeepNognar.CurrentRegionID = 100;
                    BarkeepNognar.Size            = 58;
                    BarkeepNognar.Level           = 15;
                    BarkeepNognar.MaxSpeedBase    = 191;
                    BarkeepNognar.Faction         = FactionMgr.GetFactionByID(0);
                    BarkeepNognar.X               = 805429;
                    BarkeepNognar.Y               = 726478;
                    BarkeepNognar.Z               = 4717;
                    BarkeepNognar.Heading         = 4073;
                    BarkeepNognar.RespawnInterval = -1;
                    BarkeepNognar.BodyType        = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    BarkeepNognar.SetOwnBrain(brain);

                    //You don't have to store the created mob in the db if you don't want,
                    //it will be recreated each time it is not found, just comment the following
                    //line if you rather not modify your database
                    if (SAVE_INTO_DATABASE)
                    {
                        BarkeepNognar.SaveIntoDatabase();
                    }

                    BarkeepNognar.AddToWorld();
                }
            }
            else
            {
                BarkeepNognar = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar"), (eRealm)2);

            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(101).IsDisabled)
                {
                    BarkeepPrugar       = new DOL.GS.GameMerchant();
                    BarkeepPrugar.Model = 213;
                    BarkeepPrugar.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar");
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + BarkeepPrugar.Name + ", creating ...");
                    }
                    BarkeepPrugar.GuildName       = "Part of " + questTitle + " Quest";
                    BarkeepPrugar.Realm           = eRealm.Midgard;
                    BarkeepPrugar.CurrentRegionID = 101;
                    BarkeepPrugar.Size            = 60;
                    BarkeepPrugar.Level           = 15;
                    BarkeepPrugar.MaxSpeedBase    = 191;
                    BarkeepPrugar.Faction         = FactionMgr.GetFactionByID(0);
                    BarkeepPrugar.X               = 33230;
                    BarkeepPrugar.Y               = 34802;
                    BarkeepPrugar.Z               = 8027;
                    BarkeepPrugar.Heading         = 1194;
                    BarkeepPrugar.RespawnInterval = -1;
                    BarkeepPrugar.BodyType        = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    BarkeepPrugar.SetOwnBrain(brain);

                    //You don't have to store the created mob in the db if you don't want,
                    //it will be recreated each time it is not found, just comment the following
                    //line if you rather not modify your database
                    if (SAVE_INTO_DATABASE)
                    {
                        BarkeepPrugar.SaveIntoDatabase();
                    }

                    BarkeepPrugar.AddToWorld();
                }
            }
            else
            {
                BarkeepPrugar = npcs[0];
            }


            #endregion

            #region defineItems

            rattlingskeletonpendant = GameServer.Database.FindObjectByKey <ItemTemplate>("rattlingskeletonpendant");
            if (rattlingskeletonpendant == null)
            {
                rattlingskeletonpendant      = new ItemTemplate();
                rattlingskeletonpendant.Name = "Rattling Skeleton Pendant";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + rattlingskeletonpendant.Name + ", creating it ...");
                }
                rattlingskeletonpendant.Level            = 50;
                rattlingskeletonpendant.Weight           = 5;
                rattlingskeletonpendant.Model            = 101;
                rattlingskeletonpendant.Object_Type      = 0;
                rattlingskeletonpendant.Item_Type        = 40;
                rattlingskeletonpendant.Id_nb            = "rattlingskeletonpendant";
                rattlingskeletonpendant.Hand             = 0;
                rattlingskeletonpendant.Price            = 0;
                rattlingskeletonpendant.IsPickable       = true;
                rattlingskeletonpendant.IsDropable       = true;
                rattlingskeletonpendant.IsTradable       = true;
                rattlingskeletonpendant.CanDropAsLoot    = false;
                rattlingskeletonpendant.Color            = 0;
                rattlingskeletonpendant.Bonus            = 35;      // default bonus
                rattlingskeletonpendant.Bonus1           = 0;
                rattlingskeletonpendant.Bonus1Type       = (int)0;
                rattlingskeletonpendant.Bonus2           = 0;
                rattlingskeletonpendant.Bonus2Type       = (int)0;
                rattlingskeletonpendant.Bonus3           = 0;
                rattlingskeletonpendant.Bonus3Type       = (int)0;
                rattlingskeletonpendant.Bonus4           = 0;
                rattlingskeletonpendant.Bonus4Type       = (int)0;
                rattlingskeletonpendant.Bonus5           = 0;
                rattlingskeletonpendant.Bonus5Type       = (int)0;
                rattlingskeletonpendant.Bonus6           = 0;
                rattlingskeletonpendant.Bonus6Type       = (int)0;
                rattlingskeletonpendant.Bonus7           = 0;
                rattlingskeletonpendant.Bonus7Type       = (int)0;
                rattlingskeletonpendant.Bonus8           = 0;
                rattlingskeletonpendant.Bonus8Type       = (int)0;
                rattlingskeletonpendant.Bonus9           = 0;
                rattlingskeletonpendant.Bonus9Type       = (int)0;
                rattlingskeletonpendant.Bonus10          = 0;
                rattlingskeletonpendant.Bonus10Type      = (int)0;
                rattlingskeletonpendant.ExtraBonus       = 0;
                rattlingskeletonpendant.ExtraBonusType   = (int)0;
                rattlingskeletonpendant.Effect           = 0;
                rattlingskeletonpendant.Emblem           = 0;
                rattlingskeletonpendant.Charges          = 0;
                rattlingskeletonpendant.MaxCharges       = 0;
                rattlingskeletonpendant.SpellID          = 0;
                rattlingskeletonpendant.ProcSpellID      = 0;
                rattlingskeletonpendant.Type_Damage      = 0;
                rattlingskeletonpendant.Realm            = 0;
                rattlingskeletonpendant.MaxCount         = 1;
                rattlingskeletonpendant.PackSize         = 1;
                rattlingskeletonpendant.Extension        = 0;
                rattlingskeletonpendant.Quality          = 99;
                rattlingskeletonpendant.Condition        = 50000;
                rattlingskeletonpendant.MaxCondition     = 50000;
                rattlingskeletonpendant.Durability       = 50000;
                rattlingskeletonpendant.MaxDurability    = 50000;
                rattlingskeletonpendant.PoisonCharges    = 0;
                rattlingskeletonpendant.PoisonMaxCharges = 0;
                rattlingskeletonpendant.PoisonSpellID    = 0;
                rattlingskeletonpendant.ProcSpellID1     = 0;
                rattlingskeletonpendant.SpellID1         = 0;
                rattlingskeletonpendant.MaxCharges1      = 0;
                rattlingskeletonpendant.Charges1         = 0;

                GameServer.Database.AddObject(rattlingskeletonpendant);
            }
            giftandnoteforprugar = GameServer.Database.FindObjectByKey <ItemTemplate>("giftandnoteforprugar");
            if (giftandnoteforprugar == null)
            {
                giftandnoteforprugar      = new ItemTemplate();
                giftandnoteforprugar.Name = "Gift and Note for Prugar";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + giftandnoteforprugar.Name + ", creating it ...");
                }
                giftandnoteforprugar.Level            = 50;
                giftandnoteforprugar.Weight           = 5;
                giftandnoteforprugar.Model            = 1347;
                giftandnoteforprugar.Object_Type      = 0;
                giftandnoteforprugar.Item_Type        = 40;
                giftandnoteforprugar.Id_nb            = "giftandnoteforprugar";
                giftandnoteforprugar.Hand             = 0;
                giftandnoteforprugar.Price            = 0;
                giftandnoteforprugar.IsPickable       = true;
                giftandnoteforprugar.IsDropable       = true;
                giftandnoteforprugar.IsTradable       = true;
                giftandnoteforprugar.CanDropAsLoot    = false;
                giftandnoteforprugar.Color            = 0;
                giftandnoteforprugar.Bonus            = 35;      // default bonus
                giftandnoteforprugar.Bonus1           = 0;
                giftandnoteforprugar.Bonus1Type       = (int)0;
                giftandnoteforprugar.Bonus2           = 0;
                giftandnoteforprugar.Bonus2Type       = (int)0;
                giftandnoteforprugar.Bonus3           = 0;
                giftandnoteforprugar.Bonus3Type       = (int)0;
                giftandnoteforprugar.Bonus4           = 0;
                giftandnoteforprugar.Bonus4Type       = (int)0;
                giftandnoteforprugar.Bonus5           = 0;
                giftandnoteforprugar.Bonus5Type       = (int)0;
                giftandnoteforprugar.Bonus6           = 0;
                giftandnoteforprugar.Bonus6Type       = (int)0;
                giftandnoteforprugar.Bonus7           = 0;
                giftandnoteforprugar.Bonus7Type       = (int)0;
                giftandnoteforprugar.Bonus8           = 0;
                giftandnoteforprugar.Bonus8Type       = (int)0;
                giftandnoteforprugar.Bonus9           = 0;
                giftandnoteforprugar.Bonus9Type       = (int)0;
                giftandnoteforprugar.Bonus10          = 0;
                giftandnoteforprugar.Bonus10Type      = (int)0;
                giftandnoteforprugar.ExtraBonus       = 0;
                giftandnoteforprugar.ExtraBonusType   = (int)0;
                giftandnoteforprugar.Effect           = 0;
                giftandnoteforprugar.Emblem           = 0;
                giftandnoteforprugar.Charges          = 0;
                giftandnoteforprugar.MaxCharges       = 0;
                giftandnoteforprugar.SpellID          = 0;
                giftandnoteforprugar.ProcSpellID      = 0;
                giftandnoteforprugar.Type_Damage      = 0;
                giftandnoteforprugar.Realm            = 0;
                giftandnoteforprugar.MaxCount         = 1;
                giftandnoteforprugar.PackSize         = 1;
                giftandnoteforprugar.Extension        = 0;
                giftandnoteforprugar.Quality          = 99;
                giftandnoteforprugar.Condition        = 50000;
                giftandnoteforprugar.MaxCondition     = 50000;
                giftandnoteforprugar.Durability       = 50000;
                giftandnoteforprugar.MaxDurability    = 50000;
                giftandnoteforprugar.PoisonCharges    = 0;
                giftandnoteforprugar.PoisonMaxCharges = 0;
                giftandnoteforprugar.PoisonSpellID    = 0;
                giftandnoteforprugar.ProcSpellID1     = 0;
                giftandnoteforprugar.SpellID1         = 0;
                giftandnoteforprugar.MaxCharges1      = 0;
                giftandnoteforprugar.Charges1         = 0;

                GameServer.Database.AddObject(giftandnoteforprugar);
            }

            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(thebirthdaygift));
            QuestBehaviour a;
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Interact, null, BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk1"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper1"), BarkeepNognar);

            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk2"), BarkeepNognar);

            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper2"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk3"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper3"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk4"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper4"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk5"), BarkeepNognar);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.OfferQuest"));
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.thebirthdaygift));
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk6"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.thebirthdaygift));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk7"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper5"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk8"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.EnemyKilled"), null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 1, (eComparator)3);
            a.AddAction(eActionType.GiveItem, rattlingskeletonpendant, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Interact, null, BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk9"), BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.GiveItem, BarkeepNognar, rattlingskeletonpendant);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk10"), BarkeepNognar);
            a.AddAction(eActionType.TakeItem, rattlingskeletonpendant, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepNognar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper6"), BarkeepNognar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem, rattlingskeletonpendant, 0, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk11"), BarkeepNognar);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null);
            a.AddAction(eActionType.GiveItem, giftandnoteforprugar, BarkeepNognar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepPrugar, -1);
            a.AddTrigger(eTriggerType.Interact, null, BarkeepPrugar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk12"), BarkeepPrugar);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepPrugar, -1);
            a.AddTrigger(eTriggerType.GiveItem, BarkeepPrugar, giftandnoteforprugar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk13"), BarkeepPrugar);
            a.AddAction(eActionType.TakeItem, giftandnoteforprugar, null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(BarkeepPrugar, -1);
            a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper7"), BarkeepPrugar);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3);
            a.AddRequirement(eRequirementType.InventoryItem, giftandnoteforprugar, 0, (eComparator)3);
            a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk14"), BarkeepPrugar);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 27, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (BarkeepNognar != null)
            {
                BarkeepNognar.AddQuestToGive(typeof(thebirthdaygift));
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Пример #6
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            GameNPC[] npcs;

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Gridash", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                    Gridash       = new DOL.GS.GameNPC();
                    Gridash.Model = 137;
                    Gridash.Name  = "Gridash";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + Gridash.Name + ", creating ...");
                    }

                    Gridash.GuildName       = "Part of " + questTitle + " Quest";
                    Gridash.Realm           = eRealm.Midgard;
                    Gridash.CurrentRegionID = 100;
                    Gridash.Size            = 51;
                    Gridash.Level           = 21;
                    Gridash.MaxSpeedBase    = 191;
                    Gridash.Faction         = FactionMgr.GetFactionByID(0);
                    Gridash.X               = 772795;
                    Gridash.Y               = 753335;
                    Gridash.Z               = 4600;
                    Gridash.Heading         = 3356;
                    Gridash.RespawnInterval = -1;
                    Gridash.BodyType        = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    Gridash.SetOwnBrain(brain);

                    // You don't have to store the created mob in the db if you don't want,
                    // it will be recreated each time it is not found, just comment the following
                    // line if you rather not modify your database
                    if (SAVE_INTO_DATABASE)
                    {
                        Gridash.SaveIntoDatabase();
                    }

                    Gridash.AddToWorld();
                }
            }
            else
            {
                Gridash = npcs[0];
            }

            bronze_short_sword = GameServer.Database.FindObjectByKey <ItemTemplate>("bronze_short_sword");
            if (bronze_short_sword == null)
            {
                bronze_short_sword      = new ItemTemplate();
                bronze_short_sword.Name = "bronze short sword";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + bronze_short_sword.Name + ", creating it ...");
                }

                bronze_short_sword.Level            = 1;
                bronze_short_sword.Weight           = 180;
                bronze_short_sword.Model            = 3;
                bronze_short_sword.Object_Type      = 3;
                bronze_short_sword.Item_Type        = 11;
                bronze_short_sword.Id_nb            = "bronze_short_sword";
                bronze_short_sword.Hand             = 2;
                bronze_short_sword.Price            = Money.GetMoney(0, 0, 0, 1, 50);
                bronze_short_sword.IsPickable       = true;
                bronze_short_sword.IsDropable       = true;
                bronze_short_sword.IsTradable       = false;
                bronze_short_sword.CanDropAsLoot    = true;
                bronze_short_sword.Color            = 0;
                bronze_short_sword.Bonus            = 0; // default bonus
                bronze_short_sword.Bonus1           = 0;
                bronze_short_sword.Bonus1Type       = (int)0;
                bronze_short_sword.Bonus2           = 0;
                bronze_short_sword.Bonus2Type       = (int)0;
                bronze_short_sword.Bonus3           = 0;
                bronze_short_sword.Bonus3Type       = (int)0;
                bronze_short_sword.Bonus4           = 0;
                bronze_short_sword.Bonus4Type       = (int)0;
                bronze_short_sword.Bonus5           = 0;
                bronze_short_sword.Bonus5Type       = (int)0;
                bronze_short_sword.Bonus6           = 0;
                bronze_short_sword.Bonus6Type       = (int)0;
                bronze_short_sword.Bonus7           = 0;
                bronze_short_sword.Bonus7Type       = (int)0;
                bronze_short_sword.Bonus8           = 0;
                bronze_short_sword.Bonus8Type       = (int)0;
                bronze_short_sword.Bonus9           = 0;
                bronze_short_sword.Bonus9Type       = (int)0;
                bronze_short_sword.Bonus10          = 0;
                bronze_short_sword.Bonus10Type      = (int)0;
                bronze_short_sword.ExtraBonus       = 0;
                bronze_short_sword.ExtraBonusType   = (int)0;
                bronze_short_sword.Effect           = 0;
                bronze_short_sword.Emblem           = 0;
                bronze_short_sword.Charges          = 0;
                bronze_short_sword.MaxCharges       = 0;
                bronze_short_sword.SpellID          = 0;
                bronze_short_sword.ProcSpellID      = 0;
                bronze_short_sword.Type_Damage      = 2;
                bronze_short_sword.Realm            = 1;
                bronze_short_sword.MaxCount         = 1;
                bronze_short_sword.PackSize         = 1;
                bronze_short_sword.Extension        = 0;
                bronze_short_sword.Quality          = 85;
                bronze_short_sword.Condition        = 50000;
                bronze_short_sword.MaxCondition     = 50000;
                bronze_short_sword.Durability       = 100;
                bronze_short_sword.MaxDurability    = 100;
                bronze_short_sword.PoisonCharges    = 0;
                bronze_short_sword.PoisonMaxCharges = 0;
                bronze_short_sword.PoisonSpellID    = 0;
                bronze_short_sword.ProcSpellID1     = 0;
                bronze_short_sword.SpellID1         = 0;
                bronze_short_sword.MaxCharges1      = 0;
                bronze_short_sword.Charges1         = 0;

                // You don't have to store the created item in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(bronze_short_sword);
                }
            }

            sveawolftooth = GameServer.Database.FindObjectByKey <ItemTemplate>("sveawolftooth");
            if (sveawolftooth == null)
            {
                sveawolftooth      = new ItemTemplate();
                sveawolftooth.Name = "Sveawolf Tooth";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sveawolftooth.Name + ", creating it ...");
                }

                sveawolftooth.Level            = 50;
                sveawolftooth.Weight           = 5;
                sveawolftooth.Model            = 106;
                sveawolftooth.Object_Type      = 0;
                sveawolftooth.Item_Type        = 40;
                sveawolftooth.Id_nb            = "sveawolftooth";
                sveawolftooth.Hand             = 0;
                sveawolftooth.Price            = 0;
                sveawolftooth.IsPickable       = true;
                sveawolftooth.IsDropable       = true;
                sveawolftooth.IsTradable       = true;
                sveawolftooth.CanDropAsLoot    = false;
                sveawolftooth.Color            = 0;
                sveawolftooth.Bonus            = 35; // default bonus
                sveawolftooth.Bonus1           = 0;
                sveawolftooth.Bonus1Type       = (int)0;
                sveawolftooth.Bonus2           = 0;
                sveawolftooth.Bonus2Type       = (int)0;
                sveawolftooth.Bonus3           = 0;
                sveawolftooth.Bonus3Type       = (int)0;
                sveawolftooth.Bonus4           = 0;
                sveawolftooth.Bonus4Type       = (int)0;
                sveawolftooth.Bonus5           = 0;
                sveawolftooth.Bonus5Type       = (int)0;
                sveawolftooth.Bonus6           = 0;
                sveawolftooth.Bonus6Type       = (int)0;
                sveawolftooth.Bonus7           = 0;
                sveawolftooth.Bonus7Type       = (int)0;
                sveawolftooth.Bonus8           = 0;
                sveawolftooth.Bonus8Type       = (int)0;
                sveawolftooth.Bonus9           = 0;
                sveawolftooth.Bonus9Type       = (int)0;
                sveawolftooth.Bonus10          = 0;
                sveawolftooth.Bonus10Type      = (int)0;
                sveawolftooth.ExtraBonus       = 0;
                sveawolftooth.ExtraBonusType   = (int)0;
                sveawolftooth.Effect           = 0;
                sveawolftooth.Emblem           = 0;
                sveawolftooth.Charges          = 0;
                sveawolftooth.MaxCharges       = 0;
                sveawolftooth.SpellID          = 0;
                sveawolftooth.ProcSpellID      = 0;
                sveawolftooth.Type_Damage      = 0;
                sveawolftooth.Realm            = 0;
                sveawolftooth.MaxCount         = 1;
                sveawolftooth.PackSize         = 1;
                sveawolftooth.Extension        = 0;
                sveawolftooth.Quality          = 99;
                sveawolftooth.Condition        = 50000;
                sveawolftooth.MaxCondition     = 50000;
                sveawolftooth.Durability       = 50000;
                sveawolftooth.MaxDurability    = 50000;
                sveawolftooth.PoisonCharges    = 0;
                sveawolftooth.PoisonMaxCharges = 0;
                sveawolftooth.PoisonSpellID    = 0;
                sveawolftooth.ProcSpellID1     = 0;
                sveawolftooth.SpellID1         = 0;
                sveawolftooth.MaxCharges1      = 0;
                sveawolftooth.Charges1         = 0;

                // You don't have to store the created item in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sveawolftooth);
                }
            }

            sveabone_hilt_sword = GameServer.Database.FindObjectByKey <ItemTemplate>("sveabone_hilt_sword");
            if (sveabone_hilt_sword == null)
            {
                sveabone_hilt_sword      = new ItemTemplate();
                sveabone_hilt_sword.Name = "Sveabone Hilt Sword";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sveabone_hilt_sword.Name + ", creating it ...");
                }

                sveabone_hilt_sword.Level            = 1;
                sveabone_hilt_sword.Weight           = 18;
                sveabone_hilt_sword.Model            = 311;
                sveabone_hilt_sword.Object_Type      = 11;
                sveabone_hilt_sword.Item_Type        = 10;
                sveabone_hilt_sword.Id_nb            = "sveabone_hilt_sword";
                sveabone_hilt_sword.Hand             = 0;
                sveabone_hilt_sword.Price            = 0;
                sveabone_hilt_sword.IsPickable       = true;
                sveabone_hilt_sword.IsDropable       = true;
                sveabone_hilt_sword.IsTradable       = false;
                sveabone_hilt_sword.CanDropAsLoot    = false;
                sveabone_hilt_sword.Color            = 0;
                sveabone_hilt_sword.Bonus            = 0; // default bonus
                sveabone_hilt_sword.Bonus1           = 1;
                sveabone_hilt_sword.Bonus1Type       = (int)52;
                sveabone_hilt_sword.Bonus2           = 0;
                sveabone_hilt_sword.Bonus2Type       = (int)0;
                sveabone_hilt_sword.Bonus3           = 0;
                sveabone_hilt_sword.Bonus3Type       = (int)0;
                sveabone_hilt_sword.Bonus4           = 0;
                sveabone_hilt_sword.Bonus4Type       = (int)0;
                sveabone_hilt_sword.Bonus5           = 0;
                sveabone_hilt_sword.Bonus5Type       = (int)0;
                sveabone_hilt_sword.Bonus6           = 0;
                sveabone_hilt_sword.Bonus6Type       = (int)0;
                sveabone_hilt_sword.Bonus7           = 0;
                sveabone_hilt_sword.Bonus7Type       = (int)0;
                sveabone_hilt_sword.Bonus8           = 0;
                sveabone_hilt_sword.Bonus8Type       = (int)0;
                sveabone_hilt_sword.Bonus9           = 0;
                sveabone_hilt_sword.Bonus9Type       = (int)0;
                sveabone_hilt_sword.Bonus10          = 0;
                sveabone_hilt_sword.Bonus10Type      = (int)0;
                sveabone_hilt_sword.ExtraBonus       = 0;
                sveabone_hilt_sword.ExtraBonusType   = (int)0;
                sveabone_hilt_sword.Effect           = 0;
                sveabone_hilt_sword.Emblem           = 0;
                sveabone_hilt_sword.Charges          = 0;
                sveabone_hilt_sword.MaxCharges       = 0;
                sveabone_hilt_sword.SpellID          = 0;
                sveabone_hilt_sword.ProcSpellID      = 0;
                sveabone_hilt_sword.Type_Damage      = 2;
                sveabone_hilt_sword.Realm            = 0;
                sveabone_hilt_sword.MaxCount         = 1;
                sveabone_hilt_sword.PackSize         = 1;
                sveabone_hilt_sword.Extension        = 0;
                sveabone_hilt_sword.Quality          = 99;
                sveabone_hilt_sword.Condition        = 100;
                sveabone_hilt_sword.MaxCondition     = 100;
                sveabone_hilt_sword.Durability       = 100;
                sveabone_hilt_sword.MaxDurability    = 100;
                sveabone_hilt_sword.PoisonCharges    = 0;
                sveabone_hilt_sword.PoisonMaxCharges = 0;
                sveabone_hilt_sword.PoisonSpellID    = 0;
                sveabone_hilt_sword.ProcSpellID1     = 0;
                sveabone_hilt_sword.SpellID1         = 0;
                sveabone_hilt_sword.MaxCharges1      = 0;
                sveabone_hilt_sword.Charges1         = 0;

                // You don't have to store the created item in the db if you don't want,
                // it will be recreated each time it is not found, just comment the following
                // line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sveabone_hilt_sword);
                }
            }

            QuestBuilder   builder = QuestMgr.GetBuilder(typeof(sveabonehiltsword));
            QuestBehaviour a;

            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.Interact, null, Gridash);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Hail young one! I have noticed that you do not carry one of my fine [bone hilt swords].", Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.Whisper, "bone hilt swords", Gridash);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Aye! They are some of my finest works! I don't suppose you [would care for one] eh?", Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.Whisper, "would care for one", Gridash);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), "Will you do what is asked so that Gridash can make a Sveabone hilt sword?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword));
            a.AddAction(eActionType.Talk, "No problem. See you", Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword));
            a.AddAction(eActionType.Talk, "Oh great then! Run along and buy me a bronze short sword. I should be ready once you return.", Gridash);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.GiveItem, Gridash, bronze_short_sword);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null);
            a.AddAction(eActionType.Talk, "Good work! I cannot seem to find anymore sveawolf teeth to fashion your weapon. Find one and return it to me.", Gridash);
            a.AddAction(eActionType.TakeItem, bronze_short_sword, null);
            a.AddAction(eActionType.IncQuestStep, typeof(sveabonehiltsword), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "young sveawof", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), 2, (eComparator)3);
            a.AddAction(eActionType.GiveItem, sveawolftooth, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Gridash, -1);
            a.AddTrigger(eTriggerType.GiveItem, Gridash, sveawolftooth);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Here is your completed work. I hope it serves you well!", Gridash);
            a.AddAction(eActionType.TakeItem, sveawolftooth, null);
            a.AddAction(eActionType.GiveItem, sveabone_hilt_sword, Gridash);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 450, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null);
            AddBehaviour(a);

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (Gridash != null)
            {
                Gridash.AddQuestToGive(typeof(sveabonehiltsword));
            }

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(questGiverName, eRealm.Albion);

            if (npcs.Length == 0)
            {
                questGiver       = new GameNPC();
                questGiver.Model = 1960;
                questGiver.Name  = questGiverName;
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + questGiver.Name + ", creating him ...");
                }

                questGiver.Realm           = eRealm.Albion;
                questGiver.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 691, 0);        // Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 692, 0);         // Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 688, 0);        // Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 676, 0);             // Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 689, 0);         // Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 690, 0);         // Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Size    = 55;
                questGiver.Level   = 70;
                questGiver.X       = 95510;
                questGiver.Y       = 101313;
                questGiver.Z       = 5340;
                questGiver.Heading = 3060;

                if (SAVE_INTO_DATABASE)
                {
                    questGiver.SaveIntoDatabase();
                }

                questGiver.AddToWorld();
            }
            else
            {
                questGiver = npcs[0];
            }

            npcs = WorldMgr.GetObjectsByName <GameNPC>(questTargetName, eRealm.Albion);

            if (npcs.Length == 0)
            {
                questTarget       = new GameNPC();
                questTarget.Model = 73;
                questTarget.Name  = questTargetName;
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + questTarget.Name + ", creating him ...");
                }

                questTarget.Realm           = eRealm.Albion;
                questTarget.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 665, 0);        // Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 666, 0);         // Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 662, 0);        // Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 676, 0);             // Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 663, 0);         // Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 664, 0);         // Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Size    = 50;
                questTarget.Level   = 38;
                questTarget.X       = 94789;
                questTarget.Y       = 101439;
                questTarget.Z       = 5248;
                questTarget.Heading = 2878;

                if (SAVE_INTO_DATABASE)
                {
                    questTarget.SaveIntoDatabase();
                }

                questTarget.AddToWorld();
            }
            else
            {
                questTarget = npcs[0];
            }

            targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle(string.Empty, targetLocation.X, targetLocation.Y, targetLocation.Z, 200));

            QuestBuilder   builder  = QuestMgr.GetBuilder(typeof(MovementAndInteraction));
            QuestBehaviour a        = null;
            string         message1 = "Welcome to " + zoneName + ", <Class>. Here you will learn the basic skills needed to defend yourself as you explore our realm and grow in power and wisdom. Now, without further delay, let's get you started on your [training].";
            string         message2 = "If you exit through the doors behind me, you will enter the courtyard. In the courtyard, you will find Master Gethin, who will be your training instructor. Go now and speak to Master Gethin.";

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(MovementAndInteraction), null, (eComparator)5);
            a.AddAction(eActionType.GiveQuest, typeof(MovementAndInteraction), questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, message1, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "training", questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 1, (eComparator)3);
            a.AddAction(eActionType.IncQuestStep, typeof(MovementAndInteraction), null);
            a.AddAction(eActionType.Talk, message2, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, message2, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.EnterArea, null, targetArea);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 2, (eComparator)3);
            a.AddAction(eActionType.IncQuestStep, typeof(MovementAndInteraction), null);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.Interact, null, questTarget);
            a.AddRequirement(eRequirementType.QuestStep, typeof(MovementAndInteraction), 3, (eComparator)3);
            a.AddAction(eActionType.FinishQuest, typeof(MovementAndInteraction), null);
            AddBehaviour(a);

            questGiver.AddQuestToGive(typeof(MovementAndInteraction));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }