public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_EXAMPLES)
                return;

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Quait", eRealm.Albion);
            npcs = WorldMgr.GetNPCsByName("Sir Quait", (eRealm)1);
            GameNPC SirQuait = null;
            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.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);

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

            #endregion defineNPCs

            #region defineBehaviours

            BaseBehaviour b = new BaseBehaviour(SirQuait);
            MessageAction a = new MessageAction(SirQuait, "This is just a simple test bahaviour.", eTextType.Emote);
            b.AddAction(a);
            InteractTrigger t = new InteractTrigger(SirQuait, b.NotifyHandler, SirQuait);
            b.AddTrigger(t);

            // store the behaviour in a list so it won't be garbage collected
            behaviours.Add(b);

            #endregion defineBehaviours

            log.Info("Simple Test Behaviour added");
        }
        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("Torold Sterkkriger", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(151).IsDisabled)
                {
                    ToroldSterkkriger = new DOL.GS.GameNPC();
                    ToroldSterkkriger.Model = 522;
                    ToroldSterkkriger.Name = "Torold Sterkkriger";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + ToroldSterkkriger.Name + ", creating ...");
                    ToroldSterkkriger.GuildName = "Part of " + questTitle + " Quest";
                    ToroldSterkkriger.Realm = eRealm.Midgard;
                    ToroldSterkkriger.CurrentRegionID = 151;
                    ToroldSterkkriger.Size = 50;
                    ToroldSterkkriger.Level = 55;
                    ToroldSterkkriger.MaxSpeedBase = 191;
                    ToroldSterkkriger.Faction = FactionMgr.GetFactionByID(0);
                    ToroldSterkkriger.X = 287623;
                    ToroldSterkkriger.Y = 355226;
                    ToroldSterkkriger.Z = 3488;
                    ToroldSterkkriger.Heading = 3788;
                    ToroldSterkkriger.RespawnInterval = -1;
                    ToroldSterkkriger.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    ToroldSterkkriger.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)
                        ToroldSterkkriger.SaveIntoDatabase();

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

            npcs = WorldMgr.GetNPCsByName("Jorund Bruttstein", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(151).IsDisabled)
                {
                    JorundBruttstein = new DOL.GS.GameNPC();
                    JorundBruttstein.Model = 513;
                    JorundBruttstein.Name = "Jorund Bruttstein";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + JorundBruttstein.Name + ", creating ...");
                    JorundBruttstein.GuildName = "Part of " + questTitle + " Quest";
                    JorundBruttstein.Realm = eRealm.Midgard;
                    JorundBruttstein.CurrentRegionID = 151;
                    JorundBruttstein.Size = 52;
                    JorundBruttstein.Level = 50;
                    JorundBruttstein.MaxSpeedBase = 191;
                    JorundBruttstein.Faction = FactionMgr.GetFactionByID(0);
                    JorundBruttstein.X = 287884;
                    JorundBruttstein.Y = 356307;
                    JorundBruttstein.Z = 3488;
                    JorundBruttstein.Heading = 3163;
                    JorundBruttstein.RespawnInterval = -1;
                    JorundBruttstein.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    JorundBruttstein.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)
                        JorundBruttstein.SaveIntoDatabase();

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

            #endregion defineNPCs

            #region defineItems

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

            #endregion defineItems

            #region defineAreas

            #endregion defineAreas

            #region defineQuestParts

            QuestBuilder builder = QuestMgr.getBuilder(typeof(trialofstrength));
            QuestBehaviour a;
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Vikings to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Viking like you by the presence of [Morvaltar].", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Rogue to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Rogue like you by the presence of [Morvaltar].", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "Morvaltar", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "As you may know, the Morvaltar are your wild cousins. We of Midgard do not fear Valkyn like you, for as a group you have more than proven your loyalty to King Goran. Many Valkyn have also proven that they are strong, intelligent, and brave. These are [the qualities] that all Vikings must possess before they can choose where their destiny lies.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Vikings from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Rogues from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.Whisper, "prove your strength", ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(trialofstrength), "Will you prove you have the strength to survive in the land of Aegir?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength));
            a.AddAction(eActionType.Talk, "No problem. See you", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength));
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger);
            a.AddAction(eActionType.Talk, "Seek out Jorund Bruttstein in Aegirhamn. Tell him your name when he asks.", ToroldSterkkriger);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Lo, I see a young Viking before me. What is your name? Speak up!", JorundBruttstein);
            a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "Lo, I see a young Rogue before me. What is your name? Speak up!", JorundBruttstein);
            a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Whisper, "one of the creatures", JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, "You must seek out a marine fungus. They may be found in the waters south and southwest of here. Find one and defeat it. Once you have, obtain proof that you have accomplished this test. Return to me here.", JorundBruttstein);
            AddBehaviour(a);
            a = builder.CreateBehaviour(ToroldSterkkriger, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "marine fungus", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3);
            a.AddAction(eActionType.GiveItem, marinefungusroot, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "So, you managed to survive, but anyone can run away. Show me the proof you defeated the marine fungus.", JorundBruttstein);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 35, false);
            a.AddAction(eActionType.Talk, "Well done. I do not like to be so rough with young Vikings, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 230, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(JorundBruttstein, -1);
            a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3);
            a.AddRequirement(eRequirementType.Class, 38, false);
            a.AddAction(eActionType.Talk, "\"Well done. I do not like to be so rough with young Rogues, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 230, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null);
            AddBehaviour(a);

            #endregion defineQuestParts

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (ToroldSterkkriger != null)
            {
                ToroldSterkkriger.AddQuestToGive(typeof(trialofstrength));
            }
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #3
0
        protected void CreateDunwynClone()
        {
            GameNpcInventoryTemplate template;
            if (dunwynClone == null)
            {
                dunwynClone = new GameNPC();
                dunwynClone.Name = "Master Dunwyn";
                dunwynClone.Model = 9;
                dunwynClone.GuildName = "Part of " + questTitle + " Quest";
                dunwynClone.Realm = eRealm.Albion;
                dunwynClone.CurrentRegionID = 1;
                dunwynClone.Size = 50;
                dunwynClone.Level = 14;

                dunwynClone.X = GameLocation.ConvertLocalXToGlobalX(8602, 0) + Util.Random(-150, 150);
                dunwynClone.Y = GameLocation.ConvertLocalYToGlobalY(47193, 0) + Util.Random(-150, 150);
                dunwynClone.Z = 2409;
                dunwynClone.Heading = 342;

                template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 798);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 19);
                dunwynClone.Inventory = template.CloseTemplate();
                dunwynClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 798, 0, 0, 0);
            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 19, 0, 0, 0);

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

                dunwynClone.AddToWorld();

                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterDunwyn));
                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterDunwyn));
            }
            else
            {
                dunwynClone.MoveTo(1, 567604, 509619, 2813, 3292);
            }

            foreach (GamePlayer visPlayer in dunwynClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                visPlayer.Out.SendEmoteAnimation(dunwynClone, eEmote.Bind);
            }

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i] = new GameNPC();

                recruits[i].Name = "Recruit";

                recruits[i].GuildName = "Part of " + questTitle + " Quest";
                recruits[i].Realm = eRealm.Albion;
                recruits[i].CurrentRegionID = 1;

                recruits[i].Size = 50;
                recruits[i].Level = 6;
                recruits[i].X = GameLocation.ConvertLocalXToGlobalX(8602, 0) + Util.Random(-150, 150);
                recruits[i].Y = GameLocation.ConvertLocalYToGlobalY(47193, 0) + Util.Random(-150, 150);

                recruits[i].Z = 2409;
                recruits[i].Heading = 187;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                recruits[i].SetOwnBrain(brain);

            }

            recruits[0].Name = "Recruit Armsman McTavish";
            recruits[0].Model = 40;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 69);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
            recruits[0].Inventory = template.CloseTemplate();
            recruits[0].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 69, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TORSO, 46, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.LEGS, 47, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.FEET, 50, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.ARMS, 48, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.HAND, 49, 0, 0, 0);

            recruits[1].Name = "Recruit Paladin Andral";
            recruits[1].Model = 41;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 6);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 45);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 43);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 44);
            recruits[1].Inventory = template.CloseTemplate();
            recruits[1].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 6, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TORSO, 41, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.LEGS, 42, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.FEET, 45, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.ARMS, 43, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.HAND, 44, 0, 0, 0);

            recruits[2].Name = "Recruit Scout Gillman";
            recruits[2].Model = 32;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[2].Inventory = template.CloseTemplate();
            recruits[2].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 4, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            recruits[3].Name = "Recruit Scout Stuart";
            recruits[3].Model = 32;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 5);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[3].Inventory = template.CloseTemplate();
            recruits[3].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 5, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i].AddToWorld();
            }
        }
Exemple #4
0
        public static GameNPC GetMasterFrederick()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("Master Frederick", eRealm.Albion);

            GameNPC masterFrederick = null;

            if (npcs.Length == 0)
            {
                masterFrederick = new GameNPC();
                masterFrederick.Model = 32;
                masterFrederick.Name = "Master Frederick";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + masterFrederick.Name + ", creating him ...");
                masterFrederick.GuildName = "Part of Frederick Quests";
                masterFrederick.Realm = eRealm.Albion;
                masterFrederick.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
                masterFrederick.Inventory = template.CloseTemplate();
                masterFrederick.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.TORSO, 41, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.LEG, 42, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.BOOT, 40, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.CLOAK, 91, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 4, 0, 0, 0);

                masterFrederick.Size = 50;
                masterFrederick.Level = 50;
                masterFrederick.X = 567969;
                masterFrederick.Y = 509880;
                masterFrederick.Z = 2861;
                masterFrederick.Heading = 65;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                masterFrederick.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)
                    masterFrederick.SaveIntoDatabase();

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

            return masterFrederick;
        }
		/// <summary>
		/// Load a NPC template onto this NPC
		/// </summary>
		/// <param name="template"></param>
		public virtual void LoadTemplate(INpcTemplate template)
		{
			if (template == null)
				return;

			var m_templatedInventory = new List<string>();
			this.TranslationId = template.TranslationId;
			this.Name = template.Name;
			this.Suffix = template.Suffix;
			this.GuildName = template.GuildName;
			this.ExamineArticle = template.ExamineArticle;
			this.MessageArticle = template.MessageArticle;
			
			#region Models, Sizes, Levels, Gender
			// Grav: this.Model/Size/Level accessors are triggering SendUpdate()
			// so i must use them, and not directly use private variables
			ushort choosenModel = 1;
			var splitModel = template.Model.SplitCSV(true);
			ushort.TryParse(splitModel[Util.Random(0,splitModel.Count-1)], out choosenModel);
			this.Model = choosenModel;
			
			// Graveen: template.Gender is 0,1 or 2 for respectively eGender.Neutral("it"), eGender.Male ("he"), 
			// eGender.Female ("she"). Any other value is randomly choosing a gender for current GameNPC
			int choosenGender = template.Gender>2?Util.Random(0,2):template.Gender;

			switch (choosenGender)
			{
				default	:
				case 0	: this.Gender = eGender.Neutral; break;
				case 1	: this.Gender = eGender.Male; break;
				case 2	: this.Gender = eGender.Female; break;			
			}
			
			byte choosenSize = 50;
			if (!Util.IsEmpty(template.Size))
			{
				var split = template.Size.SplitCSV(true);
				byte.TryParse(split[Util.Random(0,split.Count-1)], out choosenSize);
			}
			this.Size = choosenSize;
			
			byte choosenLevel = 1;
			if (!Util.IsEmpty(template.Level))
			{
				var split = template.Level.SplitCSV(true);
				byte.TryParse(split[Util.Random(0,split.Count-1)], out choosenLevel);
			}
			this.Level = choosenLevel;
			#endregion

			#region Stats
			// Stats
			if (template.Strength==0)
			{
				this.AutoSetStats();
			}
			else
			{
				this.Constitution = (short)template.Constitution;
				this.Dexterity = (short)template.Dexterity;
				this.Strength = (short)template.Strength;
				this.Quickness = (short)template.Quickness;
				this.Intelligence = (short)template.Intelligence;
				this.Piety = (short)template.Piety;
				this.Empathy = (short)template.Empathy;
				this.Charisma = (short)template.Charisma;
			}
			#endregion

			#region Misc Stats
			this.MaxDistance = template.MaxDistance;
			this.TetherRange = template.TetherRange;
			this.Race = (short)template.Race;
			this.BodyType = (ushort)template.BodyType;
			this.MaxSpeedBase = template.MaxSpeed;
			this.Flags = (eFlags)template.Flags;
			this.MeleeDamageType = template.MeleeDamageType;
			this.ParryChance = template.ParryChance;
			this.EvadeChance = template.EvadeChance;
			this.BlockChance = template.BlockChance;
			this.LeftHandSwingChance = template.LeftHandSwingChance;
			#endregion

			#region Inventory
			//Ok lets start loading the npc equipment - only if there is a value!
			if (!Util.IsEmpty(template.Inventory))
			{
				bool equipHasItems = false;
				GameNpcInventoryTemplate equip = new GameNpcInventoryTemplate();
				//First let's try to reach the npcequipment table and load that!
				//We use a ';' split to allow npctemplates to support more than one equipmentIDs
				var equipIDs = template.Inventory.SplitCSV();
				if (!template.Inventory.Contains(":"))
				{

					foreach (string str in equipIDs)
					{
						m_templatedInventory.Add(str);
					}

					string equipid = "";

					if (m_templatedInventory.Count > 0)
					{
						if (m_templatedInventory.Count == 1)
							equipid = template.Inventory;
						else
							equipid = m_templatedInventory[Util.Random(m_templatedInventory.Count - 1)];
					}
					if (equip.LoadFromDatabase(equipid))
						equipHasItems = true;
				}

				#region Legacy Equipment Code
				//Nope, nothing in the npcequipment table, lets do the crappy parsing
				//This is legacy code
				if (!equipHasItems && template.Inventory.Contains(":"))
				{
					//Temp list to store our models
					List<int> tempModels = new List<int>();

					//Let's go through all of our ';' seperated slots
					foreach (string str in equipIDs)
					{
						tempModels.Clear();
						//Split the equipment into slot and model(s)
						string[] slotXModels = str.Split(':');
						//It should only be two in length SLOT : MODELS
						if (slotXModels.Length == 2)
						{
							int slot;
							//Let's try to get our slot
							if (Int32.TryParse(slotXModels[0], out slot))
							{
								//Now lets go through and add all the models to the list
								string[] models = slotXModels[1].Split('|');
								foreach (string strModel in models)
								{
									//We'll add it to the list if we successfully parse it!
									int model;
									if (Int32.TryParse(strModel, out model))
										tempModels.Add(model);
								}

								//If we found some models let's randomly pick one and add it the equipment
								if (tempModels.Count > 0)
									equipHasItems |= equip.AddNPCEquipment((eInventorySlot)slot, tempModels[Util.Random(tempModels.Count - 1)]);
							}
						}
					}
				}
				#endregion

				//We added some items - let's make it the new inventory
				if (equipHasItems)
				{
					this.Inventory = new GameNPCInventory(equip);
					if (this.Inventory.GetItem(eInventorySlot.DistanceWeapon) != null)
						this.SwitchWeapon(eActiveWeaponSlot.Distance);
				}
				
				if (template.VisibleActiveWeaponSlot > 0)
					this.VisibleActiveWeaponSlots = template.VisibleActiveWeaponSlot;
			}
			#endregion
			
			if (template.Spells != null) this.Spells = template.Spells;
			if (template.Styles != null) this.Styles = template.Styles;
			if (template.Abilities != null)
			{
				lock (m_lockAbilities)
				{
					foreach (Ability ab in template.Abilities)
						m_abilities[ab.KeyName] = ab;
				}
			}
			BuffBonusCategory4[(int)eStat.STR] += template.Strength;
			BuffBonusCategory4[(int)eStat.DEX] += template.Dexterity;
			BuffBonusCategory4[(int)eStat.CON] += template.Constitution;
			BuffBonusCategory4[(int)eStat.QUI] += template.Quickness;
			BuffBonusCategory4[(int)eStat.INT] += template.Intelligence;
			BuffBonusCategory4[(int)eStat.PIE] += template.Piety;
			BuffBonusCategory4[(int)eStat.EMP] += template.Empathy;
			BuffBonusCategory4[(int)eStat.CHR] += template.Charisma;

			m_ownBrain = new StandardMobBrain
			{
				Body = this,
				AggroLevel = template.AggroLevel,
				AggroRange = template.AggroRange
			};
			this.NPCTemplate = template as NpcTemplate;
		}
Exemple #6
0
        protected virtual void CreateMorgana()
        {
            if (Morgana == null)
            {
                Morgana = new GameNPC();
                Morgana.Model = 283;
                Morgana.Name = "Morgana";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Morgana.Name + " , creating it ...");
                Morgana.GuildName = "";
                Morgana.Realm = eRealm.None;
                Morgana.CurrentRegionID = 1;
                Morgana.Size = 51;
                Morgana.Level = 90;
                Morgana.X = 306056;
                Morgana.Y = 670106;
                Morgana.Z = 3095;
                Morgana.Heading = 3261;

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 98, 43);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 133, 61);
                Morgana.Inventory = template.CloseTemplate();

            //				Morgana.AddNPCEquipment((byte) eVisibleItems.TORSO, 98, 43, 0, 0);
            //				Morgana.AddNPCEquipment((byte) eVisibleItems.BOOT, 133, 61, 0, 0);
            }

            Morgana.AddToWorld();
        }
