Beispiel #1
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Sir Dorian", eRealm.Albion);
            if (npcs == null || npcs.Length == 0)
            {
                return;
            }

            sirDorian = npcs[0];

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

            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirDorian));
            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirDorian));

            sirDorian.AddQuestToGive(typeof(NoHopeForTheHopeful));

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

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Guard Alakyrr", eRealm.None);

            if (npcs.Length == 0)
            {
                GuardAlakyrr       = new DOL.GS.GameNPC();
                GuardAlakyrr.Model = 748;
                GuardAlakyrr.Name  = "Guard Alakyrr";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + GuardAlakyrr.Name + ", creating ...");
                }
                GuardAlakyrr.GuildName       = "Part of " + questTitle + " Quest";
                GuardAlakyrr.Realm           = eRealm.Albion;
                GuardAlakyrr.CurrentRegionID = 63;
                GuardAlakyrr.Size            = 50;
                GuardAlakyrr.Level           = 30;
                GuardAlakyrr.MaxSpeedBase    = 191;
                GuardAlakyrr.Faction         = FactionMgr.GetFactionByID(0);
                GuardAlakyrr.X               = 28707;
                GuardAlakyrr.Y               = 20147;
                GuardAlakyrr.Z               = 16760;
                GuardAlakyrr.Heading         = 4016;
                GuardAlakyrr.RespawnInterval = -1;
                GuardAlakyrr.BodyType        = 0;


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

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

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

            #endregion

            #region defineItems

            enchantedtenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("enchantedtenebrousflask");
            if (enchantedtenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Enchanted Tenebrous Flask, creating it ...");
                }
                enchantedtenebrousflask               = new ItemTemplate();
                enchantedtenebrousflask.Name          = "enchanted tenebrous flask";
                enchantedtenebrousflask.Level         = 1;
                enchantedtenebrousflask.Weight        = 10;
                enchantedtenebrousflask.Model         = 1610;
                enchantedtenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                enchantedtenebrousflask.Id_nb         = "enchantedtenebrousflask";
                enchantedtenebrousflask.Price         = 0;
                enchantedtenebrousflask.IsPickable    = false;
                enchantedtenebrousflask.IsDropable    = false;
                enchantedtenebrousflask.Quality       = 100;
                enchantedtenebrousflask.Condition     = 1000;
                enchantedtenebrousflask.MaxCondition  = 1000;
                enchantedtenebrousflask.Durability    = 1000;
                enchantedtenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(enchantedtenebrousflask);
            }
            quarterfulltenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("quarterfulltenebrousflask");
            if (quarterfulltenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Quarter Full Tenebrous Flask, creating it ...");
                }
                quarterfulltenebrousflask               = new ItemTemplate();
                quarterfulltenebrousflask.Name          = "quarter full tenebrous flask";
                quarterfulltenebrousflask.Level         = 1;
                quarterfulltenebrousflask.Weight        = 250;
                quarterfulltenebrousflask.Model         = 1610;
                quarterfulltenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                quarterfulltenebrousflask.Id_nb         = "quarterfulltenebrousflask";
                quarterfulltenebrousflask.Price         = 0;
                quarterfulltenebrousflask.IsPickable    = false;
                quarterfulltenebrousflask.IsDropable    = false;
                quarterfulltenebrousflask.Quality       = 100;
                quarterfulltenebrousflask.Condition     = 1000;
                quarterfulltenebrousflask.MaxCondition  = 1000;
                quarterfulltenebrousflask.Durability    = 1000;
                quarterfulltenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(quarterfulltenebrousflask);
            }
            halffulltenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("halffulltenebrousflask");
            if (halffulltenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Half Full Tenebrous Flask, creating it ...");
                }
                halffulltenebrousflask               = new ItemTemplate();
                halffulltenebrousflask.Name          = "half full tenebrous flask";
                halffulltenebrousflask.Level         = 1;
                halffulltenebrousflask.Weight        = 250;
                halffulltenebrousflask.Model         = 1610;
                halffulltenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                halffulltenebrousflask.Id_nb         = "halffulltenebrousflask";
                halffulltenebrousflask.Price         = 0;
                halffulltenebrousflask.IsPickable    = false;
                halffulltenebrousflask.IsDropable    = false;
                halffulltenebrousflask.Quality       = 100;
                halffulltenebrousflask.Condition     = 1000;
                halffulltenebrousflask.MaxCondition  = 1000;
                halffulltenebrousflask.Durability    = 1000;
                halffulltenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(halffulltenebrousflask);
            }
            threequarterfulltenebrousflask = GameServer.Database.FindObjectByKey <ItemTemplate>("threequarterfulltenebrousflask");
            if (threequarterfulltenebrousflask == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Three Quarter Full Tenebrous Flask, creating it ...");
                }
                threequarterfulltenebrousflask               = new ItemTemplate();
                threequarterfulltenebrousflask.Name          = "three quarter full tenebrous flask";
                threequarterfulltenebrousflask.Level         = 1;
                threequarterfulltenebrousflask.Weight        = 250;
                threequarterfulltenebrousflask.Model         = 1610;
                threequarterfulltenebrousflask.Object_Type   = (int)eObjectType.GenericItem;
                threequarterfulltenebrousflask.Id_nb         = "threequarterfulltenebrousflask";
                threequarterfulltenebrousflask.Price         = 0;
                threequarterfulltenebrousflask.IsPickable    = false;
                threequarterfulltenebrousflask.IsDropable    = false;
                threequarterfulltenebrousflask.Quality       = 100;
                threequarterfulltenebrousflask.Condition     = 1000;
                threequarterfulltenebrousflask.MaxCondition  = 1000;
                threequarterfulltenebrousflask.Durability    = 1000;
                threequarterfulltenebrousflask.MaxDurability = 1000;

                GameServer.Database.AddObject(threequarterfulltenebrousflask);
            }
            fullflaskoftenebrousessence = GameServer.Database.FindObjectByKey <ItemTemplate>("fullflaskoftenebrousessence");
            if (fullflaskoftenebrousessence == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Full Flask Of Tenebrous Essence, creating it ...");
                }
                fullflaskoftenebrousessence               = new ItemTemplate();
                fullflaskoftenebrousessence.Name          = "full flask of tenebrous essence";
                fullflaskoftenebrousessence.Level         = 1;
                fullflaskoftenebrousessence.Weight        = 250;
                fullflaskoftenebrousessence.Model         = 1610;
                fullflaskoftenebrousessence.Object_Type   = (int)eObjectType.GenericItem;
                fullflaskoftenebrousessence.Id_nb         = "fullflaskoftenebrousessence";
                fullflaskoftenebrousessence.Price         = 0;
                fullflaskoftenebrousessence.IsPickable    = false;
                fullflaskoftenebrousessence.IsDropable    = false;
                fullflaskoftenebrousessence.Quality       = 100;
                fullflaskoftenebrousessence.Condition     = 1000;
                fullflaskoftenebrousessence.MaxCondition  = 1000;
                fullflaskoftenebrousessence.Durability    = 1000;
                fullflaskoftenebrousessence.MaxDurability = 1000;

                GameServer.Database.AddObject(fullflaskoftenebrousessence);
            }

            #endregion

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

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

            GameEventMgr.AddHandler(GuardAlakyrr, GameLivingEvent.Interact, new DOLEventHandler(TalkToGuardAlakyrr));
            GameEventMgr.AddHandler(GuardAlakyrr, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToGuardAlakyrr));

            GuardAlakyrr.AddQuestToGive(typeof(AidingGuardAlakyrr));

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

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

            #region defineNPCS
            GameNPC[] npcs = WorldMgr.GetNPCsByName(questGiverName, eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + questGiverName + ", creating her ...");
                }

                questGiver                 = new GameNPC();
                questGiver.Name            = questGiverName;
                questGiver.Realm           = eRealm.Hibernia;
                questGiver.CurrentRegionID = 200;

                // select * from NPCEquipment where TemplateID in (select EquipmentTemplateID from Mob where name = ?)
                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 448, 0);                         // Slot 12
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 427, 0);                             // Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 423, 0);                            // Slot 25
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 424, 0);                             // Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 425, 0);                             // Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Model   = 388;
                questGiver.Size    = 51;
                questGiver.Level   = 35;
                questGiver.X       = 346768;
                questGiver.Y       = 489521;
                questGiver.Z       = 5200;
                questGiver.Heading = 2594;

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

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

            npcs = WorldMgr.GetNPCsByName(questTargetName, eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                questTarget      = new GameNPC();
                questTarget.Name = questTargetName;
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + questTarget.Name + ", creating him ...");
                }
                questTarget.Realm           = eRealm.Hibernia;
                questTarget.CurrentRegionID = 200;

                // select * from NPCEquipment where TemplateID in (select EquipmentTemplateID from Mob where name = ?)
                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 411, 0);                            // Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 412, 0);                             // Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 408, 0);                            // Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 34);                                 // Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 409, 0);                             // Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 410, 0);                             // Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Model   = 381;
                questTarget.Size    = 50;
                questTarget.Level   = 12;
                questTarget.X       = 347327;
                questTarget.Y       = 492700;
                questTarget.Z       = 5199;
                questTarget.Heading = 2468;

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

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

            /*
             #region defineAreas
             * targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle("", targetLocation.X, targetLocation.Y, targetLocation.Z, 200));
             #endregion
             */

            #region defineItems
            armBone = GameServer.Database.FindObjectByKey <ItemTemplate>("BonesToBlades-armbone");
            if (armBone == null)
            {
                armBone      = new ItemTemplate();
                armBone.Name = "Arm Bone";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + armBone.Name + ", creating it ...");
                }
                armBone.Level            = 1;
                armBone.Weight           = 1;
                armBone.Model            = 497;
                armBone.Object_Type      = (int)eObjectType.GenericItem;
                armBone.Item_Type        = -1;
                armBone.Id_nb            = "BonesToBlades-armbone";
                armBone.Hand             = 0;
                armBone.Price            = 0;
                armBone.IsTradable       = false;
                armBone.Color            = 0;
                armBone.Bonus            = 0;      // default bonus
                armBone.Bonus1           = 0;
                armBone.Bonus1Type       = (int)0;
                armBone.Bonus2           = 0;
                armBone.Bonus2Type       = (int)0;
                armBone.Bonus3           = 0;
                armBone.Bonus3Type       = (int)0;
                armBone.Bonus4           = 0;
                armBone.Bonus4Type       = (int)0;
                armBone.Bonus5           = 0;
                armBone.Bonus5Type       = (int)0;
                armBone.Bonus6           = 0;
                armBone.Bonus6Type       = (int)0;
                armBone.Bonus7           = 0;
                armBone.Bonus7Type       = (int)0;
                armBone.Bonus8           = 0;
                armBone.Bonus8Type       = (int)0;
                armBone.Bonus9           = 0;
                armBone.Bonus9Type       = (int)0;
                armBone.Bonus10          = 0;
                armBone.Bonus10Type      = (int)0;
                armBone.ExtraBonus       = 0;
                armBone.ExtraBonusType   = (int)0;
                armBone.Effect           = 0;
                armBone.Emblem           = 0;
                armBone.Charges          = 0;
                armBone.MaxCharges       = 0;
                armBone.SpellID          = 0;
                armBone.ProcSpellID      = 0;
                armBone.Type_Damage      = 0;
                armBone.Realm            = 0;
                armBone.MaxCount         = 1;
                armBone.PackSize         = 1;
                armBone.Extension        = 0;
                armBone.Quality          = 100;
                armBone.Condition        = 100;
                armBone.MaxCondition     = 100;
                armBone.Durability       = 100;
                armBone.MaxDurability    = 100;
                armBone.PoisonCharges    = 0;
                armBone.PoisonMaxCharges = 0;
                armBone.PoisonSpellID    = 0;
                armBone.ProcSpellID1     = 0;
                armBone.SpellID1         = 0;
                armBone.MaxCharges1      = 0;
                armBone.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(armBone);
                }
            }

            carvedBoneHilt = GameServer.Database.FindObjectByKey <ItemTemplate>("BonesToBlades-carvedBoneHilts");
            if (carvedBoneHilt == null)
            {
                carvedBoneHilt      = new ItemTemplate();
                carvedBoneHilt.Name = "Two Carved Bone Hilts";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + carvedBoneHilt.Name + ", creating it ...");
                }
                carvedBoneHilt.Level            = 1;
                carvedBoneHilt.Weight           = 1;
                carvedBoneHilt.Model            = 497;
                carvedBoneHilt.Object_Type      = (int)eObjectType.GenericItem;
                carvedBoneHilt.Item_Type        = -1;
                carvedBoneHilt.Id_nb            = "BonesToBlades-carvedBoneHilts";
                carvedBoneHilt.Hand             = 0;
                carvedBoneHilt.Price            = 0;
                carvedBoneHilt.IsTradable       = false;
                carvedBoneHilt.Color            = 0;
                carvedBoneHilt.Bonus            = 0;      // default bonus
                carvedBoneHilt.Bonus1           = 0;
                carvedBoneHilt.Bonus1Type       = (int)0;
                carvedBoneHilt.Bonus2           = 0;
                carvedBoneHilt.Bonus2Type       = (int)0;
                carvedBoneHilt.Bonus3           = 0;
                carvedBoneHilt.Bonus3Type       = (int)0;
                carvedBoneHilt.Bonus4           = 0;
                carvedBoneHilt.Bonus4Type       = (int)0;
                carvedBoneHilt.Bonus5           = 0;
                carvedBoneHilt.Bonus5Type       = (int)0;
                carvedBoneHilt.Bonus6           = 0;
                carvedBoneHilt.Bonus6Type       = (int)0;
                carvedBoneHilt.Bonus7           = 0;
                carvedBoneHilt.Bonus7Type       = (int)0;
                carvedBoneHilt.Bonus8           = 0;
                carvedBoneHilt.Bonus8Type       = (int)0;
                carvedBoneHilt.Bonus9           = 0;
                carvedBoneHilt.Bonus9Type       = (int)0;
                carvedBoneHilt.Bonus10          = 0;
                carvedBoneHilt.Bonus10Type      = (int)0;
                carvedBoneHilt.ExtraBonus       = 0;
                carvedBoneHilt.ExtraBonusType   = (int)0;
                carvedBoneHilt.Effect           = 0;
                carvedBoneHilt.Emblem           = 0;
                carvedBoneHilt.Charges          = 0;
                carvedBoneHilt.MaxCharges       = 0;
                carvedBoneHilt.SpellID          = 0;
                carvedBoneHilt.ProcSpellID      = 0;
                carvedBoneHilt.Type_Damage      = 0;
                carvedBoneHilt.Realm            = 0;
                carvedBoneHilt.MaxCount         = 1;
                carvedBoneHilt.PackSize         = 1;
                carvedBoneHilt.Extension        = 0;
                carvedBoneHilt.Quality          = 100;
                carvedBoneHilt.Condition        = 100;
                carvedBoneHilt.MaxCondition     = 100;
                carvedBoneHilt.Durability       = 100;
                carvedBoneHilt.MaxDurability    = 100;
                carvedBoneHilt.PoisonCharges    = 0;
                carvedBoneHilt.PoisonMaxCharges = 0;
                carvedBoneHilt.PoisonSpellID    = 0;
                carvedBoneHilt.ProcSpellID1     = 0;
                carvedBoneHilt.SpellID1         = 0;
                carvedBoneHilt.MaxCharges1      = 0;
                carvedBoneHilt.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(carvedBoneHilt);
                }
            }
            #endregion

            #region defineBehaviours
            QuestBuilder   builder   = QuestMgr.getBuilder(typeof(BonesToBlades));
            QuestBehaviour a         = null;
            string         message1  = "Oh, have you been standing there long, <Class>? If you have, I apologize for ignoring you. I find my mind is quite distracted these days after the meeting I had yesterday with a [new client].";
            string         message2  = "Ah, I would love to tell you the name of the client, but I promised to keep their identity a secret. I keep the identity of all my clients secret because I don't want the other merchants in this area to try to steal them away from me! See, there I go again, getting distracted when I should be thinking about [those blades].";
            string         message3  = "Day in and day out I sell these plain, everyday blades. But from time to time clients do approach me to commission special blades to be made. My newest client came to me and requested that I make a set of matched falcatas to be given as [a gift] to this client's daughter upon her next birthday.";
            string         message4  = "The daughter is a highly skilled blademaster who is preparing to venture into the Frontiers. My client wants the daughter to be as well armed as possible and I seemed to have developed a reputation as a maker of some of the best custom blades out there. I hope I can [live up to] that reputation.";
            string         message5  = "I fear I have agreed to make these falcatas before I checked to see if I have all the supplies I need. It turns out I'm missing a few things, and I need to have the blades done within a few days. Making the blades alone will take me all that time without having to gather the materials for [the hilt] of each blade.";
            string         message6  = "My client has asked that the hilts of these falcatas be carved from bone. I would be happy to do that, but I don't have the bones I need. I need to get them and send them over to Jahan so he can carve them for me. Say, if you're not busy, perhaps [you can go] get the bones I need. I can pay you for your time.";
            string         message7  = "I cannot thank you enough for agreeing to help me. I've found that when people ask for carved bone hilts that the best bones come from the skeletal pawns and minions that roam the lands [just outside] of Mag Mell.";
            string         message8  = "You'll find the skeletal pawns and minions across the road on the hill northwest of here. I've also seen them in the field and by the standing stone in the woods east-southeast of Rumdor the Stable Master here in Mag Mell. Get two arm bones from either the pawns or the minions. When you have them, take them to Jahan here in Mag Mell. He will carve them for me. Good luck, <Class>!";
            string         message9  = "Ah, you must be the young <Class> that Wony told me about. She said you would have two arm bones that needed carving for hilts. Wony thinks it will take me a few days to get those bones carved but I have [a surprise] for her.";
            string         message10 = "I already had some bones among my supplies. I went ahead and carved them while you were out obtaining more bones. I'll give you the carved ones and I'll take the ones you have so I can keep my supplies well stocked. Why don't you hand me those two arm bones now?";
            string         message11 = "There you go, <Class>. Take those two carved bones to Wony right now. It will put her mind at ease having those hilts already taken care of. Don't worry about payment for my work; Wony has taken care of that already.";
            string         message12 = "<Class>, what are you doing back here already? I told you to take the arm bones to Jahan so he can carve them! You should have listened to me! Now what am I going to do?";
            string         message13 = "What is this? These hilts are already carved! Jahan played a trick on me, didn't he? He already had these done. I guess the arm bones I had you collect will get used the next time I need bone hilts. I am sorry for yelling at you when I should have been offering you [the payment] I promised you.";
            string         message14 = "There we go, <Class>. Thank you so much for helping me get these bone hilts. I shall be able to get the matching falcatas done on time and keep my new client. Perhaps one day you will have enough platinum to hire me to make custom blades for you. Until then, be well!";

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

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "new client", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message2, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "those blades", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message3, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "a gift", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message4, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "live up to", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.Talk, message5, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "the hilt", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(new MessageAction(questGiver, questGiverName + " blushes a deep red.", eTextType.Emote));
            a.AddAction(eActionType.Talk, message6, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "you can go", questGiver);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(BonesToBlades), questGiver);
            a.AddRequirement(eRequirementType.QuestPending, typeof(BonesToBlades), null, (eComparator)5);
            a.AddAction(eActionType.OfferQuest, typeof(BonesToBlades), "Do you want to help Wony?");
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, 1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(BonesToBlades));
            a.AddAction(eActionType.Talk, message7, questGiver);
            a.AddAction(eActionType.GiveQuest, typeof(BonesToBlades), questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "just outside", questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 1, eComparator.Equal);
            a.AddAction(eActionType.Talk, message8, questGiver);
            AddBehaviour(a);

            //a = builder.CreateBehaviour(questGiver, -1);
            //a.AddTrigger(eTriggerType.EnemyKilled, "skeletal pawn", null);
            //a.AddTrigger(eTriggerType.EnemyKilled, "skeletal minion", null);
            //a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 0, eComparator.Greater);
            //a.AddRequirement(eRequirementType.InventoryItem, armBone, 2, eComparator.Less);
            //a.AddAction(eActionType.GiveItem, armBone, null);
            //AddBehaviour(a);

            //a = builder.CreateBehaviour(questGiver, -1);
            //a.AddTrigger(eTriggerType.EnemyKilled, mobTypes[0], null);
            //a.AddTrigger(eTriggerType.EnemyKilled, mobTypes[1], null);
            //a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 1, eComparator.Equal);
            //a.AddRequirement(eRequirementType.InventoryItem, armBone, 1, eComparator.Greater);
            //a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 2);
            //AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.Interact, null, questTarget);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 2, eComparator.Equal);
            a.AddAction(eActionType.Talk, message9, questTarget);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.Whisper, "a surprise", questTarget);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 2, eComparator.Equal);
            a.AddAction(eActionType.Talk, message10, questTarget);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 3);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.GiveItem, questTarget, armBone);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 4, eComparator.Equal);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 5);
            a.AddAction(eActionType.TakeItem, armBone, null);
            a.AddAction(eActionType.GiveItem, carvedBoneHilt, null);
            a.AddAction(eActionType.Talk, message11, questTarget);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questTarget, -1);
            a.AddTrigger(eTriggerType.GiveItem, questTarget, armBone);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 3, eComparator.Equal);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 4);
            a.AddAction(eActionType.TakeItem, armBone, null);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Interact, null, questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 5, eComparator.Equal);
            a.AddAction(eActionType.Talk, message12, questGiver);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 6);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.GiveItem, questGiver, carvedBoneHilt);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 6, eComparator.Equal);
            a.AddAction(eActionType.SetQuestStep, typeof(BonesToBlades), 7);
            a.AddAction(eActionType.TakeItem, carvedBoneHilt, null);
            a.AddAction(eActionType.Talk, message13, questGiver);
            AddBehaviour(a);

            a = builder.CreateBehaviour(questGiver, -1);
            a.AddTrigger(eTriggerType.Whisper, "the payment", questGiver);
            a.AddRequirement(eRequirementType.QuestStep, typeof(BonesToBlades), 7, eComparator.Equal);
            a.AddAction(eActionType.Talk, message14, questGiver);
            a.AddAction(eActionType.GiveXP, 20, null);
            a.AddAction(eActionType.GiveGold, 37, null);
            a.AddAction(eActionType.FinishQuest, typeof(BonesToBlades), null);
            AddBehaviour(a);
            #endregion

            questGiver.AddQuestToGive(typeof(BonesToBlades));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #4
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* 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");
        }