Exemple #7
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 ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Jerem", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                sirJerem = new GameNPC();
                sirJerem.Model = 254;
                sirJerem.Name = "Sir Jerem";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sirJerem.Name + ", creating him ...");
                sirJerem.GuildName = "Part of " + questTitle + " Quest";
                sirJerem.Realm = eRealm.Albion;
                sirJerem.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 68, 21);
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 64);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 27);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 158);
                sirJerem.Inventory = template.CloseTemplate();
                sirJerem.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                sirJerem.Size = 51;
                sirJerem.Level = 38;
                sirJerem.X = 573815;
                sirJerem.Y = 530850;
                sirJerem.Z = 2933;
                sirJerem.Heading = 2685;

                //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)
                    sirJerem.SaveIntoDatabase();

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

            npcs = WorldMgr.GetNPCsByName("Squire Galune", eRealm.Albion);
            if (npcs.Length == 0)
            {
                squireGalune = new GameNPC();
                squireGalune.Model = 254;
                squireGalune.Name = "Squire Galune";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + squireGalune.Name + ", creating him ...");
                squireGalune.GuildName = "Part of " + questTitle + " Quest";
                squireGalune.Realm = eRealm.Albion;
                squireGalune.CurrentRegionID = 21;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 320);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                squireGalune.Inventory = template.CloseTemplate();
                squireGalune.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                squireGalune.Size = 45;
                squireGalune.Level = 8;
                squireGalune.X = 33219;
                squireGalune.Y = 31931;
                squireGalune.Z = 16240;
                squireGalune.Heading = 477;

                //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)
                    squireGalune.SaveIntoDatabase();

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

            foreach (GameNPC npc in squireGalune.GetNPCsInRadius(400))
            {
                if (npc.Name == "small spider")
                {
                    smallSpider = npc;
                    break;
                }
            }

            if (smallSpider == null)
            {
                smallSpider = new GameNPC();
                smallSpider.Model = 72;
                smallSpider.Name = "small spider";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + smallSpider.Name + ", creating him ...");
                smallSpider.GuildName = "Part of " + questTitle + " Quest";
                smallSpider.Realm = eRealm.None;
                smallSpider.CurrentRegionID = 21;
                smallSpider.Size = 17;
                smallSpider.Level = 5;
                smallSpider.X = 33158;
                smallSpider.Y = 31973;
                smallSpider.Z = 16240;

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

                smallSpider.Heading = 2605;
                smallSpider.MaxSpeedBase = 0;

                //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)
                    smallSpider.SaveIntoDatabase();

                smallSpider.AddToWorld();
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirJerem));
            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirJerem));

            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.Interact, new DOLEventHandler(TalkToSquireGalune));
            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSquireGalune));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            sirJerem.AddQuestToGive(typeof (ShakenSquire));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof(HeartOfSephucoth)) == null)
                return;

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (Step == 1)
                {
                    if (gArgs.Target.Name == "river sprite")
                    {
                        if (Util.Chance(25))
                        {
                            if (sephucoth == null)
                            {
                                sephucoth = new GameNPC();
                                sephucoth.Model = 136;
                                sephucoth.Name = "Sephucoth";
                                sephucoth.Realm = eRealm.None;
                                sephucoth.CurrentRegionID = 1;

                                sephucoth.Size = 55;
                                sephucoth.Level = 7;
                                sephucoth.X = 560836;
                                sephucoth.Y = 527260;
                                sephucoth.Z = 2082;
                                sephucoth.Heading = 1480;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                sephucoth.SetOwnBrain(brain);					  // so this mob must be abble to cast

                                sephucoth.RespawnInterval = 0; // don't respawn when killed

                                sephucoth.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Sephucoth")
                    {
                        GiveItem(gArgs.Target, player, sephucothsHeart);
                        if (sephucoth != null) { sephucoth = null; }

                        Step = 2;
                    }
                }
                else if (Step == 3)
                {
                    if (gArgs.Target.Name == "large skeleton")
                    {
                        if (Util.Chance(50))
                        {
                            GiveItem(gArgs.Target, player, polishedBone);
                            Step = 4;
                        }
                    }
                }
            }
            else if (e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs = (GiveItemEventArgs)args;
                if (gArgs.Target.Name == eowylnAstos.Name)
                {
                    if (gArgs.Item.Id_nb == sephucothsHeart.Id_nb && Step == 2)
                    {
                        RemoveItem(eowylnAstos, m_questPlayer, sephucothsHeart);

                        eowylnAstos.TurnTo(m_questPlayer);
                        eowylnAstos.SayTo(m_questPlayer, "You have done well traveler! I will still require one final object to complete the pendant. Seek out a large skeleton and bring from it a piece of polished bone! Return this to me and I shall finish your pendant.");
                        Step = 3;
                    }
                    else if (gArgs.Item.Id_nb == polishedBone.Id_nb && Step == 4)
                    {
                        RemoveItem(eowylnAstos, m_questPlayer, polishedBone);

                        eowylnAstos.TurnTo(m_questPlayer);
                        eowylnAstos.SayTo(m_questPlayer, "Eowyln draws two items before her. Gathering her strength, she shouts.");

                        new RegionTimer(eowylnAstos, new RegionTimerCallback(BuildNecklace), 5000);
                    }
                }
            }
        }
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof(HuntForSlith)) == null)
                return;

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (Step == 1)
                {
                    if (gArgs.Target.Name == "slith broodling")
                    {
                        if (Util.Chance(25))
                        {
                            if (slith == null)
                            {
                                slith = new GameNPC();
                                slith.Model = 31;
                                slith.Name = "Slith";
                                slith.Realm = eRealm.None;
                                slith.CurrentRegionID = 1;

                                slith.Size = 50;
                                slith.Level = 7;
                                slith.X = 524840;
                                slith.Y = 490529;
                                slith.Z = 2545;
                                slith.Heading = 2082;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                slith.SetOwnBrain(brain);

                                slith.RespawnInterval = 0; // don't respawn when killed

                                slith.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Slith")
                    {
                        GiveItem(gArgs.Target, player, slithsTail);
                        if (slith != null) { slith = null; }
                        FinishQuest();
                    }
                }
            }
        }
Exemple #10
0
		public void SpawnAGuard(int guardX, int guardY, int guardZ, ushort heading)
		{
			GameStairGuard guard = new GameStairGuard();
			guard.Model = 1349;
			guard.Size = 37;
			guard.Level = 80; //level 70 on live
			guard.Name = "daleros ephoros";
			guard.CurrentRegionID = (ushort)Ianetor.playerregion;
			guard.Heading = heading;
			guard.Realm = 0;
			guard.CurrentSpeed = 0;
			guard.MaxSpeedBase = 300;
			guard.GuildName = "";
			guard.X = guardX;
			guard.Y = guardY;
			guard.Z = guardZ;
			guard.RoamingRange = 0;
			guard.RespawnInterval = 0;
			guard.BodyType = 0;
			guard.Strength = 600;

			StandardMobBrain brain = new StandardMobBrain();
			brain.AggroLevel = 100;
			brain.AggroRange = 200;
			guard.SetOwnBrain(brain);

			guard.AddToWorld();
			StairGuardList.Add(guard);

			return;
		}
        protected void initDragonflyHatchling()
        {
            dragonflyHatchling = new GameNPC();

            dragonflyHatchling.Model = 819;
            dragonflyHatchling.Name = "Dragonfly Hatchling";
            dragonflyHatchling.GuildName = "Part of " + questTitle + " Quest";
            dragonflyHatchling.Flags ^= GameNPC.eFlags.PEACE;
            dragonflyHatchling.CurrentRegionID = 1;
            dragonflyHatchling.Size = 25;
            dragonflyHatchling.Level = 3;
            dragonflyHatchling.X = fairyDragonflyHandler.X + Util.Random(-150, 150);
            dragonflyHatchling.Y = fairyDragonflyHandler.Y + Util.Random(-150, 150);
            dragonflyHatchling.Z = fairyDragonflyHandler.Z;
            dragonflyHatchling.Heading = 93;
            dragonflyHatchling.MaxSpeedBase = 200;

            StandardMobBrain brain = new StandardMobBrain();
            brain.AggroLevel = 0;
            brain.AggroRange = 0;
            dragonflyHatchling.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
            //dragonflyHatchling.SaveIntoDatabase();

            GameEventMgr.AddHandler(dragonflyHatchling, GameLivingEvent.Interact, new DOLEventHandler(TalkToDragonflyHatchling));
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Nob the Stableboy", eRealm.Albion);
            if (npcs.Length == 0)
            {
                nob = new GameNPC();
                nob.Model = 9;
                nob.Name = "Nob the Stableboy";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + nob.Name + ", creating him ...");
                nob.GuildName = "Part of " + questTitle + " Quest";
                nob.Realm = eRealm.Albion;
                nob.CurrentRegionID = 1;

                nob.Size = 45;
                nob.Level = 4;
                nob.X = 573019;
                nob.Y = 504485;
                nob.Z = 2199;
                nob.Heading = 10;

                //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)
                    nob.SaveIntoDatabase();

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

            npcs = (GameNPC[])WorldMgr.GetObjectsByName("Dragonfly Handler Colm", eRealm.Albion, typeof(GameStableMaster));
            if (npcs.Length == 0)
            {
                colm = new GameStableMaster();
                colm.Model = 78;
                colm.Name = "Dragonfly Handler Colm";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + colm.Name + ", creating ...");
                colm.GuildName = "Stable Master";
                colm.Realm = eRealm.Albion;
                colm.CurrentRegionID = 1;
                colm.Size = 51;
                colm.Level = 50;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81, 10);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 82, 10);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 84, 10);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
                colm.Inventory = template.CloseTemplate();

                //				colm.AddNPCEquipment(Slot.TORSO, 81, 10, 0, 0);
                //				colm.AddNPCEquipment(Slot.LEGS, 82, 10, 0, 0);
                //				colm.AddNPCEquipment(Slot.FEET, 84, 10, 0, 0);
                //				colm.AddNPCEquipment(Slot.CLOAK, 57, 32, 0, 0);

                colm.X = 562775;
                colm.Y = 512453;
                colm.Z = 2438;
                colm.Heading = 158;
                colm.MaxSpeedBase = 200;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                colm.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)
                    colm.SaveIntoDatabase();
                colm.AddToWorld();
            }
            else
            {
                colm = npcs[0] as GameStableMaster;
            }

            npcs = WorldMgr.GetNPCsByName("Haruld", eRealm.Albion);
            if (npcs.Length == 0 || !(npcs[0] is GameStableMaster))
            {
                haruld = new GameStableMaster();
                haruld.Model = 9;
                haruld.Name = "Haruld";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + haruld.Name + ", creating ...");
                haruld.GuildName = "Stable Master";
                haruld.Realm = eRealm.Albion;
                haruld.CurrentRegionID = 1;
                haruld.Size = 49;
                haruld.Level = 4;

                haruld.X = 572479;
                haruld.Y = 504410;
                haruld.Z = 2184;
                haruld.Heading = 944;
                haruld.MaxSpeedBase = 100;

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

                haruld.EquipmentTemplateID = "11701337";

                //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)
                    haruld.SaveIntoDatabase();
                haruld.AddToWorld();
            }
            else
            {
                haruld = npcs[0] as GameStableMaster;
            }

            npcs = WorldMgr.GetNPCsByName("Fairy Dragonfly Handler", eRealm.None);
            if (npcs.Length == 0)
            {
                fairyDragonflyHandler = new GameNPC();
                fairyDragonflyHandler.Name = "Fairy Dragonfly Handler";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + fairyDragonflyHandler.Name + ", creating ...");
                fairyDragonflyHandler.X = 575334;
                fairyDragonflyHandler.Y = 506403;
                fairyDragonflyHandler.Z = 2331;
                fairyDragonflyHandler.Heading = 114;
                fairyDragonflyHandler.Model = 603;
                fairyDragonflyHandler.GuildName = "Part of " + questTitle + " Quest";
                fairyDragonflyHandler.Realm = eRealm.None;
                fairyDragonflyHandler.CurrentRegionID = 1;
                fairyDragonflyHandler.Size = 49;
                fairyDragonflyHandler.Level = 3;

                // Leave at default values to be one the save side ...
                //fairyDragonflyHandler.AggroLevel = 80;
                //fairyDragonflyHandler.AggroRange = 1000;

                //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)
                    fairyDragonflyHandler.SaveIntoDatabase();

                fairyDragonflyHandler.AddToWorld();
            }
            else
                fairyDragonflyHandler = (GameNPC)npcs[0];

            #endregion defineNPCs

            #region defineItems

            dragonflyWhip = GameServer.Database.FindObjectByKey<ItemTemplate>("dragonfly_whip");
            if (dragonflyWhip == null)
            {
                dragonflyWhip = new ItemTemplate();
                dragonflyWhip.Name = "Dragonfly Whip";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + dragonflyWhip.Name + " , creating it ...");

                dragonflyWhip.Weight = 15;
                dragonflyWhip.Model = 859;

                dragonflyWhip.Object_Type = (int)eObjectType.GenericItem;

                dragonflyWhip.Id_nb = "dragonfly_whip";
                dragonflyWhip.IsPickable = true;
                dragonflyWhip.IsDropable = false;

                //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(dragonflyWhip);
            }

            // item db check
            recruitsVest = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_vest");
            if (recruitsVest == null)
            {
                recruitsVest = new ItemTemplate();
                recruitsVest.Name = "Recruit's Studded Vest";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsVest.Name + ", creating it ...");
                recruitsVest.Level = 8;

                recruitsVest.Weight = 60;
                recruitsVest.Model = 81; // studded vest

                recruitsVest.DPS_AF = 12; // Armour
                recruitsVest.SPD_ABS = 19; // Absorption

                recruitsVest.Object_Type = (int)eObjectType.Studded;
                recruitsVest.Item_Type = (int)eEquipmentItems.TORSO;
                recruitsVest.Id_nb = "recruits_studded_vest";
                recruitsVest.Price = Money.GetMoney(0, 0, 0, 9, 0);
                recruitsVest.IsPickable = true;
                recruitsVest.IsDropable = true;
                recruitsVest.CanDropAsLoot = false;
                recruitsVest.Color = 9; // red leather

                recruitsVest.Bonus = 5; // default bonus

                recruitsVest.Bonus1 = 4;
                recruitsVest.Bonus1Type = (int)eStat.STR;

                recruitsVest.Bonus2 = 3;
                recruitsVest.Bonus2Type = (int)eStat.CON;

                recruitsVest.Quality = 100;
                recruitsVest.Condition = 1000;
                recruitsVest.MaxCondition = 1000;
                recruitsVest.Durability = 1000;
                recruitsVest.MaxDurability = 1000;

                //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(recruitsVest);
            }

            // item db check
            recruitsQuiltedVest = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_quilted_vest");
            if (recruitsQuiltedVest == null)
            {
                recruitsQuiltedVest = new ItemTemplate();
                recruitsQuiltedVest.Name = "Recruit's Quilted Vest";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsQuiltedVest.Name + ", creating it ...");
                recruitsQuiltedVest.Level = 8;

                recruitsQuiltedVest.Weight = 20;
                recruitsQuiltedVest.Model = 151; // studded vest

                recruitsQuiltedVest.DPS_AF = 6; // Armour
                recruitsQuiltedVest.SPD_ABS = 0; // Absorption

                recruitsQuiltedVest.Object_Type = (int)eObjectType.Cloth;
                recruitsQuiltedVest.Item_Type = (int)eEquipmentItems.TORSO;
                recruitsQuiltedVest.Id_nb = "recruits_quilted_vest";
                recruitsQuiltedVest.Price = Money.GetMoney(0, 0, 0, 9, 0);
                recruitsQuiltedVest.IsPickable = true;
                recruitsQuiltedVest.IsDropable = true;
                recruitsQuiltedVest.Color = 9; // red leather

                recruitsQuiltedVest.Bonus = 5; // default bonus

                recruitsQuiltedVest.Bonus1 = 4;
                recruitsQuiltedVest.Bonus1Type = (int)eStat.INT;

                recruitsQuiltedVest.Bonus2 = 3;
                recruitsQuiltedVest.Bonus2Type = (int)eStat.DEX;

                recruitsQuiltedVest.Quality = 100;
                recruitsQuiltedVest.Condition = 1000;
                recruitsQuiltedVest.MaxCondition = 1000;
                recruitsQuiltedVest.Durability = 1000;
                recruitsQuiltedVest.MaxDurability = 1000;

                //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(recruitsQuiltedVest);
            }

            #endregion defineItems

            /* Now we add some hooks to the npc we found.
			* Actually, we want to know when a player interacts with him.
			* So, we hook the right-click (interact) and the whisper method
			* of npc and set the callback method to the "TalkToXXX"
			* method. This means, the "TalkToXXX" method is called whenever
			* a player right clicks on him or when he whispers to him.
			*/

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));

            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            GameEventMgr.AddHandler(colm, GameLivingEvent.Interact, new DOLEventHandler(TalkToColm));
            GameEventMgr.AddHandler(colm, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToColm));

            GameEventMgr.AddHandler(nob, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToNob));

            GameEventMgr.AddHandler(haruld, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHaruld));

            GameEventMgr.AddHandler(fairyDragonflyHandler, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearFairyDragonflyHandler));

            /* Now we bring to masterFrederick the possibility to give this quest to players */
            masterFrederick.AddQuestToGive(typeof(IreFairyIre));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #13
0
        protected void initGrifflet()
        {
            grifflet = new GameNPC();

            grifflet.Model = 1236;
            grifflet.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.InitGrifflet.NPCGrifflet");
            //grifflet.GuildName = "Part of " + m_questPlayer.GetName(0, false) + "'s " + questTitle + " Quest";
            grifflet.Flags ^= GameNPC.eFlags.PEACE;
            grifflet.CurrentRegionID = askefruerTrainer.CurrentRegionID;
            grifflet.Size = 20;
            grifflet.Level = 3;
            grifflet.X = askefruerTrainer.X + Util.Random(-150, 150);
            grifflet.Y = askefruerTrainer.Y + Util.Random(-150, 150);
            grifflet.Z = askefruerTrainer.Z;
            grifflet.Heading = 93;
            grifflet.MaxSpeedBase = 200;

            StandardMobBrain brain = new StandardMobBrain();
            brain.AggroLevel = 0;
            brain.AggroRange = 0;
            grifflet.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
            //grifflet.SaveIntoDatabase();

            GameEventMgr.AddHandler(grifflet, GameLivingEvent.Interact, new DOLEventHandler(TalkToGrifflet));
        }
Exemple #14
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 ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the Albion realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCs

            dalikor = GetDalikor();

            GameNPC[] npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCVikingHyndla"), eRealm.Midgard);
            if (npcs.Length == 0)
            {
                hyndla = new GameNPC();
                hyndla.Model = 9;
                hyndla.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCVikingHyndla");
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + hyndla.Name + ", creating ...");
                hyndla.GuildName = "Part of " + questTitle + " Quest";
                hyndla.Realm = eRealm.Midgard;
                hyndla.CurrentRegionID = 100;

                hyndla.Size = 50;
                hyndla.Level = 40;
                hyndla.X = GameLocation.ConvertLocalXToGlobalX(53049, 100);
                hyndla.Y = GameLocation.ConvertLocalYToGlobalY(58068, 100);
                hyndla.Z = 4985;
                hyndla.Heading = 150;

                //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)
                    hyndla.SaveIntoDatabase();

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

            npcs = (GameNPC[])WorldMgr.GetObjectsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCGriffinHandlerNjiedi"), eRealm.Midgard, typeof(GameStableMaster));

            if (npcs.Length == 0)
            {
                njiedi = new GameStableMaster();
                njiedi.Model = 158;
                njiedi.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCGriffinHandlerNjiedi");
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + njiedi.Name + ", creating ...");
                njiedi.GuildName = "Stable Master";
                njiedi.Realm = eRealm.Midgard;
                njiedi.CurrentRegionID = 100;
                njiedi.Size = 51;
                njiedi.Level = 50;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81, 10);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 82, 10);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 84);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
                njiedi.Inventory = template.CloseTemplate();

                //				njiedi.AddNPCEquipment(Slot.TORSO, 81, 10, 0, 0);
                //				njiedi.AddNPCEquipment(Slot.LEGS, 82, 10, 0, 0);
                //				njiedi.AddNPCEquipment(Slot.FEET, 84, 10, 0, 0);
                //				njiedi.AddNPCEquipment(Slot.CLOAK, 57, 32, 0, 0);

                njiedi.X = GameLocation.ConvertLocalXToGlobalX(55561, 100);
                njiedi.Y = GameLocation.ConvertLocalYToGlobalY(58225, 100);
                njiedi.Z = 5005;
                njiedi.Heading = 126;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                njiedi.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)
                    njiedi.SaveIntoDatabase();
                njiedi.AddToWorld();
            }
            else
            {
                njiedi = npcs[0] as GameStableMaster;
            }

            //			npcs = WorldMgr.GetNPCsByName("Askefruer Trainer", eRealm.None);
            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCAskefruerTrainer"), eRealm.None);
            if (npcs.Length == 0)
            {
                askefruerTrainer = new GameNPC();

                askefruerTrainer.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCAskefruerTrainer");
                askefruerTrainer.X = GameLocation.ConvertLocalXToGlobalX(54739, 100);
                askefruerTrainer.Y = GameLocation.ConvertLocalYToGlobalY(18264, 100);
                askefruerTrainer.Z = 5195;
                askefruerTrainer.Heading = 79;
                askefruerTrainer.Model = 678;
                //askefruerTrainer.GuildName = "Part of " + questTitle + " Quest";
                askefruerTrainer.Realm = eRealm.None;
                askefruerTrainer.CurrentRegionID = 100;
                askefruerTrainer.Size = 49;
                askefruerTrainer.Level = 3;

                // Leave at default values to be one the save side ...
                //fairyDragonflyHandler.AggroLevel = 80;
                //fairyDragonflyHandler.AggroRange = 1000;

                //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)
                    askefruerTrainer.SaveIntoDatabase();

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

            #endregion defineNPCs

            #region defineItems

            trainerWhip = GameServer.Database.FindObjectByKey<ItemTemplate>("askefruer_whip");
            if (trainerWhip == null)
            {
                trainerWhip = new ItemTemplate();
                trainerWhip.Name = "Askefruer Trainer's Whip";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + trainerWhip.Name + " , creating it ...");

                trainerWhip.Weight = 15;
                trainerWhip.Model = 859;

                trainerWhip.Object_Type = (int)eObjectType.GenericItem;

                trainerWhip.Id_nb = "askefruer_whip";
                trainerWhip.IsPickable = true;
                trainerWhip.IsDropable = false;

                GameServer.Database.AddObject(trainerWhip);
            }

            // item db check
            recruitsVest = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_vest_mid");
            if (recruitsVest == null)
            {
                recruitsVest = new ItemTemplate();
                recruitsVest.Name = "Recruit's Studded Vest (Mid)";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsVest.Name + ", creating it ...");
                recruitsVest.Level = 8;

                recruitsVest.Weight = 60;
                recruitsVest.Model = 81; // studded vest

                recruitsVest.DPS_AF = 12; // Armour
                recruitsVest.SPD_ABS = 19; // Absorption

                recruitsVest.Object_Type = (int)eObjectType.Studded;
                recruitsVest.Item_Type = (int)eEquipmentItems.TORSO;
                recruitsVest.Id_nb = "recruits_studded_vest_mid";
                recruitsVest.Price = Money.GetMoney(0, 0, 0, 9, 0);
                recruitsVest.IsPickable = true;
                recruitsVest.IsDropable = true;
                recruitsVest.CanDropAsLoot = false;
                recruitsVest.Color = 14; // blue leather

                recruitsVest.Bonus = 5; // default bonus

                recruitsVest.Bonus1 = 3;
                recruitsVest.Bonus1Type = (int)eStat.STR;

                recruitsVest.Bonus2 = 4;
                recruitsVest.Bonus2Type = (int)eStat.CON;

                recruitsVest.Bonus3 = 1;
                recruitsVest.Bonus3Type = (int)eResist.Body;

                recruitsVest.Quality = 100;
                recruitsVest.Condition = 1000;
                recruitsVest.MaxCondition = 1000;
                recruitsVest.Durability = 1000;
                recruitsVest.MaxDurability = 1000;

                GameServer.Database.AddObject(recruitsVest);
            }

            // item db check
            recruitsQuiltedVest = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_quilted_vest");
            if (recruitsQuiltedVest == null)
            {
                recruitsQuiltedVest = new ItemTemplate();
                recruitsQuiltedVest.Name = "Recruit's Quilted Vest";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsQuiltedVest.Name + ", creating it ...");
                recruitsQuiltedVest.Level = 8;

                recruitsQuiltedVest.Weight = 20;
                recruitsQuiltedVest.Model = 151; // studded vest

                recruitsQuiltedVest.DPS_AF = 6; // Armour
                recruitsQuiltedVest.SPD_ABS = 0; // Absorption

                recruitsQuiltedVest.Object_Type = (int)eObjectType.Cloth;
                recruitsQuiltedVest.Item_Type = (int)eEquipmentItems.TORSO;
                recruitsQuiltedVest.Id_nb = "recruits_quilted_vest";
                recruitsQuiltedVest.Price = Money.GetMoney(0, 0, 0, 9, 0);
                recruitsQuiltedVest.IsPickable = true;
                recruitsQuiltedVest.IsDropable = true;
                recruitsQuiltedVest.Color = 36;

                recruitsQuiltedVest.Bonus = 5; // default bonus

                recruitsQuiltedVest.Bonus1 = 4;
                recruitsQuiltedVest.Bonus1Type = (int)eStat.INT;

                recruitsQuiltedVest.Bonus2 = 3;
                recruitsQuiltedVest.Bonus2Type = (int)eStat.DEX;

                recruitsQuiltedVest.Quality = 100;
                recruitsQuiltedVest.Condition = 1000;
                recruitsQuiltedVest.MaxCondition = 1000;
                recruitsQuiltedVest.Durability = 1000;
                recruitsQuiltedVest.MaxDurability = 1000;

                GameServer.Database.AddObject(recruitsQuiltedVest);
            }

            #endregion defineItems

            /* Now we add some hooks to the npc we found.
			* Actually, we want to know when a player interacts with him.
			* So, we hook the right-click (interact) and the whisper method
			* of npc and set the callback method to the "TalkToXXX"
			* method. This means, the "TalkToXXX" method is called whenever
			* a player right clicks on him or when he whispers to him.
			*/
            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(dalikor, GameLivingEvent.Interact, new DOLEventHandler(TalkToDalikor));
            GameEventMgr.AddHandler(dalikor, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDalikor));

            GameEventMgr.AddHandler(njiedi, GameLivingEvent.Interact, new DOLEventHandler(TalkToNjiedi));
            GameEventMgr.AddHandler(njiedi, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToNjiedi));

            GameEventMgr.AddHandler(hyndla, GameLivingEvent.Interact, new DOLEventHandler(TalkToHyndla));
            GameEventMgr.AddHandler(hyndla, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHyndla));

            GameEventMgr.AddHandler(askefruerTrainer, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearAskefruerTrainer));

            /* Now we bring to dalikor the possibility to give this quest to players */
            dalikor.AddQuestToGive(typeof(StolenEggs));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #15
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");
        }
        protected void CreateBriediClone()
        {
            GameNpcInventoryTemplate template;
            if (briediClone == null)
            {
                briediClone = new GameNPC();
                briediClone.Model = 157;
                briediClone.Name = "Master Briedi";
                briediClone.GuildName = "Part of " + questTitle + " Quest";
                briediClone.Realm = eRealm.Midgard;
                briediClone.CurrentRegionID = 100;

                briediClone.Size = 50;
                briediClone.Level = 45;
                briediClone.X = GameLocation.ConvertLocalXToGlobalX(45394, 100);
                briediClone.Y = GameLocation.ConvertLocalYToGlobalY(39768, 100);
                briediClone.Z = 4709;
                briediClone.Heading = 107;

                template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 348);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 349);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 350);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 351);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 352);
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 640);
                briediClone.Inventory = template.CloseTemplate();
                briediClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 348, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.LEGS, 349, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.ARMS, 350, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.HAND, 351, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.FEET, 352, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 640, 0, 0, 0);

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

                briediClone.AddToWorld();

                GameEventMgr.AddHandler(briediClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterBriedi));
                GameEventMgr.AddHandler(briediClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterBriedi));
            }
            else
            {
                briediClone.MoveTo(100, GameLocation.ConvertLocalXToGlobalX(45394, 100), GameLocation.ConvertLocalYToGlobalY(39768, 100), 4709, 107);
            }

            foreach (GamePlayer visPlayer in briediClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                visPlayer.Out.SendEmoteAnimation(briediClone, eEmote.Bind);
            }

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i] = new GameNPC();

                recruits[i].Name = "Recruit";

                recruits[i].GuildName = "Part of " + questTitle + " Quest";
                recruits[i].Realm = eRealm.Midgard;
                recruits[i].CurrentRegionID = briediClone.CurrentRegionID;

                recruits[i].Size = 50;
                recruits[i].Level = 6;
                recruits[i].X = briediClone.X + Util.Random(-150, 150);
                recruits[i].Y = briediClone.Y + Util.Random(-150, 150);

                recruits[i].Z = briediClone.Z;
                recruits[i].Heading = 187;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                recruits[i].SetOwnBrain(brain);
            }

            recruits[0].Name = "Recruit Hietan";
            recruits[0].Model = 189;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 69);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
            recruits[0].Inventory = template.CloseTemplate();
            recruits[0].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 69, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TORSO, 46, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.LEGS, 47, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.FEET, 50, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.ARMS, 48, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.HAND, 49, 0, 0, 0);

            recruits[1].Name = "Recruit Iduki";
            recruits[1].Model = 190;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 6);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 45);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 43);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 44);
            recruits[1].Inventory = template.CloseTemplate();
            recruits[1].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 6, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.TORSO, 41, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.LEGS, 42, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.FEET, 45, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.ARMS, 43, 0, 0, 0);
            //			recruits[1].AddNPCEquipment((byte) eEquipmentItems.HAND, 44, 0, 0, 0);

            recruits[2].Name = "Recruit Odigi";
            recruits[2].Model = 774;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[2].Inventory = template.CloseTemplate();
            recruits[2].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 4, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[2].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            recruits[3].Name = "Recruit Thulder";
            recruits[3].Model = 775;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 5);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
            recruits[3].Inventory = template.CloseTemplate();
            recruits[3].SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 5, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.TORSO, 36, 0, 0, 0);
            //			recruits[3].AddNPCEquipment((byte) eEquipmentItems.LEGS, 37, 0, 0, 0);

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i].AddToWorld();
            }
        }
Exemple #17
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("Aegan",(eRealm) 2);
            if (npcs.Length == 0)
            {
                Aegan = new DOL.GS.GameNPC();
                    Aegan.Model = 232;
                Aegan.Name = "Aegan";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Aegan.Name + ", creating ...");
                Aegan.GuildName = "Part of " + questTitle + " Quest";
                Aegan.Realm = eRealm.Midgard;
                Aegan.CurrentRegionID = 100;
                Aegan.Size = 51;
                Aegan.Level = 41;
                Aegan.MaxSpeedBase = 191;
                Aegan.Faction = FactionMgr.GetFactionByID(0);
                Aegan.X = 805398;
                Aegan.Y = 725829;
                Aegan.Z = 4700;
                Aegan.Heading = 3595;
                Aegan.RespawnInterval = -1;
                Aegan.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Aegan.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)
                    Aegan.SaveIntoDatabase();

                Aegan.AddToWorld();

            }
            else
            {
                Aegan = npcs[0];
            }

            #endregion

            #region defineItems

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

            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder builder = QuestMgr.getBuilder(typeof(Learnthehunt));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Interact,null,Aegan);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Greetings, are you [worthy of the hunt]?",Aegan);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Whisper,"worthy of the hunt",Aegan);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Oh ho! Another bright young come to help Midgard fend off her enemies, eh? Wonderful, that's what I say! Wonderful! With the rise of the Albion and Hibernia armies,Midgard will need all the she can get!",Aegan);
            a.AddAction(eActionType.Talk,"I have spent a great deal of my life hunting the [maulers] of this region",Aegan);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Whisper,"maulers",Aegan);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null,(eComparator)5);
            a.AddAction(eActionType.Talk,"Bring me the claws of a mauler cub and I shall reward you",Aegan);
            a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.Learnthehunt),"Accept Learn the Hunt quest?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.Learnthehunt));
            a.AddAction(eActionType.Talk,"No problem. See you.",Aegan);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.Learnthehunt));
            a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.Learnthehunt),Aegan);
            a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),2);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.EnemyKilled,"black mauler cub",null);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),1,(eComparator)2);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),7,(eComparator)1);
            a.AddAction(eActionType.GiveItem,clawofblackmauler,null);
            a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Aegan,-1);
                a.AddTrigger(eTriggerType.Interact,null,Aegan);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Learnthehunt),7,(eComparator)3);
            a.AddAction(eActionType.Talk,"You are doing well! Continue to pass me the bear claws!",Aegan);
            a.AddAction(eActionType.Talk,"You have proven yourself well youngster! I hope the coin serves you well.",Aegan);
            a.AddAction(eActionType.GiveXP,20,null);
            a.AddAction(eActionType.GiveGold,100,null);
            a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.Learnthehunt),null);
            a.AddAction(eActionType.TakeItem,clawofblackmauler,5);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            Aegan.AddQuestToGive(typeof (Learnthehunt));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #18
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 ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Lady Felin", eRealm.None);
            if (npcs.Length == 0)
            {
                //if (Log.IsWarnEnabled) Log.Warn("Could not find Lady Felin, creating her ...");
                ladyFelin = new GameNPC();
                ladyFelin.Model = 603;
                ladyFelin.Name = "Lady Felin";
                ladyFelin.GuildName = "Part of " + questTitle + " Quest";
                ladyFelin.Realm = eRealm.None;
                ladyFelin.CurrentRegionID = 1;
                ladyFelin.Size = 50;
                ladyFelin.Level = 30;
                ladyFelin.X = 558846;
                ladyFelin.Y = 516434;
                ladyFelin.Z = 2519;
                ladyFelin.Heading = 2332;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                ladyFelin.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
                //ladyFelin.SaveIntoDatabase();
                //ladyFelin.AddToWorld();
            }
            else
                ladyFelin = npcs[0];

            #endregion

            #region defineItems

            // item db check
            necklaceOfDoppelganger = GameServer.Database.FindObjectByKey<ItemTemplate>("necklace_of_the_doppelganger");
            if (necklaceOfDoppelganger == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Necklace of the Doppelganger, creating it ...");
                necklaceOfDoppelganger = new ItemTemplate();
                necklaceOfDoppelganger.Name = "Necklace of the Doppelganger";
                necklaceOfDoppelganger.Level = 2;
                necklaceOfDoppelganger.Weight = 2;
                necklaceOfDoppelganger.Model = 101;

                necklaceOfDoppelganger.Object_Type = (int) eObjectType.Magical;
                necklaceOfDoppelganger.Item_Type = (int) eEquipmentItems.NECK;
                necklaceOfDoppelganger.Id_nb = "necklace_of_the_doppelganger";
                necklaceOfDoppelganger.Price = 0;
                necklaceOfDoppelganger.IsPickable = true;
                necklaceOfDoppelganger.IsDropable = false;

                necklaceOfDoppelganger.Quality = 100;
                necklaceOfDoppelganger.Condition = 1000;
                necklaceOfDoppelganger.MaxCondition = 1000;
                necklaceOfDoppelganger.Durability = 1000;
                necklaceOfDoppelganger.MaxDurability = 1000;

                //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(necklaceOfDoppelganger);
            }

            // item db check
            fairyPlans = GameServer.Database.FindObjectByKey<ItemTemplate>("ire_fairy_plans");
            if (fairyPlans == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Ire Fairy Plans, creating it ...");
                fairyPlans = new ItemTemplate();
                fairyPlans.Name = "Ire Fairy Plans";

                fairyPlans.Weight = 3;
                fairyPlans.Model = 498;

                fairyPlans.Object_Type = (int) eObjectType.GenericItem;

                fairyPlans.Id_nb = "ire_fairy_plans";
                fairyPlans.IsPickable = true;
                fairyPlans.IsDropable = false;

                //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(fairyPlans);
            }

            // item db check
            recruitsBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_boots");
            if (recruitsBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Recruit's Studded Boots, creating it ...");
                recruitsBoots = new ItemTemplate();
                recruitsBoots.Name = "Recruit's Studded Boots";
                recruitsBoots.Level = 7;

                recruitsBoots.Weight = 24;
                recruitsBoots.Model = 84; // studded Boots

                recruitsBoots.DPS_AF = 12; // Armour
                recruitsBoots.SPD_ABS = 19; // Absorption

                recruitsBoots.Object_Type = (int) eObjectType.Studded;
                recruitsBoots.Item_Type = (int) eEquipmentItems.FEET;
                recruitsBoots.Id_nb = "recruits_studded_boots";
                recruitsBoots.Price = Money.GetMoney(0,0,0,10,0);
                recruitsBoots.IsPickable = true;
                recruitsBoots.IsDropable = true;
                recruitsBoots.Color = 9; // red leather

                recruitsBoots.Bonus = 5; // default bonus

                recruitsBoots.Bonus1 = 1;
                recruitsBoots.Bonus1Type = (int) eStat.STR;

                recruitsBoots.Bonus2 = 3;
                recruitsBoots.Bonus2Type = (int) eStat.CON;

                recruitsBoots.Bonus3 = 1;
                recruitsBoots.Bonus3Type = (int) eResist.Spirit;

                recruitsBoots.Quality = 100;
                recruitsBoots.Condition = 1000;
                recruitsBoots.MaxCondition = 1000;
                recruitsBoots.Durability = 1000;
                recruitsBoots.MaxDurability = 1000;

                //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(recruitsBoots);
            }

            // item db check
            recruitsQuiltedBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_quilted_boots");
            if (recruitsQuiltedBoots == null)
            {
                recruitsQuiltedBoots = new ItemTemplate();
                recruitsQuiltedBoots.Name = "Recruit's Quilted Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsQuiltedBoots.Name + ", creating it ...");
                recruitsQuiltedBoots.Level = 7;

                recruitsQuiltedBoots.Weight = 8;
                recruitsQuiltedBoots.Model = 155; // studded Boots

                recruitsQuiltedBoots.DPS_AF = 6; // Armour
                recruitsQuiltedBoots.SPD_ABS = 0; // Absorption

                recruitsQuiltedBoots.Object_Type = (int) eObjectType.Cloth;
                recruitsQuiltedBoots.Item_Type = (int) eEquipmentItems.FEET;
                recruitsQuiltedBoots.Id_nb = "recruits_quilted_boots";
                recruitsQuiltedBoots.Price = Money.GetMoney(0,0,0,10,0);
                recruitsQuiltedBoots.IsPickable = true;
                recruitsQuiltedBoots.IsDropable = true;
                recruitsQuiltedBoots.Color = 27; // red leather

                recruitsQuiltedBoots.Bonus = 5; // default bonus

                recruitsQuiltedBoots.Bonus1 = 3;
                recruitsQuiltedBoots.Bonus1Type = (int) eStat.CON;

                recruitsQuiltedBoots.Bonus2 = 1;
                recruitsQuiltedBoots.Bonus2Type = (int) eStat.STR;

                recruitsQuiltedBoots.Bonus3 = 1;
                recruitsQuiltedBoots.Bonus3Type = (int) eResist.Spirit;

                recruitsQuiltedBoots.Quality = 100;
                recruitsQuiltedBoots.Condition = 1000;
                recruitsQuiltedBoots.MaxCondition = 1000;
                recruitsQuiltedBoots.Durability = 1000;
                recruitsQuiltedBoots.MaxDurability = 1000;

                //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(recruitsQuiltedBoots);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            GameEventMgr.AddHandler(ladyFelin, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyFelin));
            GameEventMgr.AddHandler(ladyFelin, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyFelin));

            /* Now we bring to masterFrederick the possibility to give this quest to players */
            masterFrederick.AddQuestToGive(typeof (TraitorInCotswold));

            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 ...");

            #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 defineNPCs

            #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 defineItems

            #region defineAreas

            #endregion defineAreas

            #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 defineQuestParts

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            SirQuait.AddQuestToGive(typeof(HelpSirQuait));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #20
0
		/// <summary>
		/// Add aggro table of this brain to that of another living.
		/// </summary>
		/// <param name="brain">The target brain.</param>
		public void AddAggroListTo(StandardMobBrain brain)
		{
			// TODO: This should actually be the other way round, but access
			// to m_aggroTable is restricted and needs to be threadsafe.

			// do not modify aggro list if dead
			if (!brain.Body.IsAlive) return;

			lock ((m_aggroTable as ICollection).SyncRoot)
			{
				Dictionary<GameLiving, long>.Enumerator dictEnum = m_aggroTable.GetEnumerator();
				while (dictEnum.MoveNext())
					brain.AddToAggroList(dictEnum.Current.Key, Body.MaxHealth);
			}
		}