Beispiel #5
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

            /* 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 :)
             */

            dalikor = GetDalikor();

            #region defineNPCs

            generalLocations[0] = new GameLocation(generalNames[0], 100, 100, 40124, 44594, 4712, 216);
            generalLocations[1] = new GameLocation(generalNames[1], 100, 100, 46821, 40884, 4972, 21);
            generalLocations[2] = new GameLocation(generalNames[2], 100, 100, 56104, 43865, 5460, 48);

            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 ...");
                    }
                    general[i] = new GameNPC();

                    general[i].Model = 678;

                    general[i].GuildName = "Part of " + questTitle + " Quest";
                    general[i].Name      = generalNames[i];
                    general[i].Position  = generalLocations[i].Position;
                    general[i].Heading   = generalLocations[i].Heading;

                    general[i].Realm           = eRealm.None;
                    general[i].CurrentRegionID = generalLocations[i].RegionID;
                    general[i].Size            = 49;
                    general[i].Level           = 2;

                    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

            /*
             * TODO Model for Campfire doesn't work. Very Stange!
             */
            /*
             * // Add campfires to generals
             * for (int i = 0; i < generalLocations.Length; i++)
             * {
             *      GameStaticItem campfire = null;
             *
             *      IEnumerable items =  WorldMgr.GetItemsCloseToSpot(generalLocations[i].RegionID,generalLocations[i].X, generalLocations[i].Y, generalLocations[i].Z, 400,true);
             *      foreach (GameObject obj in items)
             *      {
             *              if (obj is GameStaticItem && obj.Name=="Camp Fire")
             *              {
             *                      campfire= (GameStaticItem) obj;
             *                      break;
             *              }
             *      }
             *
             *      if (campfire==null)
             *      {
             *              campfire = new GameStaticItem();
             *              campfire.Name="Camp Fire";
             *
             *              campfire.Model = 2593;
             *              campfire.Heading = generalLocations[i].Heading;
             *              campfire.X = generalLocations[i].X;
             *              campfire.Y = generalLocations[i].Y;
             *              campfire.Z = generalLocations[i].Z;
             *              campfire.CurrentRegionID = generalLocations[i].RegionID;
             *
             *              if (SAVE_INTO_DATABASE)
             *                      campfire.SaveIntoDatabase();
             *
             *              campfire.AddToWorld();
             *
             *              DOLConsole.WriteLine("Camp Fire added"+generalNames[i]);
             *      }
             * }
             */

            askefruerWings = GameServer.Database.FindObjectByKey <ItemTemplate>("askefruer_wings");
            if (askefruerWings == null)
            {
                askefruerWings      = new ItemTemplate();
                askefruerWings.Name = "Wings of Askefruer";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + askefruerWings.Name + " , creating it ...");
                }

                askefruerWings.Weight = 2;
                askefruerWings.Model  = 551;

                askefruerWings.Object_Type = (int)eObjectType.GenericItem;

                askefruerWings.Id_nb      = "askefruer_wings";
                askefruerWings.IsPickable = true;
                askefruerWings.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(askefruerWings);
                }
            }

            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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(dustyOldMap);
                }
            }


            // item db check
            recruitsArms = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_studded_arms_mid");
            if (recruitsArms == null)
            {
                recruitsArms      = new ItemTemplate();
                recruitsArms.Name = "Recruit's Studded Arms (Mid)";
                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_mid";
                recruitsArms.Price       = Money.GetMoney(0, 0, 0, 4, 0);
                recruitsArms.IsPickable  = true;
                recruitsArms.IsDropable  = true;
                recruitsArms.Color       = 36;          // blue cloth

                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
                if (SAVE_INTO_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
                if (SAVE_INTO_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.
             */
            //We want to be notified whenever a player enters the world
            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(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Blercyn", eRealm.Hibernia);

            /* 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)
            {
                Blercyn       = new GameNPC();
                Blercyn.Model = 700;
                Blercyn.Name  = "Blercyn";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Blercyn.Name + ", creating him ...");
                }

                // Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Blercyn.Realm           = eRealm.Hibernia;
                Blercyn.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Blercyn.Inventory = template.CloseTemplate();
                Blercyn.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Blercyn.Size    = 50;
                Blercyn.Level   = 50;
                Blercyn.X       = 348614;
                Blercyn.Y       = 492141;
                Blercyn.Z       = 5199;
                Blercyn.Heading = 1539;

                // 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)
                {
                    Blercyn.SaveIntoDatabase();
                }

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

            // Pompin The Crier
            npcs = WorldMgr.GetObjectsByName <GameNPC>("Epona", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                Epona       = new GameNPC();
                Epona.Model = 10;
                Epona.Name  = "Epona";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Epona.Name + ", creating him ...");
                }

                // Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Epona.Realm           = eRealm.Hibernia;
                Epona.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Epona.Inventory = template.CloseTemplate();
                Epona.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Epona.Size    = 50;
                Epona.Level   = 50;
                Epona.X       = 347606;
                Epona.Y       = 490658;
                Epona.Z       = 5227;
                Epona.Heading = 1342;

                // 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)
                {
                    Epona.SaveIntoDatabase();
                }

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

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

            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.Interact, new DOLEventHandler(TalkToBlercyn));
            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBlercyn));

            GameEventMgr.AddHandler(Epona, GameLivingEvent.Interact, new DOLEventHandler(TalkToEpona));
            GameEventMgr.AddHandler(Epona, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEpona));

            Blercyn.AddQuestToGive(typeof(SearchForKnowledge));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #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 :)
             */

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

            /* Whops, if the npcs array length is 0 then no Sir Quait 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)
            {
                argusBowman       = new GameNPC();
                argusBowman.Model = 40;
                argusBowman.Name  = "Argus Bowman";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + argusBowman.Name + ", creating him ...");
                }

                argusBowman.GuildName       = "Weapon Merchant";
                argusBowman.Realm           = eRealm.Albion;
                argusBowman.CurrentRegionID = 1;
                argusBowman.Size            = 50;
                argusBowman.Level           = 18;
                argusBowman.X       = 530594;
                argusBowman.Y       = 480120;
                argusBowman.Z       = 2251;
                argusBowman.Heading = 1627;

                // 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)
                {
                    argusBowman.SaveIntoDatabase();
                }

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

            magicalWood = GameServer.Database.FindObjectByKey <ItemTemplate>("ludlow_magical_wood");
            if (magicalWood == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Ludlow Magical Wood, creating it ...");
                }

                magicalWood             = new ItemTemplate();
                magicalWood.Object_Type = 0;
                magicalWood.Id_nb       = "ludlow_magical_wood";
                magicalWood.Name        = "Ludlow Magical Wood";
                magicalWood.Level       = 1;
                magicalWood.Model       = 520;
                magicalWood.IsDropable  = false;
                magicalWood.IsPickable  = false;
                magicalWood.Weight      = 5;
                GameServer.Database.AddObject(magicalWood);
            }

            dullBlackGem = GameServer.Database.FindObjectByKey <ItemTemplate>("dull_black_gem");
            if (dullBlackGem == null)
            {
                dullBlackGem      = new ItemTemplate();
                dullBlackGem.Name = "Dull Black Gem";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + dullBlackGem.Name + ", creating it ...");
                }

                dullBlackGem.Level = 6;

                dullBlackGem.Weight = 3;
                dullBlackGem.Model  = 118;

                dullBlackGem.Object_Type = (int)eObjectType.Magical;
                dullBlackGem.Item_Type   = (int)eEquipmentItems.JEWEL;
                dullBlackGem.Id_nb       = "dull_black_gem";
                dullBlackGem.Price       = 0;
                dullBlackGem.IsPickable  = true;
                dullBlackGem.IsDropable  = true;

                dullBlackGem.Bonus = 5; // default bonus

                dullBlackGem.Bonus1     = 6;
                dullBlackGem.Bonus1Type = (int)eStat.DEX;

                dullBlackGem.Bonus2     = 1;
                dullBlackGem.Bonus2Type = (int)eResist.Spirit;

                dullBlackGem.Quality       = 100;
                dullBlackGem.Condition     = 1000;
                dullBlackGem.MaxCondition  = 1000;
                dullBlackGem.Durability    = 1000;
                dullBlackGem.MaxDurability = 1000;
                GameServer.Database.AddObject(dullBlackGem);
            }

            /* Now we add some hooks to the Sir Quait 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 Sir Quait 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(argusBowman, GameLivingEvent.Interact, new DOLEventHandler(TalkToArgusBowman));
            GameEventMgr.AddHandler(argusBowman, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToArgusBowman));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #8
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("Master Gerol", eRealm.Albion);
            if (npcs.Length == 0)
            {
                masterGerol       = new GameNPC();
                masterGerol.Model = 10;
                masterGerol.Name  = "Master Gerol";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + masterGerol.Name + ", creating him ...");
                }
                masterGerol.GuildName       = "Healer";
                masterGerol.Realm           = eRealm.Albion;
                masterGerol.CurrentRegionID = 1;
                masterGerol.Size            = 45;
                masterGerol.Level           = 20;
                masterGerol.X            = 578668;
                masterGerol.Y            = 556823;
                masterGerol.Z            = 2184;
                masterGerol.Heading      = 79;
                masterGerol.MaxSpeedBase = 200;

                //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)
                {
                    masterGerol.SaveIntoDatabase();
                }


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



            #endregion

            #region defineItems



            boarCarcass = GameServer.Database.FindObjectByKey <ItemTemplate>("huge_boar_carcass");
            if (boarCarcass == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Elder Wood, creating it ...");
                }
                boarCarcass             = new ItemTemplate();
                boarCarcass.Object_Type = 0;
                boarCarcass.Id_nb       = "huge_boar_carcass";
                boarCarcass.Name        = "Huge Boar Carcass";
                boarCarcass.Level       = 1;
                boarCarcass.Model       = 540;
                boarCarcass.IsDropable  = false;
                boarCarcass.IsPickable  = false;
                GameServer.Database.AddObject(boarCarcass);
            }


            #endregion

            /* Now we add some hooks to the Sir Quait 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 Sir Quait 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(masterGerol, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterGerol));
            GameEventMgr.AddHandler(masterGerol, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterGerol));


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

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

            /* 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 :)
             */

            addrir = GetAddrir();

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Aethic", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                aethic       = new GameNPC();
                aethic.Model = 361;
                aethic.Name  = "Aethic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find" + aethic.Name + " , creating ...");
                }

                aethic.GuildName       = "Part of " + questTitle + " Quest";
                aethic.Realm           = eRealm.Hibernia;
                aethic.CurrentRegionID = 200;
                aethic.Size            = 49;
                aethic.Level           = 21;
                aethic.X       = GameLocation.ConvertLocalXToGlobalX(23761, 200);
                aethic.Y       = GameLocation.ConvertLocalYToGlobalY(45658, 200);
                aethic.Z       = 5448;
                aethic.Heading = 320;

                // aethic.EquipmentTemplateID = "1707754";
                // 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)
                {
                    aethic.SaveIntoDatabase();
                }

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Freagus", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                freagus       = new GameStableMaster();
                freagus.Model = 361;
                freagus.Name  = "Freagus";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + freagus.Name + ", creating ...");
                }

                freagus.GuildName       = "Stable Master";
                freagus.Realm           = eRealm.Hibernia;
                freagus.CurrentRegionID = 200;
                freagus.Size            = 48;
                freagus.Level           = 30;
                freagus.X                   = 341008;
                freagus.Y                   = 469180;
                freagus.Z                   = 5200;
                freagus.Heading             = 1934;
                freagus.EquipmentTemplateID = "3800664";

                // 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)
                {
                    freagus.SaveIntoDatabase();
                }

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

            npcs = WorldMgr.GetObjectsByName <GameNPC>("Rumdor", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Rumdor, creating ...");
                }

                rumdor                     = new GameStableMaster();
                rumdor.Model               = 361;
                rumdor.Name                = "Rumdor";
                rumdor.GuildName           = "Stable Master";
                rumdor.Realm               = eRealm.Hibernia;
                rumdor.CurrentRegionID     = 200;
                rumdor.Size                = 53;
                rumdor.Level               = 33;
                rumdor.X                   = 347175;
                rumdor.Y                   = 491836;
                rumdor.Z                   = 5226;
                rumdor.Heading             = 1262;
                rumdor.EquipmentTemplateID = "3800664";

                // 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)
                {
                    rumdor.SaveIntoDatabase();
                }

                rumdor.AddToWorld();
            }
            else
            {
                rumdor = npcs[0] as GameStableMaster;
            }

            npcs = WorldMgr.GetObjectsByName <GameStableMaster>("Truichon", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                truichon       = new GameStableMaster();
                truichon.Model = 361;
                truichon.Name  = "Truichon";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + truichon.Name + ", creating ...");
                }

                truichon.GuildName       = "Stable Master";
                truichon.Realm           = eRealm.Hibernia;
                truichon.CurrentRegionID = 1;
                truichon.Size            = 50;
                truichon.Level           = 33;
                truichon.X       = 343464;
                truichon.Y       = 526708;
                truichon.Z       = 5448;
                truichon.Heading = 68;

                // truichon.EquipmentTemplateID = "5448";

                // 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)
                {
                    truichon.SaveIntoDatabase();
                }

                truichon.AddToWorld();
            }
            else
            {
                truichon = npcs[0] as GameStableMaster;
            }

            ticketToTirnamBeo = GameServer.Database.FindObjectByKey <ItemTemplate>("hs_magmell_tirnambeo");
            if (ticketToTirnamBeo == null)
            {
                ticketToTirnamBeo = CreateTicketTo("Tir na mBeo", "hs_magmell_tirnambeo");
            }

            ticketToArdee = GameServer.Database.FindObjectByKey <ItemTemplate>("hs_tirnambeo_ardee");
            if (ticketToArdee == null)
            {
                ticketToArdee = CreateTicketTo("Ardee", "hs_tirnambeo_ardee");
            }

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

                recruitsDiary.Weight      = 3;
                recruitsDiary.Model       = 500;
                recruitsDiary.Object_Type = (int)eObjectType.GenericItem;
                recruitsDiary.Id_nb       = "recruits_diary";
                recruitsDiary.IsPickable  = true;
                recruitsDiary.IsDropable  = false;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(recruitsDiary);
                }
            }

            sackOfSupplies = GameServer.Database.FindObjectByKey <ItemTemplate>("sack_of_supplies");
            if (sackOfSupplies == null)
            {
                sackOfSupplies      = new ItemTemplate();
                sackOfSupplies.Name = "Sack of Supplies";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ...");
                }

                sackOfSupplies.Weight = 10;
                sackOfSupplies.Model  = 488;

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

                sackOfSupplies.Id_nb      = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sackOfSupplies);
                }
            }

            crateOfVegetables = GameServer.Database.FindObjectByKey <ItemTemplate>("crate_of_vegetables");
            if (crateOfVegetables == null)
            {
                crateOfVegetables      = new ItemTemplate();
                crateOfVegetables.Name = "Crate of Vegetables";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ...");
                }

                crateOfVegetables.Weight = 15;
                crateOfVegetables.Model  = 602;

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

                crateOfVegetables.Id_nb      = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(crateOfVegetables);
                }
            }

            // item db check
            recruitsCloak = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_cloak_hib");
            if (recruitsCloak == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Recruit's Cloak, creating it ...");
                }

                recruitsCloak       = new ItemTemplate();
                recruitsCloak.Name  = "Recruit's Cloak (Hib)";
                recruitsCloak.Level = 3;

                recruitsCloak.Weight = 3;
                recruitsCloak.Model  = 57;

                recruitsCloak.Object_Type = (int)eObjectType.Cloth;
                recruitsCloak.Item_Type   = (int)eEquipmentItems.CLOAK;
                recruitsCloak.Id_nb       = "recruits_cloak_hib";
                recruitsCloak.Price       = Money.GetMoney(0, 0, 0, 1, 0);
                recruitsCloak.IsPickable  = true;
                recruitsCloak.IsDropable  = true;
                recruitsCloak.Color       = 69;

                recruitsCloak.Bonus = 1; // default bonus

                recruitsCloak.Bonus1     = 1;
                recruitsCloak.Bonus1Type = (int)eStat.CON;

                recruitsCloak.Bonus2     = 1;
                recruitsCloak.Bonus2Type = (int)eResist.Slash;

                recruitsCloak.Quality       = 100;
                recruitsCloak.Condition     = 1000;
                recruitsCloak.MaxCondition  = 1000;
                recruitsCloak.Durability    = 1000;
                recruitsCloak.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(recruitsCloak);
                }
            }

            /* 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(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir));
            GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir));

            GameEventMgr.AddHandler(freagus, GameLivingEvent.Interact, new DOLEventHandler(TalkToFreagus));
            GameEventMgr.AddHandler(freagus, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFreagus));

            GameEventMgr.AddHandler(aethic, GameLivingEvent.Interact, new DOLEventHandler(TalkToAethic));
            GameEventMgr.AddHandler(aethic, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAethic));

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

            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 ...");
            /* 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("Abohas", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                abohas = new GameNPC();
                abohas.Model = 215;
                abohas.Name = "Abohas";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find" + abohas.Name + " , creating her ...");
                abohas.GuildName = "Part of " + questTitle + " Quest";
                abohas.Realm = eRealm.Midgard;
                abohas.CurrentRegionID = 100;
                abohas.Size = 49;
                abohas.Level = 21;
                abohas.X = GameLocation.ConvertLocalXToGlobalX(52274, 100);
                abohas.Y = GameLocation.ConvertLocalYToGlobalY(29985, 100);
                abohas.Z = 4960;
                abohas.Heading = 123;
                //abohas.EquipmentTemplateID = "1707754";
                //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)
                    abohas.SaveIntoDatabase();
                abohas.AddToWorld();
            }
            else
                abohas = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Harlfug", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                harlfug = new GameStableMaster();
                harlfug.Model = 215;
                harlfug.Name = "Harlfug";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + harlfug.Name + ", creating her ...");
                harlfug.GuildName = "Stable Master";
                harlfug.Realm = eRealm.Midgard;
                harlfug.CurrentRegionID = 100;
                harlfug.Size = 52;
                harlfug.Level = 41;
                harlfug.X = 773458;
                harlfug.Y = 754240;
                harlfug.Z = 4600;
                harlfug.Heading = 2707;
                harlfug.EquipmentTemplateID = "5100798";

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

            npcs = WorldMgr.GetNPCsByName("Gularg", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                gularg = new GameStableMaster();
                gularg.Model = 212;
                gularg.Name = "Gularg";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + gularg.Name + ", creating her ...");
                gularg.GuildName = "Stable Master";
                gularg.Realm = eRealm.Midgard;
                gularg.CurrentRegionID = 100;
                gularg.Size = 50;
                gularg.Level = 41;
                gularg.X = 803766;
                gularg.Y = 721959;
                gularg.Z = 4686;
                gularg.Heading = 3925;
                gularg.EquipmentTemplateID = "5100798";

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

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

            npcs = WorldMgr.GetNPCsByName("Yolafson", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                yolafson = new GameStableMaster();
                yolafson.Model = 214;
                yolafson.Name = "Yolafson";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + yolafson.Name + ", creating her ...");
                yolafson.GuildName = "Stable Master";
                yolafson.Realm = eRealm.Midgard;
                yolafson.CurrentRegionID = 100;
                yolafson.Size = 51;
                yolafson.Level = 41;
                yolafson.X = 805721;
                yolafson.Y = 700414;
                yolafson.Z = 4960;
                yolafson.Heading = 1206;
                yolafson.EquipmentTemplateID = "5100798";

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

            #endregion defineNPCs

            #region defineItems

            ticketToHaggerfel = CreateTicketTo("Haggerfel", "hs_src_haggerfel");
            ticketToVasudheim = CreateTicketTo("Vasudheim", "hs_src_vasudheim");

            sackOfSupplies = GameServer.Database.FindObjectByKey<ItemTemplate>("sack_of_supplies");
            if (sackOfSupplies == null)
            {
                sackOfSupplies = new ItemTemplate();
                sackOfSupplies.Name = "Sack of Supplies";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ...");

                sackOfSupplies.Weight = 10;
                sackOfSupplies.Model = 488;

                sackOfSupplies.Object_Type = (int)eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(sackOfSupplies);
            }

            crateOfVegetables = GameServer.Database.FindObjectByKey<ItemTemplate>("crate_of_vegetables");
            if (crateOfVegetables == null)
            {
                crateOfVegetables = new ItemTemplate();
                crateOfVegetables.Name = "Crate of Vegetables";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ...");

                crateOfVegetables.Weight = 15;
                crateOfVegetables.Model = 602;

                crateOfVegetables.Object_Type = (int)eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(crateOfVegetables);
            }

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

                recruitsCloak.Weight = 3;
                recruitsCloak.Model = 57;

                recruitsCloak.Object_Type = (int)eObjectType.Cloth;
                recruitsCloak.Item_Type = (int)eEquipmentItems.CLOAK;
                recruitsCloak.Id_nb = "recruits_cloak_mid";
                recruitsCloak.Price = Money.GetMoney(0, 0, 0, 1, 0);
                recruitsCloak.IsPickable = true;
                recruitsCloak.IsDropable = true;
                recruitsCloak.Color = 44; // brown

                recruitsCloak.Bonus = 1; // default bonus

                recruitsCloak.Bonus1 = 1;
                recruitsCloak.Bonus1Type = (int)eStat.CON;

                recruitsCloak.Bonus2 = 1;
                recruitsCloak.Bonus2Type = (int)eResist.Slash;

                recruitsCloak.Quality = 100;
                recruitsCloak.Condition = 1000;
                recruitsCloak.MaxCondition = 1000;
                recruitsCloak.Durability = 1000;
                recruitsCloak.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsCloak);
            }

            #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(dalikor, GameLivingEvent.Interact, new DOLEventHandler(TalkToDalikor));
            GameEventMgr.AddHandler(dalikor, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDalikor));

            GameEventMgr.AddHandler(harlfug, GameLivingEvent.Interact, new DOLEventHandler(TalkToHarlfug));
            GameEventMgr.AddHandler(harlfug, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHarlfug));

            GameEventMgr.AddHandler(abohas, GameLivingEvent.Interact, new DOLEventHandler(TalkToAbohas));
            GameEventMgr.AddHandler(abohas, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAbohas));

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

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

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

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.WhenBloodSpeaks.ScriptLoaded.Text1"), eRealm.Albion);

            if (npcs.Length == 0)
            {
                MasterKless       = new GameNPC();
                MasterKless.Model = 64;
                MasterKless.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.WhenBloodSpeaks.ScriptLoaded.Text1");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + MasterKless.Name + ", creating him ...");
                }

                // k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                // MasterKless.GuildName = "Part of " + questTitle + " Quest";
                MasterKless.Realm           = eRealm.Albion;
                MasterKless.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 1005);    // Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 96);           // Slot 26
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 1166); // Slot 12
                MasterKless.Inventory = template.CloseTemplate();
                MasterKless.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                MasterKless.Size    = 51;
                MasterKless.Level   = 50;
                MasterKless.X       = 559370;
                MasterKless.Y       = 513587;
                MasterKless.Z       = 2428;
                MasterKless.Heading = 2685;

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

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

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

            GameEventMgr.AddHandler(MasterKless, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterKless));
            GameEventMgr.AddHandler(MasterKless, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterKless));

            MasterKless.AddQuestToGive(typeof(WhenBloodSpeaks));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #12
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("Master Dunwyn", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Master Dunwyn, creating ...");
                dunwyn = new GameNPC();
                dunwyn.Model = 9;
                dunwyn.Name = "Master Dunwyn";
                dunwyn.GuildName = "Part of " + questTitle + " Quest";
                dunwyn.Realm = eRealm.Albion;
                dunwyn.CurrentRegionID = 1;

                dunwyn.Size = 50;
                dunwyn.Level = 20;
                dunwyn.X = 465383;
                dunwyn.Y = 634773;
                dunwyn.Z = 1840;
                dunwyn.Heading = 187;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 798);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 19);
                dunwyn.Inventory = template.CloseTemplate();

            //				dunwyn.AddNPCEquipment((byte) eEquipmentItems.TORSO, 798, 0, 0, 0);
            //				dunwyn.AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 19, 0, 0, 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)
                    dunwyn.SaveIntoDatabase();

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

            npcs = WorldMgr.GetNPCsByName("Princess Obera", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Princess Obera, creating ...");
                princessObera = new GameNPC();

                princessObera.Name = "Princess Obera";
                princessObera.X = 579289;
                princessObera.Y = 508200;
                princessObera.Z = 2779;
                princessObera.Heading = 347;
                princessObera.Model = 603;
                princessObera.GuildName = "Part of " + questTitle + " Quest";
                princessObera.Realm = eRealm.None;
                princessObera.CurrentRegionID = 1;
                princessObera.Size = 49;
                princessObera.Level = 3;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 80;
                brain.AggroRange = 1000;
                princessObera.SetOwnBrain(brain);

                if (SAVE_INTO_DATABASE)
                    princessObera.SaveIntoDatabase();
                princessObera.AddToWorld();
            }
            else
            {
                princessObera = (GameNPC) npcs[0];
            }

            int counter = 0;
            foreach (GameNPC npc in princessObera.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 = 3;
                    fairySorceress[i].X = princessObera.X + Util.Random(-150, 150);
                    fairySorceress[i].Y = princessObera.Y + Util.Random(-150, 150);
                    fairySorceress[i].Z = princessObera.Z;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 30;
                    brain.AggroRange = 300;
                    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

            swampRatTail = GameServer.Database.FindObjectByKey<ItemTemplate>("swamp_rat_tail");
            if (swampRatTail == null)
            {
                swampRatTail = new ItemTemplate();
                swampRatTail.Name = "Swamp Rat Tail";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + swampRatTail.Name + " , creating it ...");

                swampRatTail.Weight = 110;
                swampRatTail.Model = 515;

                swampRatTail.Object_Type = (int) eObjectType.GenericItem;

                swampRatTail.Id_nb = "swamp_rat_tail";
                swampRatTail.IsPickable = true;
                swampRatTail.IsDropable = false;
                GameServer.Database.AddObject(swampRatTail);
            }

            swampSlimeItem = GameServer.Database.FindObjectByKey<ItemTemplate>("swamp_slime");
            if (swampSlimeItem == null)
            {
                swampSlimeItem = new ItemTemplate();
                swampSlimeItem.Name = "Swamp Slime";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + swampSlimeItem.Name + " , creating it ...");

                swampSlimeItem.Weight = 10;
                swampSlimeItem.Model = 553;

                swampSlimeItem.Object_Type = (int) eObjectType.GenericItem;

                swampSlimeItem.Id_nb = "swamp_slime";
                swampSlimeItem.IsPickable = true;
                swampSlimeItem.IsDropable = false;
                GameServer.Database.AddObject(swampSlimeItem);
            }

            scrollDunwyn = GameServer.Database.FindObjectByKey<ItemTemplate>("scroll_for_dunwyn");
            if (scrollDunwyn == null)
            {
                scrollDunwyn = new ItemTemplate();
                scrollDunwyn.Name = "Scroll for Master Dunwyn";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + scrollDunwyn.Name + " , creating it ...");

                scrollDunwyn.Weight = 10;
                scrollDunwyn.Model = 498;

                scrollDunwyn.Object_Type = (int) eObjectType.GenericItem;

                scrollDunwyn.Id_nb = "scroll_for_dunwyn";
                scrollDunwyn.IsPickable = true;
                scrollDunwyn.IsDropable = false;
                GameServer.Database.AddObject(scrollDunwyn);
            }

            listDunwyn = GameServer.Database.FindObjectByKey<ItemTemplate>("list_for_dunwyn");
            if (listDunwyn == null)
            {
                listDunwyn = new ItemTemplate();
                listDunwyn.Name = "List for Master Dunwyn";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + listDunwyn.Name + " , creating it ...");

                listDunwyn.Weight = 10;
                listDunwyn.Model = 498;

                listDunwyn.Object_Type = (int) eObjectType.GenericItem;

                listDunwyn.Id_nb = "list_for_dunwyn";
                listDunwyn.IsPickable = true;
                listDunwyn.IsDropable = false;
                GameServer.Database.AddObject(listDunwyn);
            }

            riverSpritlingClaw = GameServer.Database.FindObjectByKey<ItemTemplate>("river_spritling_claw");
            if (riverSpritlingClaw == null)
            {
                riverSpritlingClaw = new ItemTemplate();
                riverSpritlingClaw.Name = "River Spriteling Claw";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + riverSpritlingClaw.Name + " , creating it ...");

                riverSpritlingClaw.Weight = 2;
                riverSpritlingClaw.Model = 106;

                riverSpritlingClaw.Object_Type = (int) eObjectType.GenericItem;

                riverSpritlingClaw.Id_nb = "river_spritling_claw";
                riverSpritlingClaw.IsPickable = true;
                riverSpritlingClaw.IsDropable = false;
                GameServer.Database.AddObject(riverSpritlingClaw);
            }

            princessOberasHead = GameServer.Database.FindObjectByKey<ItemTemplate>("princess_oberas_head");
            if (princessOberasHead == null)
            {
                princessOberasHead = new ItemTemplate();
                princessOberasHead.Name = "Princess Obera's Head";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + princessOberasHead.Name + " , creating it ...");

                princessOberasHead.Weight = 15;
                princessOberasHead.Model = 503;

                princessOberasHead.Object_Type = (int) eObjectType.GenericItem;

                princessOberasHead.Id_nb = "princess_oberas_head";
                princessOberasHead.IsPickable = true;
                princessOberasHead.IsDropable = false;
                GameServer.Database.AddObject(princessOberasHead);
            }

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

                recruitsHelm.Weight = 24;
                recruitsHelm.Model = 824; // studded vest

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

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

                recruitsHelm.Bonus = 5; // default bonus

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

                recruitsHelm.Bonus2 = 1;
                recruitsHelm.Bonus2Type = (int) eResist.Spirit;

                recruitsHelm.Bonus3 = 12;
                recruitsHelm.Bonus3Type = (int) eProperty.MaxHealth;

                recruitsHelm.Quality = 100;
                recruitsHelm.Condition = 1000;
                recruitsHelm.MaxCondition = 1000;
                recruitsHelm.Durability = 1000;
                recruitsHelm.MaxDurability = 1000;
                GameServer.Database.AddObject(recruitsHelm);
            }

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

                recruitsCap.Weight = 8;
                recruitsCap.Model = 822; // studded vest

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

                recruitsCap.Object_Type = (int) eObjectType.Cloth;
                recruitsCap.Item_Type = (int) eEquipmentItems.HEAD;
                recruitsCap.Id_nb = "recruits_quilted_cap";
                recruitsCap.Price = Money.GetMoney(0,0,0,9,0);
                recruitsCap.IsPickable = true;
                recruitsCap.IsDropable = true;
                recruitsCap.Color = 27; // red cloth

                recruitsCap.Bonus = 5; // default bonus

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

                recruitsCap.Bonus2 = 20;
                recruitsCap.Bonus2Type = (int) eProperty.MaxHealth;

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

                recruitsCap.Quality = 100;
                recruitsCap.Condition = 1000;
                recruitsCap.MaxCondition = 1000;
                recruitsCap.Durability = 1000;
                recruitsCap.MaxDurability = 1000;
                GameServer.Database.AddObject(recruitsCap);
            }

            recruitsRing = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_silver_ring");
            if (recruitsRing == null)
            {
                recruitsRing = new ItemTemplate();
                recruitsRing.Name = "Recruit's Silver Ring";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsRing.Name + ", creating it ...");
                recruitsRing.Level = 6;

                recruitsRing.Weight = 2;
                recruitsRing.Model = 103; // studded vest

                recruitsRing.Object_Type = (int) eObjectType.Magical;
                recruitsRing.Item_Type = (int) eEquipmentItems.R_RING;
                recruitsRing.Id_nb = "recruits_silver_ring";
                recruitsRing.Price = Money.GetMoney(0,0,0,9,0);
                recruitsRing.IsPickable = true;
                recruitsRing.IsDropable = true;

                recruitsRing.Bonus = 5; // default bonus

                recruitsRing.Bonus1 = 20;
                recruitsRing.Bonus1Type = (int) eProperty.MaxHealth;

                recruitsRing.Quality = 100;
                recruitsRing.Condition = 1000;
                recruitsRing.MaxCondition = 1000;
                recruitsRing.Durability = 1000;
                recruitsRing.MaxDurability = 1000;
                GameServer.Database.AddObject(recruitsRing);
            }

            #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(dunwyn, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterDunwyn));
            GameEventMgr.AddHandler(dunwyn, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterDunwyn));

            GameEventMgr.AddHandler(princessObera, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearPrincessObera));

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #13
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 :)
                */

            dalikor = GetDalikor();

            #region defineNPCs

            generalLocations[0] = new GameLocation(generalNames[0], 100, 100, 40124, 44594, 4712, 216);
            generalLocations[1] = new GameLocation(generalNames[1], 100, 100, 46821, 40884, 4972, 21);
            generalLocations[2] = new GameLocation(generalNames[2], 100, 100, 56104, 43865, 5460, 48);

            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 ...");
                    general[i] = new GameNPC();

                    general[i].Model = 678;

                    general[i].GuildName = "Part of " + questTitle + " Quest";
                    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].Realm = eRealm.None;
                    general[i].CurrentRegionID = generalLocations[i].RegionID;
                    general[i].Size = 49;
                    general[i].Level = 2;

                    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 defineNPCs

            #region defineItems

            /*
			 * TODO Model for Campfire doesn't work. Very Stange!
			 */
            /*
            // Add campfires to generals
            for (int i = 0; i < generalLocations.Length; i++)
            {
                GameStaticItem campfire = null;

                IEnumerable items =  WorldMgr.GetItemsCloseToSpot(generalLocations[i].RegionID,generalLocations[i].X, generalLocations[i].Y, generalLocations[i].Z, 400,true);
                foreach (GameObject obj in items)
                {
                    if (obj is GameStaticItem && obj.Name=="Camp Fire")
                    {
                        campfire= (GameStaticItem) obj;
                        break;
                    }
                }

                if (campfire==null)
                {
                    campfire = new GameStaticItem();
                    campfire.Name="Camp Fire";

                    campfire.Model = 2593;
                    campfire.Heading = generalLocations[i].Heading;
                    campfire.X = generalLocations[i].X;
                    campfire.Y = generalLocations[i].Y;
                    campfire.Z = generalLocations[i].Z;
                    campfire.CurrentRegionID = generalLocations[i].RegionID;

                    if (SAVE_INTO_DATABASE)
                        campfire.SaveIntoDatabase();

                    campfire.AddToWorld();

                    DOLConsole.WriteLine("Camp Fire added"+generalNames[i]);
                }
            }
*/

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

                askefruerWings.Weight = 2;
                askefruerWings.Model = 551;

                askefruerWings.Object_Type = (int)eObjectType.GenericItem;

                askefruerWings.Id_nb = "askefruer_wings";
                askefruerWings.IsPickable = true;
                askefruerWings.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(askefruerWings);
            }

            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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(dustyOldMap);
            }

            // item db check
            recruitsArms = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_studded_arms_mid");
            if (recruitsArms == null)
            {
                recruitsArms = new ItemTemplate();
                recruitsArms.Name = "Recruit's Studded Arms (Mid)";
                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_mid";
                recruitsArms.Price = Money.GetMoney(0, 0, 0, 4, 0);
                recruitsArms.IsPickable = true;
                recruitsArms.IsDropable = true;
                recruitsArms.Color = 36; // blue cloth

                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
                if (SAVE_INTO_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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsSleeves);
            }

            #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.GameEntered, new DOLEventHandler(PlayerEnterWorld));

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

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

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #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("Stor Gothi Annark", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Stor Gothi Annark, creating ...");
                annark = new GameNPC();
                annark.Model = 215;
                annark.Name = "Stor Gothi Annark";
                annark.GuildName = "Part of " + questTitle + " Quest";
                annark.Realm = eRealm.Midgard;
                annark.CurrentRegionID = 100;
                annark.Size = 51;
                annark.Level = 66;
                annark.X = 765357;
                annark.Y = 668790;
                annark.Z = 5759;
                annark.Heading = 7711;

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

                annark.EquipmentTemplateID = "5100090";

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

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCScryerIdora"), eRealm.Midgard);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Scryer Idora, creating ...");
                idora = new GameNPC();
                idora.Model = 227;
                idora.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCScryerIdora");
                idora.GuildName = "Part of " + questTitle + " Quest";
                idora.Realm = eRealm.Midgard;
                idora.CurrentRegionID = 234;
                idora.Size = 52;
                idora.Level = 50;
                idora.X = 558081;
                idora.Y = 573988;
                idora.Z = 8640;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 82);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 84);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 3);
                idora.Inventory = template.CloseTemplate();
                idora.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				idora.AddNPCEquipment(Slot.TORSO, 81, 0, 0, 0);
            //				idora.AddNPCEquipment(Slot.LEGS, 82, 0, 0, 0);
            //				idora.AddNPCEquipment(Slot.FEET, 84, 0, 0, 0);
            //				idora.AddNPCEquipment(Slot.CLOAK, 91, 0, 0, 0);
            //				idora.AddNPCEquipment(Slot.RIGHTHAND, 3, 0, 0, 0);

                idora.Heading = 1558;
                idora.MaxSpeedBase = 200;
                idora.EquipmentTemplateID = "200292";

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

            Point2D point = idora.GetPointFromHeading( idora.Heading, 30 );
            locationIdora = new GameLocation(idora.CurrentZone.Description, idora.CurrentRegionID, point.X, point.Y, idora.Z);

            ticketToSvasudFaste = CreateTicketTo("Svasud Faste", "hs_mularn_svasudfaste");
            ticketToMularn = CreateTicketTo("Mularn", "hs_svasudfaste_mularn");

            npcs = (GameNPC[])WorldMgr.GetObjectsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGriffinHandlerNjiedi"), eRealm.Midgard, typeof(GameStableMaster));
            if (npcs.Length == 0)
            {
                njiedi = new GameStableMaster();
                njiedi.Model = 158;
                njiedi.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.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, 10);
                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;
            }

            njiedi.TradeItems = new MerchantTradeItems(null);
            if (!njiedi.TradeItems.AddTradeItem(1, eMerchantWindowSlot.FirstEmptyInPage, ticketToSvasudFaste))
                if (log.IsWarnEnabled)
                    log.Warn("ticketToSvasudFaste not added");

            foreach (GameNPC npc in njiedi.GetNPCsInRadius(400))
            {
                if (npc.Name == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGryphon"))
                {
                    griffin = npc;
                    break;
                }
            }
            if (griffin == null)
            {
                griffin = new GameNPC();
                griffin.Model = 1236; // //819;
                griffin.Name = "tamed gryphon";

                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + griffin.Name + ", creating ...");
                griffin.GuildName = "Part of " + questTitle + " Quest";
                griffin.Realm = eRealm.Midgard;
                griffin.CurrentRegionID = njiedi.CurrentRegionID;
                griffin.Size = 50;
                griffin.Level = 50;
                griffin.X = njiedi.X + 80;
                griffin.Y = njiedi.Y + 100;
                griffin.Z = njiedi.Z;

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

                griffin.Heading = 93;
                griffin.MaxSpeedBase = 400;
                //dragonfly.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)
                {
                    griffin.SaveIntoDatabase();
                }
                griffin.AddToWorld();
            }

            npcs = (GameNPC[]) WorldMgr.GetObjectsByName("Vorgar", eRealm.Midgard, typeof (GameStableMaster));
            if (npcs.Length == 0)
            {
                vorgar = new GameStableMaster();
                vorgar.Model = 52;
                vorgar.Name = "Vorgar";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + vorgar.Name + ", creating ...");
                vorgar.GuildName = "Stable Master";
                vorgar.Realm = eRealm.Midgard;
                vorgar.CurrentRegionID = 100;
                vorgar.Size = 51;
                vorgar.Level = 50;
                vorgar.X = GameLocation.ConvertLocalXToGlobalX(10660, 100);
                vorgar.Y = GameLocation.ConvertLocalYToGlobalY(3437, 100);
                vorgar.Z = 5717;
                vorgar.Heading = 327;
                vorgar.MaxSpeedBase = 200;

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

                //ulliam.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)
                {
                    vorgar.SaveIntoDatabase();
                }

                vorgar.AddToWorld();
            }
            else
                vorgar = npcs[0] as GameStableMaster;

            Point2D vorgarloc = vorgar.GetPointFromHeading( vorgar.Heading, 30 );
            locationVorgar = new GameLocation(vorgar.CurrentZone.Description, vorgar.CurrentRegionID, vorgarloc.X, vorgarloc.Y, vorgar.Z);

            #endregion

            #region DefineItems

            // item db check
            noteForNjiedi = GameServer.Database.FindObjectByKey<ItemTemplate>("njiedi_note");
            if (noteForNjiedi == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Njiedi's Note, creating it ...");
                noteForNjiedi = new ItemTemplate();
                noteForNjiedi.Name = "Njiedi's Note";

                noteForNjiedi.Weight = 3;
                noteForNjiedi.Model = 498;

                noteForNjiedi.Object_Type = (int) eObjectType.GenericItem;

                noteForNjiedi.Id_nb = "njiedi_note";
                noteForNjiedi.IsPickable = true;
                noteForNjiedi.IsDropable = false;

                GameServer.Database.AddObject(noteForNjiedi);
            }

            // item db check
            askefruerPlans = GameServer.Database.FindObjectByKey<ItemTemplate>("askefruer_plans");
            if (askefruerPlans == null)
            {
                askefruerPlans = new ItemTemplate();
                askefruerPlans.Name = "Askefruer Plans";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + askefruerPlans.Name + ", creating it ...");

                askefruerPlans.Weight = 3;
                askefruerPlans.Model = 498;

                askefruerPlans.Object_Type = (int) eObjectType.GenericItem;

                askefruerPlans.Id_nb = "askefruer_plans";
                askefruerPlans.IsPickable = true;
                askefruerPlans.IsDropable = false;

                GameServer.Database.AddObject(askefruerPlans);
            }

            translatedPlans = GameServer.Database.FindObjectByKey<ItemTemplate>("translated_askefruer_plans");
            if (translatedPlans == null)
            {
                translatedPlans = new ItemTemplate();
                translatedPlans.Name = "Translated Askefruer Plans";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + translatedPlans.Name + ", creating it ...");

                translatedPlans.Weight = 3;
                translatedPlans.Model = 498;

                translatedPlans.Object_Type = (int) eObjectType.GenericItem;

                translatedPlans.Id_nb = "translated_askefruer_plans";
                translatedPlans.IsPickable = true;
                translatedPlans.IsDropable = false;

                GameServer.Database.AddObject(translatedPlans);
            }

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

                recruitsLegs.Weight = 42;
                recruitsLegs.Model = 82; // Studded Legs

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

                recruitsLegs.Object_Type = (int) eObjectType.Studded;
                recruitsLegs.Item_Type = (int) eEquipmentItems.LEGS;
                recruitsLegs.Id_nb = "recruits_studded_legs_mid";
                recruitsLegs.Price = Money.GetMoney(0,0,0,10,0);
                recruitsLegs.IsPickable = true;
                recruitsLegs.IsDropable = true;
                recruitsLegs.Color = 14; // blue leather

                recruitsLegs.Bonus = 5; // default bonus

                recruitsLegs.Bonus1 = 12;
                recruitsLegs.Bonus1Type = (int) eProperty.MaxHealth; // hit

                recruitsLegs.Bonus2 = 2;
                recruitsLegs.Bonus2Type = (int) eResist.Slash;

                recruitsLegs.Bonus3 = 1;
                recruitsLegs.Bonus3Type = (int) eResist.Cold;

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

                GameServer.Database.AddObject(recruitsLegs);
            }

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

                recruitsPants.Weight = 14;
                recruitsPants.Model = 152; // cloth Legs

                recruitsPants.DPS_AF = 5; // Armour
                recruitsPants.SPD_ABS = 0; // Absorption

                recruitsPants.Object_Type = (int) eObjectType.Cloth;
                recruitsPants.Item_Type = (int) eEquipmentItems.LEGS;
                recruitsPants.Id_nb = "recruits_quilted_pants";
                recruitsPants.Price = Money.GetMoney(0,0,0,10,0);
                recruitsPants.IsPickable = true;
                recruitsPants.IsDropable = true;
                recruitsPants.Color = 36;

                recruitsPants.Bonus = 5; // default bonus

                recruitsPants.Bonus1 = 12;
                recruitsPants.Bonus1Type = (int) eProperty.MaxHealth; // hit

                recruitsPants.Bonus2 = 2;
                recruitsPants.Bonus2Type = (int) eResist.Slash;

                recruitsPants.Bonus3 = 1;
                recruitsPants.Bonus3Type = (int) eResist.Cold;

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

                GameServer.Database.AddObject(recruitsPants);
            }

            #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.
            */
            //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(annark, GameObjectEvent.Interact, new DOLEventHandler(TalkToAnnark));

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

            GameEventMgr.AddHandler(idora, GameObjectEvent.Interact, new DOLEventHandler(TalkToIdora));
            GameEventMgr.AddHandler(idora, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToIdora));

            GameEventMgr.AddHandler(vorgar, GameObjectEvent.Interact, new DOLEventHandler(TalkToVorgar));
            GameEventMgr.AddHandler(vorgar, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToVorgar));

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

            if (log.IsInfoEnabled)
                if (log.IsInfoEnabled)
                    log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #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("Audun", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(101).IsDisabled)
                {
                    Audun       = new DOL.GS.GameNPC();
                    Audun.Model = 232;
                    Audun.Name  = "Audun";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + Audun.Name + ", creating ...");
                    }
                    Audun.GuildName       = "Part of " + questTitle + " Quest";
                    Audun.Realm           = eRealm.Midgard;
                    Audun.CurrentRegionID = 101;
                    Audun.Size            = 48;
                    Audun.Level           = 49;
                    Audun.MaxSpeedBase    = 191;
                    Audun.Faction         = FactionMgr.GetFactionByID(0);
                    Audun.X               = 33283;
                    Audun.Y               = 35305;
                    Audun.Z               = 8027;
                    Audun.Heading         = 1763;
                    Audun.RespawnInterval = -1;
                    Audun.BodyType        = 0;


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

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

            npcs = WorldMgr.GetNPCsByName("Guard Olja", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(229).IsDisabled)
                {
                    GuardOlja       = new DOL.GS.GameNPC();
                    GuardOlja.Model = 180;
                    GuardOlja.Name  = "Guard Olja";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + GuardOlja.Name + ", creating ...");
                    }
                    GuardOlja.GuildName       = "Part of " + questTitle + " Quest";
                    GuardOlja.Realm           = eRealm.Midgard;
                    GuardOlja.CurrentRegionID = 229;
                    GuardOlja.Size            = 50;
                    GuardOlja.Level           = 50;
                    GuardOlja.MaxSpeedBase    = 191;
                    GuardOlja.Faction         = FactionMgr.GetFactionByID(0);
                    GuardOlja.X               = 47994;
                    GuardOlja.Y               = 37341;
                    GuardOlja.Z               = 21812;
                    GuardOlja.Heading         = 204;
                    GuardOlja.RespawnInterval = -1;
                    GuardOlja.BodyType        = 0;


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

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


            #endregion

            #region defineItems

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


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(meadrun));
            QuestBehaviour a;
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.Interact, null, Audun);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.meadrun), Audun);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.meadrun), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "Greetings. You appear to be down on your luck. I have a [proposition] for you if you're interested.", null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.Whisper, "proposition", Audun);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.meadrun), Audun);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.meadrun), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "I need to deliver some mead to the guards just inside the Burial Grounds. There is a bit of coin to be had if you would deliver the mead for me.", Audun);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.meadrun), "Will you deliver the mead for Audun? [Levels 1-4]");
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.meadrun));
            a.AddAction(eActionType.Talk, "No problem. See you", Audun);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.meadrun));
            a.AddAction(eActionType.Talk, "Here take the mead to Guard Olja inside the entrance of the Burial Grounds.", Audun);
            a.AddAction(eActionType.GiveItem, bottleofmead, Audun);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.meadrun), Audun);
            AddBehaviour(a);
            a = builder.CreateBehaviour(GuardOlja, -1);
            a.AddTrigger(eTriggerType.GiveItem, GuardOlja, bottleofmead);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.meadrun), null);
            a.AddAction(eActionType.Talk, "Thanks. Here, take this empty bottle back to Auduan.", GuardOlja);
            a.AddAction(eActionType.GiveItem, emptybottle, GuardOlja);
            a.AddAction(eActionType.TakeItem, bottleofmead, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.meadrun), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(Audun, -1);
            a.AddTrigger(eTriggerType.GiveItem, Audun, emptybottle);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.meadrun), 2, (eComparator)3);
            a.AddAction(eActionType.Talk, "Good work. Here is that bit of coin I was talking about. Check back with me later, and I may have more work for you.", Audun);
            a.AddAction(eActionType.GiveXP, 5, null);
            a.AddAction(eActionType.GiveGold, 27, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.meadrun), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (Audun != null)
            {
                Audun.AddQuestToGive(typeof(meadrun));
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #16
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("Apprentice Dunan", eRealm.Albion);
            if (npcs.Length == 0)
            {
                dunan = new GameNPC();
                dunan.Model = 49;
                dunan.Name = "Apprentice Dunan";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + dunan.Name + ", creating ...");
                dunan.GuildName = "Part of " + questTitle + " Quest";
                dunan.Realm = eRealm.Albion;
                dunan.CurrentRegionID = 1;
                dunan.Size = 49;
                dunan.Level = 21;
                dunan.X = 531663;
                dunan.Y = 479785;
                dunan.Z = 2200;
                dunan.Heading = 1579;
                dunan.EquipmentTemplateID = "1707754";
                //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)
                    dunan.SaveIntoDatabase();
                dunan.AddToWorld();
            }
            else
                dunan = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Bombard", eRealm.Albion);
            if (npcs.Length == 0)
            {
                bombard = new GameStableMaster();
                bombard.Model = 8;
                bombard.Name = "Bombard";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + bombard.Name + ", creating ...");
                bombard.GuildName = "Stable Master";
                bombard.Realm = eRealm.Albion;
                bombard.CurrentRegionID = 1;
                bombard.Size = 49;
                bombard.Level = 4;
                bombard.X = 515718;
                bombard.Y = 496739;
                bombard.Z = 3352;
                bombard.Heading = 2500;

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

            npcs = WorldMgr.GetNPCsByName("Vuloch", eRealm.Albion);
            if (npcs.Length == 0)
            {
                vuloch = new GameStableMaster();
                vuloch.Model = 86;
                vuloch.Name = "Vuloch";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + vuloch.Name + ", creating ...");
                vuloch.GuildName = "Stable Master";
                vuloch.Realm = eRealm.Albion;
                vuloch.CurrentRegionID = 1;
                vuloch.Size = 50;
                vuloch.Level = 4;
                vuloch.X = 553089;
                vuloch.Y = 513380;
                vuloch.Z = 2896;
                vuloch.Heading = 2139;

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

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

            npcs = WorldMgr.GetNPCsByName("Yaren", eRealm.Albion);
            if (npcs.Length == 0)
            {
                yaren = new GameStableMaster();
                yaren.Model = 79;
                yaren.Name = "Yaren";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + yaren.Name + ", creating ...");
                yaren.GuildName = "Stable Master";
                yaren.Realm = eRealm.Albion;
                yaren.CurrentRegionID = 1;
                yaren.Size = 48;
                yaren.Level = 4;
                yaren.X = 529638;
                yaren.Y = 478091;
                yaren.Z = 2200;
                yaren.Heading = 3160;
                yaren.EquipmentTemplateID = "11701347";

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

            #endregion

            #region defineItems

            ticketToLudlow = CreateTicketTo("Ludlow", "hs_northcamelotgates_ludlow");
            ticketToBombard = CreateTicketTo("North Camelot Gates", "hs_ludlow_northcamelotgates");

            sackOfSupplies = GameServer.Database.FindObjectByKey<ItemTemplate>("sack_of_supplies");
            if (sackOfSupplies == null)
            {
                sackOfSupplies = new ItemTemplate();
                sackOfSupplies.Name = "Sack of Supplies";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ...");

                sackOfSupplies.Weight = 10;
                sackOfSupplies.Model = 488;

                sackOfSupplies.Object_Type = (int) eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.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(sackOfSupplies);
            }

            crateOfVegetables = GameServer.Database.FindObjectByKey<ItemTemplate>("crate_of_vegetables");
            if (crateOfVegetables == null)
            {
                crateOfVegetables = new ItemTemplate();
                crateOfVegetables.Name = "Crate of Vegetables";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ...");

                crateOfVegetables.Weight = 15;
                crateOfVegetables.Model = 602;

                crateOfVegetables.Object_Type = (int) eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.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(crateOfVegetables);
            }

            // item db check
            recruitsCloak = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloak");
            if (recruitsCloak == null)
            {
                recruitsCloak = new ItemTemplate();
                recruitsCloak.Name = "Recruit's Cloak";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsCloak.Name + ", creating it ...");
                recruitsCloak.Level = 3;

                recruitsCloak.Weight = 3;
                recruitsCloak.Model = 57; // studded Boots

                recruitsCloak.Object_Type = (int) eObjectType.Cloth;
                recruitsCloak.Item_Type = (int) eEquipmentItems.CLOAK;
                recruitsCloak.Id_nb = "recruits_cloak";
                recruitsCloak.Price = Money.GetMoney(0,0,0,1,0);
                recruitsCloak.IsPickable = true;
                recruitsCloak.IsDropable = true;
                recruitsCloak.Color = 36;

                recruitsCloak.Bonus = 1; // default bonus

                recruitsCloak.Bonus1 = 1;
                recruitsCloak.Bonus1Type = (int) eStat.CON;

                recruitsCloak.Bonus2 = 1;
                recruitsCloak.Bonus2Type = (int) eResist.Slash;

                recruitsCloak.Quality = 100;
                recruitsCloak.Condition = 1000;
                recruitsCloak.MaxCondition = 1000;
                recruitsCloak.Durability = 1000;
                recruitsCloak.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(recruitsCloak);
            }

            #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(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

            GameEventMgr.AddHandler(bombard, GameLivingEvent.Interact, new DOLEventHandler(TalkToBombard));
            GameEventMgr.AddHandler(bombard, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBombard));

            GameEventMgr.AddHandler(dunan, GameLivingEvent.Interact, new DOLEventHandler(TalkToDunan));
            GameEventMgr.AddHandler(dunan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDunan));

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #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 ...");
            }

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Sir Prescott", 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)
            {
                SirPrescott       = new GameNPC();
                SirPrescott.Model = 28;
                SirPrescott.Name  = "Sir Prescott";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + SirPrescott.Name + ", creating him ...");
                }

                // SirPrescott.GuildName = "Part of " + questTitle + " Quest";
                SirPrescott.Realm           = eRealm.Albion;
                SirPrescott.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                SirPrescott.Inventory = template.CloseTemplate();
                SirPrescott.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                SirPrescott.Size    = 50;
                SirPrescott.Level   = 50;
                SirPrescott.X       = 559862;
                SirPrescott.Y       = 513092;
                SirPrescott.Z       = 2408;
                SirPrescott.Heading = 2480;

                // 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)
                {
                    SirPrescott.SaveIntoDatabase();
                }

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

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

            GameEventMgr.AddHandler(SirPrescott, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirPrescott));
            GameEventMgr.AddHandler(SirPrescott, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirPrescott));

            SirPrescott.AddQuestToGive(typeof(AfterTheAccident));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #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("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");
        }
Beispiel #19
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("Mistress Laws", (eRealm)1);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(51).IsDisabled)
                {
                    MistressLaws       = new DOL.GS.GameNPC();
                    MistressLaws.Model = 68;
                    MistressLaws.Name  = "Mistress Laws";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + MistressLaws.Name + ", creating ...");
                    }
                    MistressLaws.GuildName       = "Part of " + questTitle + " Quest";
                    MistressLaws.Realm           = eRealm.Albion;
                    MistressLaws.CurrentRegionID = 51;
                    MistressLaws.Size            = 52;
                    MistressLaws.Level           = 40;
                    MistressLaws.MaxSpeedBase    = 191;
                    MistressLaws.Faction         = FactionMgr.GetFactionByID(0);
                    MistressLaws.X               = 536859;
                    MistressLaws.Y               = 548403;
                    MistressLaws.Z               = 4800;
                    MistressLaws.Heading         = 1035;
                    MistressLaws.RespawnInterval = -1;
                    MistressLaws.BodyType        = 0;


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

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

            npcs = WorldMgr.GetNPCsByName("Ylaine Barrett", (eRealm)1);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(51).IsDisabled)
                {
                    YlaineBarrett       = new DOL.GS.GameMerchant();
                    YlaineBarrett.Model = 87;
                    YlaineBarrett.Name  = "Ylaine Barrett";
                    if (log.IsWarnEnabled)
                    {
                        log.Warn("Could not find " + YlaineBarrett.Name + ", creating ...");
                    }
                    YlaineBarrett.GuildName       = "Part of " + questTitle + " Quest";
                    YlaineBarrett.Realm           = eRealm.Albion;
                    YlaineBarrett.CurrentRegionID = 51;
                    YlaineBarrett.Size            = 50;
                    YlaineBarrett.Level           = 40;
                    YlaineBarrett.MaxSpeedBase    = 191;
                    YlaineBarrett.Faction         = FactionMgr.GetFactionByID(0);
                    YlaineBarrett.X               = 522790;
                    YlaineBarrett.Y               = 542142;
                    YlaineBarrett.Z               = 3230;
                    YlaineBarrett.Heading         = 1661;
                    YlaineBarrett.RespawnInterval = -1;
                    YlaineBarrett.BodyType        = 0;


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

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


            #endregion

            #region defineItems

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


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

            QuestBuilder   builder = QuestMgr.getBuilder(typeof(Cellarinfestation));
            QuestBehaviour a;
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.Interact, null, MistressLaws);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Albion.Cellarinfestation), MistressLaws);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "You have barely begun training; yet already there is a need for you to lend your strength for the protection of this town. I know some of the locals are suspicious of the Inconnu, well, that is not to be helped. They are a mysterious people, and their sudden appearance one stormy night, well, that causes a large amount of [suspicion], as you can imagine, They are here to help us, I do believe that, and so must you. But some of the locals, they are not so sure.", MistressLaws);
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.Whisper, "suspicion", MistressLaws);
            a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Albion.Cellarinfestation), MistressLaws);
            a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null, (eComparator)5);
            a.AddAction(eActionType.Talk, "They have seen the Drakoran ruin their lands, they have witnessed Morgana's terrible magic first hand, so they cannot be expected to trust these new, powerful allies. I expect you to treat the Inconnu as allies, and to try and avoid the idle gossip of the local townsfolk. Saying that, I must send you to one of the loudest of the rabble. Ylaine Barrett. The food cellar has been swarming with swamp goo, and she wants someone to go out and clear the immediate area of swamp goo. Don't worry, I don't expect you to kill them all, just do what you can.", MistressLaws);
            a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Albion.Cellarinfestation), "Will you aid Ylaine Barrett in her attempt to rid the cellars of swamp goo?");
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Albion.Cellarinfestation));
            a.AddAction(eActionType.Talk, "No problem. See you.", MistressLaws);
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Albion.Cellarinfestation));
            a.AddAction(eActionType.Talk, "Right, I expected you would do so. Now, go talk to Ylaine Barrett.", MistressLaws);
            a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Albion.Cellarinfestation), MistressLaws);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Interact, null, YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Ah. G'day. And who might you be?", YlaineBarrett);
            a.AddAction(eActionType.Message, "Tell Ylaine Barrett your name.", (eTextType)2);
            a.AddAction(eActionType.Talk, "I see, you're a fighter. Has Mistress Laws, Master Reginald, or Delore sent you here to help me out? Why don't they just send you out after the goo? That's all I really want. You know, I don't remember that there were that many of these strange creatures crawling around the village [before].", YlaineBarrett);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Whisper, "before", YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "Yes, well, before, well, before they came. Don't you remember? That night? All day long, everything's fine. Set itself uop for a fine next day, as well! The night, it was clear. Not a sign of a storm in sight! Why, no one prepared for it! Then, in the darkest part, suddenly, the storm starts! We were woken from the noise of it! It was awful, but we didn't dare go outside! Some of the men, they did, but they came back pale as a corpse! Were shaken to their core! And some of these being the fightin' men! Best of the town! Aye, but the [swamp goo].", YlaineBarrett);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Whisper, "swamp goo", YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 1, (eComparator)3);
            a.AddAction(eActionType.Talk, "They've gotten into the food cellar! The slimy things were creeping all over that place! I've gotten rid of most of the swamp goo, but I know there's more just outside town working their way to my food stores. I think you could do a small favor for us all and get rid of some. Oh and while you are at it, the skin of the swamp goo, I've some uses for it. I'll pay you for a swamp goo skin. Just go and get me one of their skins, and I'll be satisfied with ya.", YlaineBarrett);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(MistressLaws, -1);
            a.AddTrigger(eTriggerType.EnemyKilled, "swamp goo", null);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 2, (eComparator)3);
            a.AddAction(eActionType.GiveItem, slimyswampgooskin, null);
            a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.Interact, null, YlaineBarrett);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Oh, you're back! Did you see how many there were? They are a nuisance, aren't they! Well, have you got me the skin?", YlaineBarrett);
            AddBehaviour(a);
            a = builder.CreateBehaviour(YlaineBarrett, -1);
            a.AddTrigger(eTriggerType.GiveItem, YlaineBarrett, slimyswampgooskin);
            a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Albion.Cellarinfestation), 3, (eComparator)3);
            a.AddAction(eActionType.Talk, "Ah, a good and slimy one! It's odd, these creatures, they've got some strangeness about them, but they've got their uses, as well. Thank you, then. Here, I promised I'd pay ya, and I will!", YlaineBarrett);
            a.AddAction(eActionType.GiveGold, 330, null);
            a.AddAction(eActionType.GiveXP, 11, null);
            a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Albion.Cellarinfestation), null);
            AddBehaviour(a);

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            if (MistressLaws != null)
            {
                MistressLaws.AddQuestToGive(typeof(Cellarinfestation));
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #20
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

            addrir = GetAddrir();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Aethic", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                aethic = new GameNPC();
                aethic.Model = 361;
                aethic.Name = "Aethic";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find" + aethic.Name + " , creating ...");
                aethic.GuildName = "Part of " + questTitle + " Quest";
                aethic.Realm = eRealm.Hibernia;
                aethic.CurrentRegionID = 200;
                aethic.Size = 49;
                aethic.Level = 21;
                aethic.X = GameLocation.ConvertLocalXToGlobalX(23761, 200);
                aethic.Y = GameLocation.ConvertLocalYToGlobalY(45658, 200);
                aethic.Z = 5448;
                aethic.Heading = 320;
                //aethic.EquipmentTemplateID = "1707754";
                //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)
                    aethic.SaveIntoDatabase();
                aethic.AddToWorld();
            }
            else
                aethic = npcs[0] as GameStableMaster;

            npcs = WorldMgr.GetNPCsByName("Freagus", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                freagus = new GameStableMaster();
                freagus.Model = 361;
                freagus.Name = "Freagus";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + freagus.Name + ", creating ...");
                freagus.GuildName = "Stable Master";
                freagus.Realm = eRealm.Hibernia;
                freagus.CurrentRegionID = 200;
                freagus.Size = 48;
                freagus.Level = 30;
                freagus.X = 341008;
                freagus.Y = 469180;
                freagus.Z = 5200;
                freagus.Heading = 1934;
                freagus.EquipmentTemplateID = "3800664";

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

            npcs = WorldMgr.GetNPCsByName("Rumdor", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Rumdor, creating ...");
                rumdor = new GameStableMaster();
                rumdor.Model = 361;
                rumdor.Name = "Rumdor";
                rumdor.GuildName = "Stable Master";
                rumdor.Realm = eRealm.Hibernia;
                rumdor.CurrentRegionID = 200;
                rumdor.Size = 53;
                rumdor.Level = 33;
                rumdor.X = 347175;
                rumdor.Y = 491836;
                rumdor.Z = 5226;
                rumdor.Heading = 1262;
                rumdor.EquipmentTemplateID = "3800664";

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

                rumdor.AddToWorld();
            }
            else
                rumdor = npcs[0] as GameStableMaster;

            GameObject[] objects = WorldMgr.GetObjectsByName("Truichon", eRealm.Hibernia,typeof(GameStableMaster));
            if (npcs.Length == 0)
            {
                truichon = new GameStableMaster();
                truichon.Model = 361;
                truichon.Name = "Truichon";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + truichon.Name + ", creating ...");
                truichon.GuildName = "Stable Master";
                truichon.Realm = eRealm.Hibernia;
                truichon.CurrentRegionID = 1;
                truichon.Size = 50;
                truichon.Level = 33;
                truichon.X = 343464;
                truichon.Y = 526708;
                truichon.Z = 5448;
                truichon.Heading = 68;
                //truichon.EquipmentTemplateID = "5448";

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

            #endregion

            #region defineItems

            ticketToTirnamBeo = GameServer.Database.FindObjectByKey<ItemTemplate>("hs_magmell_tirnambeo");
            if (ticketToTirnamBeo == null)
                ticketToTirnamBeo = CreateTicketTo("Tir na mBeo", "hs_magmell_tirnambeo");
            ticketToArdee = GameServer.Database.FindObjectByKey<ItemTemplate>("hs_tirnambeo_ardee");
            if (ticketToArdee == null)
                ticketToArdee = CreateTicketTo("Ardee", "hs_tirnambeo_ardee");

            recruitsDiary = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_diary");
            if (recruitsDiary == null)
            {
                recruitsDiary = new ItemTemplate();
                recruitsDiary.Name = "Recruits Diary";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsDiary.Name + " , creating it ...");
                recruitsDiary.Weight = 3;
                recruitsDiary.Model = 500;
                recruitsDiary.Object_Type = (int)eObjectType.GenericItem;
                recruitsDiary.Id_nb = "recruits_diary";
                recruitsDiary.IsPickable = true;
                recruitsDiary.IsDropable = false;

                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsDiary);
            }

            sackOfSupplies = GameServer.Database.FindObjectByKey<ItemTemplate>("sack_of_supplies");
            if (sackOfSupplies == null)
            {
                sackOfSupplies = new ItemTemplate();
                sackOfSupplies.Name = "Sack of Supplies";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ...");

                sackOfSupplies.Weight = 10;
                sackOfSupplies.Model = 488;

                sackOfSupplies.Object_Type = (int) eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(sackOfSupplies);
            }

            crateOfVegetables = GameServer.Database.FindObjectByKey<ItemTemplate>("crate_of_vegetables");
            if (crateOfVegetables == null)
            {
                crateOfVegetables = new ItemTemplate();
                crateOfVegetables.Name = "Crate of Vegetables";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ...");

                crateOfVegetables.Weight = 15;
                crateOfVegetables.Model = 602;

                crateOfVegetables.Object_Type = (int) eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(crateOfVegetables);
            }

            // item db check
            recruitsCloak = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_cloak_hib");
            if (recruitsCloak == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Recruit's Cloak, creating it ...");
                recruitsCloak = new ItemTemplate();
                recruitsCloak.Name = "Recruit's Cloak (Hib)";
                recruitsCloak.Level = 3;

                recruitsCloak.Weight = 3;
                recruitsCloak.Model = 57;

                recruitsCloak.Object_Type = (int) eObjectType.Cloth;
                recruitsCloak.Item_Type = (int) eEquipmentItems.CLOAK;
                recruitsCloak.Id_nb = "recruits_cloak_hib";
                recruitsCloak.Price = Money.GetMoney(0,0,0,1,0);
                recruitsCloak.IsPickable = true;
                recruitsCloak.IsDropable = true;
                recruitsCloak.Color = 69;

                recruitsCloak.Bonus = 1; // default bonus

                recruitsCloak.Bonus1 = 1;
                recruitsCloak.Bonus1Type = (int) eStat.CON;

                recruitsCloak.Bonus2 = 1;
                recruitsCloak.Bonus2Type = (int) eResist.Slash;

                recruitsCloak.Quality = 100;
                recruitsCloak.Condition = 1000;
                recruitsCloak.MaxCondition = 1000;
                recruitsCloak.Durability = 1000;
                recruitsCloak.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsCloak);
            }

            #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(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir));
            GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir));

            GameEventMgr.AddHandler(freagus, GameLivingEvent.Interact, new DOLEventHandler(TalkToFreagus));
            GameEventMgr.AddHandler(freagus, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFreagus));

            GameEventMgr.AddHandler(aethic, GameLivingEvent.Interact, new DOLEventHandler(TalkToAethic));
            GameEventMgr.AddHandler(aethic, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAethic));

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #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 + "\" 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();

            #endregion defineNPCS

            #region defineItems

            // item db check
            emptyMagicBox = GameServer.Database.FindObjectByKey<ItemTemplate>("empty_wodden_magic_box");
            if (emptyMagicBox == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Empty Wodden Magic Box, creating it ...");
                emptyMagicBox = new ItemTemplate();
                emptyMagicBox.Name = "Empty Wodden Magic Box";

                emptyMagicBox.Weight = 5;
                emptyMagicBox.Model = 602;

                emptyMagicBox.Object_Type = (int)eObjectType.GenericItem;
                emptyMagicBox.Id_nb = "empty_wodden_magic_box";

                emptyMagicBox.IsPickable = true;
                emptyMagicBox.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(emptyMagicBox);
            }

            // item db check
            fullMagicBox = GameServer.Database.FindObjectByKey<ItemTemplate>("full_wodden_magic_box");
            if (fullMagicBox == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Full Wodden Magic Box, creating it ...");
                fullMagicBox = new ItemTemplate();
                fullMagicBox.Name = "Full Wodden Magic Box";

                fullMagicBox.Weight = 3;
                fullMagicBox.Model = 602;

                fullMagicBox.Object_Type = (int)eObjectType.GenericItem;

                fullMagicBox.Id_nb = "full_wodden_magic_box";
                fullMagicBox.IsPickable = true;
                fullMagicBox.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(fullMagicBox);
            }

            // item db check
            recruitsShortSword = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_short_sword");
            if (recruitsShortSword == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Recruit's Short Sword, creating it ...");
                recruitsShortSword = new ItemTemplate();
                recruitsShortSword.Name = "Recruit's Short Sword";
                recruitsShortSword.Level = 4;

                recruitsShortSword.Weight = 18;
                recruitsShortSword.Model = 3; // studded Boots

                recruitsShortSword.DPS_AF = 23; // Armour
                recruitsShortSword.SPD_ABS = 30; // Absorption

                recruitsShortSword.Type_Damage = (int)eDamageType.Slash;
                recruitsShortSword.Object_Type = (int)eObjectType.SlashingWeapon;
                recruitsShortSword.Item_Type = (int)eEquipmentItems.LEFT_HAND;
                recruitsShortSword.Id_nb = "recruits_short_sword";
                recruitsShortSword.Price = Money.GetMoney(0, 0, 0, 2, 0);
                recruitsShortSword.IsPickable = true;
                recruitsShortSword.IsDropable = true;
                recruitsShortSword.Color = 45; // blue metal

                recruitsShortSword.Bonus = 1; // default bonus

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

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

                recruitsShortSword.Quality = 100;
                recruitsShortSword.Condition = 1000;
                recruitsShortSword.MaxCondition = 1000;
                recruitsShortSword.Durability = 1000;
                recruitsShortSword.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(recruitsShortSword);
            }

            // item db check
            recruitsStaff = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_staff");
            if (recruitsStaff == null)
            {
                recruitsStaff = new ItemTemplate();
                recruitsStaff.Name = "Recruit's Staff";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsStaff.Name + ", creating it ...");
                recruitsStaff.Level = 4;

                recruitsStaff.Weight = 45;
                recruitsStaff.Model = 442;

                recruitsStaff.DPS_AF = 24;
                recruitsStaff.SPD_ABS = 45;

                recruitsStaff.Type_Damage = (int)eDamageType.Slash;
                recruitsStaff.Object_Type = (int)eObjectType.Staff;
                recruitsStaff.Item_Type = (int)eEquipmentItems.LEFT_HAND;
                recruitsStaff.Id_nb = "recruits_staff";
                recruitsStaff.Price = Money.GetMoney(0, 0, 0, 2, 0);
                recruitsStaff.IsPickable = true;
                recruitsStaff.IsDropable = true;
                recruitsStaff.Color = 45; // blue metal

                recruitsStaff.Bonus = 1; // default bonus

                recruitsStaff.Bonus1 = 3;
                recruitsStaff.Bonus1Type = (int)eStat.INT;

                recruitsStaff.Bonus2 = 1;
                recruitsStaff.Bonus2Type = (int)eResist.Crush;

                recruitsStaff.Quality = 100;
                recruitsStaff.Condition = 1000;
                recruitsStaff.MaxCondition = 1000;
                recruitsStaff.Durability = 1000;
                recruitsStaff.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(recruitsStaff);
            }

            #endregion defineItems

            fairyArea = WorldMgr.GetRegion(fairyLocation.RegionID).AddArea(new Area.Circle("Fairy contamined Area", fairyLocation.X, fairyLocation.Y, 0, 1500));
            fairyArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterFairyArea));

            /* 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(Nuisances));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #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 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("Master Briedi", eRealm.Midgard);
            if (npcs.Length == 0)
            {
                briedi = new GameNPC();
                briedi.Model = 157;
                briedi.Name = "Master Briedi";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + briedi.Name + ", creating him ...");
                briedi.GuildName = "Part of " + questTitle + " Quest";
                briedi.Realm = eRealm.Midgard;
                briedi.CurrentRegionID = 100;

                briedi.Size = 50;
                briedi.Level = 45;
                briedi.X = GameLocation.ConvertLocalXToGlobalX(26240, 103);
                briedi.Y = GameLocation.ConvertLocalYToGlobalY(15706, 103);
                briedi.Z = 4489;
                briedi.Heading = 292;

                GameNpcInventoryTemplate 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);
                briedi.Inventory = template.CloseTemplate();
                briedi.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //				briedi.AddNPCEquipment((byte) eEquipmentItems.TORSO, 348, 0, 0, 0);
            //				briedi.AddNPCEquipment((byte) eEquipmentItems.LEGS, 349, 0, 0, 0);
            //				briedi.AddNPCEquipment((byte) eEquipmentItems.ARMS, 350, 0, 0, 0);
            //				briedi.AddNPCEquipment((byte) eEquipmentItems.HAND, 351, 0, 0, 0);
            //				briedi.AddNPCEquipment((byte) eEquipmentItems.FEET, 352, 0, 0, 0);
            //				briedi.AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 640, 0, 0, 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)
                {
                    briedi.SaveIntoDatabase();
                }
                briedi.AddToWorld();
            }
            else
                briedi = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Princess Aiyr", eRealm.None);
            if (npcs.Length == 0)
            {
                princessAiyr = new GameNPC();

                princessAiyr.Name = "Princess Aiyr";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + princessAiyr.Name + ", creating ...");
                princessAiyr.X = GameLocation.ConvertLocalXToGlobalX(39315, 100);
                princessAiyr.Y = GameLocation.ConvertLocalYToGlobalY(38957, 100);
                princessAiyr.Z = 5460;
                princessAiyr.Heading = 1;
                princessAiyr.Model = 678;
                princessAiyr.GuildName = "Part of " + questTitle + " Quest";
                princessAiyr.Realm = eRealm.None;
                princessAiyr.CurrentRegionID = 100;
                princessAiyr.Size = 49;
                princessAiyr.Level = 3;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 80;
                brain.AggroRange = 1000;
                princessAiyr.SetOwnBrain(brain);

                if (SAVE_INTO_DATABASE)
                    princessAiyr.SaveIntoDatabase();
                princessAiyr.AddToWorld();
            }
            else
            {
                princessAiyr = npcs[0];
            }

            int counter = 0;
            foreach (GameNPC npc in princessAiyr.GetNPCsInRadius(500))
            {
                if (npc.Name == "askefruer sorceress")
                {
                    askefruerSorceress[counter] = npc;
                    counter++;
                }
                if (counter == askefruerSorceress.Length)
                    break;
            }

            for (int i = 0; i < askefruerSorceress.Length; i++)
            {
                if (askefruerSorceress[i] == null)
                {
                    askefruerSorceress[i] = new GameNPC();
                    askefruerSorceress[i].Model = 678;
                    askefruerSorceress[i].Name = "askefruer sorceress";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + askefruerSorceress[i].Name + ", creating ...");
                    askefruerSorceress[i].GuildName = "Part of " + questTitle + " Quest";
                    askefruerSorceress[i].Realm = eRealm.None;
                    askefruerSorceress[i].CurrentRegionID = 100;
                    askefruerSorceress[i].Size = 35;
                    askefruerSorceress[i].Level = 3;
                    askefruerSorceress[i].X = princessAiyr.X + Util.Random(-150, 150);
                    askefruerSorceress[i].Y = princessAiyr.Y + Util.Random(-150, 150);
                    askefruerSorceress[i].Z = princessAiyr.Z;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 30;
                    brain.AggroRange = 300;
                    askefruerSorceress[i].SetOwnBrain(brain);

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

            #endregion

            #region defineItems

            coastalWolfBlood = GameServer.Database.FindObjectByKey<ItemTemplate>("coastal_wolf_blood");
            if (coastalWolfBlood == null)
            {
                coastalWolfBlood = new ItemTemplate();
                coastalWolfBlood.Name = "Coastal Wolf Blood";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + coastalWolfBlood.Name + " , creating it ...");

                coastalWolfBlood.Weight = 110;
                coastalWolfBlood.Model = 99;

                coastalWolfBlood.Object_Type = (int) eObjectType.GenericItem;

                coastalWolfBlood.Id_nb = "coastal_wolf_blood";
                coastalWolfBlood.IsPickable = true;
                coastalWolfBlood.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(coastalWolfBlood);
            }

            tatteredShirt = GameServer.Database.FindObjectByKey<ItemTemplate>("tattered_shirt");
            if (tatteredShirt == null)
            {
                tatteredShirt = new ItemTemplate();
                tatteredShirt.Name = "Tattered Shirt";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + tatteredShirt.Name + " , creating it ...");

                tatteredShirt.Weight = 10;
                tatteredShirt.Model = 139;

                tatteredShirt.Object_Type = (int) eObjectType.GenericItem;

                tatteredShirt.Id_nb = "tattered_shirt";
                tatteredShirt.IsPickable = true;
                tatteredShirt.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(tatteredShirt);
            }

            scrollBriedi = GameServer.Database.FindObjectByKey<ItemTemplate>("scroll_for_briedi");
            if (scrollBriedi == null)
            {
                scrollBriedi = new ItemTemplate();
                scrollBriedi.Name = "Scroll for Master Briedi";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + scrollBriedi.Name + " , creating it ...");

                scrollBriedi.Weight = 10;
                scrollBriedi.Model = 498;

                scrollBriedi.Object_Type = (int) eObjectType.GenericItem;

                scrollBriedi.Id_nb = "scroll_for_briedi";
                scrollBriedi.IsPickable = true;
                scrollBriedi.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(scrollBriedi);
            }

            listBriedi = GameServer.Database.FindObjectByKey<ItemTemplate>("list_for_briedi");
            if (listBriedi == null)
            {
                listBriedi = new ItemTemplate();
                listBriedi.Name = "List for Master Briedi";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + listBriedi.Name + " , creating it ...");

                listBriedi.Weight = 10;
                listBriedi.Model = 498;

                listBriedi.Object_Type = (int) eObjectType.GenericItem;

                listBriedi.Id_nb = "list_for_briedi";
                listBriedi.IsPickable = true;
                listBriedi.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(listBriedi);
            }

            smieraGattoClaw = GameServer.Database.FindObjectByKey<ItemTemplate>("smiera_gatto_claw");
            if (smieraGattoClaw == null)
            {
                smieraGattoClaw = new ItemTemplate();
                smieraGattoClaw.Name = "Smiera-Gatto's Claw";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + smieraGattoClaw.Name + " , creating it ...");

                smieraGattoClaw.Weight = 2;
                smieraGattoClaw.Model = 106;

                smieraGattoClaw.Object_Type = (int) eObjectType.GenericItem;

                smieraGattoClaw.Id_nb = "smiera_gatto_claw";
                smieraGattoClaw.IsPickable = true;
                smieraGattoClaw.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(smieraGattoClaw);
            }

            princessAiyrHead = GameServer.Database.FindObjectByKey<ItemTemplate>("princess_ayir_head");
            if (princessAiyrHead == null)
            {
                princessAiyrHead = new ItemTemplate();
                princessAiyrHead.Name = "Princess Ayir's Head";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + princessAiyrHead.Name + " , creating it ...");

                princessAiyrHead.Weight = 15;
                princessAiyrHead.Model = 503;

                princessAiyrHead.Object_Type = (int) eObjectType.GenericItem;

                princessAiyrHead.Id_nb = "princess_ayir_head";
                princessAiyrHead.IsPickable = true;
                princessAiyrHead.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(princessAiyrHead);
            }

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

                recruitsHelm.Weight = 24;
                recruitsHelm.Model = 824; // studded vest

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

                recruitsHelm.Object_Type = (int) eObjectType.Studded;
                recruitsHelm.Item_Type = (int) eEquipmentItems.HEAD;
                recruitsHelm.Id_nb = "recruits_studded_helm_mid";
                recruitsHelm.Price = Money.GetMoney(0,0,0,9,0);
                recruitsHelm.IsPickable = true;
                recruitsHelm.IsDropable = true;
                recruitsHelm.Color = 14; // blue leather

                recruitsHelm.Bonus = 5; // default bonus

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

                recruitsHelm.Bonus2 = 1;
                recruitsHelm.Bonus2Type = (int) eResist.Spirit;

                recruitsHelm.Bonus3 = 12;
                recruitsHelm.Bonus3Type = (int) eProperty.MaxHealth;

                recruitsHelm.Quality = 100;
                recruitsHelm.Condition = 1000;
                recruitsHelm.MaxCondition = 1000;
                recruitsHelm.Durability = 1000;
                recruitsHelm.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsHelm);
            }

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

                recruitsCap.Weight = 8;
                recruitsCap.Model = 822; // studded vest

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

                recruitsCap.Object_Type = (int) eObjectType.Cloth;
                recruitsCap.Item_Type = (int) eEquipmentItems.HEAD;
                recruitsCap.Id_nb = "recruits_quilted_cap";
                recruitsCap.Price = Money.GetMoney(0,0,0,9,0);
                recruitsCap.IsPickable = true;
                recruitsCap.IsDropable = true;
                recruitsCap.Color = 36; // blue cloth

                recruitsCap.Bonus = 5; // default bonus

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

                recruitsCap.Bonus2 = 20;
                recruitsCap.Bonus2Type = (int) eProperty.MaxHealth;

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

                recruitsCap.Quality = 100;
                recruitsCap.Condition = 1000;
                recruitsCap.MaxCondition = 1000;
                recruitsCap.Durability = 1000;
                recruitsCap.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsCap);
            }

            recruitsRing = GameServer.Database.FindObjectByKey<ItemTemplate>("recruits_pewter_ring");
            if (recruitsRing == null)
            {
                recruitsRing = new ItemTemplate();
                recruitsRing.Name = "Recruit's Pewter Ring";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + recruitsRing.Name + ", creating it ...");
                recruitsRing.Level = 6;

                recruitsRing.Weight = 2;
                recruitsRing.Model = 103;

                recruitsRing.Object_Type = (int) eObjectType.Magical;
                recruitsRing.Item_Type = (int) eEquipmentItems.R_RING;
                recruitsRing.Id_nb = "recruits_pewter_ring";
                recruitsRing.Price = Money.GetMoney(0,0,0,9,0);
                recruitsRing.IsPickable = true;
                recruitsRing.IsDropable = true;

                recruitsRing.Bonus = 5; // default bonus

                recruitsRing.Bonus1 = 4;
                recruitsRing.Bonus1Type = (int) eStat.CON;

                recruitsRing.Bonus2 = 1;
                recruitsRing.Bonus2Type = (int) eResist.Crush;

                recruitsRing.Bonus3 = 12;
                recruitsRing.Bonus3Type = (int) eProperty.MaxHealth;

                recruitsRing.Quality = 100;
                recruitsRing.Condition = 1000;
                recruitsRing.MaxCondition = 1000;
                recruitsRing.Durability = 1000;
                recruitsRing.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
                if (SAVE_INTO_DATABASE)
                    GameServer.Database.AddObject(recruitsRing);
            }

            #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.
            */
            //We want to be notified whenever a player enters the world
            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(briedi, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterBriedi));
            GameEventMgr.AddHandler(briedi, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterBriedi));

            GameEventMgr.AddHandler(princessAiyr, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearPrincessAyir));

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

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

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

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

            GameNPC[] npcs;

            npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.NPCKreimhilde"), (eRealm)2);
            if (npcs.Length == 0)
            {
                VikingKreimhilde       = new DOL.GS.GameNPC();
                VikingKreimhilde.Model = 218;
                VikingKreimhilde.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.ABearyBadProblem.NPCKreimhilde");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + VikingKreimhilde.Name + ", creating ...");
                }

                VikingKreimhilde.GuildName       = "Part of " + questTitle + " Quest";
                VikingKreimhilde.Realm           = eRealm.Midgard;
                VikingKreimhilde.CurrentRegionID = 100;
                VikingKreimhilde.Size            = 51;
                VikingKreimhilde.Level           = 50;
                VikingKreimhilde.MaxSpeedBase    = 191;
                VikingKreimhilde.Faction         = FactionMgr.GetFactionByID(0);
                VikingKreimhilde.X               = 803999;
                VikingKreimhilde.Y               = 726551;
                VikingKreimhilde.Z               = 4752;
                VikingKreimhilde.Heading         = 2116;
                VikingKreimhilde.RespawnInterval = -1;
                VikingKreimhilde.BodyType        = 0;

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

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

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

            silverringofhealth = GameServer.Database.FindObjectByKey <ItemTemplate>("silverringofhealth");
            if (silverringofhealth == null)
            {
                silverringofhealth      = new ItemTemplate();
                silverringofhealth.Name = "Silver Ring of Health";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + silverringofhealth.Name + ", creating it ...");
                }

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

                GameServer.Database.AddObject(silverringofhealth);
            }

            blackmaulercubpelt = GameServer.Database.FindObjectByKey <ItemTemplate>("blackmaulercubpelt");
            if (blackmaulercubpelt == null)
            {
                blackmaulercubpelt      = new ItemTemplate();
                blackmaulercubpelt.Name = "Black Mauler Cub Pelt";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + blackmaulercubpelt.Name + ", creating it ...");
                }

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

                GameServer.Database.AddObject(blackmaulercubpelt);
            }

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

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

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            VikingKreimhilde.AddQuestToGive(typeof(Abearybadproblem));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #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 ...");
            }

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

            #endregion

            #region defineItems

            // item db check
            emptyMagicBox = GameServer.Database.FindObjectByKey <ItemTemplate>("empty_wodden_magic_box");
            if (emptyMagicBox == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Empty Wodden Magic Box, creating it ...");
                }
                emptyMagicBox      = new ItemTemplate();
                emptyMagicBox.Name = "Empty Wodden Magic Box";

                emptyMagicBox.Weight = 5;
                emptyMagicBox.Model  = 602;

                emptyMagicBox.Object_Type = (int)eObjectType.GenericItem;
                emptyMagicBox.Id_nb       = "empty_wodden_magic_box";

                emptyMagicBox.IsPickable = true;
                emptyMagicBox.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(emptyMagicBox);
                }
            }

            // item db check
            fullMagicBox = GameServer.Database.FindObjectByKey <ItemTemplate>("full_wodden_magic_box");
            if (fullMagicBox == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Full Wodden Magic Box, creating it ...");
                }
                fullMagicBox      = new ItemTemplate();
                fullMagicBox.Name = "Full Wodden Magic Box";

                fullMagicBox.Weight = 3;
                fullMagicBox.Model  = 602;

                fullMagicBox.Object_Type = (int)eObjectType.GenericItem;

                fullMagicBox.Id_nb      = "full_wodden_magic_box";
                fullMagicBox.IsPickable = true;
                fullMagicBox.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(fullMagicBox);
                }
            }

            // item db check
            recruitsShortSword = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_short_sword_mid");
            if (recruitsShortSword == null)
            {
                recruitsShortSword      = new ItemTemplate();
                recruitsShortSword.Name = "Recruit's Short Sword (Mid)";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + recruitsShortSword.Name + ", creating it ...");
                }
                recruitsShortSword.Level = 4;

                recruitsShortSword.Weight = 18;
                recruitsShortSword.Model  = 3;                // studded Boots

                recruitsShortSword.DPS_AF  = 23;              // Armour
                recruitsShortSword.SPD_ABS = 30;              // Absorption

                recruitsShortSword.Type_Damage = (int)eDamageType.Slash;
                recruitsShortSword.Object_Type = (int)eObjectType.Sword;
                recruitsShortSword.Item_Type   = (int)eEquipmentItems.LEFT_HAND;
                recruitsShortSword.Id_nb       = "recruits_short_sword_mid";
                recruitsShortSword.Price       = Money.GetMoney(0, 0, 0, 2, 0);
                recruitsShortSword.IsPickable  = true;
                recruitsShortSword.IsDropable  = true;
                recruitsShortSword.Color       = 61;

                recruitsShortSword.Bonus = 1;                 // default bonus

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

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

                recruitsShortSword.Quality       = 100;
                recruitsShortSword.Condition     = 1000;
                recruitsShortSword.MaxCondition  = 1000;
                recruitsShortSword.Durability    = 1000;
                recruitsShortSword.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(recruitsShortSword);
                }
            }

            // item db check
            recruitsStaff = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_staff");
            if (recruitsStaff == null)
            {
                recruitsStaff      = new ItemTemplate();
                recruitsStaff.Name = "Recruit's Staff";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + recruitsStaff.Name + ", creating it ...");
                }
                recruitsStaff.Level = 4;

                recruitsStaff.Weight = 45;
                recruitsStaff.Model  = 442;

                recruitsStaff.DPS_AF  = 24;
                recruitsStaff.SPD_ABS = 45;

                recruitsStaff.Type_Damage = (int)eDamageType.Slash;
                recruitsStaff.Object_Type = (int)eObjectType.Staff;
                recruitsStaff.Item_Type   = (int)eEquipmentItems.LEFT_HAND;
                recruitsStaff.Id_nb       = "recruits_staff";
                recruitsStaff.Price       = Money.GetMoney(0, 0, 0, 2, 0);
                recruitsStaff.IsPickable  = true;
                recruitsStaff.IsDropable  = true;
                recruitsStaff.Color       = 61;

                recruitsStaff.Bonus = 1;                 // default bonus

                recruitsStaff.Bonus1     = 3;
                recruitsStaff.Bonus1Type = (int)eStat.INT;

                recruitsStaff.Bonus2     = 1;
                recruitsStaff.Bonus2Type = (int)eResist.Crush;

                recruitsStaff.Quality       = 100;
                recruitsStaff.Condition     = 1000;
                recruitsStaff.MaxCondition  = 1000;
                recruitsStaff.Durability    = 1000;
                recruitsStaff.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(recruitsStaff);
                }
            }

            #endregion

            askefruerArea = WorldMgr.GetRegion(askefruerLocation.RegionID).AddArea(new Area.Circle("Askefruer contamined Area", askefruerLocation.X, askefruerLocation.Y, 0, 1500));
            askefruerArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterAskefruerArea));

            /* 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));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #25
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("Kealan", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no Sir Quait 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)
            {
                kealan       = new GameNPC();
                kealan.Model = 281;
                kealan.Name  = "Kealan";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + kealan.Name + ", creating him ...");
                }

                kealan.GuildName       = "Part of " + questTitle + " Quest";
                kealan.Realm           = eRealm.Albion;
                kealan.CurrentRegionID = 1;
                kealan.Size            = 48;
                kealan.Level           = 32;
                kealan.X       = 493414;
                kealan.Y       = 593089;
                kealan.Z       = 1797;
                kealan.Heading = 830;

                kealan.EquipmentTemplateID = "11704675";

                //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)
                {
                    kealan.SaveIntoDatabase();
                }


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

            npcs = WorldMgr.GetNPCsByName("Arachneida", eRealm.None);
            if (npcs.Length == 0)
            {
                arachneida       = new GameNPC();
                arachneida.Model = 72;
                arachneida.Name  = "Arachneida";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + arachneida.Name + ", creating her ...");
                }

                arachneida.GuildName       = "Part of " + questTitle + " Quest";
                arachneida.Realm           = eRealm.None;
                arachneida.CurrentRegionID = 1;
                arachneida.Size            = 90;
                arachneida.Level           = 12;
                arachneida.X       = 534851;
                arachneida.Y       = 609656;
                arachneida.Z       = 2456;
                arachneida.Heading = 2080;

                arachneida.EquipmentTemplateID = "2";

                //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)
                {
                    arachneida.SaveIntoDatabase();
                }

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

            #endregion

            #region defineItems

            spiderSilkenRobe = GameServer.Database.FindObjectByKey <ItemTemplate>("spider_silken_robe");
            if (spiderSilkenRobe == null)
            {
                spiderSilkenRobe      = new ItemTemplate();
                spiderSilkenRobe.Name = "Spider Silken Robe";

                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + spiderSilkenRobe.Name + ", creating it ...");
                }
                spiderSilkenRobe.Level  = 20;
                spiderSilkenRobe.Weight = 5;
                spiderSilkenRobe.Model  = 58;

                spiderSilkenRobe.Bonus      = 5;
                spiderSilkenRobe.Bonus1     = 3;
                spiderSilkenRobe.Bonus1Type = (int)eStat.DEX;
                ;

                spiderSilkenRobe.Bonus2     = 3;
                spiderSilkenRobe.Bonus2Type = (int)eStat.INT;

                spiderSilkenRobe.Bonus3     = 6;
                spiderSilkenRobe.Bonus3Type = (int)eProperty.MaxHealth;

                spiderSilkenRobe.DPS_AF  = 18;
                spiderSilkenRobe.SPD_ABS = 0;

                spiderSilkenRobe.Object_Type = (int)eObjectType.Cloth;
                spiderSilkenRobe.Item_Type   = (int)eEquipmentItems.TORSO;
                spiderSilkenRobe.Id_nb       = "spider_silken_robe";
                spiderSilkenRobe.Price       = Money.GetMoney(0, 0, 0, 8, 3);
                spiderSilkenRobe.IsPickable  = true;
                spiderSilkenRobe.IsDropable  = true;
                //spiderSilkenRobe.Color = 44;
                spiderSilkenRobe.Quality       = 100;
                spiderSilkenRobe.Condition     = 1000;
                spiderSilkenRobe.MaxCondition  = 1000;
                spiderSilkenRobe.Durability    = 1000;
                spiderSilkenRobe.MaxDurability = 1000;


                //You don't have to store the created wolfPeltCloak 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(spiderSilkenRobe);
            }

            ringedSpiderChitinTunic = GameServer.Database.FindObjectByKey <ItemTemplate>("ringed_spider_chitin_tunic");
            if (ringedSpiderChitinTunic == null)
            {
                ringedSpiderChitinTunic      = new ItemTemplate();
                ringedSpiderChitinTunic.Name = "Ringed Spider Chitin Tunic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + ringedSpiderChitinTunic.Name + ", creating it ...");
                }

                ringedSpiderChitinTunic.Level  = 17;
                ringedSpiderChitinTunic.Weight = 80;
                ringedSpiderChitinTunic.Model  = 41;

                ringedSpiderChitinTunic.Bonus      = 5;
                ringedSpiderChitinTunic.Bonus1     = 4;
                ringedSpiderChitinTunic.Bonus1Type = (int)eStat.STR;

                ringedSpiderChitinTunic.Bonus2     = 3;
                ringedSpiderChitinTunic.Bonus2Type = (int)eStat.QUI;

                ringedSpiderChitinTunic.Bonus3     = 9;
                ringedSpiderChitinTunic.Bonus3Type = (int)eProperty.MaxHealth;

                ringedSpiderChitinTunic.DPS_AF  = 28;
                ringedSpiderChitinTunic.SPD_ABS = 27;

                ringedSpiderChitinTunic.Object_Type = (int)eObjectType.Chain;
                ringedSpiderChitinTunic.Item_Type   = (int)eEquipmentItems.TORSO;
                ringedSpiderChitinTunic.Id_nb       = "ringed_spider_chitin_tunic";
                ringedSpiderChitinTunic.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                ringedSpiderChitinTunic.IsPickable  = true;
                ringedSpiderChitinTunic.IsDropable  = true;

                ringedSpiderChitinTunic.Color         = 45;
                ringedSpiderChitinTunic.Quality       = 100;
                ringedSpiderChitinTunic.Condition     = 1000;
                ringedSpiderChitinTunic.MaxCondition  = 1000;
                ringedSpiderChitinTunic.Durability    = 1000;
                ringedSpiderChitinTunic.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(ringedSpiderChitinTunic);
            }

            studdedSpiderEyeVest = GameServer.Database.FindObjectByKey <ItemTemplate>("studded_spider_eye_vest");
            if (studdedSpiderEyeVest == null)
            {
                studdedSpiderEyeVest      = new ItemTemplate();
                studdedSpiderEyeVest.Name = "Studded Spider Eye Vest";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + studdedSpiderEyeVest.Name + ", creating it ...");
                }

                studdedSpiderEyeVest.Level  = 17;
                studdedSpiderEyeVest.Weight = 60;
                studdedSpiderEyeVest.Model  = 51;

                studdedSpiderEyeVest.Bonus      = 5;
                studdedSpiderEyeVest.Bonus1     = 3;
                studdedSpiderEyeVest.Bonus1Type = (int)eStat.QUI;

                studdedSpiderEyeVest.Bonus2     = 2;
                studdedSpiderEyeVest.Bonus2Type = (int)eStat.PIE;

                studdedSpiderEyeVest.Bonus3     = 9;
                studdedSpiderEyeVest.Bonus3Type = (int)eProperty.MaxHealth;

                studdedSpiderEyeVest.DPS_AF  = 28;
                studdedSpiderEyeVest.SPD_ABS = 19;

                studdedSpiderEyeVest.Object_Type = (int)eObjectType.Studded;
                studdedSpiderEyeVest.Item_Type   = (int)eEquipmentItems.TORSO;
                studdedSpiderEyeVest.Id_nb       = "studded_spider_eye_vest";
                studdedSpiderEyeVest.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                studdedSpiderEyeVest.IsPickable  = true;
                studdedSpiderEyeVest.IsDropable  = true;

                studdedSpiderEyeVest.Color         = 45;
                studdedSpiderEyeVest.Quality       = 100;
                studdedSpiderEyeVest.Condition     = 1000;
                studdedSpiderEyeVest.MaxCondition  = 1000;
                studdedSpiderEyeVest.Durability    = 1000;
                studdedSpiderEyeVest.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(studdedSpiderEyeVest);
            }

            spiderEmblazonedTunic = GameServer.Database.FindObjectByKey <ItemTemplate>("spider_emblazoned_tunic");
            if (spiderEmblazonedTunic == null)
            {
                spiderEmblazonedTunic      = new ItemTemplate();
                spiderEmblazonedTunic.Name = "Spider Emblazoned Tunic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + spiderEmblazonedTunic.Name + ", creating it ...");
                }
                spiderEmblazonedTunic.Level  = 17;
                spiderEmblazonedTunic.Weight = 40;
                spiderEmblazonedTunic.Model  = 31;

                spiderEmblazonedTunic.Bonus      = 5;
                spiderEmblazonedTunic.Bonus1     = 2;
                spiderEmblazonedTunic.Bonus1Type = (int)eStat.STR;

                spiderEmblazonedTunic.Bonus2     = 3;
                spiderEmblazonedTunic.Bonus2Type = (int)eStat.PIE;

                spiderEmblazonedTunic.Bonus3     = 9;
                spiderEmblazonedTunic.Bonus3Type = (int)eProperty.MaxHealth;

                spiderEmblazonedTunic.DPS_AF  = 28;
                spiderEmblazonedTunic.SPD_ABS = 10;

                spiderEmblazonedTunic.Object_Type = (int)eObjectType.Leather;
                spiderEmblazonedTunic.Item_Type   = (int)eEquipmentItems.TORSO;
                spiderEmblazonedTunic.Id_nb       = "spider_emblazoned_tunic";
                spiderEmblazonedTunic.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                spiderEmblazonedTunic.IsPickable  = true;
                spiderEmblazonedTunic.IsDropable  = true;

                spiderEmblazonedTunic.Color         = 45;
                spiderEmblazonedTunic.Quality       = 100;
                spiderEmblazonedTunic.Condition     = 1000;
                spiderEmblazonedTunic.MaxCondition  = 1000;
                spiderEmblazonedTunic.Durability    = 1000;
                spiderEmblazonedTunic.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(spiderEmblazonedTunic);
            }

            embossedSpiderTunic = GameServer.Database.FindObjectByKey <ItemTemplate>("embossed_spider_tunic");
            if (embossedSpiderTunic == null)
            {
                embossedSpiderTunic      = new ItemTemplate();
                embossedSpiderTunic.Name = "Embossed Spider Tunic";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + embossedSpiderTunic.Name + ", creating it ...");
                }

                embossedSpiderTunic.Level  = 17;
                embossedSpiderTunic.Weight = 40;
                embossedSpiderTunic.Model  = 31;

                embossedSpiderTunic.Bonus      = 5;
                embossedSpiderTunic.Bonus1     = 2;
                embossedSpiderTunic.Bonus1Type = (int)eStat.STR;

                embossedSpiderTunic.Bonus2     = 2;
                embossedSpiderTunic.Bonus2Type = (int)eStat.DEX;

                embossedSpiderTunic.Bonus3     = 12;
                embossedSpiderTunic.Bonus3Type = (int)eProperty.MaxHealth;

                embossedSpiderTunic.DPS_AF  = 28;
                embossedSpiderTunic.SPD_ABS = 10;

                embossedSpiderTunic.Object_Type = (int)eObjectType.Leather;
                embossedSpiderTunic.Item_Type   = (int)eEquipmentItems.TORSO;
                embossedSpiderTunic.Id_nb       = "embossed_spider_tunic";
                embossedSpiderTunic.Price       = Money.GetMoney(0, 0, 0, 9, 3);
                embossedSpiderTunic.IsPickable  = true;
                embossedSpiderTunic.IsDropable  = true;

                embossedSpiderTunic.Color         = 45;
                embossedSpiderTunic.Quality       = 100;
                embossedSpiderTunic.Condition     = 1000;
                embossedSpiderTunic.MaxCondition  = 1000;
                embossedSpiderTunic.Durability    = 1000;
                embossedSpiderTunic.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(embossedSpiderTunic);
            }

            bloatedFang = GameServer.Database.FindObjectByKey <ItemTemplate>("bloated_spider_fang");
            if (bloatedFang == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find  Bloated spider fang, creating it ...");
                }
                bloatedFang             = new ItemTemplate();
                bloatedFang.Object_Type = (int)eObjectType.GenericItem;
                bloatedFang.Weight      = 10;
                bloatedFang.Id_nb       = "bloated_spider_fang";
                bloatedFang.Name        = "Bloated spider fang";
                bloatedFang.Model       = 106;
                bloatedFang.IsDropable  = false;
                bloatedFang.IsPickable  = 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(bloatedFang);
            }

            spiderChitin = GameServer.Database.FindObjectByKey <ItemTemplate>("arachneida_spider_chitin");
            if (spiderChitin == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Arachneida's Chitin, creating it ...");
                }
                spiderChitin             = new ItemTemplate();
                spiderChitin.Object_Type = (int)eObjectType.GenericItem;
                spiderChitin.Weight      = 25;
                spiderChitin.Id_nb       = "arachneida_spider_chitin";
                spiderChitin.Name        = "Arachneida's Chitin";
                spiderChitin.Model       = 108;
                spiderChitin.IsDropable  = false;
                spiderChitin.IsPickable  = 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(spiderChitin);
            }

            #endregion

            /* Now we add some hooks to the Sir Quait 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 Sir Quait 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(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(kealan, GameLivingEvent.Interact, new DOLEventHandler(TalkToKealan));
            GameEventMgr.AddHandler(kealan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToKealan));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #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 ...");
            }

            /* 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("Farmer Asma", eRealm.Albion);
            if (npcs.Length == 0)
            {
                farmerAsma       = new GameNPC();
                farmerAsma.Model = 82;
                farmerAsma.Name  = "Farmer Asma";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + farmerAsma.Name + ", creating him ...");
                }
                farmerAsma.GuildName       = "Part of " + questTitle + " Quest";
                farmerAsma.Realm           = eRealm.Albion;
                farmerAsma.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 31);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 32);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 33);
                farmerAsma.Inventory = template.CloseTemplate();
                farmerAsma.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                farmerAsma.Size    = 50;
                farmerAsma.Level   = 35;
                farmerAsma.X       = 563939;
                farmerAsma.Y       = 509234;
                farmerAsma.Z       = 2744;
                farmerAsma.Heading = 21;

                //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)
                {
                    farmerAsma.SaveIntoDatabase();
                }

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

            #endregion

            #region defineItems

            // item db check
            farmerAsmasMap = GameServer.Database.FindObjectByKey <ItemTemplate>("farmer_asma_map");
            if (farmerAsmasMap == null)
            {
                farmerAsmasMap      = new ItemTemplate();
                farmerAsmasMap.Name = "Farmer Asma's Map";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + farmerAsmasMap.Name + ", creating it ...");
                }
                farmerAsmasMap.Level  = 0;
                farmerAsmasMap.Weight = 1;
                farmerAsmasMap.Model  = 499;

                farmerAsmasMap.Object_Type = (int)eObjectType.GenericItem;
                farmerAsmasMap.Id_nb       = "farmer_asma_map";
                farmerAsmasMap.Price       = 0;
                farmerAsmasMap.IsPickable  = false;
                farmerAsmasMap.IsDropable  = false;

                farmerAsmasMap.Quality       = 100;
                farmerAsmasMap.Condition     = 1000;
                farmerAsmasMap.MaxCondition  = 1000;
                farmerAsmasMap.Durability    = 1000;
                farmerAsmasMap.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(farmerAsmasMap);
            }

            #endregion


            firstFieldArea = WorldMgr.GetRegion(firstField.RegionID).AddArea(new Area.Circle("First Vacant Field", firstField.X, firstField.Y, 0, 1450));
            firstFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterFirstFieldArea));

            secondFieldArea = WorldMgr.GetRegion(secondField.RegionID).AddArea(new Area.Circle("Second Vacant Field", secondField.X, secondField.Y, 0, 1100));
            secondFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterSecondFieldArea));

            thirdFieldArea = WorldMgr.GetRegion(thirdField.RegionID).AddArea(new Area.Circle("Third Vacant Field", thirdField.X, thirdField.Y, 0, 1100));
            thirdFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterThirdFieldArea));

            /* 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(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld));

            GameEventMgr.AddHandler(farmerAsma, GameObjectEvent.Interact, new DOLEventHandler(TalkToFarmerAsma));
            GameEventMgr.AddHandler(farmerAsma, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFarmerAsma));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #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 :)
             */

            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.GetObjectsByName <GameNPC>(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();
                }
            }

            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);
            }

            /* 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");
            }
        }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }

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

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

            if (npcs.Length == 0)
            {
                sirDorian       = new GameNPC();
                sirDorian.Model = 28;
                sirDorian.Name  = "Sir Dorian";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sirDorian.Name + ", creating him ...");
                }

                // k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                // sirDorian.GuildName = "Part of " + questTitle + " Quest";
                sirDorian.Realm           = eRealm.Albion;
                sirDorian.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
                sirDorian.Inventory = template.CloseTemplate();
                sirDorian.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                sirDorian.Size    = 52;
                sirDorian.Level   = 40;
                sirDorian.X       = 560869;
                sirDorian.Y       = 511737;
                sirDorian.Z       = 2344;
                sirDorian.Heading = 2930;

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

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

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

            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.Interact, new DOLEventHandler(TalkTosirDorian));
            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkTosirDorian));

            sirDorian.AddQuestToGive(typeof(DredgeUpAPledge));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #29
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");
        }
Beispiel #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 = WorldMgr.GetNPCsByName("Cemmeth Budgwold", eRealm.Albion);

            if (npcs.Length == 0)
            {
                CemmethBudgwold       = new GameNPC();
                CemmethBudgwold.Model = 28;
                CemmethBudgwold.Name  = "Cemmeth Budgwold";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + CemmethBudgwold.Name + ", creating him ...");
                }
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //Cemmeth.GuildName = "Part of " + questTitle + " Quest";
                CemmethBudgwold.Realm           = eRealm.Albion;
                CemmethBudgwold.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);                    //Slot 22
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 93);                     //Slot 21
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);                     //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);                    //Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);                         //Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);                     //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);                     //Slot 28
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 68);                 //Slot 12
                CemmethBudgwold.Inventory = template.CloseTemplate();
                CemmethBudgwold.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                CemmethBudgwold.Size    = 50;
                CemmethBudgwold.Level   = 38;
                CemmethBudgwold.X       = 560528;
                CemmethBudgwold.Y       = 513140;
                CemmethBudgwold.Z       = 2394;
                CemmethBudgwold.Heading = 2275;

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

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

            #endregion

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

            GameEventMgr.AddHandler(CemmethBudgwold, GameLivingEvent.Interact, new DOLEventHandler(TalkToCemmethBudgwold));
            GameEventMgr.AddHandler(CemmethBudgwold, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCemmethBudgwold));

            CemmethBudgwold.AddQuestToGive(typeof(CemmethsOrders));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #31
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("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");
        }
Beispiel #32
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("Josson", eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                Josson       = new GameNPC();
                Josson.Model = 382;
                Josson.Name  = "Josson";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Josson.Name + ", creating him ...");
                }
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //Josson.GuildName = "Part of " + questTitle + " Quest";
                Josson.Realm           = eRealm.Hibernia;
                Josson.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 386);                   //Slot 22
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 835);                    //Slot 21
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 387);                    //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 383);                   //Slot 25
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 384);                    //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 385);                    //Slot 28
                Josson.Inventory = template.CloseTemplate();
                Josson.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Josson.Size    = 48;
                Josson.Level   = 50;
                Josson.X       = 346627;
                Josson.Y       = 491453;
                Josson.Z       = 5247;
                Josson.Heading = 2946;

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

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

            #endregion

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

            GameEventMgr.AddHandler(Josson, GameLivingEvent.Interact, new DOLEventHandler(TalkToJosson));
            GameEventMgr.AddHandler(Josson, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToJosson));

            Josson.AddQuestToGive(typeof(MagicalBacklash));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #33
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("Masrim", eRealm.Midgard);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Masrim , creating it ...");
                }
                Masrim                 = new GameNPC();
                Masrim.Model           = 177;
                Masrim.Name            = "Masrim";
                Masrim.GuildName       = "";
                Masrim.Realm           = eRealm.Midgard;
                Masrim.CurrentRegionID = 100;
                Masrim.Size            = 52;
                Masrim.Level           = 40;
                Masrim.X               = 749099;
                Masrim.Y               = 813104;
                Masrim.Z               = 4437;
                Masrim.Heading         = 2605;
                Masrim.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Masrim.SaveIntoDatabase();
                }
            }
            else
            {
                Masrim = npcs[0];
            }
            // end npc

            npcs = WorldMgr.GetNPCsByName("Oona", eRealm.None);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Oona , creating it ...");
                }
                Oona                 = new GameNPC();
                Oona.Model           = 356;
                Oona.Name            = "Oona";
                Oona.GuildName       = "";
                Oona.Realm           = eRealm.None;
                Oona.CurrentRegionID = 100;
                Oona.Size            = 50;
                Oona.Level           = 65;
                Oona.X               = 607233;
                Oona.Y               = 786850;
                Oona.Z               = 4384;
                Oona.Heading         = 3891;
                Oona.Flags          ^= GameNPC.eFlags.GHOST;
                Oona.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Oona.SaveIntoDatabase();
                }
            }
            else
            {
                Oona = npcs[0];
            }
            // end npc

            npcs = WorldMgr.GetNPCsByName("Morlin Caan", eRealm.Midgard);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Morlin Caan , creating it ...");
                }
                MorlinCaan                 = new GameNPC();
                MorlinCaan.Model           = 235;
                MorlinCaan.Name            = "Morlin Caan";
                MorlinCaan.GuildName       = "Smith";
                MorlinCaan.Realm           = eRealm.Midgard;
                MorlinCaan.CurrentRegionID = 101;
                MorlinCaan.Size            = 50;
                MorlinCaan.Level           = 54;
                MorlinCaan.X               = 33400;
                MorlinCaan.Y               = 33620;
                MorlinCaan.Z               = 8023;
                MorlinCaan.Heading         = 523;
                MorlinCaan.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    MorlinCaan.SaveIntoDatabase();
                }
            }
            else
            {
                MorlinCaan = npcs[0];
            }
            // end npc

            #endregion

            #region defineItems

            oona_head = GameServer.Database.FindObjectByKey <ItemTemplate>("oona_head");
            if (oona_head == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Oona's Head , creating it ...");
                }
                oona_head             = new ItemTemplate();
                oona_head.Id_nb       = "oona_head";
                oona_head.Name        = "Oona's Head";
                oona_head.Level       = 8;
                oona_head.Item_Type   = 29;
                oona_head.Model       = 503;
                oona_head.IsDropable  = false;
                oona_head.IsPickable  = false;
                oona_head.DPS_AF      = 0;
                oona_head.SPD_ABS     = 0;
                oona_head.Object_Type = 41;
                oona_head.Hand        = 0;
                oona_head.Type_Damage = 0;
                oona_head.Quality     = 100;
                oona_head.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(oona_head);
                }
            }

            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;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sealed_pouch);
                }
            }
// end item

            HunterEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicBoots");
            if (HunterEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Boots , creating it ...");
                }
                HunterEpicBoots               = new ItemTemplate();
                HunterEpicBoots.Id_nb         = "HunterEpicBoots";
                HunterEpicBoots.Name          = "Call of the Hunt Boots";
                HunterEpicBoots.Level         = 50;
                HunterEpicBoots.Item_Type     = 23;
                HunterEpicBoots.Model         = 760;
                HunterEpicBoots.IsDropable    = true;
                HunterEpicBoots.IsPickable    = true;
                HunterEpicBoots.DPS_AF        = 100;
                HunterEpicBoots.SPD_ABS       = 19;
                HunterEpicBoots.Object_Type   = 34;
                HunterEpicBoots.Quality       = 100;
                HunterEpicBoots.Weight        = 22;
                HunterEpicBoots.Bonus         = 35;
                HunterEpicBoots.MaxCondition  = 50000;
                HunterEpicBoots.MaxDurability = 50000;
                HunterEpicBoots.Condition     = 50000;
                HunterEpicBoots.Durability    = 50000;

                HunterEpicBoots.Bonus1     = 19;
                HunterEpicBoots.Bonus1Type = (int)eStat.CON;

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

                HunterEpicBoots.Bonus3     = 10;
                HunterEpicBoots.Bonus3Type = (int)eResist.Thrust;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicBoots);
                }
            }
//end item
            //Call of the Hunt Coif
            HunterEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicHelm");
            if (HunterEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Helm , creating it ...");
                }
                HunterEpicHelm               = new ItemTemplate();
                HunterEpicHelm.Id_nb         = "HunterEpicHelm";
                HunterEpicHelm.Name          = "Call of the Hunt Coif";
                HunterEpicHelm.Level         = 50;
                HunterEpicHelm.Item_Type     = 21;
                HunterEpicHelm.Model         = 829;         //NEED TO WORK ON..
                HunterEpicHelm.IsDropable    = true;
                HunterEpicHelm.IsPickable    = true;
                HunterEpicHelm.DPS_AF        = 100;
                HunterEpicHelm.SPD_ABS       = 19;
                HunterEpicHelm.Object_Type   = 34;
                HunterEpicHelm.Quality       = 100;
                HunterEpicHelm.Weight        = 22;
                HunterEpicHelm.Bonus         = 35;
                HunterEpicHelm.MaxCondition  = 50000;
                HunterEpicHelm.MaxDurability = 50000;
                HunterEpicHelm.Condition     = 50000;
                HunterEpicHelm.Durability    = 50000;

                HunterEpicHelm.Bonus1     = 3;
                HunterEpicHelm.Bonus1Type = (int)eProperty.Skill_Spear;

                HunterEpicHelm.Bonus2     = 3;
                HunterEpicHelm.Bonus2Type = (int)eProperty.Skill_Stealth;

                HunterEpicHelm.Bonus3     = 3;
                HunterEpicHelm.Bonus3Type = (int)eProperty.Skill_Composite;

                HunterEpicHelm.Bonus4     = 19;
                HunterEpicHelm.Bonus4Type = (int)eStat.DEX;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicHelm);
                }
            }
//end item
            //Call of the Hunt Gloves
            HunterEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicGloves");
            if (HunterEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Gloves , creating it ...");
                }
                HunterEpicGloves               = new ItemTemplate();
                HunterEpicGloves.Id_nb         = "HunterEpicGloves";
                HunterEpicGloves.Name          = "Call of the Hunt Gloves ";
                HunterEpicGloves.Level         = 50;
                HunterEpicGloves.Item_Type     = 22;
                HunterEpicGloves.Model         = 759;
                HunterEpicGloves.IsDropable    = true;
                HunterEpicGloves.IsPickable    = true;
                HunterEpicGloves.DPS_AF        = 100;
                HunterEpicGloves.SPD_ABS       = 19;
                HunterEpicGloves.Object_Type   = 34;
                HunterEpicGloves.Quality       = 100;
                HunterEpicGloves.Weight        = 22;
                HunterEpicGloves.Bonus         = 35;
                HunterEpicGloves.MaxCondition  = 50000;
                HunterEpicGloves.MaxDurability = 50000;
                HunterEpicGloves.Condition     = 50000;
                HunterEpicGloves.Durability    = 50000;

                HunterEpicGloves.Bonus1     = 5;
                HunterEpicGloves.Bonus1Type = (int)eProperty.Skill_Composite;

                HunterEpicGloves.Bonus2     = 15;
                HunterEpicGloves.Bonus2Type = (int)eStat.QUI;

                HunterEpicGloves.Bonus3     = 33;
                HunterEpicGloves.Bonus3Type = (int)eProperty.MaxHealth;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicGloves);
                }
            }
            //Call of the Hunt Hauberk
            HunterEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicVest");
            if (HunterEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Vest , creating it ...");
                }
                HunterEpicVest               = new ItemTemplate();
                HunterEpicVest.Id_nb         = "HunterEpicVest";
                HunterEpicVest.Name          = "Call of the Hunt Jerkin";
                HunterEpicVest.Level         = 50;
                HunterEpicVest.Item_Type     = 25;
                HunterEpicVest.Model         = 756;
                HunterEpicVest.IsDropable    = true;
                HunterEpicVest.IsPickable    = true;
                HunterEpicVest.DPS_AF        = 100;
                HunterEpicVest.SPD_ABS       = 19;
                HunterEpicVest.Object_Type   = 34;
                HunterEpicVest.Quality       = 100;
                HunterEpicVest.Weight        = 22;
                HunterEpicVest.Bonus         = 35;
                HunterEpicVest.MaxCondition  = 50000;
                HunterEpicVest.MaxDurability = 50000;
                HunterEpicVest.Condition     = 50000;
                HunterEpicVest.Durability    = 50000;

                HunterEpicVest.Bonus1     = 13;
                HunterEpicVest.Bonus1Type = (int)eStat.STR;

                HunterEpicVest.Bonus2     = 15;
                HunterEpicVest.Bonus2Type = (int)eStat.CON;

                HunterEpicVest.Bonus3     = 13;
                HunterEpicVest.Bonus3Type = (int)eStat.DEX;

                HunterEpicVest.Bonus4     = 6;
                HunterEpicVest.Bonus4Type = (int)eResist.Cold;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicVest);
                }
            }
            //Call of the Hunt Legs
            HunterEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicLegs");
            if (HunterEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunters Epic Legs , creating it ...");
                }
                HunterEpicLegs               = new ItemTemplate();
                HunterEpicLegs.Id_nb         = "HunterEpicLegs";
                HunterEpicLegs.Name          = "Call of the Hunt Legs";
                HunterEpicLegs.Level         = 50;
                HunterEpicLegs.Item_Type     = 27;
                HunterEpicLegs.Model         = 757;
                HunterEpicLegs.IsDropable    = true;
                HunterEpicLegs.IsPickable    = true;
                HunterEpicLegs.DPS_AF        = 100;
                HunterEpicLegs.SPD_ABS       = 19;
                HunterEpicLegs.Object_Type   = 34;
                HunterEpicLegs.Quality       = 100;
                HunterEpicLegs.Weight        = 22;
                HunterEpicLegs.Bonus         = 35;
                HunterEpicLegs.MaxCondition  = 50000;
                HunterEpicLegs.MaxDurability = 50000;
                HunterEpicLegs.Condition     = 50000;
                HunterEpicLegs.Durability    = 50000;

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

                HunterEpicLegs.Bonus2     = 15;
                HunterEpicLegs.Bonus2Type = (int)eStat.DEX;

                HunterEpicLegs.Bonus3     = 7;
                HunterEpicLegs.Bonus3Type = (int)eStat.QUI;

                HunterEpicLegs.Bonus4     = 12;
                HunterEpicLegs.Bonus4Type = (int)eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicLegs);
                }
            }
            //Call of the Hunt Sleeves
            HunterEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("HunterEpicArms");
            if (HunterEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Hunter Epic Arms , creating it ...");
                }
                HunterEpicArms               = new ItemTemplate();
                HunterEpicArms.Id_nb         = "HunterEpicArms";
                HunterEpicArms.Name          = "Call of the Hunt Sleeves";
                HunterEpicArms.Level         = 50;
                HunterEpicArms.Item_Type     = 28;
                HunterEpicArms.Model         = 758;
                HunterEpicArms.IsDropable    = true;
                HunterEpicArms.IsPickable    = true;
                HunterEpicArms.DPS_AF        = 100;
                HunterEpicArms.SPD_ABS       = 19;
                HunterEpicArms.Object_Type   = 34;
                HunterEpicArms.Quality       = 100;
                HunterEpicArms.Weight        = 22;
                HunterEpicArms.Bonus         = 35;
                HunterEpicArms.MaxCondition  = 50000;
                HunterEpicArms.MaxDurability = 50000;
                HunterEpicArms.Condition     = 50000;
                HunterEpicArms.Durability    = 50000;

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

                HunterEpicArms.Bonus2     = 15;
                HunterEpicArms.Bonus2Type = (int)eStat.QUI;

                HunterEpicArms.Bonus3     = 10;
                HunterEpicArms.Bonus3Type = (int)eResist.Crush;

                HunterEpicArms.Bonus4     = 10;
                HunterEpicArms.Bonus4Type = (int)eResist.Slash;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HunterEpicArms);
                }
            }
            //Shadow Shrouded Boots
            ShadowbladeEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicBoots");
            if (ShadowbladeEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Boots , creating it ...");
                }
                ShadowbladeEpicBoots               = new ItemTemplate();
                ShadowbladeEpicBoots.Id_nb         = "ShadowbladeEpicBoots";
                ShadowbladeEpicBoots.Name          = "Shadow Shrouded Boots";
                ShadowbladeEpicBoots.Level         = 50;
                ShadowbladeEpicBoots.Item_Type     = 23;
                ShadowbladeEpicBoots.Model         = 765;
                ShadowbladeEpicBoots.IsDropable    = true;
                ShadowbladeEpicBoots.IsPickable    = true;
                ShadowbladeEpicBoots.DPS_AF        = 100;
                ShadowbladeEpicBoots.SPD_ABS       = 10;
                ShadowbladeEpicBoots.Object_Type   = 33;
                ShadowbladeEpicBoots.Quality       = 100;
                ShadowbladeEpicBoots.Weight        = 22;
                ShadowbladeEpicBoots.Bonus         = 35;
                ShadowbladeEpicBoots.MaxCondition  = 50000;
                ShadowbladeEpicBoots.MaxDurability = 50000;
                ShadowbladeEpicBoots.Condition     = 50000;
                ShadowbladeEpicBoots.Durability    = 50000;

                ShadowbladeEpicBoots.Bonus1     = 5;
                ShadowbladeEpicBoots.Bonus1Type = (int)eProperty.Skill_Stealth;

                ShadowbladeEpicBoots.Bonus2     = 13;
                ShadowbladeEpicBoots.Bonus2Type = (int)eStat.DEX;

                ShadowbladeEpicBoots.Bonus3     = 13;
                ShadowbladeEpicBoots.Bonus3Type = (int)eStat.QUI;

                ShadowbladeEpicBoots.Bonus4     = 6;
                ShadowbladeEpicBoots.Bonus4Type = (int)eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicBoots);
                }
            }
            //Shadow Shrouded Coif
            ShadowbladeEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicHelm");
            if (ShadowbladeEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Helm , creating it ...");
                }
                ShadowbladeEpicHelm               = new ItemTemplate();
                ShadowbladeEpicHelm.Id_nb         = "ShadowbladeEpicHelm";
                ShadowbladeEpicHelm.Name          = "Shadow Shrouded Coif";
                ShadowbladeEpicHelm.Level         = 50;
                ShadowbladeEpicHelm.Item_Type     = 21;
                ShadowbladeEpicHelm.Model         = 335;         //NEED TO WORK ON..
                ShadowbladeEpicHelm.IsDropable    = true;
                ShadowbladeEpicHelm.IsPickable    = true;
                ShadowbladeEpicHelm.DPS_AF        = 100;
                ShadowbladeEpicHelm.SPD_ABS       = 10;
                ShadowbladeEpicHelm.Object_Type   = 33;
                ShadowbladeEpicHelm.Quality       = 100;
                ShadowbladeEpicHelm.Weight        = 22;
                ShadowbladeEpicHelm.Bonus         = 35;
                ShadowbladeEpicHelm.MaxCondition  = 50000;
                ShadowbladeEpicHelm.MaxDurability = 50000;
                ShadowbladeEpicHelm.Condition     = 50000;
                ShadowbladeEpicHelm.Durability    = 50000;

                ShadowbladeEpicHelm.Bonus1     = 10;
                ShadowbladeEpicHelm.Bonus1Type = (int)eStat.STR;

                ShadowbladeEpicHelm.Bonus2     = 12;
                ShadowbladeEpicHelm.Bonus2Type = (int)eStat.CON;

                ShadowbladeEpicHelm.Bonus3     = 10;
                ShadowbladeEpicHelm.Bonus3Type = (int)eStat.DEX;

                ShadowbladeEpicHelm.Bonus4     = 10;
                ShadowbladeEpicHelm.Bonus4Type = (int)eStat.QUI;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicHelm);
                }
            }
            //Shadow Shrouded Gloves
            ShadowbladeEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicGloves");
            if (ShadowbladeEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Gloves , creating it ...");
                }
                ShadowbladeEpicGloves               = new ItemTemplate();
                ShadowbladeEpicGloves.Id_nb         = "ShadowbladeEpicGloves";
                ShadowbladeEpicGloves.Name          = "Shadow Shrouded Gloves";
                ShadowbladeEpicGloves.Level         = 50;
                ShadowbladeEpicGloves.Item_Type     = 22;
                ShadowbladeEpicGloves.Model         = 764;
                ShadowbladeEpicGloves.IsDropable    = true;
                ShadowbladeEpicGloves.IsPickable    = true;
                ShadowbladeEpicGloves.DPS_AF        = 100;
                ShadowbladeEpicGloves.SPD_ABS       = 10;
                ShadowbladeEpicGloves.Object_Type   = 33;
                ShadowbladeEpicGloves.Quality       = 100;
                ShadowbladeEpicGloves.Weight        = 22;
                ShadowbladeEpicGloves.Bonus         = 35;
                ShadowbladeEpicGloves.MaxCondition  = 50000;
                ShadowbladeEpicGloves.MaxDurability = 50000;
                ShadowbladeEpicGloves.Condition     = 50000;
                ShadowbladeEpicGloves.Durability    = 50000;

                ShadowbladeEpicGloves.Bonus1     = 2;
                ShadowbladeEpicGloves.Bonus1Type = (int)eProperty.Skill_Critical_Strike;

                ShadowbladeEpicGloves.Bonus2     = 12;
                ShadowbladeEpicGloves.Bonus2Type = (int)eStat.QUI;

                ShadowbladeEpicGloves.Bonus3     = 33;
                ShadowbladeEpicGloves.Bonus3Type = (int)eProperty.MaxHealth;

                ShadowbladeEpicGloves.Bonus4     = 4;
                ShadowbladeEpicGloves.Bonus4Type = (int)eProperty.Skill_Envenom;


                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicGloves);
                }
            }
            //Shadow Shrouded Hauberk
            ShadowbladeEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicVest");
            if (ShadowbladeEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Vest , creating it ...");
                }
                ShadowbladeEpicVest               = new ItemTemplate();
                ShadowbladeEpicVest.Id_nb         = "ShadowbladeEpicVest";
                ShadowbladeEpicVest.Name          = "Shadow Shrouded Jerkin";
                ShadowbladeEpicVest.Level         = 50;
                ShadowbladeEpicVest.Item_Type     = 25;
                ShadowbladeEpicVest.Model         = 761;
                ShadowbladeEpicVest.IsDropable    = true;
                ShadowbladeEpicVest.IsPickable    = true;
                ShadowbladeEpicVest.DPS_AF        = 100;
                ShadowbladeEpicVest.SPD_ABS       = 10;
                ShadowbladeEpicVest.Object_Type   = 33;
                ShadowbladeEpicVest.Quality       = 100;
                ShadowbladeEpicVest.Weight        = 22;
                ShadowbladeEpicVest.Bonus         = 35;
                ShadowbladeEpicVest.MaxCondition  = 50000;
                ShadowbladeEpicVest.MaxDurability = 50000;
                ShadowbladeEpicVest.Condition     = 50000;
                ShadowbladeEpicVest.Durability    = 50000;

                ShadowbladeEpicVest.Bonus1     = 13;
                ShadowbladeEpicVest.Bonus1Type = (int)eStat.STR;

                ShadowbladeEpicVest.Bonus2     = 13;
                ShadowbladeEpicVest.Bonus2Type = (int)eStat.DEX;

                ShadowbladeEpicVest.Bonus3     = 30;
                ShadowbladeEpicVest.Bonus3Type = (int)eProperty.MaxHealth;

                ShadowbladeEpicVest.Bonus4     = 6;
                ShadowbladeEpicVest.Bonus4Type = (int)eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicVest);
                }
            }
            //Shadow Shrouded Legs
            ShadowbladeEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicLegs");
            if (ShadowbladeEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Legs , creating it ...");
                }
                ShadowbladeEpicLegs               = new ItemTemplate();
                ShadowbladeEpicLegs.Id_nb         = "ShadowbladeEpicLegs";
                ShadowbladeEpicLegs.Name          = "Shadow Shrouded Legs";
                ShadowbladeEpicLegs.Level         = 50;
                ShadowbladeEpicLegs.Item_Type     = 27;
                ShadowbladeEpicLegs.Model         = 762;
                ShadowbladeEpicLegs.IsDropable    = true;
                ShadowbladeEpicLegs.IsPickable    = true;
                ShadowbladeEpicLegs.DPS_AF        = 100;
                ShadowbladeEpicLegs.SPD_ABS       = 10;
                ShadowbladeEpicLegs.Object_Type   = 33;
                ShadowbladeEpicLegs.Quality       = 100;
                ShadowbladeEpicLegs.Weight        = 22;
                ShadowbladeEpicLegs.Bonus         = 35;
                ShadowbladeEpicLegs.MaxCondition  = 50000;
                ShadowbladeEpicLegs.MaxDurability = 50000;
                ShadowbladeEpicLegs.Condition     = 50000;
                ShadowbladeEpicLegs.Durability    = 50000;

                ShadowbladeEpicLegs.Bonus1     = 12;
                ShadowbladeEpicLegs.Bonus1Type = (int)eStat.STR;

                ShadowbladeEpicLegs.Bonus2     = 15;
                ShadowbladeEpicLegs.Bonus2Type = (int)eStat.CON;

                ShadowbladeEpicLegs.Bonus3     = 12;
                ShadowbladeEpicLegs.Bonus3Type = (int)eStat.QUI;

                ShadowbladeEpicLegs.Bonus4     = 10;
                ShadowbladeEpicLegs.Bonus4Type = (int)eResist.Slash;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicLegs);
                }
            }
            //Shadow Shrouded Sleeves
            ShadowbladeEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("ShadowbladeEpicArms");
            if (ShadowbladeEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shadowblade Epic Arms , creating it ...");
                }
                ShadowbladeEpicArms               = new ItemTemplate();
                ShadowbladeEpicArms.Id_nb         = "ShadowbladeEpicArms";
                ShadowbladeEpicArms.Name          = "Shadow Shrouded Sleeves";
                ShadowbladeEpicArms.Level         = 50;
                ShadowbladeEpicArms.Item_Type     = 28;
                ShadowbladeEpicArms.Model         = 763;
                ShadowbladeEpicArms.IsDropable    = true;
                ShadowbladeEpicArms.IsPickable    = true;
                ShadowbladeEpicArms.DPS_AF        = 100;
                ShadowbladeEpicArms.SPD_ABS       = 10;
                ShadowbladeEpicArms.Object_Type   = 33;
                ShadowbladeEpicArms.Quality       = 100;
                ShadowbladeEpicArms.Weight        = 22;
                ShadowbladeEpicArms.Bonus         = 35;
                ShadowbladeEpicArms.MaxCondition  = 50000;
                ShadowbladeEpicArms.MaxDurability = 50000;
                ShadowbladeEpicArms.Condition     = 50000;
                ShadowbladeEpicArms.Durability    = 50000;

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

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

                ShadowbladeEpicArms.Bonus3     = 10;
                ShadowbladeEpicArms.Bonus3Type = (int)eResist.Crush;

                ShadowbladeEpicArms.Bonus4     = 10;
                ShadowbladeEpicArms.Bonus4Type = (int)eResist.Thrust;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShadowbladeEpicArms);
                }
            }
//Shadowblade Epic Sleeves End
//Item Descriptions End

            #endregion

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

            GameEventMgr.AddHandler(Masrim, GameObjectEvent.Interact, new DOLEventHandler(TalkToMasrim));
            GameEventMgr.AddHandler(Masrim, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasrim));

            GameEventMgr.AddHandler(MorlinCaan, GameObjectEvent.Interact, new DOLEventHandler(TalkToMorlinCaan));
            GameEventMgr.AddHandler(MorlinCaan, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMorlinCaan));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #34
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("Richael", eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                Richael       = new GameNPC();
                Richael.Model = 377;
                Richael.Name  = "Richael";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + Richael.Name + ", creating her ...");
                }
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //Richael.GuildName = "Part of " + questTitle + " Quest";
                Richael.Realm           = eRealm.Hibernia;
                Richael.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 416, 37);                       //Slot 22
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 413, 37);                       //Slot 25
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 417, 37);                        //Slot 23
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 414, 35);                        //Slot 27
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 35);                             //Slot 26
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 415, 37);                        //Slot 28
                Richael.Inventory = template.CloseTemplate();
                Richael.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Richael.Size    = 48;
                Richael.Level   = 38;
                Richael.X       = 347089;
                Richael.Y       = 491290;
                Richael.Z       = 5247;
                Richael.Heading = 978;

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

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

            #endregion
            #region defineAreas
            Demons_Breach_Area = WorldMgr.GetRegion(Demons_Breach.RegionID).AddArea(new Area.Circle("", Demons_Breach.Position, 200));
            Demons_Breach_Area.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterDemonBreachArea));
            #endregion

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

            GameEventMgr.AddHandler(Richael, GameLivingEvent.Interact, new DOLEventHandler(TalkToRichael));
            GameEventMgr.AddHandler(Richael, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToRichael));

            Richael.AddQuestToGive(typeof(ToReachTheBreach));

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #35
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(questGiverName, eRealm.Albion);

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

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

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

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

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

            npcs = WorldMgr.GetNPCsByName(questTargetName, eRealm.Albion);

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

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

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

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

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

            #region defineAreas
            targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle("", targetLocation.X, targetLocation.Y, targetLocation.Z, 200));
            #endregion

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

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

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

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

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

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

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

            questGiver.AddQuestToGive(typeof(MovementAndInteraction));

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

            /* 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 :)
             */

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Eowyln Astos", 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)
            {
                eowylnAstos       = new GameNPC();
                eowylnAstos.Model = 35;
                eowylnAstos.Name  = "Eowyln Astos";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + eowylnAstos.Name + ", creating him ...");
                }

                eowylnAstos.GuildName       = "Part of " + questTitle + " Quest";
                eowylnAstos.Realm           = eRealm.Albion;
                eowylnAstos.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 40);
                eowylnAstos.Inventory = template.CloseTemplate();
                eowylnAstos.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                eowylnAstos.Size    = 54;
                eowylnAstos.Level   = 17;
                eowylnAstos.X       = 559680;
                eowylnAstos.Y       = 513793;
                eowylnAstos.Z       = 2619;
                eowylnAstos.Heading = 3185;

                // 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)
                {
                    eowylnAstos.SaveIntoDatabase();
                }

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

            // item db check
            sephucothsHeart = GameServer.Database.FindObjectByKey <ItemTemplate>("sephucoths_heart");
            if (sephucothsHeart == null)
            {
                sephucothsHeart      = new ItemTemplate();
                sephucothsHeart.Name = "Sephucoth's Heart";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sephucothsHeart.Name + ", creating it ...");
                }

                sephucothsHeart.Level  = 0;
                sephucothsHeart.Weight = 0;
                sephucothsHeart.Model  = 595;

                sephucothsHeart.Object_Type = (int)eObjectType.GenericItem;
                sephucothsHeart.Id_nb       = "sephucoths_heart";
                sephucothsHeart.Price       = 0;
                sephucothsHeart.IsPickable  = false;
                sephucothsHeart.IsDropable  = false;

                sephucothsHeart.Quality       = 100;
                sephucothsHeart.Condition     = 1000;
                sephucothsHeart.MaxCondition  = 1000;
                sephucothsHeart.Durability    = 1000;
                sephucothsHeart.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(sephucothsHeart);
            }

            // item db check
            polishedBone = GameServer.Database.FindObjectByKey <ItemTemplate>("polished_bone");
            if (polishedBone == null)
            {
                polishedBone      = new ItemTemplate();
                polishedBone.Name = "Polished Bone";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + polishedBone.Name + ", creating it ...");
                }

                polishedBone.Level  = 0;
                polishedBone.Weight = 15;
                polishedBone.Model  = 497;

                polishedBone.Object_Type = (int)eObjectType.GenericItem;
                polishedBone.Id_nb       = "polished_bone";
                polishedBone.Price       = 0;
                polishedBone.IsPickable  = false;
                polishedBone.IsDropable  = false;

                polishedBone.Quality       = 100;
                polishedBone.Condition     = 1000;
                polishedBone.MaxCondition  = 1000;
                polishedBone.Durability    = 1000;
                polishedBone.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(polishedBone);
            }

            // item db check
            fieryCrystalPendant = GameServer.Database.FindObjectByKey <ItemTemplate>("fiery_crystal_pendant");
            if (fieryCrystalPendant == null)
            {
                fieryCrystalPendant      = new ItemTemplate();
                fieryCrystalPendant.Name = "Fiery Crystal Pendant";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + fieryCrystalPendant.Name + ", creating it ...");
                }

                fieryCrystalPendant.Level  = 8;
                fieryCrystalPendant.Weight = 8;
                fieryCrystalPendant.Model  = 101;

                fieryCrystalPendant.Object_Type = (int)eObjectType.Magical;
                fieryCrystalPendant.Item_Type   = (int)eEquipmentItems.NECK;
                fieryCrystalPendant.Id_nb       = "fiery_crystal_pendant";
                fieryCrystalPendant.Price       = Money.GetMoney(0, 0, 0, 0, 30);
                fieryCrystalPendant.IsPickable  = true;
                fieryCrystalPendant.IsDropable  = true;

                fieryCrystalPendant.Bonus1     = 1;
                fieryCrystalPendant.Bonus1Type = (int)eProperty.Skill_Fire;
                fieryCrystalPendant.Bonus2     = 1;
                fieryCrystalPendant.Bonus2Type = (int)eProperty.Intelligence;

                fieryCrystalPendant.Quality       = 100;
                fieryCrystalPendant.Condition     = 1000;
                fieryCrystalPendant.MaxCondition  = 1000;
                fieryCrystalPendant.Durability    = 1000;
                fieryCrystalPendant.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(fieryCrystalPendant);
            }

            /* 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(eowylnAstos, GameLivingEvent.Interact, new DOLEventHandler(TalkToEowylnAstos));
            GameEventMgr.AddHandler(eowylnAstos, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEowylnAstos));

            /* Now we bring to Yetta Fletcher the possibility to give this quest to players */
            eowylnAstos.AddQuestToGive(typeof(HeartOfSephucoth));

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

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

            GameNPC[] npcs;

            npcs = WorldMgr.GetObjectsByName <GameNPC>("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];
            }

            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);
                }
            }

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

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End
            Aegan.AddQuestToGive(typeof(Learnthehunt));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #38
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 static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Dorian", eRealm.Albion);
            if (npcs == null || npcs.Length == 0)
                return;

            sirDorian = npcs[0];

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

            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirDorian));
            GameEventMgr.AddHandler(sirDorian, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirDorian));

            sirDorian.AddQuestToGive(typeof(NoHopeForTheHopeful));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #40
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("Inaksha", eRealm.Midgard);

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 100 && npc.X == 805929 && npc.Y == 702449)
                    {
                        Inaksha = npc;
                        break;
                    }
                }
            }

            if (Inaksha == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Inaksha , creating it ...");
                }
                Inaksha                 = new GameNPC();
                Inaksha.Model           = 193;
                Inaksha.Name            = "Inaksha";
                Inaksha.GuildName       = "";
                Inaksha.Realm           = eRealm.Midgard;
                Inaksha.CurrentRegionID = 100;
                Inaksha.Size            = 50;
                Inaksha.Level           = 41;
                Inaksha.X               = 805929;
                Inaksha.Y               = 702449;
                Inaksha.Z               = 4960;
                Inaksha.Heading         = 2116;
                Inaksha.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Inaksha.SaveIntoDatabase();
                }
            }
            // end npc

            npcs = WorldMgr.GetNPCsByName("Loken", eRealm.None);

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 100 && npc.X == 636784 && npc.Y == 762433)
                    {
                        Loken = npc;
                        break;
                    }
                }
            }

            if (Loken == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Loken , creating it ...");
                }
                Loken                 = new GameNPC();
                Loken.Model           = 212;
                Loken.Name            = "Loken";
                Loken.GuildName       = "";
                Loken.Realm           = eRealm.None;
                Loken.CurrentRegionID = 100;
                Loken.Size            = 50;
                Loken.Level           = 65;
                Loken.X               = 636784;
                Loken.Y               = 762433;
                Loken.Z               = 4596;
                Loken.Heading         = 3777;
                Loken.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Loken.SaveIntoDatabase();
                }
            }
            // end npc

            npcs = WorldMgr.GetNPCsByName("Miri", eRealm.Midgard);

            if (npcs.Length > 0)
            {
                foreach (GameNPC npc in npcs)
                {
                    if (npc.CurrentRegionID == 101 && npc.X == 30641 && npc.Y == 32093)
                    {
                        Miri = npc;
                        break;
                    }
                }
            }

            if (Miri == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Miri , creating it ...");
                }
                Miri                 = new GameNPC();
                Miri.Model           = 220;
                Miri.Name            = "Miri";
                Miri.GuildName       = "";
                Miri.Realm           = eRealm.Midgard;
                Miri.CurrentRegionID = 101;
                Miri.Size            = 50;
                Miri.Level           = 43;
                Miri.X               = 30641;
                Miri.Y               = 32093;
                Miri.Z               = 8305;
                Miri.Heading         = 3037;
                Miri.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Miri.SaveIntoDatabase();
                }
            }
            // end npc

            #endregion

            #region defineItems

            ball_of_flame = GameServer.Database.FindObjectByKey <ItemTemplate>("ball_of_flame");
            if (ball_of_flame == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find ball_of_flame , creating it ...");
                }
                ball_of_flame             = new ItemTemplate();
                ball_of_flame.Id_nb       = "ball_of_flame";
                ball_of_flame.Name        = "Ball of Flame";
                ball_of_flame.Level       = 8;
                ball_of_flame.Item_Type   = 29;
                ball_of_flame.Model       = 601;
                ball_of_flame.IsDropable  = false;
                ball_of_flame.IsPickable  = false;
                ball_of_flame.DPS_AF      = 0;
                ball_of_flame.SPD_ABS     = 0;
                ball_of_flame.Object_Type = 41;
                ball_of_flame.Hand        = 0;
                ball_of_flame.Type_Damage = 0;
                ball_of_flame.Quality     = 100;
                ball_of_flame.Weight      = 12;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ball_of_flame);
                }
            }