Exemple #21
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" (Alb) initializing ...");

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Charles", (eRealm)1);
            if (npcs.Length == 0)
            {
                Charles = new DOL.GS.GameNPC();
                Charles.Model = 92;
                Charles.Name = "Charles";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Charles.Name + ", creating ...");
                Charles.Realm = eRealm.Albion;
                Charles.CurrentRegionID = 1;
                Charles.Size = 37;
                Charles.Level = 1;
                Charles.MaxSpeedBase = 191;
                Charles.Faction = FactionMgr.GetFactionByID(0);
                Charles.X = 559883;
                Charles.Y = 511489;
                Charles.Z = 2382;
                Charles.Heading = 3515;
                Charles.RespawnInterval = -1;
                Charles.BodyType = 0;

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

                if (SAVE_INTO_DATABASE)
                    Charles.SaveIntoDatabase();

                Charles.AddToWorld();

            }
            else
            {
                Charles = npcs[0];
            }

            #endregion

            #region defineItems

            daringpaddedboots_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedboots_alb");
            if (daringpaddedboots_alb == null)
            {
                daringpaddedboots_alb = new ItemTemplate();
                daringpaddedboots_alb.Name = "Daring Padded Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedboots_alb.Name + ", creating it ...");
                daringpaddedboots_alb.Level = 5;
                daringpaddedboots_alb.Weight = 8;
                daringpaddedboots_alb.Model = 143;
                daringpaddedboots_alb.Object_Type = 32;
                daringpaddedboots_alb.Item_Type = 23;
                daringpaddedboots_alb.Id_nb = "daringpaddedboots_alb";
                daringpaddedboots_alb.Hand = 0;
                daringpaddedboots_alb.Price = 0;
                daringpaddedboots_alb.IsPickable = true;
                daringpaddedboots_alb.IsDropable = true;
                daringpaddedboots_alb.IsTradable = true;
                daringpaddedboots_alb.CanDropAsLoot = false;
                daringpaddedboots_alb.Color = 0;
                daringpaddedboots_alb.Bonus = 0; // default bonus
                daringpaddedboots_alb.Bonus1 = 4;
                daringpaddedboots_alb.Bonus1Type = (int)3;
                daringpaddedboots_alb.Bonus2 = 0;
                daringpaddedboots_alb.Bonus2Type = (int)0;
                daringpaddedboots_alb.Bonus3 = 0;
                daringpaddedboots_alb.Bonus3Type = (int)0;
                daringpaddedboots_alb.Bonus4 = 0;
                daringpaddedboots_alb.Bonus4Type = (int)0;
                daringpaddedboots_alb.Bonus5 = 0;
                daringpaddedboots_alb.Bonus5Type = (int)0;
                daringpaddedboots_alb.Bonus6 = 0;
                daringpaddedboots_alb.Bonus6Type = (int)0;
                daringpaddedboots_alb.Bonus7 = 0;
                daringpaddedboots_alb.Bonus7Type = (int)0;
                daringpaddedboots_alb.Bonus8 = 0;
                daringpaddedboots_alb.Bonus8Type = (int)0;
                daringpaddedboots_alb.Bonus9 = 0;
                daringpaddedboots_alb.Bonus9Type = (int)0;
                daringpaddedboots_alb.Bonus10 = 0;
                daringpaddedboots_alb.Bonus10Type = (int)0;
                daringpaddedboots_alb.ExtraBonus = 0;
                daringpaddedboots_alb.ExtraBonusType = (int)0;
                daringpaddedboots_alb.Effect = 0;
                daringpaddedboots_alb.DPS_AF = 6;
                daringpaddedboots_alb.Charges = 0;
                daringpaddedboots_alb.MaxCharges = 0;
                daringpaddedboots_alb.SpellID = 0;
                daringpaddedboots_alb.ProcSpellID = 0;
                daringpaddedboots_alb.SPD_ABS = 0;
                daringpaddedboots_alb.Realm = 0;
                daringpaddedboots_alb.MaxCount = 1;
                daringpaddedboots_alb.PackSize = 1;
                daringpaddedboots_alb.Extension = 0;
                daringpaddedboots_alb.Quality =89;
                daringpaddedboots_alb.Condition = 50000;
                daringpaddedboots_alb.MaxCondition = 50000;
                daringpaddedboots_alb.Durability = 50000;
                daringpaddedboots_alb.MaxDurability = 50000;
                daringpaddedboots_alb.PoisonCharges = 0;
                daringpaddedboots_alb.PoisonMaxCharges = 0;
                daringpaddedboots_alb.PoisonSpellID = 0;
                daringpaddedboots_alb.ProcSpellID1 = 0;
                daringpaddedboots_alb.SpellID1 = 0;
                daringpaddedboots_alb.MaxCharges1 = 0;
                daringpaddedboots_alb.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(daringpaddedboots_alb);
            }
            daringpaddedcap_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedcap_alb");
            if (daringpaddedcap_alb == null)
            {
                daringpaddedcap_alb = new ItemTemplate();
                daringpaddedcap_alb.Name = "Daring Padded Cap";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedcap_alb.Name + ", creating it ...");
                daringpaddedcap_alb.Level = 5;
                daringpaddedcap_alb.Weight = 8;
                daringpaddedcap_alb.Model = 822;
                daringpaddedcap_alb.Object_Type = 32;
                daringpaddedcap_alb.Item_Type = 21;
                daringpaddedcap_alb.Id_nb = "daringpaddedcap_alb";
                daringpaddedcap_alb.Hand = 0;
                daringpaddedcap_alb.Price = 0;
                daringpaddedcap_alb.IsPickable = true;
                daringpaddedcap_alb.IsDropable = true;
                daringpaddedcap_alb.IsTradable = true;
                daringpaddedcap_alb.CanDropAsLoot = false;
                daringpaddedcap_alb.Color = 0;
                daringpaddedcap_alb.Bonus = 0; // default bonus
                daringpaddedcap_alb.Bonus1 = 4;
                daringpaddedcap_alb.Bonus1Type = (int)2;
                daringpaddedcap_alb.Bonus2 = 0;
                daringpaddedcap_alb.Bonus2Type = (int)0;
                daringpaddedcap_alb.Bonus3 = 0;
                daringpaddedcap_alb.Bonus3Type = (int)0;
                daringpaddedcap_alb.Bonus4 = 0;
                daringpaddedcap_alb.Bonus4Type = (int)0;
                daringpaddedcap_alb.Bonus5 = 0;
                daringpaddedcap_alb.Bonus5Type = (int)0;
                daringpaddedcap_alb.Bonus6 = 0;
                daringpaddedcap_alb.Bonus6Type = (int)0;
                daringpaddedcap_alb.Bonus7 = 0;
                daringpaddedcap_alb.Bonus7Type = (int)0;
                daringpaddedcap_alb.Bonus8 = 0;
                daringpaddedcap_alb.Bonus8Type = (int)0;
                daringpaddedcap_alb.Bonus9 = 0;
                daringpaddedcap_alb.Bonus9Type = (int)0;
                daringpaddedcap_alb.Bonus10 = 0;
                daringpaddedcap_alb.Bonus10Type = (int)0;
                daringpaddedcap_alb.ExtraBonus = 0;
                daringpaddedcap_alb.ExtraBonusType = (int)0;
                daringpaddedcap_alb.Effect = 0;
                daringpaddedcap_alb.DPS_AF = 6;
                daringpaddedcap_alb.Charges = 0;
                daringpaddedcap_alb.MaxCharges = 0;
                daringpaddedcap_alb.SpellID = 0;
                daringpaddedcap_alb.ProcSpellID = 0;
                daringpaddedcap_alb.SPD_ABS = 0;
                daringpaddedcap_alb.Realm = 0;
                daringpaddedcap_alb.MaxCount = 1;
                daringpaddedcap_alb.PackSize = 1;
                daringpaddedcap_alb.Extension = 0;
                daringpaddedcap_alb.Quality =89;
                daringpaddedcap_alb.Condition = 50000;
                daringpaddedcap_alb.MaxCondition = 50000;
                daringpaddedcap_alb.Durability = 50000;
                daringpaddedcap_alb.MaxDurability = 50000;
                daringpaddedcap_alb.PoisonCharges = 0;
                daringpaddedcap_alb.PoisonMaxCharges = 0;
                daringpaddedcap_alb.PoisonSpellID = 0;
                daringpaddedcap_alb.ProcSpellID1 = 0;
                daringpaddedcap_alb.SpellID1 = 0;
                daringpaddedcap_alb.MaxCharges1 = 0;
                daringpaddedcap_alb.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(daringpaddedcap_alb);
            }
            daringpaddedgloves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedgloves_alb");
            if (daringpaddedgloves_alb == null)
            {
                daringpaddedgloves_alb = new ItemTemplate();
                daringpaddedgloves_alb.Name = "Daring Padded Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedgloves_alb.Name + ", creating it ...");
                daringpaddedgloves_alb.Level = 5;
                daringpaddedgloves_alb.Weight = 8;
                daringpaddedgloves_alb.Model = 142;
                daringpaddedgloves_alb.Object_Type = 32;
                daringpaddedgloves_alb.Item_Type = 22;
                daringpaddedgloves_alb.Id_nb = "daringpaddedgloves_alb";
                daringpaddedgloves_alb.Hand = 0;
                daringpaddedgloves_alb.Price = 0;
                daringpaddedgloves_alb.IsPickable = true;
                daringpaddedgloves_alb.IsDropable = true;
                daringpaddedgloves_alb.IsTradable = true;
                daringpaddedgloves_alb.CanDropAsLoot = false;
                daringpaddedgloves_alb.Color = 0;
                daringpaddedgloves_alb.Bonus = 0; // default bonus
                daringpaddedgloves_alb.Bonus1 = 4;
                daringpaddedgloves_alb.Bonus1Type = (int)3;
                daringpaddedgloves_alb.Bonus2 = 0;
                daringpaddedgloves_alb.Bonus2Type = (int)0;
                daringpaddedgloves_alb.Bonus3 = 0;
                daringpaddedgloves_alb.Bonus3Type = (int)0;
                daringpaddedgloves_alb.Bonus4 = 0;
                daringpaddedgloves_alb.Bonus4Type = (int)0;
                daringpaddedgloves_alb.Bonus5 = 0;
                daringpaddedgloves_alb.Bonus5Type = (int)0;
                daringpaddedgloves_alb.Bonus6 = 0;
                daringpaddedgloves_alb.Bonus6Type = (int)0;
                daringpaddedgloves_alb.Bonus7 = 0;
                daringpaddedgloves_alb.Bonus7Type = (int)0;
                daringpaddedgloves_alb.Bonus8 = 0;
                daringpaddedgloves_alb.Bonus8Type = (int)0;
                daringpaddedgloves_alb.Bonus9 = 0;
                daringpaddedgloves_alb.Bonus9Type = (int)0;
                daringpaddedgloves_alb.Bonus10 = 0;
                daringpaddedgloves_alb.Bonus10Type = (int)0;
                daringpaddedgloves_alb.ExtraBonus = 0;
                daringpaddedgloves_alb.ExtraBonusType = (int)0;
                daringpaddedgloves_alb.Effect = 0;
                daringpaddedgloves_alb.DPS_AF = 6;
                daringpaddedgloves_alb.Charges = 0;
                daringpaddedgloves_alb.MaxCharges = 0;
                daringpaddedgloves_alb.SpellID = 0;
                daringpaddedgloves_alb.ProcSpellID = 0;
                daringpaddedgloves_alb.SPD_ABS = 0;
                daringpaddedgloves_alb.Realm = 0;
                daringpaddedgloves_alb.MaxCount = 1;
                daringpaddedgloves_alb.PackSize = 1;
                daringpaddedgloves_alb.Extension = 0;
                daringpaddedgloves_alb.Quality =89;
                daringpaddedgloves_alb.Condition = 50000;
                daringpaddedgloves_alb.MaxCondition = 50000;
                daringpaddedgloves_alb.Durability = 50000;
                daringpaddedgloves_alb.MaxDurability = 50000;
                daringpaddedgloves_alb.PoisonCharges = 0;
                daringpaddedgloves_alb.PoisonMaxCharges = 0;
                daringpaddedgloves_alb.PoisonSpellID = 0;
                daringpaddedgloves_alb.ProcSpellID1 = 0;
                daringpaddedgloves_alb.SpellID1 = 0;
                daringpaddedgloves_alb.MaxCharges1 = 0;
                daringpaddedgloves_alb.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(daringpaddedgloves_alb);
            }
            daringpaddedpants_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedpants_alb");
            if (daringpaddedpants_alb == null)
            {
                daringpaddedpants_alb = new ItemTemplate();
                daringpaddedpants_alb.Name = "Daring Padded Pants";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedpants_alb.Name + ", creating it ...");
                daringpaddedpants_alb.Level = 5;
                daringpaddedpants_alb.Weight = 14;
                daringpaddedpants_alb.Model = 140;
                daringpaddedpants_alb.Object_Type = 32;
                daringpaddedpants_alb.Item_Type = 27;
                daringpaddedpants_alb.Id_nb = "daringpaddedpants_alb";
                daringpaddedpants_alb.Hand = 0;
                daringpaddedpants_alb.Price  = 0;
                daringpaddedpants_alb.IsPickable = true;
                daringpaddedpants_alb.IsDropable = true;
                daringpaddedpants_alb.IsTradable = true;
                daringpaddedpants_alb.CanDropAsLoot = false;
                daringpaddedpants_alb.Color = 0;
                daringpaddedpants_alb.Bonus = 0; // default bonus
                daringpaddedpants_alb.Bonus1 = 4;
                daringpaddedpants_alb.Bonus1Type = (int)2;
                daringpaddedpants_alb.Bonus2 = 0;
                daringpaddedpants_alb.Bonus2Type = (int)0;
                daringpaddedpants_alb.Bonus3 = 0;
                daringpaddedpants_alb.Bonus3Type = (int)0;
                daringpaddedpants_alb.Bonus4 = 0;
                daringpaddedpants_alb.Bonus4Type = (int)0;
                daringpaddedpants_alb.Bonus5 = 0;
                daringpaddedpants_alb.Bonus5Type = (int)0;
                daringpaddedpants_alb.Bonus6 = 0;
                daringpaddedpants_alb.Bonus6Type = (int)0;
                daringpaddedpants_alb.Bonus7 = 0;
                daringpaddedpants_alb.Bonus7Type = (int)0;
                daringpaddedpants_alb.Bonus8 = 0;
                daringpaddedpants_alb.Bonus8Type = (int)0;
                daringpaddedpants_alb.Bonus9 = 0;
                daringpaddedpants_alb.Bonus9Type = (int)0;
                daringpaddedpants_alb.Bonus10 = 0;
                daringpaddedpants_alb.Bonus10Type = (int)0;
                daringpaddedpants_alb.ExtraBonus = 0;
                daringpaddedpants_alb.ExtraBonusType = (int)0;
                daringpaddedpants_alb.Effect = 0;
                daringpaddedpants_alb.DPS_AF = 6;
                daringpaddedpants_alb.Charges = 0;
                daringpaddedpants_alb.MaxCharges = 0;
                daringpaddedpants_alb.SpellID = 0;
                daringpaddedpants_alb.ProcSpellID = 0;
                daringpaddedpants_alb.SPD_ABS = 0;
                daringpaddedpants_alb.Realm = 0;
                daringpaddedpants_alb.MaxCount = 1;
                daringpaddedpants_alb.PackSize = 1;
                daringpaddedpants_alb.Extension = 0;
                daringpaddedpants_alb.Quality =89;
                daringpaddedpants_alb.Condition = 50000;
                daringpaddedpants_alb.MaxCondition = 50000;
                daringpaddedpants_alb.Durability = 50000;
                daringpaddedpants_alb.MaxDurability = 50000;
                daringpaddedpants_alb.PoisonCharges = 0;
                daringpaddedpants_alb.PoisonMaxCharges = 0;
                daringpaddedpants_alb.PoisonSpellID = 0;
                daringpaddedpants_alb.ProcSpellID1 = 0;
                daringpaddedpants_alb.SpellID1 = 0;
                daringpaddedpants_alb.MaxCharges1 = 0;
                daringpaddedpants_alb.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(daringpaddedpants_alb);
            }
            daringpaddedsleeves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedsleeves_alb");
            if (daringpaddedsleeves_alb == null)
            {
                daringpaddedsleeves_alb = new ItemTemplate();
                daringpaddedsleeves_alb.Name = "Daring Padded Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedsleeves_alb.Name + ", creating it ...");
                daringpaddedsleeves_alb.Level = 5;
                daringpaddedsleeves_alb.Weight = 12;
                daringpaddedsleeves_alb.Model = 141;
                daringpaddedsleeves_alb.Object_Type = 32;
                daringpaddedsleeves_alb.Item_Type = 28;
                daringpaddedsleeves_alb.Id_nb = "daringpaddedsleeves_alb";
                daringpaddedsleeves_alb.Hand = 0;
                daringpaddedsleeves_alb.Price = 0;
                daringpaddedsleeves_alb.IsPickable = true;
                daringpaddedsleeves_alb.IsDropable = true;
                daringpaddedsleeves_alb.IsTradable = true;
                daringpaddedsleeves_alb.CanDropAsLoot = false;
                daringpaddedsleeves_alb.Color = 0;
                daringpaddedsleeves_alb.Bonus = 0; // default bonus
                daringpaddedsleeves_alb.Bonus1 = 4;
                daringpaddedsleeves_alb.Bonus1Type = (int)6;
                daringpaddedsleeves_alb.Bonus2 = 0;
                daringpaddedsleeves_alb.Bonus2Type = (int)0;
                daringpaddedsleeves_alb.Bonus3 = 0;
                daringpaddedsleeves_alb.Bonus3Type = (int)0;
                daringpaddedsleeves_alb.Bonus4 = 0;
                daringpaddedsleeves_alb.Bonus4Type = (int)0;
                daringpaddedsleeves_alb.Bonus5 = 0;
                daringpaddedsleeves_alb.Bonus5Type = (int)0;
                daringpaddedsleeves_alb.Bonus6 = 0;
                daringpaddedsleeves_alb.Bonus6Type = (int)0;
                daringpaddedsleeves_alb.Bonus7 = 0;
                daringpaddedsleeves_alb.Bonus7Type = (int)0;
                daringpaddedsleeves_alb.Bonus8 = 0;
                daringpaddedsleeves_alb.Bonus8Type = (int)0;
                daringpaddedsleeves_alb.Bonus9 = 0;
                daringpaddedsleeves_alb.Bonus9Type = (int)0;
                daringpaddedsleeves_alb.Bonus10 = 0;
                daringpaddedsleeves_alb.Bonus10Type = (int)0;
                daringpaddedsleeves_alb.ExtraBonus = 0;
                daringpaddedsleeves_alb.ExtraBonusType = (int)0;
                daringpaddedsleeves_alb.Effect = 0;
                daringpaddedsleeves_alb.DPS_AF = 6;
                daringpaddedsleeves_alb.Charges = 0;
                daringpaddedsleeves_alb.MaxCharges = 0;
                daringpaddedsleeves_alb.SpellID = 0;
                daringpaddedsleeves_alb.ProcSpellID = 0;
                daringpaddedsleeves_alb.SPD_ABS = 0;
                daringpaddedsleeves_alb.Realm = 0;
                daringpaddedsleeves_alb.MaxCount = 1;
                daringpaddedsleeves_alb.PackSize = 1;
                daringpaddedsleeves_alb.Extension = 0;
                daringpaddedsleeves_alb.Quality =89;
                daringpaddedsleeves_alb.Condition = 50000;
                daringpaddedsleeves_alb.MaxCondition = 50000;
                daringpaddedsleeves_alb.Durability = 50000;
                daringpaddedsleeves_alb.MaxDurability = 50000;
                daringpaddedsleeves_alb.PoisonCharges = 0;
                daringpaddedsleeves_alb.PoisonMaxCharges = 0;
                daringpaddedsleeves_alb.PoisonSpellID = 0;
                daringpaddedsleeves_alb.ProcSpellID1 = 0;
                daringpaddedsleeves_alb.SpellID1 = 0;
                daringpaddedsleeves_alb.MaxCharges1 = 0;
                daringpaddedsleeves_alb.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(daringpaddedsleeves_alb);
            }
            daringpaddedvest_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringpaddedvest_alb");
            if (daringpaddedvest_alb == null)
            {
                daringpaddedvest_alb = new ItemTemplate();
                daringpaddedvest_alb.Name = "Daring Padded Vest";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringpaddedvest_alb.Name + ", creating it ...");
                daringpaddedvest_alb.Level = 5;
                daringpaddedvest_alb.Weight = 20;
                daringpaddedvest_alb.Model = 139;
                daringpaddedvest_alb.Object_Type = 32;
                daringpaddedvest_alb.Item_Type = 25;
                daringpaddedvest_alb.Id_nb = "daringpaddedvest_alb";
                daringpaddedvest_alb.Hand = 0;
                daringpaddedvest_alb.Price = 0;
                daringpaddedvest_alb.IsPickable = true;
                daringpaddedvest_alb.IsDropable = true;
                daringpaddedvest_alb.IsTradable = true;
                daringpaddedvest_alb.CanDropAsLoot = false;
                daringpaddedvest_alb.Color = 0;
                daringpaddedvest_alb.Bonus = 0; // default bonus
                daringpaddedvest_alb.Bonus1 = 12;
                daringpaddedvest_alb.Bonus1Type = (int)10;
                daringpaddedvest_alb.Bonus2 = 0;
                daringpaddedvest_alb.Bonus2Type = (int)0;
                daringpaddedvest_alb.Bonus3 = 0;
                daringpaddedvest_alb.Bonus3Type = (int)0;
                daringpaddedvest_alb.Bonus4 = 0;
                daringpaddedvest_alb.Bonus4Type = (int)0;
                daringpaddedvest_alb.Bonus5 = 0;
                daringpaddedvest_alb.Bonus5Type = (int)0;
                daringpaddedvest_alb.Bonus6 = 0;
                daringpaddedvest_alb.Bonus6Type = (int)0;
                daringpaddedvest_alb.Bonus7 = 0;
                daringpaddedvest_alb.Bonus7Type = (int)0;
                daringpaddedvest_alb.Bonus8 = 0;
                daringpaddedvest_alb.Bonus8Type = (int)0;
                daringpaddedvest_alb.Bonus9 = 0;
                daringpaddedvest_alb.Bonus9Type = (int)0;
                daringpaddedvest_alb.Bonus10 = 0;
                daringpaddedvest_alb.Bonus10Type = (int)0;
                daringpaddedvest_alb.ExtraBonus = 0;
                daringpaddedvest_alb.ExtraBonusType = (int)0;
                daringpaddedvest_alb.Effect = 0;
                daringpaddedvest_alb.DPS_AF = 6;
                daringpaddedvest_alb.Charges = 0;
                daringpaddedvest_alb.MaxCharges = 0;
                daringpaddedvest_alb.SpellID = 0;
                daringpaddedvest_alb.ProcSpellID = 0;
                daringpaddedvest_alb.SPD_ABS = 0;
                daringpaddedvest_alb.Realm = 0;
                daringpaddedvest_alb.MaxCount = 1;
                daringpaddedvest_alb.PackSize = 1;
                daringpaddedvest_alb.Extension = 0;
                daringpaddedvest_alb.Quality =89;
                daringpaddedvest_alb.Condition = 50000;
                daringpaddedvest_alb.MaxCondition = 50000;
                daringpaddedvest_alb.Durability = 50000;
                daringpaddedvest_alb.MaxDurability = 50000;
                daringpaddedvest_alb.PoisonCharges = 0;
                daringpaddedvest_alb.PoisonMaxCharges = 0;
                daringpaddedvest_alb.PoisonSpellID = 0;
                daringpaddedvest_alb.ProcSpellID1 = 0;
                daringpaddedvest_alb.SpellID1 = 0;
                daringpaddedvest_alb.MaxCharges1 = 0;
                daringpaddedvest_alb.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(daringpaddedvest_alb);
            }
            daringleatherboots_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleatherboots_alb");
            if (daringleatherboots_alb == null)
            {
                daringleatherboots_alb = new ItemTemplate();
                daringleatherboots_alb.Name = "Daring Leather Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleatherboots_alb.Name + ", creating it ...");
                daringleatherboots_alb.Level = 5;
                daringleatherboots_alb.Weight = 16;
                daringleatherboots_alb.Model = 133;
                daringleatherboots_alb.Object_Type = 33;
                daringleatherboots_alb.Item_Type = 23;
                daringleatherboots_alb.Id_nb = "daringleatherboots_alb";
                daringleatherboots_alb.Hand = 0;
                daringleatherboots_alb.Price = 0;
                daringleatherboots_alb.IsPickable = true;
                daringleatherboots_alb.IsDropable = true;
                daringleatherboots_alb.IsTradable = true;
                daringleatherboots_alb.CanDropAsLoot = false;
                daringleatherboots_alb.Color = 0;
                daringleatherboots_alb.Bonus = 0; // default bonus
                daringleatherboots_alb.Bonus1 = 4;
                daringleatherboots_alb.Bonus1Type = (int)3;
                daringleatherboots_alb.Bonus2 = 0;
                daringleatherboots_alb.Bonus2Type = (int)0;
                daringleatherboots_alb.Bonus3 = 0;
                daringleatherboots_alb.Bonus3Type = (int)0;
                daringleatherboots_alb.Bonus4 = 0;
                daringleatherboots_alb.Bonus4Type = (int)0;
                daringleatherboots_alb.Bonus5 = 0;
                daringleatherboots_alb.Bonus5Type = (int)0;
                daringleatherboots_alb.Bonus6 = 0;
                daringleatherboots_alb.Bonus6Type = (int)0;
                daringleatherboots_alb.Bonus7 = 0;
                daringleatherboots_alb.Bonus7Type = (int)0;
                daringleatherboots_alb.Bonus8 = 0;
                daringleatherboots_alb.Bonus8Type = (int)0;
                daringleatherboots_alb.Bonus9 = 0;
                daringleatherboots_alb.Bonus9Type = (int)0;
                daringleatherboots_alb.Bonus10 = 0;
                daringleatherboots_alb.Bonus10Type = (int)0;
                daringleatherboots_alb.ExtraBonus = 0;
                daringleatherboots_alb.ExtraBonusType = (int)0;
                daringleatherboots_alb.Effect = 0;
                daringleatherboots_alb.DPS_AF = 10;
                daringleatherboots_alb.Charges = 0;
                daringleatherboots_alb.MaxCharges = 0;
                daringleatherboots_alb.SpellID = 0;
                daringleatherboots_alb.ProcSpellID = 0;
                daringleatherboots_alb.SPD_ABS = 10;
                daringleatherboots_alb.Realm = 0;
                daringleatherboots_alb.MaxCount = 1;
                daringleatherboots_alb.PackSize = 1;
                daringleatherboots_alb.Extension = 0;
                daringleatherboots_alb.Quality =89;
                daringleatherboots_alb.Condition = 50000;
                daringleatherboots_alb.MaxCondition = 50000;
                daringleatherboots_alb.Durability = 50000;
                daringleatherboots_alb.MaxDurability = 50000;
                daringleatherboots_alb.PoisonCharges = 0;
                daringleatherboots_alb.PoisonMaxCharges = 0;
                daringleatherboots_alb.PoisonSpellID = 0;
                daringleatherboots_alb.ProcSpellID1 = 0;
                daringleatherboots_alb.SpellID1 = 0;
                daringleatherboots_alb.MaxCharges1 = 0;
                daringleatherboots_alb.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(daringleatherboots_alb);
            }
            daringleathercap_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleathercap_alb");
            if (daringleathercap_alb == null)
            {
                daringleathercap_alb = new ItemTemplate();
                daringleathercap_alb.Name = "Daring Leather Cap";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleathercap_alb.Name + ", creating it ...");
                daringleathercap_alb.Level = 5;
                daringleathercap_alb.Weight = 16;
                daringleathercap_alb.Model = 62;
                daringleathercap_alb.Object_Type = 33;
                daringleathercap_alb.Item_Type = 21;
                daringleathercap_alb.Id_nb = "daringleathercap_alb";
                daringleathercap_alb.Hand = 0;
                daringleathercap_alb.Price = 0;
                daringleathercap_alb.IsPickable = true;
                daringleathercap_alb.IsDropable = true;
                daringleathercap_alb.IsTradable = true;
                daringleathercap_alb.CanDropAsLoot = false;
                daringleathercap_alb.Color = 0;
                daringleathercap_alb.Bonus = 0; // default bonus
                daringleathercap_alb.Bonus1 = 4;
                daringleathercap_alb.Bonus1Type = (int)3;
                daringleathercap_alb.Bonus2 = 0;
                daringleathercap_alb.Bonus2Type = (int)0;
                daringleathercap_alb.Bonus3 = 0;
                daringleathercap_alb.Bonus3Type = (int)0;
                daringleathercap_alb.Bonus4 = 0;
                daringleathercap_alb.Bonus4Type = (int)0;
                daringleathercap_alb.Bonus5 = 0;
                daringleathercap_alb.Bonus5Type = (int)0;
                daringleathercap_alb.Bonus6 = 0;
                daringleathercap_alb.Bonus6Type = (int)0;
                daringleathercap_alb.Bonus7 = 0;
                daringleathercap_alb.Bonus7Type = (int)0;
                daringleathercap_alb.Bonus8 = 0;
                daringleathercap_alb.Bonus8Type = (int)0;
                daringleathercap_alb.Bonus9 = 0;
                daringleathercap_alb.Bonus9Type = (int)0;
                daringleathercap_alb.Bonus10 = 0;
                daringleathercap_alb.Bonus10Type = (int)0;
                daringleathercap_alb.ExtraBonus = 0;
                daringleathercap_alb.ExtraBonusType = (int)0;
                daringleathercap_alb.Effect = 0;
                daringleathercap_alb.DPS_AF = 10;
                daringleathercap_alb.Charges = 0;
                daringleathercap_alb.MaxCharges = 0;
                daringleathercap_alb.SpellID = 0;
                daringleathercap_alb.ProcSpellID = 0;
                daringleathercap_alb.SPD_ABS = 10;
                daringleathercap_alb.Realm = 0;
                daringleathercap_alb.MaxCount = 1;
                daringleathercap_alb.PackSize = 1;
                daringleathercap_alb.Extension = 0;
                daringleathercap_alb.Quality =89;
                daringleathercap_alb.Condition = 50000;
                daringleathercap_alb.MaxCondition = 50000;
                daringleathercap_alb.Durability = 50000;
                daringleathercap_alb.MaxDurability = 50000;
                daringleathercap_alb.PoisonCharges = 0;
                daringleathercap_alb.PoisonMaxCharges = 0;
                daringleathercap_alb.PoisonSpellID = 0;
                daringleathercap_alb.ProcSpellID1 = 0;
                daringleathercap_alb.SpellID1 = 0;
                daringleathercap_alb.MaxCharges1 = 0;
                daringleathercap_alb.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(daringleathercap_alb);
            }
            daringleathergloves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleathergloves_alb");
            if (daringleathergloves_alb == null)
            {
                daringleathergloves_alb = new ItemTemplate();
                daringleathergloves_alb.Name = "Daring Leather Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleathergloves_alb.Name + ", creating it ...");
                daringleathergloves_alb.Level = 5;
                daringleathergloves_alb.Weight = 16;
                daringleathergloves_alb.Model = 34;
                daringleathergloves_alb.Object_Type = 33;
                daringleathergloves_alb.Item_Type = 22;
                daringleathergloves_alb.Id_nb = "daringleathergloves_alb";
                daringleathergloves_alb.Hand = 0;
                daringleathergloves_alb.Price = 0;
                daringleathergloves_alb.IsPickable = true;
                daringleathergloves_alb.IsDropable = true;
                daringleathergloves_alb.IsTradable = true;
                daringleathergloves_alb.CanDropAsLoot = false;
                daringleathergloves_alb.Color = 0;
                daringleathergloves_alb.Bonus = 0; // default bonus
                daringleathergloves_alb.Bonus1 = 4;
                daringleathergloves_alb.Bonus1Type = (int)2;
                daringleathergloves_alb.Bonus2 = 0;
                daringleathergloves_alb.Bonus2Type = (int)0;
                daringleathergloves_alb.Bonus3 = 0;
                daringleathergloves_alb.Bonus3Type = (int)0;
                daringleathergloves_alb.Bonus4 = 0;
                daringleathergloves_alb.Bonus4Type = (int)0;
                daringleathergloves_alb.Bonus5 = 0;
                daringleathergloves_alb.Bonus5Type = (int)0;
                daringleathergloves_alb.Bonus6 = 0;
                daringleathergloves_alb.Bonus6Type = (int)0;
                daringleathergloves_alb.Bonus7 = 0;
                daringleathergloves_alb.Bonus7Type = (int)0;
                daringleathergloves_alb.Bonus8 = 0;
                daringleathergloves_alb.Bonus8Type = (int)0;
                daringleathergloves_alb.Bonus9 = 0;
                daringleathergloves_alb.Bonus9Type = (int)0;
                daringleathergloves_alb.Bonus10 = 0;
                daringleathergloves_alb.Bonus10Type = (int)0;
                daringleathergloves_alb.ExtraBonus = 0;
                daringleathergloves_alb.ExtraBonusType = (int)0;
                daringleathergloves_alb.Effect = 0;
                daringleathergloves_alb.DPS_AF = 10;
                daringleathergloves_alb.Charges = 0;
                daringleathergloves_alb.MaxCharges = 0;
                daringleathergloves_alb.SpellID = 0;
                daringleathergloves_alb.ProcSpellID = 0;
                daringleathergloves_alb.SPD_ABS = 10;
                daringleathergloves_alb.Realm = 0;
                daringleathergloves_alb.MaxCount = 1;
                daringleathergloves_alb.PackSize = 1;
                daringleathergloves_alb.Extension = 0;
                daringleathergloves_alb.Quality =89;
                daringleathergloves_alb.Condition = 50000;
                daringleathergloves_alb.MaxCondition = 50000;
                daringleathergloves_alb.Durability = 50000;
                daringleathergloves_alb.MaxDurability = 50000;
                daringleathergloves_alb.PoisonCharges = 0;
                daringleathergloves_alb.PoisonMaxCharges = 0;
                daringleathergloves_alb.PoisonSpellID = 0;
                daringleathergloves_alb.ProcSpellID1 = 0;
                daringleathergloves_alb.SpellID1 = 0;
                daringleathergloves_alb.MaxCharges1 = 0;
                daringleathergloves_alb.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(daringleathergloves_alb);
            }
            daringleatherjerkin_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleatherjerkin_alb");
            if (daringleatherjerkin_alb == null)
            {
                daringleatherjerkin_alb = new ItemTemplate();
                daringleatherjerkin_alb.Name = "Daring Leather Jerkin";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleatherjerkin_alb.Name + ", creating it ...");
                daringleatherjerkin_alb.Level = 5;
                daringleatherjerkin_alb.Weight = 16;
                daringleatherjerkin_alb.Model = 31;
                daringleatherjerkin_alb.Object_Type = 33;
                daringleatherjerkin_alb.Item_Type = 25;
                daringleatherjerkin_alb.Id_nb = "daringleatherjerkin_alb";
                daringleatherjerkin_alb.Hand = 0;
                daringleatherjerkin_alb.Price = 0;
                daringleatherjerkin_alb.IsPickable = true;
                daringleatherjerkin_alb.IsDropable = true;
                daringleatherjerkin_alb.IsTradable = true;
                daringleatherjerkin_alb.CanDropAsLoot = false;
                daringleatherjerkin_alb.Color = 0;
                daringleatherjerkin_alb.Bonus = 0; // default bonus
                daringleatherjerkin_alb.Bonus1 = 12;
                daringleatherjerkin_alb.Bonus1Type = (int)10;
                daringleatherjerkin_alb.Bonus2 = 0;
                daringleatherjerkin_alb.Bonus2Type = (int)0;
                daringleatherjerkin_alb.Bonus3 = 0;
                daringleatherjerkin_alb.Bonus3Type = (int)0;
                daringleatherjerkin_alb.Bonus4 = 0;
                daringleatherjerkin_alb.Bonus4Type = (int)0;
                daringleatherjerkin_alb.Bonus5 = 0;
                daringleatherjerkin_alb.Bonus5Type = (int)0;
                daringleatherjerkin_alb.Bonus6 = 0;
                daringleatherjerkin_alb.Bonus6Type = (int)0;
                daringleatherjerkin_alb.Bonus7 = 0;
                daringleatherjerkin_alb.Bonus7Type = (int)0;
                daringleatherjerkin_alb.Bonus8 = 0;
                daringleatherjerkin_alb.Bonus8Type = (int)0;
                daringleatherjerkin_alb.Bonus9 = 0;
                daringleatherjerkin_alb.Bonus9Type = (int)0;
                daringleatherjerkin_alb.Bonus10 = 0;
                daringleatherjerkin_alb.Bonus10Type = (int)0;
                daringleatherjerkin_alb.ExtraBonus = 0;
                daringleatherjerkin_alb.ExtraBonusType = (int)0;
                daringleatherjerkin_alb.Effect = 0;
                daringleatherjerkin_alb.DPS_AF = 10;
                daringleatherjerkin_alb.Charges = 0;
                daringleatherjerkin_alb.MaxCharges = 0;
                daringleatherjerkin_alb.SpellID = 0;
                daringleatherjerkin_alb.ProcSpellID = 0;
                daringleatherjerkin_alb.SPD_ABS = 10;
                daringleatherjerkin_alb.Realm = 0;
                daringleatherjerkin_alb.MaxCount = 1;
                daringleatherjerkin_alb.PackSize = 1;
                daringleatherjerkin_alb.Extension = 0;
                daringleatherjerkin_alb.Quality =89;
                daringleatherjerkin_alb.Condition = 50000;
                daringleatherjerkin_alb.MaxCondition = 50000;
                daringleatherjerkin_alb.Durability = 50000;
                daringleatherjerkin_alb.MaxDurability = 50000;
                daringleatherjerkin_alb.PoisonCharges = 0;
                daringleatherjerkin_alb.PoisonMaxCharges = 0;
                daringleatherjerkin_alb.PoisonSpellID = 0;
                daringleatherjerkin_alb.ProcSpellID1 = 0;
                daringleatherjerkin_alb.SpellID1 = 0;
                daringleatherjerkin_alb.MaxCharges1 = 0;
                daringleatherjerkin_alb.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(daringleatherjerkin_alb);
            }
            daringleatherleggings_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleatherleggings_alb");
            if (daringleatherleggings_alb == null)
            {
                daringleatherleggings_alb = new ItemTemplate();
                daringleatherleggings_alb.Name = "Daring Leather Leggings";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleatherleggings_alb.Name + ", creating it ...");
                daringleatherleggings_alb.Level = 5;
                daringleatherleggings_alb.Weight = 16;
                daringleatherleggings_alb.Model = 32;
                daringleatherleggings_alb.Object_Type = 33;
                daringleatherleggings_alb.Item_Type = 27;
                daringleatherleggings_alb.Id_nb = "daringleatherleggings_alb";
                daringleatherleggings_alb.Hand = 0;
                daringleatherleggings_alb.Price = 0;
                daringleatherleggings_alb.IsPickable = true;
                daringleatherleggings_alb.IsDropable = true;
                daringleatherleggings_alb.IsTradable = true;
                daringleatherleggings_alb.CanDropAsLoot = false;
                daringleatherleggings_alb.Color = 0;
                daringleatherleggings_alb.Bonus = 0; // default bonus
                daringleatherleggings_alb.Bonus1 = 4;
                daringleatherleggings_alb.Bonus1Type = (int)2;
                daringleatherleggings_alb.Bonus2 = 0;
                daringleatherleggings_alb.Bonus2Type = (int)0;
                daringleatherleggings_alb.Bonus3 = 0;
                daringleatherleggings_alb.Bonus3Type = (int)0;
                daringleatherleggings_alb.Bonus4 = 0;
                daringleatherleggings_alb.Bonus4Type = (int)0;
                daringleatherleggings_alb.Bonus5 = 0;
                daringleatherleggings_alb.Bonus5Type = (int)0;
                daringleatherleggings_alb.Bonus6 = 0;
                daringleatherleggings_alb.Bonus6Type = (int)0;
                daringleatherleggings_alb.Bonus7 = 0;
                daringleatherleggings_alb.Bonus7Type = (int)0;
                daringleatherleggings_alb.Bonus8 = 0;
                daringleatherleggings_alb.Bonus8Type = (int)0;
                daringleatherleggings_alb.Bonus9 = 0;
                daringleatherleggings_alb.Bonus9Type = (int)0;
                daringleatherleggings_alb.Bonus10 = 0;
                daringleatherleggings_alb.Bonus10Type = (int)0;
                daringleatherleggings_alb.ExtraBonus = 0;
                daringleatherleggings_alb.ExtraBonusType = (int)0;
                daringleatherleggings_alb.Effect = 0;
                daringleatherleggings_alb.DPS_AF = 10;
                daringleatherleggings_alb.Charges = 0;
                daringleatherleggings_alb.MaxCharges = 0;
                daringleatherleggings_alb.SpellID = 0;
                daringleatherleggings_alb.ProcSpellID = 0;
                daringleatherleggings_alb.SPD_ABS = 10;
                daringleatherleggings_alb.Realm = 0;
                daringleatherleggings_alb.MaxCount = 1;
                daringleatherleggings_alb.PackSize = 1;
                daringleatherleggings_alb.Extension = 0;
                daringleatherleggings_alb.Quality =89;
                daringleatherleggings_alb.Condition = 50000;
                daringleatherleggings_alb.MaxCondition = 50000;
                daringleatherleggings_alb.Durability = 50000;
                daringleatherleggings_alb.MaxDurability = 50000;
                daringleatherleggings_alb.PoisonCharges = 0;
                daringleatherleggings_alb.PoisonMaxCharges = 0;
                daringleatherleggings_alb.PoisonSpellID = 0;
                daringleatherleggings_alb.ProcSpellID1 = 0;
                daringleatherleggings_alb.SpellID1 = 0;
                daringleatherleggings_alb.MaxCharges1 = 0;
                daringleatherleggings_alb.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(daringleatherleggings_alb);
            }
            daringleathersleeves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringleathersleeves_alb");
            if (daringleathersleeves_alb == null)
            {
                daringleathersleeves_alb = new ItemTemplate();
                daringleathersleeves_alb.Name = "Daring Leather Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringleathersleeves_alb.Name + ", creating it ...");
                daringleathersleeves_alb.Level = 5;
                daringleathersleeves_alb.Weight = 16;
                daringleathersleeves_alb.Model = 33;
                daringleathersleeves_alb.Object_Type = 33;
                daringleathersleeves_alb.Item_Type = 28;
                daringleathersleeves_alb.Id_nb = "daringleathersleeves_alb";
                daringleathersleeves_alb.Hand = 0;
                daringleathersleeves_alb.Price = 0;
                daringleathersleeves_alb.IsPickable = true;
                daringleathersleeves_alb.IsDropable = true;
                daringleathersleeves_alb.IsTradable = true;
                daringleathersleeves_alb.CanDropAsLoot = false;
                daringleathersleeves_alb.Color = 0;
                daringleathersleeves_alb.Bonus = 0; // default bonus
                daringleathersleeves_alb.Bonus1 = 4;
                daringleathersleeves_alb.Bonus1Type = (int)1;
                daringleathersleeves_alb.Bonus2 = 0;
                daringleathersleeves_alb.Bonus2Type = (int)0;
                daringleathersleeves_alb.Bonus3 = 0;
                daringleathersleeves_alb.Bonus3Type = (int)0;
                daringleathersleeves_alb.Bonus4 = 0;
                daringleathersleeves_alb.Bonus4Type = (int)0;
                daringleathersleeves_alb.Bonus5 = 0;
                daringleathersleeves_alb.Bonus5Type = (int)0;
                daringleathersleeves_alb.Bonus6 = 0;
                daringleathersleeves_alb.Bonus6Type = (int)0;
                daringleathersleeves_alb.Bonus7 = 0;
                daringleathersleeves_alb.Bonus7Type = (int)0;
                daringleathersleeves_alb.Bonus8 = 0;
                daringleathersleeves_alb.Bonus8Type = (int)0;
                daringleathersleeves_alb.Bonus9 = 0;
                daringleathersleeves_alb.Bonus9Type = (int)0;
                daringleathersleeves_alb.Bonus10 = 0;
                daringleathersleeves_alb.Bonus10Type = (int)0;
                daringleathersleeves_alb.ExtraBonus = 0;
                daringleathersleeves_alb.ExtraBonusType = (int)0;
                daringleathersleeves_alb.Effect = 0;
                daringleathersleeves_alb.DPS_AF = 10;
                daringleathersleeves_alb.Charges = 0;
                daringleathersleeves_alb.MaxCharges = 0;
                daringleathersleeves_alb.SpellID = 0;
                daringleathersleeves_alb.ProcSpellID = 0;
                daringleathersleeves_alb.SPD_ABS = 10;
                daringleathersleeves_alb.Realm = 0;
                daringleathersleeves_alb.MaxCount = 1;
                daringleathersleeves_alb.PackSize = 1;
                daringleathersleeves_alb.Extension = 0;
                daringleathersleeves_alb.Quality =89;
                daringleathersleeves_alb.Condition = 50000;
                daringleathersleeves_alb.MaxCondition = 50000;
                daringleathersleeves_alb.Durability = 50000;
                daringleathersleeves_alb.MaxDurability = 50000;
                daringleathersleeves_alb.PoisonCharges = 0;
                daringleathersleeves_alb.PoisonMaxCharges = 0;
                daringleathersleeves_alb.PoisonSpellID = 0;
                daringleathersleeves_alb.ProcSpellID1 = 0;
                daringleathersleeves_alb.SpellID1 = 0;
                daringleathersleeves_alb.MaxCharges1 = 0;
                daringleathersleeves_alb.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(daringleathersleeves_alb);
            }
            daringstuddedboots_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedboots_alb");
            if (daringstuddedboots_alb == null)
            {
                daringstuddedboots_alb = new ItemTemplate();
                daringstuddedboots_alb.Name = "Daring Studded Boots";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedboots_alb.Name + ", creating it ...");
                daringstuddedboots_alb.Level = 5;
                daringstuddedboots_alb.Weight = 24;
                daringstuddedboots_alb.Model = 84;
                daringstuddedboots_alb.Object_Type = 34;
                daringstuddedboots_alb.Item_Type = 23;
                daringstuddedboots_alb.Id_nb = "daringstuddedboots_alb";
                daringstuddedboots_alb.Hand = 0;
                daringstuddedboots_alb.Price = 0;
                daringstuddedboots_alb.IsPickable = true;
                daringstuddedboots_alb.IsDropable = true;
                daringstuddedboots_alb.IsTradable = true;
                daringstuddedboots_alb.CanDropAsLoot = false;
                daringstuddedboots_alb.Color = 0;
                daringstuddedboots_alb.Bonus = 0; // default bonus
                daringstuddedboots_alb.Bonus1 = 4;
                daringstuddedboots_alb.Bonus1Type = (int)3;
                daringstuddedboots_alb.Bonus2 = 0;
                daringstuddedboots_alb.Bonus2Type = (int)0;
                daringstuddedboots_alb.Bonus3 = 0;
                daringstuddedboots_alb.Bonus3Type = (int)0;
                daringstuddedboots_alb.Bonus4 = 0;
                daringstuddedboots_alb.Bonus4Type = (int)0;
                daringstuddedboots_alb.Bonus5 = 0;
                daringstuddedboots_alb.Bonus5Type = (int)0;
                daringstuddedboots_alb.Bonus6 = 0;
                daringstuddedboots_alb.Bonus6Type = (int)0;
                daringstuddedboots_alb.Bonus7 = 0;
                daringstuddedboots_alb.Bonus7Type = (int)0;
                daringstuddedboots_alb.Bonus8 = 0;
                daringstuddedboots_alb.Bonus8Type = (int)0;
                daringstuddedboots_alb.Bonus9 = 0;
                daringstuddedboots_alb.Bonus9Type = (int)0;
                daringstuddedboots_alb.Bonus10 = 0;
                daringstuddedboots_alb.Bonus10Type = (int)0;
                daringstuddedboots_alb.ExtraBonus = 0;
                daringstuddedboots_alb.ExtraBonusType = (int)0;
                daringstuddedboots_alb.Effect = 0;
                daringstuddedboots_alb.DPS_AF = 12;
                daringstuddedboots_alb.Charges = 0;
                daringstuddedboots_alb.MaxCharges = 0;
                daringstuddedboots_alb.SpellID = 0;
                daringstuddedboots_alb.ProcSpellID = 0;
                daringstuddedboots_alb.SPD_ABS = 19;
                daringstuddedboots_alb.Realm = 0;
                daringstuddedboots_alb.MaxCount = 1;
                daringstuddedboots_alb.PackSize = 1;
                daringstuddedboots_alb.Extension = 0;
                daringstuddedboots_alb.Quality =89;
                daringstuddedboots_alb.Condition = 50000;
                daringstuddedboots_alb.MaxCondition = 50000;
                daringstuddedboots_alb.Durability = 50000;
                daringstuddedboots_alb.MaxDurability = 50000;
                daringstuddedboots_alb.PoisonCharges = 0;
                daringstuddedboots_alb.PoisonMaxCharges = 0;
                daringstuddedboots_alb.PoisonSpellID = 0;
                daringstuddedboots_alb.ProcSpellID1 = 0;
                daringstuddedboots_alb.SpellID1 = 0;
                daringstuddedboots_alb.MaxCharges1 = 0;
                daringstuddedboots_alb.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(daringstuddedboots_alb);
            }
            daringstuddedcap_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedcap_alb");
            if (daringstuddedcap_alb == null)
            {
                daringstuddedcap_alb = new ItemTemplate();
                daringstuddedcap_alb.Name = "Daring Studded Cap";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedcap_alb.Name + ", creating it ...");
                daringstuddedcap_alb.Level = 5;
                daringstuddedcap_alb.Weight = 24;
                daringstuddedcap_alb.Model = 824;
                daringstuddedcap_alb.Object_Type = 34;
                daringstuddedcap_alb.Item_Type = 21;
                daringstuddedcap_alb.Id_nb = "daringstuddedcap_alb";
                daringstuddedcap_alb.Hand = 0;
                daringstuddedcap_alb.Price = 0;
                daringstuddedcap_alb.IsPickable = true;
                daringstuddedcap_alb.IsDropable = true;
                daringstuddedcap_alb.IsTradable = true;
                daringstuddedcap_alb.CanDropAsLoot = false;
                daringstuddedcap_alb.Color = 0;
                daringstuddedcap_alb.Bonus = 0; // default bonus
                daringstuddedcap_alb.Bonus1 = 4;
                daringstuddedcap_alb.Bonus1Type = (int)3;
                daringstuddedcap_alb.Bonus2 = 0;
                daringstuddedcap_alb.Bonus2Type = (int)0;
                daringstuddedcap_alb.Bonus3 = 0;
                daringstuddedcap_alb.Bonus3Type = (int)0;
                daringstuddedcap_alb.Bonus4 = 0;
                daringstuddedcap_alb.Bonus4Type = (int)0;
                daringstuddedcap_alb.Bonus5 = 0;
                daringstuddedcap_alb.Bonus5Type = (int)0;
                daringstuddedcap_alb.Bonus6 = 0;
                daringstuddedcap_alb.Bonus6Type = (int)0;
                daringstuddedcap_alb.Bonus7 = 0;
                daringstuddedcap_alb.Bonus7Type = (int)0;
                daringstuddedcap_alb.Bonus8 = 0;
                daringstuddedcap_alb.Bonus8Type = (int)0;
                daringstuddedcap_alb.Bonus9 = 0;
                daringstuddedcap_alb.Bonus9Type = (int)0;
                daringstuddedcap_alb.Bonus10 = 0;
                daringstuddedcap_alb.Bonus10Type = (int)0;
                daringstuddedcap_alb.ExtraBonus = 0;
                daringstuddedcap_alb.ExtraBonusType = (int)0;
                daringstuddedcap_alb.Effect = 0;
                daringstuddedcap_alb.DPS_AF = 12;
                daringstuddedcap_alb.Charges = 0;
                daringstuddedcap_alb.MaxCharges = 0;
                daringstuddedcap_alb.SpellID = 0;
                daringstuddedcap_alb.ProcSpellID = 0;
                daringstuddedcap_alb.SPD_ABS = 19;
                daringstuddedcap_alb.Realm = 0;
                daringstuddedcap_alb.MaxCount = 1;
                daringstuddedcap_alb.PackSize = 1;
                daringstuddedcap_alb.Extension = 0;
                daringstuddedcap_alb.Quality =89;
                daringstuddedcap_alb.Condition = 50000;
                daringstuddedcap_alb.MaxCondition = 50000;
                daringstuddedcap_alb.Durability = 50000;
                daringstuddedcap_alb.MaxDurability = 50000;
                daringstuddedcap_alb.PoisonCharges = 0;
                daringstuddedcap_alb.PoisonMaxCharges = 0;
                daringstuddedcap_alb.PoisonSpellID = 0;
                daringstuddedcap_alb.ProcSpellID1 = 0;
                daringstuddedcap_alb.SpellID1 = 0;
                daringstuddedcap_alb.MaxCharges1 = 0;
                daringstuddedcap_alb.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(daringstuddedcap_alb);
            }
            daringstuddedgloves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedgloves_alb");
            if (daringstuddedgloves_alb == null)
            {
                daringstuddedgloves_alb = new ItemTemplate();
                daringstuddedgloves_alb.Name = "Daring Studded Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedgloves_alb.Name + ", creating it ...");
                daringstuddedgloves_alb.Level = 5;
                daringstuddedgloves_alb.Weight = 24;
                daringstuddedgloves_alb.Model = 85;
                daringstuddedgloves_alb.Object_Type = 34;
                daringstuddedgloves_alb.Item_Type = 22;
                daringstuddedgloves_alb.Id_nb = "daringstuddedgloves_alb";
                daringstuddedgloves_alb.Hand = 0;
                daringstuddedgloves_alb.Price = 0;
                daringstuddedgloves_alb.IsPickable = true;
                daringstuddedgloves_alb.IsDropable = true;
                daringstuddedgloves_alb.IsTradable = true;
                daringstuddedgloves_alb.CanDropAsLoot = false;
                daringstuddedgloves_alb.Color = 0;
                daringstuddedgloves_alb.Bonus = 0; // default bonus
                daringstuddedgloves_alb.Bonus1 = 4;
                daringstuddedgloves_alb.Bonus1Type = (int)4;
                daringstuddedgloves_alb.Bonus2 = 0;
                daringstuddedgloves_alb.Bonus2Type = (int)0;
                daringstuddedgloves_alb.Bonus3 = 0;
                daringstuddedgloves_alb.Bonus3Type = (int)0;
                daringstuddedgloves_alb.Bonus4 = 0;
                daringstuddedgloves_alb.Bonus4Type = (int)0;
                daringstuddedgloves_alb.Bonus5 = 0;
                daringstuddedgloves_alb.Bonus5Type = (int)0;
                daringstuddedgloves_alb.Bonus6 = 0;
                daringstuddedgloves_alb.Bonus6Type = (int)0;
                daringstuddedgloves_alb.Bonus7 = 0;
                daringstuddedgloves_alb.Bonus7Type = (int)0;
                daringstuddedgloves_alb.Bonus8 = 0;
                daringstuddedgloves_alb.Bonus8Type = (int)0;
                daringstuddedgloves_alb.Bonus9 = 0;
                daringstuddedgloves_alb.Bonus9Type = (int)0;
                daringstuddedgloves_alb.Bonus10 = 0;
                daringstuddedgloves_alb.Bonus10Type = (int)0;
                daringstuddedgloves_alb.ExtraBonus = 0;
                daringstuddedgloves_alb.ExtraBonusType = (int)0;
                daringstuddedgloves_alb.Effect = 0;
                daringstuddedgloves_alb.DPS_AF = 12;
                daringstuddedgloves_alb.Charges = 0;
                daringstuddedgloves_alb.MaxCharges = 0;
                daringstuddedgloves_alb.SpellID = 0;
                daringstuddedgloves_alb.ProcSpellID = 0;
                daringstuddedgloves_alb.SPD_ABS = 19;
                daringstuddedgloves_alb.Realm = 0;
                daringstuddedgloves_alb.MaxCount = 1;
                daringstuddedgloves_alb.PackSize = 1;
                daringstuddedgloves_alb.Extension = 0;
                daringstuddedgloves_alb.Quality =89;
                daringstuddedgloves_alb.Condition = 50000;
                daringstuddedgloves_alb.MaxCondition = 50000;
                daringstuddedgloves_alb.Durability = 50000;
                daringstuddedgloves_alb.MaxDurability = 50000;
                daringstuddedgloves_alb.PoisonCharges = 0;
                daringstuddedgloves_alb.PoisonMaxCharges = 0;
                daringstuddedgloves_alb.PoisonSpellID = 0;
                daringstuddedgloves_alb.ProcSpellID1 = 0;
                daringstuddedgloves_alb.SpellID1 = 0;
                daringstuddedgloves_alb.MaxCharges1 = 0;
                daringstuddedgloves_alb.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(daringstuddedgloves_alb);
            }
            daringstuddedjerkin_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedjerkin_alb");
            if (daringstuddedjerkin_alb == null)
            {
                daringstuddedjerkin_alb = new ItemTemplate();
                daringstuddedjerkin_alb.Name = "Daring Studded Jerkin";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedjerkin_alb.Name + ", creating it ...");
                daringstuddedjerkin_alb.Level = 5;
                daringstuddedjerkin_alb.Weight = 60;
                daringstuddedjerkin_alb.Model = 81;
                daringstuddedjerkin_alb.Object_Type = 34;
                daringstuddedjerkin_alb.Item_Type = 25;
                daringstuddedjerkin_alb.Id_nb = "daringstuddedjerkin_alb";
                daringstuddedjerkin_alb.Hand = 0;
                daringstuddedjerkin_alb.Price = 0;
                daringstuddedjerkin_alb.IsPickable = true;
                daringstuddedjerkin_alb.IsDropable = true;
                daringstuddedjerkin_alb.IsTradable = true;
                daringstuddedjerkin_alb.CanDropAsLoot = false;
                daringstuddedjerkin_alb.Color = 0;
                daringstuddedjerkin_alb.Bonus = 0; // default bonus
                daringstuddedjerkin_alb.Bonus1 = 12;
                daringstuddedjerkin_alb.Bonus1Type = (int)10;
                daringstuddedjerkin_alb.Bonus2 = 0;
                daringstuddedjerkin_alb.Bonus2Type = (int)0;
                daringstuddedjerkin_alb.Bonus3 = 0;
                daringstuddedjerkin_alb.Bonus3Type = (int)0;
                daringstuddedjerkin_alb.Bonus4 = 0;
                daringstuddedjerkin_alb.Bonus4Type = (int)0;
                daringstuddedjerkin_alb.Bonus5 = 0;
                daringstuddedjerkin_alb.Bonus5Type = (int)0;
                daringstuddedjerkin_alb.Bonus6 = 0;
                daringstuddedjerkin_alb.Bonus6Type = (int)0;
                daringstuddedjerkin_alb.Bonus7 = 0;
                daringstuddedjerkin_alb.Bonus7Type = (int)0;
                daringstuddedjerkin_alb.Bonus8 = 0;
                daringstuddedjerkin_alb.Bonus8Type = (int)0;
                daringstuddedjerkin_alb.Bonus9 = 0;
                daringstuddedjerkin_alb.Bonus9Type = (int)0;
                daringstuddedjerkin_alb.Bonus10 = 0;
                daringstuddedjerkin_alb.Bonus10Type = (int)0;
                daringstuddedjerkin_alb.ExtraBonus = 0;
                daringstuddedjerkin_alb.ExtraBonusType = (int)0;
                daringstuddedjerkin_alb.Effect = 0;
                daringstuddedjerkin_alb.DPS_AF = 12;
                daringstuddedjerkin_alb.Charges = 0;
                daringstuddedjerkin_alb.MaxCharges = 0;
                daringstuddedjerkin_alb.SpellID = 0;
                daringstuddedjerkin_alb.ProcSpellID = 0;
                daringstuddedjerkin_alb.SPD_ABS = 19;
                daringstuddedjerkin_alb.Realm = 0;
                daringstuddedjerkin_alb.MaxCount = 1;
                daringstuddedjerkin_alb.PackSize = 1;
                daringstuddedjerkin_alb.Extension = 0;
                daringstuddedjerkin_alb.Quality =89;
                daringstuddedjerkin_alb.Condition = 50000;
                daringstuddedjerkin_alb.MaxCondition = 50000;
                daringstuddedjerkin_alb.Durability = 50000;
                daringstuddedjerkin_alb.MaxDurability = 50000;
                daringstuddedjerkin_alb.PoisonCharges = 0;
                daringstuddedjerkin_alb.PoisonMaxCharges = 0;
                daringstuddedjerkin_alb.PoisonSpellID = 0;
                daringstuddedjerkin_alb.ProcSpellID1 = 0;
                daringstuddedjerkin_alb.SpellID1 = 0;
                daringstuddedjerkin_alb.MaxCharges1 = 0;
                daringstuddedjerkin_alb.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(daringstuddedjerkin_alb);
            }
            daringstuddedleggings_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedleggings_alb");
            if (daringstuddedleggings_alb == null)
            {
                daringstuddedleggings_alb = new ItemTemplate();
                daringstuddedleggings_alb.Name = "Daring Studded Leggings";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedleggings_alb.Name + ", creating it ...");
                daringstuddedleggings_alb.Level = 5;
                daringstuddedleggings_alb.Weight = 42;
                daringstuddedleggings_alb.Model = 82;
                daringstuddedleggings_alb.Object_Type = 34;
                daringstuddedleggings_alb.Item_Type = 27;
                daringstuddedleggings_alb.Id_nb = "daringstuddedleggings_alb";
                daringstuddedleggings_alb.Hand = 0;
                daringstuddedleggings_alb.Price = 0;
                daringstuddedleggings_alb.IsPickable = true;
                daringstuddedleggings_alb.IsDropable = true;
                daringstuddedleggings_alb.IsTradable = true;
                daringstuddedleggings_alb.CanDropAsLoot = false;
                daringstuddedleggings_alb.Color = 0;
                daringstuddedleggings_alb.Bonus = 0; // default bonus
                daringstuddedleggings_alb.Bonus1 = 4;
                daringstuddedleggings_alb.Bonus1Type = (int)4;
                daringstuddedleggings_alb.Bonus2 = 0;
                daringstuddedleggings_alb.Bonus2Type = (int)0;
                daringstuddedleggings_alb.Bonus3 = 0;
                daringstuddedleggings_alb.Bonus3Type = (int)0;
                daringstuddedleggings_alb.Bonus4 = 0;
                daringstuddedleggings_alb.Bonus4Type = (int)0;
                daringstuddedleggings_alb.Bonus5 = 0;
                daringstuddedleggings_alb.Bonus5Type = (int)0;
                daringstuddedleggings_alb.Bonus6 = 0;
                daringstuddedleggings_alb.Bonus6Type = (int)0;
                daringstuddedleggings_alb.Bonus7 = 0;
                daringstuddedleggings_alb.Bonus7Type = (int)0;
                daringstuddedleggings_alb.Bonus8 = 0;
                daringstuddedleggings_alb.Bonus8Type = (int)0;
                daringstuddedleggings_alb.Bonus9 = 0;
                daringstuddedleggings_alb.Bonus9Type = (int)0;
                daringstuddedleggings_alb.Bonus10 = 0;
                daringstuddedleggings_alb.Bonus10Type = (int)0;
                daringstuddedleggings_alb.ExtraBonus = 0;
                daringstuddedleggings_alb.ExtraBonusType = (int)0;
                daringstuddedleggings_alb.Effect = 0;
                daringstuddedleggings_alb.DPS_AF = 12;
                daringstuddedleggings_alb.Charges = 0;
                daringstuddedleggings_alb.MaxCharges = 0;
                daringstuddedleggings_alb.SpellID = 0;
                daringstuddedleggings_alb.ProcSpellID = 0;
                daringstuddedleggings_alb.SPD_ABS = 19;
                daringstuddedleggings_alb.Realm = 0;
                daringstuddedleggings_alb.MaxCount = 1;
                daringstuddedleggings_alb.PackSize = 1;
                daringstuddedleggings_alb.Extension = 0;
                daringstuddedleggings_alb.Quality =89;
                daringstuddedleggings_alb.Condition = 50000;
                daringstuddedleggings_alb.MaxCondition = 50000;
                daringstuddedleggings_alb.Durability = 50000;
                daringstuddedleggings_alb.MaxDurability = 50000;
                daringstuddedleggings_alb.PoisonCharges = 0;
                daringstuddedleggings_alb.PoisonMaxCharges = 0;
                daringstuddedleggings_alb.PoisonSpellID = 0;
                daringstuddedleggings_alb.ProcSpellID1 = 0;
                daringstuddedleggings_alb.SpellID1 = 0;
                daringstuddedleggings_alb.MaxCharges1 = 0;
                daringstuddedleggings_alb.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(daringstuddedleggings_alb);
            }
            daringstuddedsleeves_alb = GameServer.Database.FindObjectByKey<ItemTemplate>("daringstuddedsleeves_alb");
            if (daringstuddedsleeves_alb == null)
            {
                daringstuddedsleeves_alb = new ItemTemplate();
                daringstuddedsleeves_alb.Name = "Daring Studded Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + daringstuddedsleeves_alb.Name + ", creating it ...");
                daringstuddedsleeves_alb.Level = 5;
                daringstuddedsleeves_alb.Weight = 36;
                daringstuddedsleeves_alb.Model = 83;
                daringstuddedsleeves_alb.Object_Type = 34;
                daringstuddedsleeves_alb.Item_Type = 28;
                daringstuddedsleeves_alb.Id_nb = "daringstuddedsleeves_alb";
                daringstuddedsleeves_alb.Hand = 0;
                daringstuddedsleeves_alb.Price = 0;
                daringstuddedsleeves_alb.IsPickable = true;
                daringstuddedsleeves_alb.IsDropable = true;
                daringstuddedsleeves_alb.IsTradable = true;
                daringstuddedsleeves_alb.CanDropAsLoot = false;
                daringstuddedsleeves_alb.Color = 0;
                daringstuddedsleeves_alb.Bonus = 0; // default bonus
                daringstuddedsleeves_alb.Bonus1 = 4;
                daringstuddedsleeves_alb.Bonus1Type = (int)1;
                daringstuddedsleeves_alb.Bonus2 = 0;
                daringstuddedsleeves_alb.Bonus2Type = (int)0;
                daringstuddedsleeves_alb.Bonus3 = 0;
                daringstuddedsleeves_alb.Bonus3Type = (int)0;
                daringstuddedsleeves_alb.Bonus4 = 0;
                daringstuddedsleeves_alb.Bonus4Type = (int)0;
                daringstuddedsleeves_alb.Bonus5 = 0;
                daringstuddedsleeves_alb.Bonus5Type = (int)0;
                daringstuddedsleeves_alb.Bonus6 = 0;
                daringstuddedsleeves_alb.Bonus6Type = (int)0;
                daringstuddedsleeves_alb.Bonus7 = 0;
                daringstuddedsleeves_alb.Bonus7Type = (int)0;
                daringstuddedsleeves_alb.Bonus8 = 0;
                daringstuddedsleeves_alb.Bonus8Type = (int)0;
                daringstuddedsleeves_alb.Bonus9 = 0;
                daringstuddedsleeves_alb.Bonus9Type = (int)0;
                daringstuddedsleeves_alb.Bonus10 = 0;
                daringstuddedsleeves_alb.Bonus10Type = (int)0;
                daringstuddedsleeves_alb.ExtraBonus = 0;
                daringstuddedsleeves_alb.ExtraBonusType = (int)0;
                daringstuddedsleeves_alb.Effect = 0;
                daringstuddedsleeves_alb.DPS_AF = 12;
                daringstuddedsleeves_alb.Charges = 0;
                daringstuddedsleeves_alb.MaxCharges = 0;
                daringstuddedsleeves_alb.SpellID = 0;
                daringstuddedsleeves_alb.ProcSpellID = 0;
                daringstuddedsleeves_alb.SPD_ABS = 19;
                daringstuddedsleeves_alb.Realm = 0;
                daringstuddedsleeves_alb.MaxCount = 1;
                daringstuddedsleeves_alb.PackSize = 1;
                daringstuddedsleeves_alb.Extension = 0;
                daringstuddedsleeves_alb.Quality =89;
                daringstuddedsleeves_alb.Condition = 50000;
                daringstuddedsleeves_alb.MaxCondition = 50000;
                daringstuddedsleeves_alb.Durability = 50000;
                daringstuddedsleeves_alb.MaxDurability = 50000;
                daringstuddedsleeves_alb.PoisonCharges = 0;
                daringstuddedsleeves_alb.PoisonMaxCharges = 0;
                daringstuddedsleeves_alb.PoisonSpellID = 0;
                daringstuddedsleeves_alb.ProcSpellID1 = 0;
                daringstuddedsleeves_alb.SpellID1 = 0;
                daringstuddedsleeves_alb.MaxCharges1 = 0;
                daringstuddedsleeves_alb.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(daringstuddedsleeves_alb);
            }

            #endregion

            #region defineAreas
            Albion_Statue_Area = WorldMgr.GetRegion(Albion_Statue.RegionID).AddArea(new Area.Circle("", Albion_Statue.X, Albion_Statue.Y, Albion_Statue.Z, 500));
            Albion_Statue_Area.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterStatueArea));

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles));
            GameEventMgr.AddHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles));

            Charles.AddQuestToGive(typeof(childsplay));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #22
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 ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            masterFrederick = GetMasterFrederick();

            generalLocations[0] = new GameLocation(generalNames[0], 1, 568589, 501801, 2134, 23);
            generalLocations[1] = new GameLocation(generalNames[1], 1, 572320, 499246, 2472, 14);
            generalLocations[2] = new GameLocation(generalNames[2], 1, 571900, 510559, 2210, 170);

            GameNPC[] npcs = null;
            for (int i = 0; i < general.Length; i++)
            {
                npcs = WorldMgr.GetNPCsByName(generalNames[i], eRealm.None);
                if (npcs.Length > 0)
                    general[i] = npcs[0] as GameNPC;
                else
                {
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + generalNames[i] + ", creating her ...");
                    general[i] = new GameNPC();

                    general[i].Model = 603;

                    general[i].Name = generalNames[i];
                    general[i].X = generalLocations[i].X;
                    general[i].Y = generalLocations[i].Y;
                    general[i].Z = generalLocations[i].Z;
                    general[i].Heading = generalLocations[i].Heading;

                    general[i].GuildName = "Part of " + questTitle + " Quest";
                    general[i].Realm = eRealm.None;
                    general[i].CurrentRegionID = generalLocations[i].RegionID;

                    general[i].Size = 49;
                    general[i].Level = 2;
                    general[i].Race = 2007;
                    general[i].BodyType = 8;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 80;
                    brain.AggroRange = 1000;
                    general[i].SetOwnBrain(brain);

                    if (SAVE_INTO_DATABASE)
                        general[i].SaveIntoDatabase();
                    general[i].AddToWorld();
                }
            }

            #endregion

            #region defineItems

            fairyGeneralWings = GameServer.Database.FindObjectByKey<ItemTemplate>("fairy_general_wings");
            if (fairyGeneralWings == null)
            {
                fairyGeneralWings = new ItemTemplate();
                fairyGeneralWings.Name = "Wings of Fairy General";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + fairyGeneralWings.Name + " , creating it ...");

                fairyGeneralWings.Weight = 2;
                fairyGeneralWings.Model = 551;

                fairyGeneralWings.Object_Type = (int) eObjectType.GenericItem;

                fairyGeneralWings.Id_nb = "fairy_general_wings";
                fairyGeneralWings.IsPickable = true;
                fairyGeneralWings.IsDropable = false;

                //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(fairyGeneralWings);
            }

            dustyOldMap = GameServer.Database.FindObjectByKey<ItemTemplate>("dusty_old_map");
            if (dustyOldMap == null)
            {
                dustyOldMap = new ItemTemplate();
                dustyOldMap.Name = "Dusty Old Map";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + dustyOldMap.Name + " , creating it ...");

                dustyOldMap.Weight = 10;
                dustyOldMap.Model = 498;

                dustyOldMap.Object_Type = (int) eObjectType.GenericItem;

                dustyOldMap.Id_nb = "dusty_old_map";
                dustyOldMap.IsPickable = true;
                dustyOldMap.IsDropable = false;

                //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(dustyOldMap);
            }

            // item db check
            recruitsArms = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_arms");
            if (recruitsArms == null)
            {
                recruitsArms = new ItemTemplate();
                recruitsArms.Name = "Recruit's Studded Arms";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsArms.Name + ", creating it ...");
                recruitsArms.Level = 7;

                recruitsArms.Weight = 36;
                recruitsArms.Model = 83; // studded Boots

                recruitsArms.DPS_AF = 10; // Armour
                recruitsArms.SPD_ABS = 19; // Absorption

                recruitsArms.Object_Type = (int) eObjectType.Studded;
                recruitsArms.Item_Type = (int) eEquipmentItems.ARMS;
                recruitsArms.Id_nb = "recruits_studded_arms";
                recruitsArms.Price = Money.GetMoney(0,0,0,4,0);
                recruitsArms.IsPickable = true;
                recruitsArms.IsDropable = true;
                recruitsArms.Color = 9; // red leather

                recruitsArms.Bonus = 5; // default bonus

                recruitsArms.Bonus1 = 4;
                recruitsArms.Bonus1Type = (int) eStat.QUI;

                recruitsArms.Bonus2 = 1;
                recruitsArms.Bonus2Type = (int) eResist.Body;

                recruitsArms.Quality = 100;
                recruitsArms.Condition = 1000;
                recruitsArms.MaxCondition = 1000;
                recruitsArms.Durability = 1000;
                recruitsArms.MaxDurability = 1000;

                //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(recruitsArms);
            }

            recruitsSleeves = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_quilted_sleeves");
            if (recruitsSleeves == null)
            {
                recruitsSleeves = new ItemTemplate();
                recruitsSleeves.Name = "Recruit's Quilted Sleeves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsSleeves.Name + ", creating it ...");
                recruitsSleeves.Level = 7;

                recruitsSleeves.Weight = 12;
                recruitsSleeves.Model = 153;

                recruitsSleeves.DPS_AF = 6; // Armour
                recruitsSleeves.SPD_ABS = 0; // Absorption

                recruitsSleeves.Object_Type = (int) eObjectType.Cloth;
                recruitsSleeves.Item_Type = (int) eEquipmentItems.ARMS;
                recruitsSleeves.Id_nb = "recruits_quilted_sleeves";
                recruitsSleeves.Price = Money.GetMoney(0,0,0,4,0);
                recruitsSleeves.IsPickable = true;
                recruitsSleeves.IsDropable = true;
                recruitsSleeves.Color = 27; // red cloth

                recruitsSleeves.Bonus = 5; // default bonus

                recruitsSleeves.Bonus1 = 4;
                recruitsSleeves.Bonus1Type = (int) eStat.DEX;

                recruitsSleeves.Bonus2 = 1;
                recruitsSleeves.Bonus2Type = (int) eResist.Body;

                recruitsSleeves.Quality = 100;
                recruitsSleeves.Condition = 1000;
                recruitsSleeves.MaxCondition = 1000;
                recruitsSleeves.Durability = 1000;
                recruitsSleeves.MaxDurability = 1000;

                //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(recruitsSleeves);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            /* Now we bring to masterFrederick the possibility to give this quest to players */
            masterFrederick.AddQuestToGive(typeof (Collection));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #23
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 = WorldMgr.GetNPCsByName("Master Ferowl", eRealm.Albion);
            if (npcs.Length == 0)
            {
                Ferowl = new GameNPC();
                Ferowl.Model = 61;
                Ferowl.Name = "Master Ferowl";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Ferowl.Name + " , creating it ...");
                Ferowl.GuildName = "";
                Ferowl.Realm = eRealm.Albion;
                Ferowl.CurrentRegionID = 1;
                Ferowl.Size = 51;
                Ferowl.Level = 40;
                Ferowl.X = 559716;
                Ferowl.Y = 510733;
                Ferowl.Z = 2720;
                Ferowl.Heading = 703;
                Ferowl.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Ferowl.SaveIntoDatabase();
            }
            else
                Ferowl = npcs[0];
            // end npc

            npcs = WorldMgr.GetNPCsByName("Morgana", eRealm.None);
            if (npcs.Length == 0)
            {
                Morgana = new GameNPC();
                Morgana.Model = 283;
                Morgana.Name = "Morgana";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Morgana.Name + " , creating it ...");
                Morgana.GuildName = "";
                Morgana.Realm = eRealm.None;
                Morgana.CurrentRegionID = 1;
                Morgana.Size = 51;
                Morgana.Level = 90;
                Morgana.X = 306056;
                Morgana.Y = 670106;
                Morgana.Z = 3095;
                Morgana.Heading = 3261;

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 98, 43);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 133, 61);
                Morgana.Inventory = template.CloseTemplate();

            //				Morgana.AddNPCEquipment((byte) eVisibleItems.TORSO, 98, 43, 0, 0);
            //				Morgana.AddNPCEquipment((byte) eVisibleItems.BOOT, 133, 61, 0, 0);

                //Morgana.AddToWorld(); will be added later during quest

                if (SAVE_INTO_DATABASE)
                    Morgana.SaveIntoDatabase();
            }
            else
                Morgana = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Bechard", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bechard , creating it ...");
                Bechard = new GameNPC();
                Bechard.Model = 606;
                Bechard.Name = "Bechard";
                Bechard.GuildName = "";
                Bechard.Realm = eRealm.None;
                Bechard.CurrentRegionID = 1;
                Bechard.Size = 50;
                Bechard.Level = 63;
                Bechard.X = 306025;
                Bechard.Y = 670473;
                Bechard.Z = 2863;
                Bechard.Heading = 3754;
                Bechard.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Bechard.SaveIntoDatabase();
            }
            else
                Bechard = npcs[0];
            // end npc

            npcs = WorldMgr.GetNPCsByName("Silcharde", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Silcharde , creating it ...");
                Silcharde = new GameNPC();
                Silcharde.Model = 606;
                Silcharde.Name = "Silcharde";
                Silcharde.GuildName = "";
                Silcharde.Realm = eRealm.None;
                Silcharde.CurrentRegionID = 1;
                Silcharde.Size = 50;
                Silcharde.Level = 63;
                Silcharde.X = 306252;
                Silcharde.Y = 670274;
                Silcharde.Z = 2857;
                Silcharde.Heading = 3299;
                Silcharde.AddToWorld();

                if (SAVE_INTO_DATABASE)
                    Silcharde.SaveIntoDatabase();

            }
            else
                Silcharde = npcs[0];
            // end npc

            #endregion

            #region Item Declarations

            sealed_pouch = GameServer.Database.FindObjectByKey<ItemTemplate>("sealed_pouch");
            if (sealed_pouch == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sealed Pouch , creating it ...");
                sealed_pouch = new ItemTemplate();
                sealed_pouch.Id_nb = "sealed_pouch";
                sealed_pouch.Name = "Sealed Pouch";
                sealed_pouch.Level = 8;
                sealed_pouch.Item_Type = 29;
                sealed_pouch.Model = 488;
                sealed_pouch.IsDropable = false;
                sealed_pouch.IsPickable = false;
                sealed_pouch.DPS_AF = 0;
                sealed_pouch.SPD_ABS = 0;
                sealed_pouch.Object_Type = 41;
                sealed_pouch.Hand = 0;
                sealed_pouch.Type_Damage = 0;
                sealed_pouch.Quality = 100;
                sealed_pouch.Weight = 12;

                    GameServer.Database.AddObject(sealed_pouch);
            }
            // end item

            ItemTemplate item = null;

            WizardEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicBoots");
            if (WizardEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Boots , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicBoots";
                item.Name = "Bernor's Numinous Boots";
                item.Level = 50;
                item.Item_Type = 23;
                item.Model = 143;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Skill_Cold;

                item.Bonus2 = 22;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Body;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                WizardEpicBoots = item;
            }
            //end item
            //Bernor's Numinous Coif
            WizardEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicHelm");
            if (WizardEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Helm , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicHelm";
                item.Name = "Bernor's Numinous Cap";
                item.Level = 50;
                item.Item_Type = 21;
                item.Model = 1290; //NEED TO WORK ON..
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 13;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 21;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Thrust;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Spirit;

                    GameServer.Database.AddObject(item);

                WizardEpicHelm = item;
            }
            //end item
            //Bernor's Numinous Gloves
            WizardEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicGloves");
            if (WizardEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Gloves , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicGloves";
                item.Name = "Bernor's Numinous Gloves ";
                item.Level = 50;
                item.Item_Type = 22;
                item.Model = 142;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Matter;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                WizardEpicGloves = item;
            }

            //Bernor's Numinous Hauberk
            WizardEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicVest");
            if (WizardEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Vest , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicVest";
                item.Name = "Bernor's Numinous Robes";
                item.Level = 50;
                item.Item_Type = 25;
                item.Model = 798;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eResist.Cold;

                item.Bonus2 = 14;
                item.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                item.Bonus3 = 24;
                item.Bonus3Type = (int) eProperty.MaxHealth;

                    GameServer.Database.AddObject(item);

                WizardEpicVest = item;

            }
            //Bernor's Numinous Legs
            WizardEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicLegs");
            if (WizardEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizards Epic Legs , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicLegs";
                item.Name = "Bernor's Numinous Pants";
                item.Level = 50;
                item.Item_Type = 27;
                item.Model = 140;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Skill_Fire;

                item.Bonus2 = 8;
                item.Bonus2Type = (int) eResist.Cold;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                WizardEpicLegs = item;

            }
            //Bernor's Numinous Sleeves
            WizardEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("WizardEpicArms");
            if (WizardEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wizard Epic Arms , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "WizardEpicArms";
                item.Name = "Bernor's Numinous Sleeves";
                item.Level = 50;
                item.Item_Type = 28;
                item.Model = 141;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Skill_Earth;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 16;
                item.Bonus3Type = (int) eStat.INT;

                    GameServer.Database.AddObject(item);

                WizardEpicArms = item;

            }
            //Minstrel Epic Sleeves End
            MinstrelEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicBoots");
            if (MinstrelEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Boots , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicBoots";
                item.Name = "Boots of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 23;
                item.Model = 727;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 7;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 27;
                item.Bonus2Type = (int) eStat.QUI;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Slash;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Cold;

                    GameServer.Database.AddObject(item);

                MinstrelEpicBoots = item;

            }
            //end item
            //of Coruscating Harmony  Coif
            MinstrelEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicHelm");
            if (MinstrelEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Helm , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicHelm";
                item.Name = "Coif of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 21;
                item.Model = 1290; //NEED TO WORK ON..
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.CON;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.CHR;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Thrust;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                MinstrelEpicHelm = item;

            }
            //end item
            //of Coruscating Harmony  Gloves
            MinstrelEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicGloves");
            if (MinstrelEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Gloves , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicGloves";
                item.Name = "Gauntlets of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 22;
                item.Model = 726;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 15;
                item.Bonus1Type = (int) eStat.CON;

                item.Bonus2 = 19;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Crush;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                MinstrelEpicGloves = item;

            }
            //of Coruscating Harmony  Hauberk
            MinstrelEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicVest");
            if (MinstrelEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Vest , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicVest";
                item.Name = "Habergeon of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 25;
                item.Model = 723;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 6;
                item.Bonus1Type = (int) eResist.Cold;

                item.Bonus2 = 8;
                item.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                item.Bonus3 = 39;
                item.Bonus3Type = (int) eProperty.MaxHealth;

                item.Bonus4 = 6;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                MinstrelEpicVest = item;

            }
            //of Coruscating Harmony  Legs
            MinstrelEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicLegs");
            if (MinstrelEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrels Epic Legs , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicLegs";
                item.Name = "Chaussess of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 27;
                item.Model = 724;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 15;
                item.Bonus1Type = (int) eStat.STR;

                item.Bonus2 = 19;
                item.Bonus2Type = (int) eStat.CON;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Body;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                MinstrelEpicLegs = item;

            }
            //of Coruscating Harmony  Sleeves
            MinstrelEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("MinstrelEpicArms");
            if (MinstrelEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Minstrel Epic Arms , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "MinstrelEpicArms";
                item.Name = "Sleeves of Coruscating Harmony";
                item.Level = 50;
                item.Item_Type = 28;
                item.Model = 725;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 100;
                item.SPD_ABS = 27;
                item.Object_Type = 35;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.STR;

                item.Bonus2 = 21;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Crush;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Body;

                    GameServer.Database.AddObject(item);

                MinstrelEpicArms = item;
            }

            SorcerorEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicBoots");
            if (SorcerorEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Boots , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicBoots";
                item.Name = "Boots of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 23;
                item.Model = 143;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Focus_Matter;

                item.Bonus2 = 22;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Matter;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Energy;

                    GameServer.Database.AddObject(item);

                SorcerorEpicBoots = item;

            }
            //end item
            //of Mental Acuity Coif
            SorcerorEpicHelm = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicHelm");
            if (SorcerorEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Helm , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicHelm";
                item.Name = "Cap of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 21;
                item.Model = 1290; //NEED TO WORK ON..
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 13;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 21;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Slash;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Thrust;

                    GameServer.Database.AddObject(item);

                SorcerorEpicHelm = item;

            }
            //end item
            //of Mental Acuity Gloves
            SorcerorEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicGloves");
            if (SorcerorEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Gloves , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicGloves";
                item.Name = "Gloves of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 22;
                item.Model = 142;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 16;
                item.Bonus1Type = (int) eStat.DEX;

                item.Bonus2 = 18;
                item.Bonus2Type = (int) eStat.INT;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Cold;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Heat;

                    GameServer.Database.AddObject(item);

                SorcerorEpicGloves = item;

            }
            //of Mental Acuity Hauberk
            SorcerorEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicVest");
            if (SorcerorEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Vest , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicVest";
                item.Name = "Vest of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 25;
                item.Model = 804;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eResist.Spirit;

                item.Bonus2 = 14;
                item.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                item.Bonus3 = 24;
                item.Bonus3Type = (int) eProperty.MaxHealth;

                    GameServer.Database.AddObject(item);

                SorcerorEpicVest = item;

            }
            //of Mental Acuity Legs
            SorcerorEpicLegs = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicLegs");
            if (SorcerorEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Legs , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicLegs";
                item.Name = "Pants of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 27;
                item.Model = 140;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Focus_Mind;

                item.Bonus2 = 19;
                item.Bonus2Type = (int) eStat.CON;

                item.Bonus3 = 8;
                item.Bonus3Type = (int) eResist.Body;

                item.Bonus4 = 8;
                item.Bonus4Type = (int) eResist.Spirit;

                    GameServer.Database.AddObject(item);

                SorcerorEpicLegs = item;

            }
            //of Mental Acuity Sleeves
            SorcerorEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("SorcerorEpicArms");
            if (SorcerorEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Sorceror Epic Arms , creating it ...");
                item = new ItemTemplate();
                item.Id_nb = "SorcerorEpicArms";
                item.Name = "Sleeves of Mental Acuity";
                item.Level = 50;
                item.Item_Type = 28;
                item.Model = 141;
                item.IsDropable = true;
                item.IsPickable = true;
                item.DPS_AF = 50;
                item.SPD_ABS = 0;
                item.Object_Type = 32;
                item.Quality = 100;
                item.Weight = 22;
                item.Bonus = 35;
                item.MaxCondition = 50000;
                item.MaxDurability = 50000;
                item.Condition = 50000;
                item.Durability = 50000;

                item.Bonus1 = 4;
                item.Bonus1Type = (int) eProperty.Focus_Body;

                item.Bonus2 = 16;
                item.Bonus2Type = (int) eStat.DEX;

                item.Bonus3 = 18;
                item.Bonus3Type = (int) eStat.INT;

                    GameServer.Database.AddObject(item);

                SorcerorEpicArms = item;
            }
            //Item Descriptions End

            #endregion

            morganaArea = WorldMgr.GetRegion(Morgana.CurrentRegionID).AddArea(new Area.Circle(null, Morgana.X, Morgana.Y, 0, 1000));
            morganaArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterMorganaArea));

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Ferowl, GameObjectEvent.Interact, new DOLEventHandler(TalkToFerowl));
            GameEventMgr.AddHandler(Ferowl, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFerowl));

            /* Now we bring to Ferowl the possibility to give this quest to players */
            Ferowl.AddQuestToGive(typeof (Academy_50));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #24
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");
        }
		/// <summary>
		/// Create a copy of the GameNPC
		/// </summary>
		/// <param name="copyTarget">A GameNPC to copy this GameNPC to (can be null)</param>
		/// <returns>The GameNPC this GameNPC was copied to</returns>
		public GameNPC Copy( GameNPC copyTarget )
		{
			if ( copyTarget == null )
				copyTarget = new GameNPC();

			copyTarget.TranslationId = TranslationId;
			copyTarget.BlockChance = BlockChance;
			copyTarget.BodyType = BodyType;
			copyTarget.CanUseLefthandedWeapon = CanUseLefthandedWeapon;
			copyTarget.Charisma = Charisma;
			copyTarget.Constitution = Constitution;
			copyTarget.CurrentRegion = CurrentRegion;
			copyTarget.Dexterity = Dexterity;
			copyTarget.Empathy = Empathy;
			copyTarget.Endurance = Endurance;
			copyTarget.EquipmentTemplateID = EquipmentTemplateID;
			copyTarget.EvadeChance = EvadeChance;
			copyTarget.Faction = Faction;
			copyTarget.Flags = Flags;
			copyTarget.GuildName = GuildName;
			copyTarget.ExamineArticle = ExamineArticle;
			copyTarget.MessageArticle = MessageArticle;
			copyTarget.Heading = Heading;
			copyTarget.Intelligence = Intelligence;
			copyTarget.IsCloakHoodUp = IsCloakHoodUp;
			copyTarget.IsCloakInvisible = IsCloakInvisible;
			copyTarget.IsHelmInvisible = IsHelmInvisible;
			copyTarget.LeftHandSwingChance = LeftHandSwingChance;
			copyTarget.Level = Level;
			copyTarget.LoadedFromScript = LoadedFromScript;
			copyTarget.MaxSpeedBase = MaxSpeedBase;
			copyTarget.MeleeDamageType = MeleeDamageType;
			copyTarget.Model = Model;
			copyTarget.Name = Name;
			copyTarget.Suffix = Suffix;
			copyTarget.NPCTemplate = NPCTemplate;
			copyTarget.ParryChance = ParryChance;
			copyTarget.PathID = PathID;
			copyTarget.PathingNormalSpeed = PathingNormalSpeed;
			copyTarget.Quickness = Quickness;
			copyTarget.Piety = Piety;
			copyTarget.Race = Race;
			copyTarget.Realm = Realm;
			copyTarget.RespawnInterval = RespawnInterval;
			copyTarget.RoamingRange = RoamingRange;
			copyTarget.Size = Size;
			copyTarget.SaveInDB = SaveInDB;
			copyTarget.Strength = Strength;
			copyTarget.TetherRange = TetherRange;
			copyTarget.MaxDistance = MaxDistance;
			copyTarget.X = X;
			copyTarget.Y = Y;
			copyTarget.Z = Z;
			copyTarget.OwnerID = OwnerID;
			copyTarget.PackageID = PackageID;

			if ( Abilities != null && Abilities.Count > 0 )
			{
				foreach (Ability targetAbility in Abilities.Values)
				{
					if ( targetAbility != null )
						copyTarget.AddAbility( targetAbility );
				}
			}

			ABrain brain = null;
			foreach ( Assembly assembly in AppDomain.CurrentDomain.GetAssemblies() )
			{
				brain = (ABrain)assembly.CreateInstance( Brain.GetType().FullName, true );
				if ( brain != null )
					break;
			}

			if ( brain == null )
			{
				log.Warn( "GameNPC.Copy():  Unable to create brain:  " + Brain.GetType().FullName + ", using StandardMobBrain." );
				brain = new StandardMobBrain();
			}

			StandardMobBrain newBrainSMB = brain as StandardMobBrain;
			StandardMobBrain thisBrainSMB = this.Brain as StandardMobBrain;

			if ( newBrainSMB != null && thisBrainSMB != null )
			{
				newBrainSMB.AggroLevel = thisBrainSMB.AggroLevel;
				newBrainSMB.AggroRange = thisBrainSMB.AggroRange;
			}

			copyTarget.SetOwnBrain( brain );

			if ( Inventory != null && Inventory.AllItems.Count > 0 )
			{
				GameNpcInventoryTemplate inventoryTemplate = Inventory as GameNpcInventoryTemplate;

				if( inventoryTemplate != null )
					copyTarget.Inventory = inventoryTemplate.CloneTemplate();
			}

			if (Spells != null && Spells.Count > 0)
				copyTarget.Spells = new List<Spell>(Spells.Cast<Spell>());

			if ( Styles != null && Styles.Count > 0 )
				copyTarget.Styles = new ArrayList( Styles );

			if ( copyTarget.Inventory != null )
				copyTarget.SwitchWeapon( ActiveWeaponSlot );

			return copyTarget;
		}