// end item
            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;
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(sealed_pouch);
                }
            }
// end item

            //Valhalla Touched Boots
            HealerEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicBoots");
            if (HealerEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Boots , creating it ...");
                }
                HealerEpicBoots               = new ItemTemplate();
                HealerEpicBoots.Id_nb         = "HealerEpicBoots";
                HealerEpicBoots.Name          = "Valhalla Touched Boots";
                HealerEpicBoots.Level         = 50;
                HealerEpicBoots.Item_Type     = 23;
                HealerEpicBoots.Model         = 702;
                HealerEpicBoots.IsDropable    = true;
                HealerEpicBoots.IsPickable    = true;
                HealerEpicBoots.DPS_AF        = 100;
                HealerEpicBoots.SPD_ABS       = 27;
                HealerEpicBoots.Object_Type   = 35;
                HealerEpicBoots.Quality       = 100;
                HealerEpicBoots.Weight        = 22;
                HealerEpicBoots.Bonus         = 35;
                HealerEpicBoots.MaxCondition  = 50000;
                HealerEpicBoots.MaxDurability = 50000;
                HealerEpicBoots.Condition     = 50000;
                HealerEpicBoots.Durability    = 50000;

                HealerEpicBoots.Bonus1     = 12;
                HealerEpicBoots.Bonus1Type = (int)eStat.CON;

                HealerEpicBoots.Bonus2     = 12;
                HealerEpicBoots.Bonus2Type = (int)eStat.DEX;

                HealerEpicBoots.Bonus3     = 12;
                HealerEpicBoots.Bonus3Type = (int)eStat.QUI;

                HealerEpicBoots.Bonus4     = 21;
                HealerEpicBoots.Bonus4Type = (int)eProperty.MaxHealth;

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

                HealerEpicHelm.Bonus1     = 4;
                HealerEpicHelm.Bonus1Type = (int)eProperty.Skill_Augmentation;

                HealerEpicHelm.Bonus2     = 18;
                HealerEpicHelm.Bonus2Type = (int)eStat.PIE;

                HealerEpicHelm.Bonus3     = 4;
                HealerEpicHelm.Bonus3Type = (int)eResist.Slash;

                HealerEpicHelm.Bonus4     = 6;
                HealerEpicHelm.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicHelm);
                }
            }
//end item
            //Valhalla Touched Gloves
            HealerEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicGloves");
            if (HealerEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Gloves , creating it ...");
                }
                HealerEpicGloves               = new ItemTemplate();
                HealerEpicGloves.Id_nb         = "HealerEpicGloves";
                HealerEpicGloves.Name          = "Valhalla Touched Gloves ";
                HealerEpicGloves.Level         = 50;
                HealerEpicGloves.Item_Type     = 22;
                HealerEpicGloves.Model         = 701;
                HealerEpicGloves.IsDropable    = true;
                HealerEpicGloves.IsPickable    = true;
                HealerEpicGloves.DPS_AF        = 100;
                HealerEpicGloves.SPD_ABS       = 27;
                HealerEpicGloves.Object_Type   = 35;
                HealerEpicGloves.Quality       = 100;
                HealerEpicGloves.Weight        = 22;
                HealerEpicGloves.Bonus         = 35;
                HealerEpicGloves.MaxCondition  = 50000;
                HealerEpicGloves.MaxDurability = 50000;
                HealerEpicGloves.Condition     = 50000;
                HealerEpicGloves.Durability    = 50000;

                HealerEpicGloves.Bonus1     = 4;
                HealerEpicGloves.Bonus1Type = (int)eProperty.Skill_Mending;

                HealerEpicGloves.Bonus2     = 16;
                HealerEpicGloves.Bonus2Type = (int)eStat.PIE;

                HealerEpicGloves.Bonus3     = 4;
                HealerEpicGloves.Bonus3Type = (int)eResist.Crush;

                HealerEpicGloves.Bonus4     = 6;
                HealerEpicGloves.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicGloves);
                }
            }
            //Valhalla Touched Hauberk
            HealerEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicVest");
            if (HealerEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Vest , creating it ...");
                }
                HealerEpicVest               = new ItemTemplate();
                HealerEpicVest.Id_nb         = "HealerEpicVest";
                HealerEpicVest.Name          = "Valhalla Touched Haukberk";
                HealerEpicVest.Level         = 50;
                HealerEpicVest.Item_Type     = 25;
                HealerEpicVest.Model         = 698;
                HealerEpicVest.IsDropable    = true;
                HealerEpicVest.IsPickable    = true;
                HealerEpicVest.DPS_AF        = 100;
                HealerEpicVest.SPD_ABS       = 27;
                HealerEpicVest.Object_Type   = 35;
                HealerEpicVest.Quality       = 100;
                HealerEpicVest.Weight        = 22;
                HealerEpicVest.Bonus         = 35;
                HealerEpicVest.MaxCondition  = 50000;
                HealerEpicVest.MaxDurability = 50000;
                HealerEpicVest.Condition     = 50000;
                HealerEpicVest.Durability    = 50000;

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

                HealerEpicVest.Bonus2     = 16;
                HealerEpicVest.Bonus2Type = (int)eStat.PIE;

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

                HealerEpicVest.Bonus4     = 10;
                HealerEpicVest.Bonus4Type = (int)eResist.Heat;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicVest);
                }
            }
            //Valhalla Touched Legs
            HealerEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicLegs");
            if (HealerEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healers Epic Legs , creating it ...");
                }
                HealerEpicLegs               = new ItemTemplate();
                HealerEpicLegs.Id_nb         = "HealerEpicLegs";
                HealerEpicLegs.Name          = "Valhalla Touched Legs";
                HealerEpicLegs.Level         = 50;
                HealerEpicLegs.Item_Type     = 27;
                HealerEpicLegs.Model         = 699;
                HealerEpicLegs.IsDropable    = true;
                HealerEpicLegs.IsPickable    = true;
                HealerEpicLegs.DPS_AF        = 100;
                HealerEpicLegs.SPD_ABS       = 27;
                HealerEpicLegs.Object_Type   = 35;
                HealerEpicLegs.Quality       = 100;
                HealerEpicLegs.Weight        = 22;
                HealerEpicLegs.Bonus         = 35;
                HealerEpicLegs.MaxCondition  = 50000;
                HealerEpicLegs.MaxDurability = 50000;
                HealerEpicLegs.Condition     = 50000;
                HealerEpicLegs.Durability    = 50000;

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

                HealerEpicLegs.Bonus2     = 16;
                HealerEpicLegs.Bonus2Type = (int)eStat.CON;

                HealerEpicLegs.Bonus3     = 10;
                HealerEpicLegs.Bonus3Type = (int)eResist.Spirit;

                HealerEpicLegs.Bonus4     = 10;
                HealerEpicLegs.Bonus4Type = (int)eResist.Energy;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicLegs);
                }
            }
            //Valhalla Touched Sleeves
            HealerEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("HealerEpicArms");
            if (HealerEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Healer Epic Arms , creating it ...");
                }
                HealerEpicArms               = new ItemTemplate();
                HealerEpicArms.Id_nb         = "HealerEpicArms";
                HealerEpicArms.Name          = "Valhalla Touched Sleeves";
                HealerEpicArms.Level         = 50;
                HealerEpicArms.Item_Type     = 28;
                HealerEpicArms.Model         = 700;
                HealerEpicArms.IsDropable    = true;
                HealerEpicArms.IsPickable    = true;
                HealerEpicArms.DPS_AF        = 100;
                HealerEpicArms.SPD_ABS       = 27;
                HealerEpicArms.Object_Type   = 35;
                HealerEpicArms.Quality       = 100;
                HealerEpicArms.Weight        = 22;
                HealerEpicArms.Bonus         = 35;
                HealerEpicArms.MaxCondition  = 50000;
                HealerEpicArms.MaxDurability = 50000;
                HealerEpicArms.Condition     = 50000;
                HealerEpicArms.Durability    = 50000;

                HealerEpicArms.Bonus1     = 4;
                HealerEpicArms.Bonus1Type = (int)eProperty.Skill_Mending;

                HealerEpicArms.Bonus2     = 13;
                HealerEpicArms.Bonus2Type = (int)eStat.STR;

                HealerEpicArms.Bonus3     = 15;
                HealerEpicArms.Bonus3Type = (int)eStat.PIE;

                HealerEpicArms.Bonus4     = 6;
                HealerEpicArms.Bonus4Type = (int)eResist.Matter;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(HealerEpicArms);
                }
            }
            //Subterranean Boots
            ShamanEpicBoots = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicBoots");
            if (ShamanEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Boots , creating it ...");
                }
                ShamanEpicBoots               = new ItemTemplate();
                ShamanEpicBoots.Id_nb         = "ShamanEpicBoots";
                ShamanEpicBoots.Name          = "Subterranean Boots";
                ShamanEpicBoots.Level         = 50;
                ShamanEpicBoots.Item_Type     = 23;
                ShamanEpicBoots.Model         = 770;
                ShamanEpicBoots.IsDropable    = true;
                ShamanEpicBoots.IsPickable    = true;
                ShamanEpicBoots.DPS_AF        = 100;
                ShamanEpicBoots.SPD_ABS       = 27;
                ShamanEpicBoots.Object_Type   = 35;
                ShamanEpicBoots.Quality       = 100;
                ShamanEpicBoots.Weight        = 22;
                ShamanEpicBoots.Bonus         = 35;
                ShamanEpicBoots.MaxCondition  = 50000;
                ShamanEpicBoots.MaxDurability = 50000;
                ShamanEpicBoots.Condition     = 50000;
                ShamanEpicBoots.Durability    = 50000;

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

                ShamanEpicBoots.Bonus2     = 13;
                ShamanEpicBoots.Bonus2Type = (int)eStat.QUI;

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

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicBoots);
                }
            }
            //Subterranean Coif
            ShamanEpicHelm = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicHelm");
            if (ShamanEpicHelm == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Helm , creating it ...");
                }
                ShamanEpicHelm               = new ItemTemplate();
                ShamanEpicHelm.Id_nb         = "ShamanEpicHelm";
                ShamanEpicHelm.Name          = "Subterranean Coif";
                ShamanEpicHelm.Level         = 50;
                ShamanEpicHelm.Item_Type     = 21;
                ShamanEpicHelm.Model         = 63;         //NEED TO WORK ON..
                ShamanEpicHelm.IsDropable    = true;
                ShamanEpicHelm.IsPickable    = true;
                ShamanEpicHelm.DPS_AF        = 100;
                ShamanEpicHelm.SPD_ABS       = 27;
                ShamanEpicHelm.Object_Type   = 35;
                ShamanEpicHelm.Quality       = 100;
                ShamanEpicHelm.Weight        = 22;
                ShamanEpicHelm.Bonus         = 35;
                ShamanEpicHelm.MaxCondition  = 50000;
                ShamanEpicHelm.MaxDurability = 50000;
                ShamanEpicHelm.Condition     = 50000;
                ShamanEpicHelm.Durability    = 50000;

                ShamanEpicHelm.Bonus1     = 4;
                ShamanEpicHelm.Bonus1Type = (int)eProperty.Skill_Mending;

                ShamanEpicHelm.Bonus2     = 18;
                ShamanEpicHelm.Bonus2Type = (int)eStat.PIE;

                ShamanEpicHelm.Bonus3     = 4;
                ShamanEpicHelm.Bonus3Type = (int)eResist.Thrust;

                ShamanEpicHelm.Bonus4     = 6;
                ShamanEpicHelm.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicHelm);
                }
            }
            //Subterranean Gloves
            ShamanEpicGloves = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicGloves");
            if (ShamanEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Gloves , creating it ...");
                }
                ShamanEpicGloves               = new ItemTemplate();
                ShamanEpicGloves.Id_nb         = "ShamanEpicGloves";
                ShamanEpicGloves.Name          = "Subterranean Gloves";
                ShamanEpicGloves.Level         = 50;
                ShamanEpicGloves.Item_Type     = 22;
                ShamanEpicGloves.Model         = 769;
                ShamanEpicGloves.IsDropable    = true;
                ShamanEpicGloves.IsPickable    = true;
                ShamanEpicGloves.DPS_AF        = 100;
                ShamanEpicGloves.SPD_ABS       = 27;
                ShamanEpicGloves.Object_Type   = 35;
                ShamanEpicGloves.Quality       = 100;
                ShamanEpicGloves.Weight        = 22;
                ShamanEpicGloves.Bonus         = 35;
                ShamanEpicGloves.MaxCondition  = 50000;
                ShamanEpicGloves.MaxDurability = 50000;
                ShamanEpicGloves.Condition     = 50000;
                ShamanEpicGloves.Durability    = 50000;

                ShamanEpicGloves.Bonus1     = 4;
                ShamanEpicGloves.Bonus1Type = (int)eProperty.Skill_Subterranean;

                ShamanEpicGloves.Bonus2     = 18;
                ShamanEpicGloves.Bonus2Type = (int)eStat.PIE;

                ShamanEpicGloves.Bonus3     = 4;
                ShamanEpicGloves.Bonus3Type = (int)eResist.Crush;

                ShamanEpicGloves.Bonus4     = 6;
                ShamanEpicGloves.Bonus4Type = (int)eProperty.PowerRegenerationRate;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicGloves);
                }
            }
            //Subterranean Hauberk
            ShamanEpicVest = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicVest");
            if (ShamanEpicVest == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Vest , creating it ...");
                }
                ShamanEpicVest               = new ItemTemplate();
                ShamanEpicVest.Id_nb         = "ShamanEpicVest";
                ShamanEpicVest.Name          = "Subterranean Hauberk";
                ShamanEpicVest.Level         = 50;
                ShamanEpicVest.Item_Type     = 25;
                ShamanEpicVest.Model         = 766;
                ShamanEpicVest.IsDropable    = true;
                ShamanEpicVest.IsPickable    = true;
                ShamanEpicVest.DPS_AF        = 100;
                ShamanEpicVest.SPD_ABS       = 27;
                ShamanEpicVest.Object_Type   = 35;
                ShamanEpicVest.Quality       = 100;
                ShamanEpicVest.Weight        = 22;
                ShamanEpicVest.Bonus         = 35;
                ShamanEpicVest.MaxCondition  = 50000;
                ShamanEpicVest.MaxDurability = 50000;
                ShamanEpicVest.Condition     = 50000;
                ShamanEpicVest.Durability    = 50000;

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

                ShamanEpicVest.Bonus2     = 16;
                ShamanEpicVest.Bonus2Type = (int)eStat.PIE;

                ShamanEpicVest.Bonus3     = 10;
                ShamanEpicVest.Bonus3Type = (int)eResist.Matter;

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

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicVest);
                }
            }
            //Subterranean Legs
            ShamanEpicLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicLegs");
            if (ShamanEpicLegs == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Legs , creating it ...");
                }
                ShamanEpicLegs               = new ItemTemplate();
                ShamanEpicLegs.Id_nb         = "ShamanEpicLegs";
                ShamanEpicLegs.Name          = "Subterranean Legs";
                ShamanEpicLegs.Level         = 50;
                ShamanEpicLegs.Item_Type     = 27;
                ShamanEpicLegs.Model         = 767;
                ShamanEpicLegs.IsDropable    = true;
                ShamanEpicLegs.IsPickable    = true;
                ShamanEpicLegs.DPS_AF        = 100;
                ShamanEpicLegs.SPD_ABS       = 27;
                ShamanEpicLegs.Object_Type   = 35;
                ShamanEpicLegs.Quality       = 100;
                ShamanEpicLegs.Weight        = 22;
                ShamanEpicLegs.Bonus         = 35;
                ShamanEpicLegs.MaxCondition  = 50000;
                ShamanEpicLegs.MaxDurability = 50000;
                ShamanEpicLegs.Condition     = 50000;
                ShamanEpicLegs.Durability    = 50000;

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

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

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

                ShamanEpicLegs.Bonus4     = 10;
                ShamanEpicLegs.Bonus4Type = (int)eResist.Spirit;

                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicLegs);
                }
            }
            //Subterranean Sleeves
            ShamanEpicArms = GameServer.Database.FindObjectByKey <ItemTemplate>("ShamanEpicArms");
            if (ShamanEpicArms == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Shaman Epic Arms , creating it ...");
                }
                ShamanEpicArms               = new ItemTemplate();
                ShamanEpicArms.Id_nb         = "ShamanEpicArms";
                ShamanEpicArms.Name          = "Subterranean Sleeves";
                ShamanEpicArms.Level         = 50;
                ShamanEpicArms.Item_Type     = 28;
                ShamanEpicArms.Model         = 768;
                ShamanEpicArms.IsDropable    = true;
                ShamanEpicArms.IsPickable    = true;
                ShamanEpicArms.DPS_AF        = 100;
                ShamanEpicArms.SPD_ABS       = 27;
                ShamanEpicArms.Object_Type   = 35;
                ShamanEpicArms.Quality       = 100;
                ShamanEpicArms.Weight        = 22;
                ShamanEpicArms.Bonus         = 35;
                ShamanEpicArms.MaxCondition  = 50000;
                ShamanEpicArms.MaxDurability = 50000;
                ShamanEpicArms.Condition     = 50000;
                ShamanEpicArms.Durability    = 50000;

                ShamanEpicArms.Bonus1     = 4;
                ShamanEpicArms.Bonus1Type = (int)eProperty.Skill_Augmentation;

                ShamanEpicArms.Bonus2     = 12;
                ShamanEpicArms.Bonus2Type = (int)eStat.STR;

                ShamanEpicArms.Bonus3     = 18;
                ShamanEpicArms.Bonus3Type = (int)eStat.PIE;

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


                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(ShamanEpicArms);
                }
            }