Exemple #26
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("Ambient Rat Statua",(eRealm) 0);
            if (npcs.Length == 0)
            {
                AmbientRatStatua = new DOL.GS.GameNPC();
                    AmbientRatStatua.Model = 1673;
                AmbientRatStatua.Name = "Ambient Rat Statua";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + AmbientRatStatua.Name + ", creating ...");
                AmbientRatStatua.GuildName = "Part of " + questTitle + " Quest";
                AmbientRatStatua.Realm = eRealm.None;
                AmbientRatStatua.CurrentRegionID = 229;
                AmbientRatStatua.Size = 1;
                AmbientRatStatua.Level = 1;
                AmbientRatStatua.MaxSpeedBase = 0;
                AmbientRatStatua.X = 40887;
                AmbientRatStatua.Y = 39276;
                AmbientRatStatua.Z = 17040;
                AmbientRatStatua.Heading = 0;
                AmbientRatStatua.RespawnInterval = -1;
                AmbientRatStatua.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                AmbientRatStatua.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)
                    AmbientRatStatua.SaveIntoDatabase();

                AmbientRatStatua.AddToWorld();

            }
            else
            {
                AmbientRatStatua = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("Ballach",(eRealm) 2);
            if (npcs.Length == 0)
            {
                Ballach = new DOL.GS.GameNPC();
                    Ballach.Model = 225;
                Ballach.Name = "Ballach";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Ballach.Name + ", creating ...");
                Ballach.GuildName = "Part of " + questTitle + " Quest";
                Ballach.Realm = eRealm.Midgard;
                Ballach.CurrentRegionID = 243;
                Ballach.Size = 48;
                Ballach.Level = 20;
                Ballach.MaxSpeedBase = 0;
                Ballach.Faction = FactionMgr.GetFactionByID(0);
                Ballach.X = 27723;
                Ballach.Y = 39184;
                Ballach.Z = 20156;
                Ballach.Heading = 2070;
                Ballach.RespawnInterval = -1;
                Ballach.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                Ballach.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)
                    Ballach.SaveIntoDatabase();

                Ballach.AddToWorld();

            }
            else
            {
                Ballach = npcs[0];
            }

            #endregion

            #region defineItems

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

            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder builder = QuestMgr.getBuilder(typeof(essenceoflife));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.Interact,null,Ballach);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.essenceoflife),Ballach);
            a.AddAction(eActionType.Talk,"Greetings Guardian. I have some [business] that needs tended to. There is some coin involved in it for you.",Ballach);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.Whisper,"business",Ballach);
            a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.essenceoflife),Ballach);
            a.AddAction(eActionType.Talk,"I am running low on Essence of Life. Do you think you could retrieve some for me?",Ballach);
            a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.essenceoflife),"Will you aid Ballach and retrieve some Essence of Life? [Levels 1-4]");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.essenceoflife));
            a.AddAction(eActionType.Talk,"No problem. See you.",Ballach);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.essenceoflife));
            a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.essenceoflife),Ballach);
            a.AddAction(eActionType.Talk,"Thank you very much for offering to help. Here, take this enchanted flask. You will need to find a grave in the Burial Grounds. When you find one, use the flask and capture the essence of life that rests in the buried persons remains.",Ballach);
            a.AddAction(eActionType.GiveItem,enchantedflask,Ballach);
            AddBehaviour(a);
            a = builder.CreateBehaviour(AmbientRatStatua,-1);
                a.AddTrigger(eTriggerType.ItemUsed,null,enchantedflask);
            a.AddRequirement(eRequirementType.Distance,AmbientRatStatua,1000,(eComparator)1);
            a.AddAction(eActionType.Timer,"flask",4000);
            a.AddAction(eActionType.Message,"You fill the flask",(eTextType)1);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.Timer,"flask",null);
            a.AddAction(eActionType.ReplaceItem,enchantedflask,Flaskofetherealessence);
            a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.essenceoflife),null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.Interact,null,Ballach);
            a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.essenceoflife),2,(eComparator)3);
            a.AddAction(eActionType.Talk,"Did you collect the essence for me? If so, hand me the flask.",Ballach);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Ballach,-1);
                a.AddTrigger(eTriggerType.GiveItem,Ballach,Flaskofetherealessence);
            a.AddAction(eActionType.Talk,"Thank you for taking on this task for me. You have replenished my supply. Here, take this small monetary reward.",Ballach);
            a.AddAction(eActionType.GiveXP,60,null);
            a.AddAction(eActionType.GiveGold,18,null);
            a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.essenceoflife),null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            Ballach.AddQuestToGive(typeof (essenceoflife));
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #27
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 ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Queen Tatiana", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Queen Tatiana, creating ...");
                queenTatiana = new GameNPC();

                queenTatiana.Name = "Queen Tatiana";
                queenTatiana.X = 558500;
                queenTatiana.Y = 533042;
                queenTatiana.Z = 2573;
                queenTatiana.Heading = 174;
                queenTatiana.Model = 603;
                queenTatiana.GuildName = "Part of " + questTitle + " Quest";
                queenTatiana.Realm = eRealm.None;
                queenTatiana.CurrentRegionID = 1;
                queenTatiana.Size = 49;
                queenTatiana.Level = 5;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 30;
                brain.AggroRange = 600;
                queenTatiana.SetOwnBrain(brain);

                if (SAVE_INTO_DATABASE)
                    queenTatiana.SaveIntoDatabase();

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

            int counter = 0;
            foreach (GameNPC npc in queenTatiana.GetNPCsInRadius(500))
            {
                if (npc.Name == "ire fairy sorceress")
                {
                    fairySorceress[counter] = (GameNPC) npc;
                    counter++;
                }
                if (counter == fairySorceress.Length)
                    break;
            }

            for (int i = 0; i < fairySorceress.Length; i++)
            {
                if (fairySorceress[i] == null)
                {
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find ire fairy sorceress, creating ...");
                    fairySorceress[i] = new GameNPC();
                    fairySorceress[i].Model = 603; // //819;
                    fairySorceress[i].Name = "ire fairy sorceress";
                    fairySorceress[i].GuildName = "Part of " + questTitle + " Quest";
                    fairySorceress[i].Realm = eRealm.None;
                    fairySorceress[i].CurrentRegionID = 1;
                    fairySorceress[i].Size = 35;
                    fairySorceress[i].Level = 5;
                    fairySorceress[i].X = queenTatiana.X + Util.Random(30, 150);
                    fairySorceress[i].Y = queenTatiana.Y + Util.Random(30, 150);
                    fairySorceress[i].Z = queenTatiana.Z;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 30;
                    brain.AggroRange = 600;
                    fairySorceress[i].SetOwnBrain(brain);

                    fairySorceress[i].Heading = 93;
                    //fairySorceress[i].EquipmentTemplateID = 200276;

                    //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)
                        fairySorceress[i].SaveIntoDatabase();
                    fairySorceress[i].AddToWorld();
                }
            }

            #endregion

            #region defineItems

            queenTatianasHead = GameServer.Database.FindObjectByKey<ItemTemplate>("queen_tatianas_head");
            if (queenTatianasHead == null)
            {
                queenTatianasHead = new ItemTemplate();
                queenTatianasHead.Name = "Queen Tatiana's Head";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + queenTatianasHead.Name + " , creating it ...");

                queenTatianasHead.Weight = 15;
                queenTatianasHead.Model = 503;

                queenTatianasHead.Object_Type = (int) eObjectType.GenericItem;

                queenTatianasHead.Id_nb = "queen_tatianas_head";
                queenTatianasHead.IsPickable = true;
                queenTatianasHead.IsDropable = false;

                //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(queenTatianasHead);
            }

            // item db check
            recruitsGauntlets = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_gauntlets");
            if (recruitsGauntlets == null)
            {
                recruitsGauntlets = new ItemTemplate();
                recruitsGauntlets.Name = "Recruit's Studded Gauntles";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsGauntlets.Name + ", creating it ...");
                recruitsGauntlets.Level = 8;

                recruitsGauntlets.Weight = 24;
                recruitsGauntlets.Model = 80;

                recruitsGauntlets.DPS_AF = 14; // Armour
                recruitsGauntlets.SPD_ABS = 19; // Absorption

                recruitsGauntlets.Object_Type = (int) eObjectType.Studded;
                recruitsGauntlets.Item_Type = (int) eEquipmentItems.HAND;
                recruitsGauntlets.Id_nb = "recruits_studded_gauntlets";
                recruitsGauntlets.Price = Money.GetMoney(0,0,0,9,0);
                recruitsGauntlets.IsPickable = true;
                recruitsGauntlets.IsDropable = true;
                recruitsGauntlets.Color = 9; // red leather

                recruitsGauntlets.Bonus = 5; // default bonus

                recruitsGauntlets.Bonus1 = 4;
                recruitsGauntlets.Bonus1Type = (int) eStat.STR;

                recruitsGauntlets.Bonus2 = 3;
                recruitsGauntlets.Bonus2Type = (int) eStat.DEX;

                recruitsGauntlets.Quality = 100;
                recruitsGauntlets.Condition = 1000;
                recruitsGauntlets.MaxCondition = 1000;
                recruitsGauntlets.Durability = 1000;
                recruitsGauntlets.MaxDurability = 1000;

                //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(recruitsGauntlets);
            }

            // item db check
            recruitsGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_quilted_gloves");
            if (recruitsGloves == null)
            {
                recruitsGloves = new ItemTemplate();
                recruitsGloves.Name = "Recruit's Quilted Gloves";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsGloves.Name + ", creating it ...");
                recruitsGloves.Level = 8;

                recruitsGloves.Weight = 8;
                recruitsGloves.Model = 154;

                recruitsGloves.DPS_AF = 7; // Armour
                recruitsGloves.SPD_ABS = 0; // Absorption

                recruitsGloves.Object_Type = (int) eObjectType.Cloth;
                recruitsGloves.Item_Type = (int) eEquipmentItems.HAND;
                recruitsGloves.Id_nb = "recruits_quilted_gloves";
                recruitsGloves.Price = Money.GetMoney(0,0,0,9,0);
                recruitsGloves.IsPickable = true;
                recruitsGloves.IsDropable = true;
                recruitsGloves.Color = 27; // red leather

                recruitsGloves.Bonus = 5; // default bonus

                recruitsGloves.Bonus1 = 4;
                recruitsGloves.Bonus1Type = (int) eStat.INT;

                recruitsGloves.Bonus2 = 3;
                recruitsGloves.Bonus2Type = (int) eStat.DEX;

                recruitsGloves.Quality = 100;
                recruitsGloves.Condition = 1000;
                recruitsGloves.MaxCondition = 1000;
                recruitsGloves.Durability = 1000;
                recruitsGloves.MaxDurability = 1000;

                //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(recruitsGloves);
            }

            recruitsJewel = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloudy_jewel");
            if (recruitsJewel == null)
            {
                recruitsJewel = new ItemTemplate();
                recruitsJewel.Name = "Recruit's Cloudy Jewel";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsJewel.Name + ", creating it ...");
                recruitsJewel.Level = 7;

                recruitsJewel.Weight = 2;
                recruitsJewel.Model = 110;

                recruitsJewel.Object_Type = (int) eObjectType.Magical;
                recruitsJewel.Item_Type = (int) eEquipmentItems.JEWEL;
                recruitsJewel.Id_nb = "recruits_cloudy_jewel";
                recruitsJewel.Price = Money.GetMoney(0,0,0,9,0);
                recruitsJewel.IsPickable = true;
                recruitsJewel.IsDropable = true;

                recruitsJewel.Bonus = 5; // default bonus

                recruitsJewel.Bonus1 = 6;
                recruitsJewel.Bonus1Type = (int) eStat.STR;

                recruitsJewel.Quality = 100;
                recruitsJewel.Condition = 1000;
                recruitsJewel.MaxCondition = 1000;
                recruitsJewel.Durability = 1000;
                recruitsJewel.MaxDurability = 1000;

                //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(recruitsJewel);
            }

            recruitsJewelCloth = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloudy_jewel_cloth");
            if (recruitsJewelCloth == null)
            {
                recruitsJewelCloth = new ItemTemplate();
                recruitsJewelCloth.Name = "Recruit's Cloudy Jewel";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsJewelCloth.Name + ", creating it ...");
                recruitsJewelCloth.Level = 7;

                recruitsJewelCloth.Weight = 2;
                recruitsJewelCloth.Model = 110;

                recruitsJewelCloth.Object_Type = (int) eObjectType.Magical;
                recruitsJewelCloth.Item_Type = (int) eEquipmentItems.JEWEL;
                recruitsJewelCloth.Id_nb = "recruits_cloudy_jewel_cloth";
                recruitsJewelCloth.Price = Money.GetMoney(0,0,0,9,0);
                recruitsJewelCloth.IsPickable = true;
                recruitsJewelCloth.IsDropable = true;

                recruitsJewelCloth.Bonus = 5; // default bonus

                recruitsJewelCloth.Bonus1 = 4;
                recruitsJewelCloth.Bonus1Type = (int) eStat.INT;

                recruitsJewelCloth.Bonus2 = 3;
                recruitsJewelCloth.Bonus2Type = (int) eStat.CON;

                recruitsJewelCloth.Bonus3 = 1;
                recruitsJewelCloth.Bonus3Type = (int) eResist.Body;

                recruitsJewelCloth.Quality = 100;
                recruitsJewelCloth.Condition = 1000;
                recruitsJewelCloth.MaxCondition = 1000;
                recruitsJewelCloth.Durability = 1000;
                recruitsJewelCloth.MaxDurability = 1000;

                //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(recruitsJewelCloth);
            }

            recruitsBracer = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_golden_bracer");
            if (recruitsBracer == null)
            {
                recruitsBracer = new ItemTemplate();
                recruitsBracer.Name = "Recruit's Golden Bracer";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsBracer.Name + ", creating it ...");
                recruitsBracer.Level = 7;

                recruitsBracer.Weight = 2;
                recruitsBracer.Model = 121;

                recruitsBracer.Object_Type = (int) eObjectType.Magical;
                recruitsBracer.Item_Type = (int) eEquipmentItems.R_BRACER;
                recruitsBracer.Id_nb = "recruits_golden_bracer";
                recruitsBracer.Price = Money.GetMoney(0,0,0,9,0);
                recruitsBracer.IsPickable = true;
                recruitsBracer.IsDropable = true;

                recruitsBracer.Bonus = 5; // default bonus

                recruitsBracer.Bonus1 = 4;
                recruitsBracer.Bonus1Type = (int) eStat.STR;

                recruitsBracer.Bonus2 = 3;
                recruitsBracer.Bonus2Type = (int) eStat.CON;

                recruitsBracer.Bonus3 = 1;
                recruitsBracer.Bonus3Type = (int) eResist.Body;

                recruitsBracer.Quality = 100;
                recruitsBracer.Condition = 1000;
                recruitsBracer.MaxCondition = 1000;
                recruitsBracer.Durability = 1000;
                recruitsBracer.MaxDurability = 1000;

                //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(recruitsBracer);
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            GameEventMgr.AddHandler(queenTatiana, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearQueenTatiana));

            /* Now we bring to masterFrederick the possibility to give this quest to players */
            masterFrederick.AddQuestToGive(typeof (Culmination));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Exemple #28