//Shaman Epic Sleeves End
//Item Descriptions End

            #endregion

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

            GameEventMgr.AddHandler(Inaksha, GameObjectEvent.Interact, new DOLEventHandler(TalkToInaksha));
            GameEventMgr.AddHandler(Inaksha, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToInaksha));
            GameEventMgr.AddHandler(Miri, GameObjectEvent.Interact, new DOLEventHandler(TalkToMiri));
            GameEventMgr.AddHandler(Miri, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMiri));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #41
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 ...");
            }

            /* 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("Sentinel Maitias", eRealm.Hibernia);

            /* Whops, if the npcs array length is 0 then no Sir Quait 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)
            {
                sentinelMaitias       = new GameGuard();
                sentinelMaitias.Model = 381;
                sentinelMaitias.Name  = "Sentinel Maitias";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sentinelMaitias.Name + ", creating him ...");
                }
                sentinelMaitias.GuildName       = "Part of " + questTitle;
                sentinelMaitias.Realm           = eRealm.Hibernia;
                sentinelMaitias.CurrentRegionID = 200;
                sentinelMaitias.Size            = 50;
                sentinelMaitias.Level           = 51;
                sentinelMaitias.X                   = 348237;
                sentinelMaitias.Y                   = 493406;
                sentinelMaitias.Z                   = 5176;
                sentinelMaitias.Heading             = 1695;
                sentinelMaitias.EquipmentTemplateID = "15bc1cc4-6c01-4cd1-a26c-8e20c9377114";

                //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)
                {
                    sentinelMaitias.SaveIntoDatabase();
                }


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

            /* Now we do the same for the Lynnet.
             */
            npcs = WorldMgr.GetNPCsByName("Sentinel Moya", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                sentinelMoya       = new GameGuard();
                sentinelMoya.Model = 378;
                sentinelMoya.Name  = "Sentinel Moya";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + sentinelMoya.Name + ", creating ...");
                }
                sentinelMoya.GuildName       = "Part of " + questTitle;
                sentinelMoya.Realm           = eRealm.Hibernia;       //Needs to be none, else we can't kill him ;-)
                sentinelMoya.CurrentRegionID = 1;
                sentinelMoya.Size            = 50;
                sentinelMoya.Level           = 51;
                sentinelMoya.X                   = 341784;
                sentinelMoya.Y                   = 467817;
                sentinelMoya.Z                   = 5200;
                sentinelMoya.Heading             = 3948;
                sentinelMoya.EquipmentTemplateID = "64356d42-041a-489d-9ca7-a738bdc81d5c";

                //You don't have to store the creted 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)
                {
                    sentinelMoya.SaveIntoDatabase();
                }

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

            #endregion

            #region defineItems

            boxTrain = GameServer.Database.FindObjectByKey <ItemTemplate>("Crate_of_Training_Supplies");
            if (boxTrain == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Crate of Training Supplies, creating it ...");
                }
                boxTrain               = new ItemTemplate();
                boxTrain.Name          = "Crate of Training Supplies";
                boxTrain.Level         = 1;
                boxTrain.Weight        = 0;
                boxTrain.Model         = 602;
                boxTrain.Id_nb         = "Crate_of_Training_Supplies";
                boxTrain.IsPickable    = true;
                boxTrain.IsDropable    = true;
                boxTrain.Color         = 0;
                boxTrain.Quality       = 0;
                boxTrain.Condition     = 0;
                boxTrain.MaxCondition  = 0;
                boxTrain.Durability    = 1;
                boxTrain.MaxDurability = 1;


                //You don't have to store the created TheDevilsintheDetails 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(boxTrain);
            }

            #endregion

            /* Now we add some hooks to the Sir Quait 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 Sir Quait 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(sentinelMaitias, GameLivingEvent.Interact, new DOLEventHandler(TalkTosentinelMaitias));
            GameEventMgr.AddHandler(sentinelMaitias, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkTosentinelMaitias));

            GameEventMgr.AddHandler(sentinelMoya, GameLivingEvent.Interact, new DOLEventHandler(TalkTosentinelMoya));
            GameEventMgr.AddHandler(sentinelMoya, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkTosentinelMoya));

            /* Now we bring to stewardWillie the possibility to give this quest to players */
            sentinelMaitias.AddQuestToGive(typeof(TheDevilsintheDetails));
            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 ...");
            }

            /* 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("Farmer Asma", 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)
            {
                farmerAsma       = new GameNPC();
                farmerAsma.Model = 82;
                farmerAsma.Name  = "Farmer Asma";
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + farmerAsma.Name + ", creating him ...");
                }
                farmerAsma.GuildName       = "Part of " + questTitle + " Quest";
                farmerAsma.Realm           = eRealm.Albion;
                farmerAsma.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 31);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 32);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 33);
                farmerAsma.Inventory = template.CloseTemplate();
                farmerAsma.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                farmerAsma.Size    = 50;
                farmerAsma.Level   = 35;
                farmerAsma.X       = 563939;
                farmerAsma.Y       = 509234;
                farmerAsma.Z       = 2744;
                farmerAsma.Heading = 21;

                //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)
                {
                    farmerAsma.SaveIntoDatabase();
                }

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

            #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(farmerAsma, GameObjectEvent.Interact, new DOLEventHandler(TalkToFarmerAsma));
            GameEventMgr.AddHandler(farmerAsma, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFarmerAsma));

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

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

            /* 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 :)
             */

            dalikor = GetDalikor();

            GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Lady Hinda", eRealm.None);
            if (npcs.Length == 0)
            {
                // if (Log.IsWarnEnabled) Log.Warn("Could not find Lady Hinda, creating her ...");
                ladyHinda                 = new GameNPC();
                ladyHinda.Model           = 678;
                ladyHinda.Name            = "Lady Hinda";
                ladyHinda.GuildName       = "Part of " + questTitle + " Quest";
                ladyHinda.Realm           = eRealm.None;
                ladyHinda.CurrentRegionID = hindaStart.RegionID;
                ladyHinda.Size            = 50;
                ladyHinda.Level           = 30;
                ladyHinda.X               = hindaStart.X;
                ladyHinda.Y               = hindaStart.Y;
                ladyHinda.Z               = hindaStart.Z;
                ladyHinda.Heading         = hindaStart.Heading;

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

            // 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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(necklaceOfDoppelganger);
                }
            }

            // item db check
            askefruerPlans = GameServer.Database.FindObjectByKey <ItemTemplate>("askefruer_plans");
            if (askefruerPlans == null)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find Askefruer Plans, creating it ...");
                }

                askefruerPlans      = new ItemTemplate();
                askefruerPlans.Name = "Akefruer Plans";

                askefruerPlans.Weight = 3;
                askefruerPlans.Model  = 498;

                askefruerPlans.Object_Type = (int)eObjectType.GenericItem;

                askefruerPlans.Id_nb      = "askefruer_plans";
                askefruerPlans.IsPickable = true;
                askefruerPlans.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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(askefruerPlans);
                }
            }

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

                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_mid";
                recruitsBoots.Price       = Money.GetMoney(0, 0, 0, 10, 0);
                recruitsBoots.IsPickable  = true;
                recruitsBoots.IsDropable  = true;
                recruitsBoots.Color       = 14;

                recruitsBoots.Bonus = 1; // default bonus

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

                recruitsBoots.Bonus2     = 1;
                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
                if (SAVE_INTO_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       = 36;

                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
                if (SAVE_INTO_DATABASE)
                {
                    GameServer.Database.AddObject(recruitsQuiltedBoots);
                }
            }

            /* 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(ladyHinda, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyHinda));
            GameEventMgr.AddHandler(ladyHinda, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyHinda));

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #45
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("Master Visur", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Master Visur, creating ...");
                masterVisur = new GameNPC();
                masterVisur.Model = 61;
                masterVisur.Name = "Master Visur";
                masterVisur.GuildName = "Part of " + questTitle + " Quest";
                masterVisur.Realm = eRealm.Albion;
                masterVisur.CurrentRegionID = 1;
                masterVisur.Size = 49;
                masterVisur.Level = 55;
                masterVisur.X = 585589;
                masterVisur.Y = 478396;
                masterVisur.Z = 3368;
                masterVisur.Heading = 56;
                masterVisur.MaxSpeedBase = 200;

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

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

                masterVisur.EquipmentTemplateID = "3400843";

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

            npcs = WorldMgr.GetNPCsByName("Scryer Alice", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Alice, creating ...");
                alice = new GameNPC();
                alice.Model = 52;
                alice.Name = "Scryer Alice";
                alice.GuildName = "Part of " + questTitle + " Quest";
                alice.Realm = eRealm.Albion;
                alice.CurrentRegionID = 1;
                alice.Size = 51;
                alice.Level = 50;
                alice.X = 436598;
                alice.Y = 650425;
                alice.Z = 2448;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 82);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 84);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 3);
                alice.Inventory = template.CloseTemplate();
                alice.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				alice.AddNPCEquipment(Slot.TORSO, 81, 0, 0, 0);
            //				alice.AddNPCEquipment(Slot.LEGS, 82, 0, 0, 0);
            //				alice.AddNPCEquipment(Slot.FEET, 84, 0, 0, 0);
            //				alice.AddNPCEquipment(Slot.CLOAK, 91, 0, 0, 0);
            //				alice.AddNPCEquipment(Slot.RIGHTHAND, 3, 0, 0, 0);

                alice.Heading = 3766;
                alice.MaxSpeedBase = 200;
                alice.EquipmentTemplateID = "200276";
                alice.Flags = (GameNPC.eFlags) 18;

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

            Point2D point = alice.GetPointFromHeading( alice.Heading, 30 );
            locationAlice = new GameLocation(alice.CurrentZone.Description, alice.CurrentRegionID, point.X, point.Y, alice.Z);

            dragonflyTicket = CreateTicketTo("Castle Sauvage", "hs_src_castlesauvage");
            horseTicket = CreateTicketTo("Camelot Hills", "hs_src_camelothills");

            npcs = (GameNPC[]) WorldMgr.GetObjectsByName("Dragonfly Handler Colm", eRealm.Albion, typeof (GameStableMaster));
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Dragonfly Handler Colm, creating ...");
                colm = new GameStableMaster();
                colm.Model = 78;
                colm.Name = "Dragonfly Handler Colm";
                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;
            }

            colm.TradeItems = new MerchantTradeItems(null);
            if (!colm.TradeItems.AddTradeItem(0, eMerchantWindowSlot.FirstEmptyInPage, dragonflyTicket))
                if (log.IsWarnEnabled)
                    log.Warn("dragonflyTicket not added");

            foreach (GameNPC npc in colm.GetNPCsInRadius(400))
            {
                if (npc.Name == "dragonfly hatchling")
                {
                    dragonfly = npc;
                    break;
                }
            }
            if (dragonfly == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Dragon Fly, creating ...");
                dragonfly = new GameNPC();
                dragonfly.Model = 1207;
                dragonfly.Name = "dragonfly hatchling";
                dragonfly.GuildName = "Part of " + questTitle + " Quest";
                dragonfly.Realm = eRealm.None;
                dragonfly.CurrentRegionID = 1;
                dragonfly.Size = 25;
                dragonfly.Level = 31;
                dragonfly.X = colm.X + 80;
                dragonfly.Y = colm.Y + 100;
                dragonfly.Z = colm.Z;

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

                dragonfly.Heading = 2434;
                dragonfly.MaxSpeedBase = 400;
                //dragonfly.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)
                    dragonfly.SaveIntoDatabase();
                dragonfly.AddToWorld();
            }

            npcs = (GameNPC[]) WorldMgr.GetObjectsByName("Uliam", eRealm.Albion, typeof (GameStableMaster));
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Uliam, creating ...");
                uliam = new GameStableMaster();
                uliam.Model = 52;
                uliam.Name = "Uliam";
                uliam.GuildName = "Stable Master";
                uliam.Realm = eRealm.Albion;
                uliam.CurrentRegionID = 1;
                uliam.Size = 51;
                uliam.Level = 50;
                uliam.X = 585609;
                uliam.Y = 478980;
                uliam.Z = 2183;
                uliam.Heading = 93;
                uliam.MaxSpeedBase = 200;

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

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

                uliam.AddToWorld();
            }
            else
                uliam = npcs[0] as GameStableMaster;

            Point2D uliamloc = uliam.GetPointFromHeading( uliam.Heading, 30 );
            locationUliam = new GameLocation(uliam.CurrentZone.Description, uliam.CurrentRegionID, uliam.X, uliam.Y, uliam.Z);

            /*
            foreach (GameNPC npc in WorldMgr.GetNPCsCloseToObject(uliam, 400))
            {
                if (npc.Name == "horse")
                {
                    horse = npc;
                    break;
                }
            }

            if (horse == null)
            {
                if(Log.IsWarnEnabled)
                                    Log.Warn("Could not find Horse near Uliam, creating ...");
                horse = new GameNPC();
                horse.Model = 450; // //819;
                horse.Name = "horse";
                horse.GuildName = "Part of " + questTitle + " Quest";
                horse.Realm = (byte)eRealm.None;
                horse.CurrentRegionID = 1;
                horse.Size = 63;
                horse.Level = 55;
                horse.X = uliam.X + 80;
                horse.Y = uliam.Y + 130;
                horse.Z = uliam.Z;
                horse.Heading = 93;

                horse.AggroLevel = 0;
                horse.AggroRange = 0;
                //horse.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)
                    horse.SaveIntoDatabase();
                horse.AddToWorld();
            }
             */

            #endregion

            #region DefineItems

            // item db check
            noteFormColm = GameServer.Database.FindObjectByKey<ItemTemplate>("colms_note");
            if (noteFormColm == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Colm's Note, creating it ...");
                noteFormColm = new ItemTemplate();
                noteFormColm.Name = "Colm's Note";

                noteFormColm.Weight = 3;
                noteFormColm.Model = 498;

                noteFormColm.Object_Type = (int) eObjectType.GenericItem;

                noteFormColm.Id_nb = "colms_note";
                noteFormColm.IsPickable = true;
                noteFormColm.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(noteFormColm);
            }

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

            translatedPlans = GameServer.Database.FindObjectByKey<ItemTemplate>("translated_ire_fairy_plans");
            if (translatedPlans == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Translated Ire Fairy Plans, creating it ...");
                translatedPlans = new ItemTemplate();
                translatedPlans.Name = "Translated Ire Fairy Plans";

                translatedPlans.Weight = 3;
                translatedPlans.Model = 498;

                translatedPlans.Object_Type = (int) eObjectType.GenericItem;

                translatedPlans.Id_nb = "translated_ire_fairy_plans";
                translatedPlans.IsPickable = true;
                translatedPlans.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(translatedPlans);
            }

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

                recruitsLegs.Weight = 42;
                recruitsLegs.Model = 82; // Studded Legs

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

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

                recruitsLegs.Bonus = 5; // default bonus

                recruitsLegs.Bonus1 = 10;
                recruitsLegs.Bonus1Type = (int) eProperty.MaxHealth; // hit

                recruitsLegs.Bonus2 = 2;
                recruitsLegs.Bonus2Type = (int) eResist.Slash;

                recruitsLegs.Bonus3 = 1;
                recruitsLegs.Bonus3Type = (int) eResist.Cold;

                recruitsLegs.Quality = 100;
                recruitsLegs.Condition = 1000;
                recruitsLegs.MaxCondition = 1000;
                recruitsLegs.Durability = 1000;
                recruitsLegs.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(recruitsLegs);
            }

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

                recruitsPants.Weight = 14;
                recruitsPants.Model = 152; // cloth Legs

                recruitsPants.DPS_AF = 5; // Armour
                recruitsPants.SPD_ABS = 0; // Absorption

                recruitsPants.Object_Type = (int) eObjectType.Cloth;
                recruitsPants.Item_Type = (int) eEquipmentItems.LEGS;
                recruitsPants.Id_nb = "recruits_quilted_pants";
                recruitsPants.Price = Money.GetMoney(0,0,0,10,0);
                recruitsPants.IsPickable = true;
                recruitsPants.IsDropable = true;
                recruitsPants.Color = 17; // red leather

                recruitsPants.Bonus = 5; // default bonus

                recruitsPants.Bonus1 = 12;
                recruitsPants.Bonus1Type = (int) eProperty.MaxHealth; // hit

                recruitsPants.Bonus2 = 2;
                recruitsPants.Bonus2Type = (int) eResist.Slash;

                recruitsPants.Bonus3 = 1;
                recruitsPants.Bonus3Type = (int) eResist.Cold;

                recruitsPants.Quality = 100;
                recruitsPants.Condition = 1000;
                recruitsPants.MaxCondition = 1000;
                recruitsPants.Durability = 1000;
                recruitsPants.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(recruitsPants);
            }

            #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(masterVisur, GameObjectEvent.Interact, new DOLEventHandler(TalkToMasterVisur));

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

            GameEventMgr.AddHandler(alice, GameObjectEvent.Interact, new DOLEventHandler(TalkToAlice));
            GameEventMgr.AddHandler(alice, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAlice));

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

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