0
        public static GameNPC GetAddrir()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("Addrir", eRealm.Hibernia);

            GameNPC addrir = null;

            if (npcs.Length == 0)
            {
                addrir = new GameNPC();
                addrir.Model = 335;
                addrir.Name = "Addrir";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + addrir.Name + ", creating him ...");
                addrir.GuildName = "Part of Addrir Quests";
                addrir.Realm = eRealm.Hibernia;
                addrir.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 35);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 1173);
                addrir.Inventory = template.CloseTemplate();
                addrir.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				addrir.AddNPCEquipment((byte) eVisibleItems.TORSO, 58, 35, 0, 0);
            //				addrir.AddNPCEquipment((byte) eVisibleItems.CLOAK, 57, 32, 0, 0);
            //				addrir.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 1173, 0, 0, 0);

                addrir.Size = 50;
                addrir.Level = 50;
                addrir.X = GameLocation.ConvertLocalXToGlobalX(26955, 200);
                addrir.Y = GameLocation.ConvertLocalYToGlobalY(7789, 200);
                addrir.Z = 5196;
                addrir.Heading = 22;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                addrir.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)
                    addrir.SaveIntoDatabase();

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

            return addrir;
        }
Exemple #29
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof (ClericMulgrut)) == null)
                return;

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs) args;
                if(Step == 1)
                {
                    if (gArgs.Target.Name == "puny skeleton")
                    {
                        if (Util.Chance(25))
                        {
                            if(mulgrutMaggot == null)
                            {
                                mulgrutMaggot = new GameNPC();
                                mulgrutMaggot.Model = 467;
                                mulgrutMaggot.Name = "Mulgrut Maggot";
                                mulgrutMaggot.Realm = eRealm.None;
                                mulgrutMaggot.CurrentRegionID = 1;

                                mulgrutMaggot.Size = 60;
                                mulgrutMaggot.Level = 5;
                                mulgrutMaggot.X = 565941;
                                mulgrutMaggot.Y = 528121;
                                mulgrutMaggot.Z = 2152;
                                mulgrutMaggot.Heading = 2278;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                mulgrutMaggot.SetOwnBrain(brain);

                                mulgrutMaggot.RespawnInterval = 0; // don't respawn when killed

                                mulgrutMaggot.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Mulgrut Maggot")
                    {
                        GiveItem(gArgs.Target, player, beltOfAnimation);
                        if(mulgrutMaggot != null) { mulgrutMaggot = null; }
                        FinishQuest();
                    }
                }
            }
        }
Exemple #30
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");
        }