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"); } }
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"); } }
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"); } }
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 ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.NPCKreimhilde"), (eRealm)2); if (npcs.Length == 0) { VikingKreimhilde = new DOL.GS.GameNPC(); VikingKreimhilde.Model = 218; VikingKreimhilde.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.NPCKreimhilde"); if (log.IsWarnEnabled) { log.Warn("Could not find " + VikingKreimhilde.Name + ", creating ..."); } VikingKreimhilde.GuildName = "Part of " + questTitle + " Quest"; VikingKreimhilde.Realm = eRealm.Midgard; VikingKreimhilde.CurrentRegionID = 100; VikingKreimhilde.Size = 51; VikingKreimhilde.Level = 50; VikingKreimhilde.MaxSpeedBase = 191; VikingKreimhilde.Faction = FactionMgr.GetFactionByID(0); VikingKreimhilde.X = 803999; VikingKreimhilde.Y = 726551; VikingKreimhilde.Z = 4752; VikingKreimhilde.Heading = 2116; VikingKreimhilde.RespawnInterval = -1; VikingKreimhilde.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; VikingKreimhilde.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { VikingKreimhilde.SaveIntoDatabase(); } VikingKreimhilde.AddToWorld(); } else { VikingKreimhilde = npcs[0]; } #endregion #region defineItems blackmaulercubpelt = GameServer.Database.FindObjectByKey <ItemTemplate>("blackmaulercubpelt"); if (blackmaulercubpelt == null) { blackmaulercubpelt = new ItemTemplate(); blackmaulercubpelt.Name = "Black Mauler Cub Pelt"; if (log.IsWarnEnabled) { log.Warn("Could not find " + blackmaulercubpelt.Name + ", creating it ..."); } blackmaulercubpelt.Level = 1; blackmaulercubpelt.Weight = 5; blackmaulercubpelt.Model = 100; blackmaulercubpelt.Object_Type = 0; blackmaulercubpelt.Item_Type = 40; blackmaulercubpelt.Id_nb = "blackmaulercubpelt"; blackmaulercubpelt.Hand = 0; blackmaulercubpelt.Price = 0; blackmaulercubpelt.IsPickable = true; blackmaulercubpelt.IsDropable = true; blackmaulercubpelt.IsTradable = true; blackmaulercubpelt.CanDropAsLoot = false; blackmaulercubpelt.Color = 0; blackmaulercubpelt.Bonus = 35; // default bonus blackmaulercubpelt.Bonus1 = 0; blackmaulercubpelt.Bonus1Type = (int)0; blackmaulercubpelt.Bonus2 = 0; blackmaulercubpelt.Bonus2Type = (int)0; blackmaulercubpelt.Bonus3 = 0; blackmaulercubpelt.Bonus3Type = (int)0; blackmaulercubpelt.Bonus4 = 0; blackmaulercubpelt.Bonus4Type = (int)0; blackmaulercubpelt.Bonus5 = 0; blackmaulercubpelt.Bonus5Type = (int)0; blackmaulercubpelt.Bonus6 = 0; blackmaulercubpelt.Bonus6Type = (int)0; blackmaulercubpelt.Bonus7 = 0; blackmaulercubpelt.Bonus7Type = (int)0; blackmaulercubpelt.Bonus8 = 0; blackmaulercubpelt.Bonus8Type = (int)0; blackmaulercubpelt.Bonus9 = 0; blackmaulercubpelt.Bonus9Type = (int)0; blackmaulercubpelt.Bonus10 = 0; blackmaulercubpelt.Bonus10Type = (int)0; blackmaulercubpelt.ExtraBonus = 0; blackmaulercubpelt.ExtraBonusType = (int)0; blackmaulercubpelt.Effect = 0; blackmaulercubpelt.Emblem = 0; blackmaulercubpelt.Charges = 0; blackmaulercubpelt.MaxCharges = 0; blackmaulercubpelt.SpellID = 0; blackmaulercubpelt.ProcSpellID = 0; blackmaulercubpelt.Type_Damage = 0; blackmaulercubpelt.Realm = 0; blackmaulercubpelt.MaxCount = 1; blackmaulercubpelt.PackSize = 1; blackmaulercubpelt.Extension = 0; blackmaulercubpelt.Quality = 99; blackmaulercubpelt.Condition = 100; blackmaulercubpelt.MaxCondition = 100; blackmaulercubpelt.Durability = 100; blackmaulercubpelt.MaxDurability = 100; blackmaulercubpelt.PoisonCharges = 0; blackmaulercubpelt.PoisonMaxCharges = 0; blackmaulercubpelt.PoisonSpellID = 0; blackmaulercubpelt.ProcSpellID1 = 0; blackmaulercubpelt.SpellID1 = 0; blackmaulercubpelt.MaxCharges1 = 0; blackmaulercubpelt.Charges1 = 0; GameServer.Database.AddObject(blackmaulercubpelt); } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(maulerinvasion)); QuestBehaviour a; a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Interact, null, VikingKreimhilde); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk1"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper1"), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk2"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper2"), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk3"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper3"), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk4"), null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper4"), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk5"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper5"), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null, (eComparator)5); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.OfferQuest")); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.maulerinvasion)); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk6"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.maulerinvasion)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk7"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.EnemyKilled"), null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 3, (eComparator)1); a.AddAction(eActionType.GiveItem, blackmaulercubpelt, null); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.Interact, null, VikingKreimhilde); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 3, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk8"), VikingKreimhilde); a.AddAction(eActionType.SetQuestStep, typeof(maulerinvasion), 4); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.GiveItem, VikingKreimhilde, blackmaulercubpelt); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 4, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk9"), VikingKreimhilde); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 5); a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.GiveItem, VikingKreimhilde, blackmaulercubpelt); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 5, (eComparator)3); a.AddRequirement(eRequirementType.Level, 1, null, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP, 5, null); a.AddAction(eActionType.GiveGold, 27, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null); a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.GiveItem, VikingKreimhilde, blackmaulercubpelt); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 5, (eComparator)3); a.AddRequirement(eRequirementType.Level, 2, null, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 27, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null); a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.GiveItem, VikingKreimhilde, blackmaulercubpelt); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 5, (eComparator)3); a.AddRequirement(eRequirementType.Level, 3, null, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP, 40, null); a.AddAction(eActionType.GiveGold, 27, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null); a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde, -1); a.AddTrigger(eTriggerType.GiveItem, VikingKreimhilde, blackmaulercubpelt); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.maulerinvasion), 5, (eComparator)3); a.AddRequirement(eRequirementType.Level, 4, null, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP, 60, null); a.AddAction(eActionType.GiveGold, 27, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), null); a.AddAction(eActionType.TakeItem, blackmaulercubpelt, null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End VikingKreimhilde.AddQuestToGive(typeof(maulerinvasion)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Pedra", (eRealm)2); if (npcs.Length == 0) { Pedra = new DOL.GS.GameNPC(); Pedra.Model = 214; Pedra.Name = "Pedra"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Pedra.Name + ", creating ..."); } Pedra.GuildName = "Part of " + questTitle + " Quest"; Pedra.Realm = eRealm.Midgard; Pedra.CurrentRegionID = 151; Pedra.Size = 51; Pedra.Level = 50; Pedra.MaxSpeedBase = 191; Pedra.Faction = FactionMgr.GetFactionByID(0); Pedra.X = 289895; Pedra.Y = 356014; Pedra.Z = 3866; Pedra.Heading = 1661; Pedra.RespawnInterval = -1; Pedra.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Pedra.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) { Pedra.SaveIntoDatabase(); } Pedra.AddToWorld(); } else { Pedra = npcs[0]; } npcs = WorldMgr.GetNPCsByName("Kedra", (eRealm)2); if (npcs.Length == 0) { Kedra = new GameHealer(); Kedra.Model = 206; Kedra.Name = "Kedra"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Kedra.Name + ", creating ..."); } Kedra.GuildName = "Part of " + questTitle + " Quest"; Kedra.Realm = eRealm.Midgard; Kedra.CurrentRegionID = 151; Kedra.Size = 51; Kedra.Level = 50; Kedra.MaxSpeedBase = 191; Kedra.Faction = FactionMgr.GetFactionByID(0); Kedra.X = 289612; Kedra.Y = 354560; Kedra.Z = 3866; Kedra.Heading = 3902; Kedra.RespawnInterval = -1; Kedra.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Kedra.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) { Kedra.SaveIntoDatabase(); } Kedra.AddToWorld(); } else { Kedra = npcs[0]; } #endregion #region defineItems marinefungus = GameServer.Database.FindObjectByKey <ItemTemplate>("marinefungus"); if (marinefungus == null) { marinefungus = new ItemTemplate(); marinefungus.Name = "Marine Fungus"; if (log.IsWarnEnabled) { log.Warn("Could not find " + marinefungus.Name + ", creating it ..."); } marinefungus.Level = 1; marinefungus.Weight = 5; marinefungus.Model = 546; marinefungus.Object_Type = 0; marinefungus.Item_Type = 40; marinefungus.Id_nb = "marinefungus"; marinefungus.Hand = 0; marinefungus.Price = 0; marinefungus.IsPickable = false; marinefungus.IsDropable = false; marinefungus.IsTradable = false; marinefungus.CanDropAsLoot = false; marinefungus.Color = 0; marinefungus.Bonus = 35; // default bonus marinefungus.Bonus1 = 0; marinefungus.Bonus1Type = (int)0; marinefungus.Bonus2 = 0; marinefungus.Bonus2Type = (int)0; marinefungus.Bonus3 = 0; marinefungus.Bonus3Type = (int)0; marinefungus.Bonus4 = 0; marinefungus.Bonus4Type = (int)0; marinefungus.Bonus5 = 0; marinefungus.Bonus5Type = (int)0; marinefungus.Bonus6 = 0; marinefungus.Bonus6Type = (int)0; marinefungus.Bonus7 = 0; marinefungus.Bonus7Type = (int)0; marinefungus.Bonus8 = 0; marinefungus.Bonus8Type = (int)0; marinefungus.Bonus9 = 0; marinefungus.Bonus9Type = (int)0; marinefungus.Bonus10 = 0; marinefungus.Bonus10Type = (int)0; marinefungus.ExtraBonus = 0; marinefungus.ExtraBonusType = (int)0; marinefungus.Effect = 0; marinefungus.Emblem = 0; marinefungus.Charges = 0; marinefungus.MaxCharges = 0; marinefungus.SpellID = 0; marinefungus.ProcSpellID = 0; marinefungus.Type_Damage = 0; marinefungus.Realm = 0; marinefungus.MaxCount = 1; marinefungus.PackSize = 1; marinefungus.Extension = 0; marinefungus.Quality = 99; marinefungus.Condition = 100; marinefungus.MaxCondition = 100; marinefungus.Durability = 100; marinefungus.MaxDurability = 100; marinefungus.PoisonCharges = 0; marinefungus.PoisonMaxCharges = 0; marinefungus.PoisonSpellID = 0; marinefungus.ProcSpellID1 = 0; marinefungus.SpellID1 = 0; marinefungus.MaxCharges1 = 0; marinefungus.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(marinefungus); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(badfood)); QuestBehaviour a; a = builder.CreateBehaviour(Pedra, -1); a.AddTrigger(eTriggerType.Interact, null, Pedra); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.badfood), Pedra); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.badfood), null, (eComparator)5); a.AddAction(eActionType.Talk, "Oh, I am not feeling very well at all. I don't think there's one member of this town that hasn't felt a little queasy at least (once?) from all the bad fish we've [eaten].", Pedra); AddBehaviour(a); a = builder.CreateBehaviour(Pedra, -1); a.AddTrigger(eTriggerType.Whisper, "eaten", Pedra); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.badfood), Pedra); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.badfood), null, (eComparator)5); a.AddAction(eActionType.Talk, "Aye, and now Kedra, the healer, is busy sorting out the worst! It turns out we are ate some bad fish. Now, Kedra says she is running our of her cure, and doesn't have time to get any more of the ingredients! Do you think you could help?", Pedra); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.badfood), "Will you help the healer out?"); AddBehaviour(a); a = builder.CreateBehaviour(Pedra, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.badfood)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.badfood), Pedra); a.AddAction(eActionType.Talk, "Oh good! Talk to Kedra about bad fish. She'll tell you what needs to be done.", Pedra); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 2); AddBehaviour(a); a = builder.CreateBehaviour(Kedra, -1); a.AddTrigger(eTriggerType.Interact, null, Kedra); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 2, (eComparator)3); a.AddAction(eActionType.Talk, "Fish! The entire town has eaten bad fish! It is crazy! I told them not to! I told them the moon's position in the sky indicated a bad harvest of fish, but did anyone listen? And now, everyone is [sick].", Kedra); AddBehaviour(a); a = builder.CreateBehaviour(Kedra, -1); a.AddTrigger(eTriggerType.Whisper, "sick", Kedra); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 2, (eComparator)3); a.AddAction(eActionType.Talk, "Yes. Sick. Why are you here? Are you sick? You don't look sick to me. You can help me. I am running out of my cure! I don't have time to go get the [marine fungus] I need!", Kedra); AddBehaviour(a); a = builder.CreateBehaviour(Kedra, -1); a.AddTrigger(eTriggerType.Whisper, "marine fungus", Kedra); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 2, (eComparator)3); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 3); a.AddAction(eActionType.Talk, "Aye. I mash it up and add herbs to it. It's a great cure! I need more though! Go get me a marine fungus. I will pay you for it! And the whole town will thank you, when they are through wretching up the illness, that is.", Kedra); AddBehaviour(a); a = builder.CreateBehaviour(Pedra, -1); a.AddTrigger(eTriggerType.EnemyKilled, "marine fungus", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 3, (eComparator)3); a.AddAction(eActionType.GiveItem, marinefungus, null); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 4); AddBehaviour(a); a = builder.CreateBehaviour(Kedra, -1); a.AddTrigger(eTriggerType.Interact, null, Kedra); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.badfood), 4, (eComparator)3); a.AddAction(eActionType.Talk, "Oh thank you! The stench of the ill is getting to me! I can make a few more batches of my cure after this, and then be done with it all! This will teach everyone to ignore me! Let's see if they eat the fish the next time I say the moon isn't right! Here, I hope this is enough. Thank you for your aid!", Kedra); a.AddAction(eActionType.GiveGold, 305, null); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.badfood), null); a.AddAction(eActionType.TakeItem, marinefungus, null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End Pedra.AddQuestToGive(typeof(badfood)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Aegan", (eRealm)2); if (npcs.Length == 0) { Aegan = new DOL.GS.GameNPC(); Aegan.Model = 232; Aegan.Name = "Aegan"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Aegan.Name + ", creating ..."); } Aegan.GuildName = "Part of " + questTitle + " Quest"; Aegan.Realm = eRealm.Midgard; Aegan.CurrentRegionID = 100; Aegan.Size = 51; Aegan.Level = 41; Aegan.MaxSpeedBase = 191; Aegan.Faction = FactionMgr.GetFactionByID(0); Aegan.X = 805398; Aegan.Y = 725829; Aegan.Z = 4700; Aegan.Heading = 3595; Aegan.RespawnInterval = -1; Aegan.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Aegan.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Aegan.SaveIntoDatabase(); } Aegan.AddToWorld(); } else { Aegan = npcs[0]; } #endregion #region defineItems clawofblackmauler = GameServer.Database.FindObjectByKey <ItemTemplate>("clawofblackmauler"); if (clawofblackmauler == null) { clawofblackmauler = new ItemTemplate(); clawofblackmauler.Name = "Claw of Black Mauler"; if (log.IsWarnEnabled) { log.Warn("Could not find " + clawofblackmauler.Name + ", creating it ..."); } clawofblackmauler.Level = 50; clawofblackmauler.Weight = 5; clawofblackmauler.Model = 1; clawofblackmauler.Object_Type = 0; clawofblackmauler.Item_Type = 40; clawofblackmauler.Id_nb = "clawofblackmauler"; clawofblackmauler.Hand = 0; clawofblackmauler.Price = 0; clawofblackmauler.IsPickable = true; clawofblackmauler.IsDropable = true; clawofblackmauler.IsTradable = true; clawofblackmauler.CanDropAsLoot = false; clawofblackmauler.Color = 0; clawofblackmauler.Bonus = 35; // default bonus clawofblackmauler.Bonus1 = 0; clawofblackmauler.Bonus1Type = (int)0; clawofblackmauler.Bonus2 = 0; clawofblackmauler.Bonus2Type = (int)0; clawofblackmauler.Bonus3 = 0; clawofblackmauler.Bonus3Type = (int)0; clawofblackmauler.Bonus4 = 0; clawofblackmauler.Bonus4Type = (int)0; clawofblackmauler.Bonus5 = 0; clawofblackmauler.Bonus5Type = (int)0; clawofblackmauler.Bonus6 = 0; clawofblackmauler.Bonus6Type = (int)0; clawofblackmauler.Bonus7 = 0; clawofblackmauler.Bonus7Type = (int)0; clawofblackmauler.Bonus8 = 0; clawofblackmauler.Bonus8Type = (int)0; clawofblackmauler.Bonus9 = 0; clawofblackmauler.Bonus9Type = (int)0; clawofblackmauler.Bonus10 = 0; clawofblackmauler.Bonus10Type = (int)0; clawofblackmauler.ExtraBonus = 0; clawofblackmauler.ExtraBonusType = (int)0; clawofblackmauler.Effect = 0; clawofblackmauler.Emblem = 0; clawofblackmauler.Charges = 0; clawofblackmauler.MaxCharges = 0; clawofblackmauler.SpellID = 0; clawofblackmauler.ProcSpellID = 0; clawofblackmauler.Type_Damage = 0; clawofblackmauler.Realm = 0; clawofblackmauler.MaxCount = 1; clawofblackmauler.PackSize = 1; clawofblackmauler.Extension = 0; clawofblackmauler.Quality = 99; clawofblackmauler.Condition = 100; clawofblackmauler.MaxCondition = 100; clawofblackmauler.Durability = 100; clawofblackmauler.MaxDurability = 100; clawofblackmauler.PoisonCharges = 0; clawofblackmauler.PoisonMaxCharges = 0; clawofblackmauler.PoisonSpellID = 0; clawofblackmauler.ProcSpellID1 = 0; clawofblackmauler.SpellID1 = 0; clawofblackmauler.MaxCharges1 = 0; clawofblackmauler.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(clawofblackmauler); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(Learnthehunt)); QuestBehaviour a; a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.Interact, null, Aegan); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Learnthehunt), Aegan); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Learnthehunt), null, (eComparator)5); a.AddAction(eActionType.Talk, "Greetings, are you [worthy of the hunt]?", Aegan); AddBehaviour(a); a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.Whisper, "worthy of the hunt", Aegan); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Learnthehunt), Aegan); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Learnthehunt), null, (eComparator)5); a.AddAction(eActionType.Talk, "Oh ho! Another bright young come to help Midgard fend off her enemies, eh? Wonderful, that's what I say! Wonderful! With the rise of the Albion and Hibernia armies,Midgard will need all the she can get!", Aegan); a.AddAction(eActionType.Talk, "I have spent a great deal of my life hunting the [maulers] of this region", Aegan); AddBehaviour(a); a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.Whisper, "maulers", Aegan); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Learnthehunt), Aegan); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Learnthehunt), null, (eComparator)5); a.AddAction(eActionType.Talk, "Bring me the claws of a mauler cub and I shall reward you", Aegan); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Learnthehunt), "Accept Learn the Hunt quest?"); AddBehaviour(a); a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Learnthehunt)); a.AddAction(eActionType.Talk, "No problem. See you.", Aegan); AddBehaviour(a); a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Learnthehunt)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Learnthehunt), Aegan); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Learnthehunt), 2); AddBehaviour(a); a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.EnemyKilled, "black mauler cub", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Learnthehunt), 1, (eComparator)2); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Learnthehunt), 7, (eComparator)1); a.AddAction(eActionType.GiveItem, clawofblackmauler, null); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.Learnthehunt), null); AddBehaviour(a); a = builder.CreateBehaviour(Aegan, -1); a.AddTrigger(eTriggerType.Interact, null, Aegan); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Learnthehunt), 7, (eComparator)3); a.AddAction(eActionType.Talk, "You are doing well! Continue to pass me the bear claws!", Aegan); a.AddAction(eActionType.Talk, "You have proven yourself well youngster! I hope the coin serves you well.", Aegan); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 100, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Learnthehunt), null); a.AddAction(eActionType.TakeItem, clawofblackmauler, 5); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End Aegan.AddQuestToGive(typeof(Learnthehunt)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
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("Gridash", (eRealm)2); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(100).IsDisabled) { Gridash = new DOL.GS.GameNPC(); Gridash.Model = 137; Gridash.Name = "Gridash"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Gridash.Name + ", creating ..."); } Gridash.GuildName = "Part of " + questTitle + " Quest"; Gridash.Realm = eRealm.Midgard; Gridash.CurrentRegionID = 100; Gridash.Size = 51; Gridash.Level = 21; Gridash.MaxSpeedBase = 191; Gridash.Faction = FactionMgr.GetFactionByID(0); Gridash.X = 772795; Gridash.Y = 753335; Gridash.Z = 4600; Gridash.Heading = 3356; Gridash.RespawnInterval = -1; Gridash.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Gridash.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Gridash.SaveIntoDatabase(); } Gridash.AddToWorld(); } } else { Gridash = npcs[0]; } #endregion #region defineItems bronze_short_sword = GameServer.Database.FindObjectByKey <ItemTemplate>("bronze_short_sword"); if (bronze_short_sword == null) { bronze_short_sword = new ItemTemplate(); bronze_short_sword.Name = "bronze short sword"; if (log.IsWarnEnabled) { log.Warn("Could not find " + bronze_short_sword.Name + ", creating it ..."); } bronze_short_sword.Level = 1; bronze_short_sword.Weight = 180; bronze_short_sword.Model = 3; bronze_short_sword.Object_Type = 3; bronze_short_sword.Item_Type = 11; bronze_short_sword.Id_nb = "bronze_short_sword"; bronze_short_sword.Hand = 2; bronze_short_sword.Price = Money.GetMoney(0, 0, 0, 1, 50); bronze_short_sword.IsPickable = true; bronze_short_sword.IsDropable = true; bronze_short_sword.IsTradable = false; bronze_short_sword.CanDropAsLoot = true; bronze_short_sword.Color = 0; bronze_short_sword.Bonus = 0; // default bonus bronze_short_sword.Bonus1 = 0; bronze_short_sword.Bonus1Type = (int)0; bronze_short_sword.Bonus2 = 0; bronze_short_sword.Bonus2Type = (int)0; bronze_short_sword.Bonus3 = 0; bronze_short_sword.Bonus3Type = (int)0; bronze_short_sword.Bonus4 = 0; bronze_short_sword.Bonus4Type = (int)0; bronze_short_sword.Bonus5 = 0; bronze_short_sword.Bonus5Type = (int)0; bronze_short_sword.Bonus6 = 0; bronze_short_sword.Bonus6Type = (int)0; bronze_short_sword.Bonus7 = 0; bronze_short_sword.Bonus7Type = (int)0; bronze_short_sword.Bonus8 = 0; bronze_short_sword.Bonus8Type = (int)0; bronze_short_sword.Bonus9 = 0; bronze_short_sword.Bonus9Type = (int)0; bronze_short_sword.Bonus10 = 0; bronze_short_sword.Bonus10Type = (int)0; bronze_short_sword.ExtraBonus = 0; bronze_short_sword.ExtraBonusType = (int)0; bronze_short_sword.Effect = 0; bronze_short_sword.Emblem = 0; bronze_short_sword.Charges = 0; bronze_short_sword.MaxCharges = 0; bronze_short_sword.SpellID = 0; bronze_short_sword.ProcSpellID = 0; bronze_short_sword.Type_Damage = 2; bronze_short_sword.Realm = 1; bronze_short_sword.MaxCount = 1; bronze_short_sword.PackSize = 1; bronze_short_sword.Extension = 0; bronze_short_sword.Quality = 85; bronze_short_sword.Condition = 50000; bronze_short_sword.MaxCondition = 50000; bronze_short_sword.Durability = 100; bronze_short_sword.MaxDurability = 100; bronze_short_sword.PoisonCharges = 0; bronze_short_sword.PoisonMaxCharges = 0; bronze_short_sword.PoisonSpellID = 0; bronze_short_sword.ProcSpellID1 = 0; bronze_short_sword.SpellID1 = 0; bronze_short_sword.MaxCharges1 = 0; bronze_short_sword.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(bronze_short_sword); } } sveawolftooth = GameServer.Database.FindObjectByKey <ItemTemplate>("sveawolftooth"); if (sveawolftooth == null) { sveawolftooth = new ItemTemplate(); sveawolftooth.Name = "Sveawolf Tooth"; if (log.IsWarnEnabled) { log.Warn("Could not find " + sveawolftooth.Name + ", creating it ..."); } sveawolftooth.Level = 50; sveawolftooth.Weight = 5; sveawolftooth.Model = 106; sveawolftooth.Object_Type = 0; sveawolftooth.Item_Type = 40; sveawolftooth.Id_nb = "sveawolftooth"; sveawolftooth.Hand = 0; sveawolftooth.Price = 0; sveawolftooth.IsPickable = true; sveawolftooth.IsDropable = true; sveawolftooth.IsTradable = true; sveawolftooth.CanDropAsLoot = false; sveawolftooth.Color = 0; sveawolftooth.Bonus = 35; // default bonus sveawolftooth.Bonus1 = 0; sveawolftooth.Bonus1Type = (int)0; sveawolftooth.Bonus2 = 0; sveawolftooth.Bonus2Type = (int)0; sveawolftooth.Bonus3 = 0; sveawolftooth.Bonus3Type = (int)0; sveawolftooth.Bonus4 = 0; sveawolftooth.Bonus4Type = (int)0; sveawolftooth.Bonus5 = 0; sveawolftooth.Bonus5Type = (int)0; sveawolftooth.Bonus6 = 0; sveawolftooth.Bonus6Type = (int)0; sveawolftooth.Bonus7 = 0; sveawolftooth.Bonus7Type = (int)0; sveawolftooth.Bonus8 = 0; sveawolftooth.Bonus8Type = (int)0; sveawolftooth.Bonus9 = 0; sveawolftooth.Bonus9Type = (int)0; sveawolftooth.Bonus10 = 0; sveawolftooth.Bonus10Type = (int)0; sveawolftooth.ExtraBonus = 0; sveawolftooth.ExtraBonusType = (int)0; sveawolftooth.Effect = 0; sveawolftooth.Emblem = 0; sveawolftooth.Charges = 0; sveawolftooth.MaxCharges = 0; sveawolftooth.SpellID = 0; sveawolftooth.ProcSpellID = 0; sveawolftooth.Type_Damage = 0; sveawolftooth.Realm = 0; sveawolftooth.MaxCount = 1; sveawolftooth.PackSize = 1; sveawolftooth.Extension = 0; sveawolftooth.Quality = 99; sveawolftooth.Condition = 50000; sveawolftooth.MaxCondition = 50000; sveawolftooth.Durability = 50000; sveawolftooth.MaxDurability = 50000; sveawolftooth.PoisonCharges = 0; sveawolftooth.PoisonMaxCharges = 0; sveawolftooth.PoisonSpellID = 0; sveawolftooth.ProcSpellID1 = 0; sveawolftooth.SpellID1 = 0; sveawolftooth.MaxCharges1 = 0; sveawolftooth.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(sveawolftooth); } } sveabone_hilt_sword = GameServer.Database.FindObjectByKey <ItemTemplate>("sveabone_hilt_sword"); if (sveabone_hilt_sword == null) { sveabone_hilt_sword = new ItemTemplate(); sveabone_hilt_sword.Name = "Sveabone Hilt Sword"; if (log.IsWarnEnabled) { log.Warn("Could not find " + sveabone_hilt_sword.Name + ", creating it ..."); } sveabone_hilt_sword.Level = 1; sveabone_hilt_sword.Weight = 18; sveabone_hilt_sword.Model = 311; sveabone_hilt_sword.Object_Type = 11; sveabone_hilt_sword.Item_Type = 10; sveabone_hilt_sword.Id_nb = "sveabone_hilt_sword"; sveabone_hilt_sword.Hand = 0; sveabone_hilt_sword.Price = 0; sveabone_hilt_sword.IsPickable = true; sveabone_hilt_sword.IsDropable = true; sveabone_hilt_sword.IsTradable = false; sveabone_hilt_sword.CanDropAsLoot = false; sveabone_hilt_sword.Color = 0; sveabone_hilt_sword.Bonus = 0; // default bonus sveabone_hilt_sword.Bonus1 = 1; sveabone_hilt_sword.Bonus1Type = (int)52; sveabone_hilt_sword.Bonus2 = 0; sveabone_hilt_sword.Bonus2Type = (int)0; sveabone_hilt_sword.Bonus3 = 0; sveabone_hilt_sword.Bonus3Type = (int)0; sveabone_hilt_sword.Bonus4 = 0; sveabone_hilt_sword.Bonus4Type = (int)0; sveabone_hilt_sword.Bonus5 = 0; sveabone_hilt_sword.Bonus5Type = (int)0; sveabone_hilt_sword.Bonus6 = 0; sveabone_hilt_sword.Bonus6Type = (int)0; sveabone_hilt_sword.Bonus7 = 0; sveabone_hilt_sword.Bonus7Type = (int)0; sveabone_hilt_sword.Bonus8 = 0; sveabone_hilt_sword.Bonus8Type = (int)0; sveabone_hilt_sword.Bonus9 = 0; sveabone_hilt_sword.Bonus9Type = (int)0; sveabone_hilt_sword.Bonus10 = 0; sveabone_hilt_sword.Bonus10Type = (int)0; sveabone_hilt_sword.ExtraBonus = 0; sveabone_hilt_sword.ExtraBonusType = (int)0; sveabone_hilt_sword.Effect = 0; sveabone_hilt_sword.Emblem = 0; sveabone_hilt_sword.Charges = 0; sveabone_hilt_sword.MaxCharges = 0; sveabone_hilt_sword.SpellID = 0; sveabone_hilt_sword.ProcSpellID = 0; sveabone_hilt_sword.Type_Damage = 2; sveabone_hilt_sword.Realm = 0; sveabone_hilt_sword.MaxCount = 1; sveabone_hilt_sword.PackSize = 1; sveabone_hilt_sword.Extension = 0; sveabone_hilt_sword.Quality = 99; sveabone_hilt_sword.Condition = 100; sveabone_hilt_sword.MaxCondition = 100; sveabone_hilt_sword.Durability = 100; sveabone_hilt_sword.MaxDurability = 100; sveabone_hilt_sword.PoisonCharges = 0; sveabone_hilt_sword.PoisonMaxCharges = 0; sveabone_hilt_sword.PoisonSpellID = 0; sveabone_hilt_sword.ProcSpellID1 = 0; sveabone_hilt_sword.SpellID1 = 0; sveabone_hilt_sword.MaxCharges1 = 0; sveabone_hilt_sword.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(sveabone_hilt_sword); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(sveabonehiltsword)); QuestBehaviour a; a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.Interact, null, Gridash); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5); a.AddAction(eActionType.Talk, "Hail young one! I have noticed that you do not carry one of my fine [bone hilt swords].", Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.Whisper, "bone hilt swords", Gridash); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5); a.AddAction(eActionType.Talk, "Aye! They are some of my finest works! I don't suppose you [would care for one] eh?", Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.Whisper, "would care for one", Gridash); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null, (eComparator)5); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), "Will you do what is asked so that Gridash can make a Sveabone hilt sword?"); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword)); a.AddAction(eActionType.Talk, "No problem. See you", Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword)); a.AddAction(eActionType.Talk, "Oh great then! Run along and buy me a bronze short sword. I should be ready once you return.", Gridash); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.GiveItem, Gridash, bronze_short_sword); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null); a.AddAction(eActionType.Talk, "Good work! I cannot seem to find anymore sveawolf teeth to fashion your weapon. Find one and return it to me.", Gridash); a.AddAction(eActionType.TakeItem, bronze_short_sword, null); a.AddAction(eActionType.IncQuestStep, typeof(sveabonehiltsword), null); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.EnemyKilled, "young sveawof", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), 2, (eComparator)3); a.AddAction(eActionType.GiveItem, sveawolftooth, null); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null); AddBehaviour(a); a = builder.CreateBehaviour(Gridash, -1); a.AddTrigger(eTriggerType.GiveItem, Gridash, sveawolftooth); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), 3, (eComparator)3); a.AddAction(eActionType.Talk, "Here is your completed work. I hope it serves you well!", Gridash); a.AddAction(eActionType.TakeItem, sveawolftooth, null); a.AddAction(eActionType.GiveItem, sveabone_hilt_sword, Gridash); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 450, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.sveabonehiltsword), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End if (Gridash != null) { Gridash.AddQuestToGive(typeof(sveabonehiltsword)); } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Dwarven Guard Rinda", (eRealm)2); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(100).IsDisabled) { DwarvenGuardRinda = new DOL.GS.GameNPC(); DwarvenGuardRinda.Model = 238; DwarvenGuardRinda.Name = "Dwarven Guard Rinda"; if (log.IsWarnEnabled) { log.Warn("Could not find " + DwarvenGuardRinda.Name + ", creating ..."); } DwarvenGuardRinda.GuildName = "Part of " + questTitle + " Quest"; DwarvenGuardRinda.Realm = eRealm.Midgard; DwarvenGuardRinda.CurrentRegionID = 100; DwarvenGuardRinda.Size = 53; DwarvenGuardRinda.Level = 41; DwarvenGuardRinda.MaxSpeedBase = 191; DwarvenGuardRinda.Faction = FactionMgr.GetFactionByID(0); DwarvenGuardRinda.X = 805496; DwarvenGuardRinda.Y = 701215; DwarvenGuardRinda.Z = 4960; DwarvenGuardRinda.Heading = 1570; DwarvenGuardRinda.RespawnInterval = -1; DwarvenGuardRinda.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; DwarvenGuardRinda.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) { DwarvenGuardRinda.SaveIntoDatabase(); } DwarvenGuardRinda.AddToWorld(); } } else { DwarvenGuardRinda = npcs[0]; } npcs = WorldMgr.GetNPCsByName("hobgoblin snake-finder", (eRealm)0); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(100).IsDisabled) { hobgoblinsnakefinder = new DOL.GS.GameNPC(); hobgoblinsnakefinder.Model = 251; hobgoblinsnakefinder.Name = "hobgoblin snake-finder"; if (log.IsWarnEnabled) { log.Warn("Could not find " + hobgoblinsnakefinder.Name + ", creating ..."); } hobgoblinsnakefinder.GuildName = "Part of " + questTitle + " Quest"; hobgoblinsnakefinder.Realm = eRealm.None; hobgoblinsnakefinder.CurrentRegionID = 100; hobgoblinsnakefinder.Size = 37; hobgoblinsnakefinder.Level = 1; hobgoblinsnakefinder.MaxSpeedBase = 191; hobgoblinsnakefinder.Faction = FactionMgr.GetFactionByID(0); hobgoblinsnakefinder.X = 803189; hobgoblinsnakefinder.Y = 695157; hobgoblinsnakefinder.Z = 4926; hobgoblinsnakefinder.Heading = 125; hobgoblinsnakefinder.RespawnInterval = -1; hobgoblinsnakefinder.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; hobgoblinsnakefinder.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) { hobgoblinsnakefinder.SaveIntoDatabase(); } hobgoblinsnakefinder.AddToWorld(); } } else { hobgoblinsnakefinder = npcs[0]; } #endregion #region defineItems rindaskey = GameServer.Database.FindObjectByKey <ItemTemplate>("rindaskey"); if (rindaskey == null) { rindaskey = new ItemTemplate(); rindaskey.Name = "Rinda's Key"; if (log.IsWarnEnabled) { log.Warn("Could not find " + rindaskey.Name + ", creating it ..."); } rindaskey.Level = 50; rindaskey.Weight = 5; rindaskey.Model = 583; rindaskey.Object_Type = 0; rindaskey.Item_Type = 40; rindaskey.Id_nb = "rindaskey"; rindaskey.Hand = 0; rindaskey.Price = 0; rindaskey.IsPickable = true; rindaskey.IsDropable = true; rindaskey.IsTradable = true; rindaskey.CanDropAsLoot = false; rindaskey.Color = 0; rindaskey.Bonus = 35; // default bonus rindaskey.Bonus1 = 0; rindaskey.Bonus1Type = (int)0; rindaskey.Bonus2 = 0; rindaskey.Bonus2Type = (int)0; rindaskey.Bonus3 = 0; rindaskey.Bonus3Type = (int)0; rindaskey.Bonus4 = 0; rindaskey.Bonus4Type = (int)0; rindaskey.Bonus5 = 0; rindaskey.Bonus5Type = (int)0; rindaskey.Bonus6 = 0; rindaskey.Bonus6Type = (int)0; rindaskey.Bonus7 = 0; rindaskey.Bonus7Type = (int)0; rindaskey.Bonus8 = 0; rindaskey.Bonus8Type = (int)0; rindaskey.Bonus9 = 0; rindaskey.Bonus9Type = (int)0; rindaskey.Bonus10 = 0; rindaskey.Bonus10Type = (int)0; rindaskey.ExtraBonus = 0; rindaskey.ExtraBonusType = (int)0; rindaskey.Effect = 0; rindaskey.Emblem = 0; rindaskey.Charges = 0; rindaskey.MaxCharges = 0; rindaskey.SpellID = 0; rindaskey.ProcSpellID = 0; rindaskey.Type_Damage = 0; rindaskey.Realm = 0; rindaskey.MaxCount = 1; rindaskey.PackSize = 1; rindaskey.Extension = 0; rindaskey.Quality = 99; rindaskey.Condition = 50000; rindaskey.MaxCondition = 50000; rindaskey.Durability = 50000; rindaskey.MaxDurability = 50000; rindaskey.PoisonCharges = 0; rindaskey.PoisonMaxCharges = 0; rindaskey.PoisonSpellID = 0; rindaskey.ProcSpellID1 = 0; rindaskey.SpellID1 = 0; rindaskey.MaxCharges1 = 0; rindaskey.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(rindaskey); } } ironkeychain = GameServer.Database.FindObjectByKey <ItemTemplate>("ironkeychain"); if (ironkeychain == null) { ironkeychain = new ItemTemplate(); ironkeychain.Name = "Iron Keychain"; if (log.IsWarnEnabled) { log.Warn("Could not find " + ironkeychain.Name + ", creating it ..."); } ironkeychain.Level = 50; ironkeychain.Weight = 5; ironkeychain.Model = 583; ironkeychain.Object_Type = 0; ironkeychain.Item_Type = 40; ironkeychain.Id_nb = "ironkeychain"; ironkeychain.Hand = 0; ironkeychain.Price = 0; ironkeychain.IsPickable = true; ironkeychain.IsDropable = true; ironkeychain.IsTradable = true; ironkeychain.CanDropAsLoot = false; ironkeychain.Color = 0; ironkeychain.Bonus = 35; // default bonus ironkeychain.Bonus1 = 0; ironkeychain.Bonus1Type = (int)0; ironkeychain.Bonus2 = 0; ironkeychain.Bonus2Type = (int)0; ironkeychain.Bonus3 = 0; ironkeychain.Bonus3Type = (int)0; ironkeychain.Bonus4 = 0; ironkeychain.Bonus4Type = (int)0; ironkeychain.Bonus5 = 0; ironkeychain.Bonus5Type = (int)0; ironkeychain.Bonus6 = 0; ironkeychain.Bonus6Type = (int)0; ironkeychain.Bonus7 = 0; ironkeychain.Bonus7Type = (int)0; ironkeychain.Bonus8 = 0; ironkeychain.Bonus8Type = (int)0; ironkeychain.Bonus9 = 0; ironkeychain.Bonus9Type = (int)0; ironkeychain.Bonus10 = 0; ironkeychain.Bonus10Type = (int)0; ironkeychain.ExtraBonus = 0; ironkeychain.ExtraBonusType = (int)0; ironkeychain.Effect = 0; ironkeychain.Emblem = 0; ironkeychain.Charges = 0; ironkeychain.MaxCharges = 0; ironkeychain.SpellID = 0; ironkeychain.ProcSpellID = 0; ironkeychain.Type_Damage = 0; ironkeychain.Realm = 0; ironkeychain.MaxCount = 1; ironkeychain.PackSize = 1; ironkeychain.Extension = 0; ironkeychain.Quality = 99; ironkeychain.Condition = 50000; ironkeychain.MaxCondition = 50000; ironkeychain.Durability = 50000; ironkeychain.MaxDurability = 50000; ironkeychain.PoisonCharges = 0; ironkeychain.PoisonMaxCharges = 0; ironkeychain.PoisonSpellID = 0; ironkeychain.ProcSpellID1 = 0; ironkeychain.SpellID1 = 0; ironkeychain.MaxCharges1 = 0; ironkeychain.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(ironkeychain); } } 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 = 41; 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; //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(silverringofhealth); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(rindaslostkey)); QuestBehaviour a; a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.Interact, null, DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.rindaslostkey), DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null, (eComparator)5); a.AddAction(eActionType.Talk, "Greetings, and welcome to the dwarf town of Haggerfel. I wish I could stay and talk with you for a moment, but I am in a hurry to find my [lost keys].", DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.Whisper, "lost keys", DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.rindaslostkey), DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null, (eComparator)5); a.AddAction(eActionType.Talk, "Oh yes. It is dreadful that I was so careless as to lost them like this! You see, I am responsible for helping to lock the money the merchants bring in during the day into a large chest. I am the only one with the keys, and I have [misplaced them].", DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.Whisper, "misplaced them", DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.rindaslostkey), DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null, (eComparator)5); a.AddAction(eActionType.Talk, "Oh, this makes me so angry! I have searched all around Haggerfel for them, but they are no where to be found. I don't suppose you would have a [little time] to help me out, would you?", DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.Whisper, "little time", DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.rindaslostkey), DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null, (eComparator)5); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.rindaslostkey), "Will you help Rinda find her keys?"); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.rindaslostkey)); a.AddAction(eActionType.Talk, "No problem. See you", DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.rindaslostkey)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.rindaslostkey), DwarvenGuardRinda); a.AddAction(eActionType.Talk, "Thank you! Thank you! I know there are some hobgoblins around that like to play jokes on people, viscious and mean ones. Why don't you check there while I check the merchant huts again?", DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(hobgoblinsnakefinder, -1); a.AddTrigger(eTriggerType.Interact, null, hobgoblinsnakefinder); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), 1, (eComparator)3); a.AddAction(eActionType.Talk, "Ha ha! Me no have keys! Feed to hungry bear! haha! You no help Rinda...Gold be ours!", hobgoblinsnakefinder); a.AddAction(eActionType.GiveItem, ironkeychain, hobgoblinsnakefinder); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.EnemyKilled, "black mauler cub", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), 2, (eComparator)3); a.AddAction(eActionType.GiveItem, rindaskey, null); a.AddAction(eActionType.IncQuestStep, typeof(rindaslostkey), null); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.Interact, null, DwarvenGuardRinda); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), 3, (eComparator)3); a.AddAction(eActionType.Talk, "I couldn't find them again in the village. Did you have better luck?", DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.GiveItem, DwarvenGuardRinda, ironkeychain); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), 3, (eComparator)3); a.AddAction(eActionType.Talk, "Oh my keychain. Well, this is a good start. But you didn't happen to find my key, did you?", DwarvenGuardRinda); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 225, null); a.AddAction(eActionType.TakeItem, ironkeychain, null); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.GiveItem, DwarvenGuardRinda, rindaskey); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), 3, (eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, ironkeychain, null, (eComparator)3); a.AddAction(eActionType.Talk, "Ah! This is great! My key! You have done a fabulous job in helping me. Please accept this coin in return for your time and effort. Thank you so much! Now, I can safely lock up the town's money. Thank you!", DwarvenGuardRinda); a.AddAction(eActionType.TakeItem, rindaskey, null); a.AddAction(eActionType.TakeItem, ironkeychain, null); a.AddAction(eActionType.GiveXP, 40, null); a.AddAction(eActionType.GiveGold, 450, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null); a.AddAction(eActionType.GiveItem, silverringofhealth, DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda, -1); a.AddTrigger(eTriggerType.GiveItem, DwarvenGuardRinda, rindaskey); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.rindaslostkey), 3, (eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, ironkeychain, null, (eComparator)1); a.AddAction(eActionType.Talk, "Ah! This is great! My key! You have done a fabulous job in helping me. Please accept this coin in return for your time and effort. Thank you so much! Now, I can safely lock up the town's money. Thank you!", DwarvenGuardRinda); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 225, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.rindaslostkey), null); a.AddAction(eActionType.TakeItem, rindaskey, null); a.AddAction(eActionType.GiveItem, silverringofhealth, DwarvenGuardRinda); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End if (DwarvenGuardRinda != null) { DwarvenGuardRinda.AddQuestToGive(typeof(rindaslostkey)); } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Ambient Rat Statua", (eRealm)0); if (npcs.Length == 0) { AmbientRatStatua = new DOL.GS.GameNPC(); AmbientRatStatua.Model = 1673; AmbientRatStatua.Name = "Ambient Rat Statua"; if (log.IsWarnEnabled) { log.Warn("Could not find " + AmbientRatStatua.Name + ", creating ..."); } AmbientRatStatua.GuildName = "Part of " + questTitle + " Quest"; AmbientRatStatua.Realm = eRealm.None; AmbientRatStatua.CurrentRegionID = 229; AmbientRatStatua.Size = 1; AmbientRatStatua.Level = 1; AmbientRatStatua.MaxSpeedBase = 0; AmbientRatStatua.X = 40887; AmbientRatStatua.Y = 39276; AmbientRatStatua.Z = 17040; AmbientRatStatua.Heading = 0; AmbientRatStatua.RespawnInterval = -1; AmbientRatStatua.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; AmbientRatStatua.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { AmbientRatStatua.SaveIntoDatabase(); } AmbientRatStatua.AddToWorld(); } else { AmbientRatStatua = npcs[0]; } npcs = WorldMgr.GetNPCsByName("Ballach", (eRealm)2); if (npcs.Length == 0) { Ballach = new DOL.GS.GameNPC(); Ballach.Model = 225; Ballach.Name = "Ballach"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Ballach.Name + ", creating ..."); } Ballach.GuildName = "Part of " + questTitle + " Quest"; Ballach.Realm = eRealm.Midgard; Ballach.CurrentRegionID = 243; Ballach.Size = 48; Ballach.Level = 20; Ballach.MaxSpeedBase = 0; Ballach.Faction = FactionMgr.GetFactionByID(0); Ballach.X = 27723; Ballach.Y = 39184; Ballach.Z = 20156; Ballach.Heading = 2070; Ballach.RespawnInterval = -1; Ballach.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Ballach.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Ballach.SaveIntoDatabase(); } Ballach.AddToWorld(); } else { Ballach = npcs[0]; } #endregion #region defineItems enchantedflask = GameServer.Database.FindObjectByKey <ItemTemplate>("enchantedflask"); if (enchantedflask == null) { enchantedflask = new ItemTemplate(); enchantedflask.Name = "Enchanted Flask"; if (log.IsWarnEnabled) { log.Warn("Could not find " + enchantedflask.Name + ", creating it ..."); } enchantedflask.Level = 1; enchantedflask.Weight = 5; enchantedflask.Model = 99; enchantedflask.Object_Type = 0; enchantedflask.Item_Type = 40; enchantedflask.Id_nb = "enchantedflask"; enchantedflask.Hand = 0; enchantedflask.Price = 0; enchantedflask.IsPickable = true; enchantedflask.IsDropable = true; enchantedflask.IsTradable = false; enchantedflask.CanDropAsLoot = false; enchantedflask.Color = 0; enchantedflask.Bonus = 35; // default bonus enchantedflask.Bonus1 = 0; enchantedflask.Bonus1Type = (int)0; enchantedflask.Bonus2 = 0; enchantedflask.Bonus2Type = (int)0; enchantedflask.Bonus3 = 0; enchantedflask.Bonus3Type = (int)0; enchantedflask.Bonus4 = 0; enchantedflask.Bonus4Type = (int)0; enchantedflask.Bonus5 = 0; enchantedflask.Bonus5Type = (int)0; enchantedflask.Bonus6 = 0; enchantedflask.Bonus6Type = (int)0; enchantedflask.Bonus7 = 0; enchantedflask.Bonus7Type = (int)0; enchantedflask.Bonus8 = 0; enchantedflask.Bonus8Type = (int)0; enchantedflask.Bonus9 = 0; enchantedflask.Bonus9Type = (int)0; enchantedflask.Bonus10 = 0; enchantedflask.Bonus10Type = (int)0; enchantedflask.ExtraBonus = 0; enchantedflask.ExtraBonusType = (int)0; enchantedflask.Effect = 0; enchantedflask.Emblem = 0; enchantedflask.Charges = 0; enchantedflask.MaxCharges = 0; enchantedflask.SpellID = 0; enchantedflask.ProcSpellID = 0; enchantedflask.Type_Damage = 0; enchantedflask.Realm = 2; enchantedflask.MaxCount = 1; enchantedflask.PackSize = 1; enchantedflask.Extension = 0; enchantedflask.Quality = 99; enchantedflask.Condition = 100; enchantedflask.MaxCondition = 100; enchantedflask.Durability = 100; enchantedflask.MaxDurability = 100; enchantedflask.PoisonCharges = 0; enchantedflask.PoisonMaxCharges = 0; enchantedflask.PoisonSpellID = 0; enchantedflask.ProcSpellID1 = 0; enchantedflask.SpellID1 = 0; enchantedflask.MaxCharges1 = 0; enchantedflask.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(enchantedflask); } } Flaskofetherealessence = GameServer.Database.FindObjectByKey <ItemTemplate>("Flaskofetherealessence"); if (Flaskofetherealessence == null) { Flaskofetherealessence = new ItemTemplate(); Flaskofetherealessence.Name = "Flask of Ethereal Essence"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Flaskofetherealessence.Name + ", creating it ..."); } Flaskofetherealessence.Level = 1; Flaskofetherealessence.Weight = 5; Flaskofetherealessence.Model = 99; Flaskofetherealessence.Object_Type = 0; Flaskofetherealessence.Item_Type = 40; Flaskofetherealessence.Id_nb = "Flaskofetherealessence"; Flaskofetherealessence.Hand = 0; Flaskofetherealessence.Price = 0; Flaskofetherealessence.IsPickable = true; Flaskofetherealessence.IsDropable = true; Flaskofetherealessence.IsTradable = false; Flaskofetherealessence.CanDropAsLoot = false; Flaskofetherealessence.Color = 0; Flaskofetherealessence.Bonus = 35; // default bonus Flaskofetherealessence.Bonus1 = 0; Flaskofetherealessence.Bonus1Type = (int)0; Flaskofetherealessence.Bonus2 = 0; Flaskofetherealessence.Bonus2Type = (int)0; Flaskofetherealessence.Bonus3 = 0; Flaskofetherealessence.Bonus3Type = (int)0; Flaskofetherealessence.Bonus4 = 0; Flaskofetherealessence.Bonus4Type = (int)0; Flaskofetherealessence.Bonus5 = 0; Flaskofetherealessence.Bonus5Type = (int)0; Flaskofetherealessence.Bonus6 = 0; Flaskofetherealessence.Bonus6Type = (int)0; Flaskofetherealessence.Bonus7 = 0; Flaskofetherealessence.Bonus7Type = (int)0; Flaskofetherealessence.Bonus8 = 0; Flaskofetherealessence.Bonus8Type = (int)0; Flaskofetherealessence.Bonus9 = 0; Flaskofetherealessence.Bonus9Type = (int)0; Flaskofetherealessence.Bonus10 = 0; Flaskofetherealessence.Bonus10Type = (int)0; Flaskofetherealessence.ExtraBonus = 0; Flaskofetherealessence.ExtraBonusType = (int)0; Flaskofetherealessence.Effect = 0; Flaskofetherealessence.Emblem = 0; Flaskofetherealessence.Charges = 0; Flaskofetherealessence.MaxCharges = 0; Flaskofetherealessence.SpellID = 0; Flaskofetherealessence.ProcSpellID = 0; Flaskofetherealessence.Type_Damage = 0; Flaskofetherealessence.Realm = 2; Flaskofetherealessence.MaxCount = 1; Flaskofetherealessence.PackSize = 1; Flaskofetherealessence.Extension = 0; Flaskofetherealessence.Quality = 99; Flaskofetherealessence.Condition = 100; Flaskofetherealessence.MaxCondition = 100; Flaskofetherealessence.Durability = 100; Flaskofetherealessence.MaxDurability = 100; Flaskofetherealessence.PoisonCharges = 0; Flaskofetherealessence.PoisonMaxCharges = 0; Flaskofetherealessence.PoisonSpellID = 0; Flaskofetherealessence.ProcSpellID1 = 0; Flaskofetherealessence.SpellID1 = 0; Flaskofetherealessence.MaxCharges1 = 0; Flaskofetherealessence.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(Flaskofetherealessence); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(essenceoflife)); QuestBehaviour a; a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.Interact, null, Ballach); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.essenceoflife), Ballach); a.AddAction(eActionType.Talk, "Greetings Guardian. I have some [business] that needs tended to. There is some coin involved in it for you.", Ballach); AddBehaviour(a); a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.Whisper, "business", Ballach); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.essenceoflife), Ballach); a.AddAction(eActionType.Talk, "I am running low on Essence of Life. Do you think you could retrieve some for me?", Ballach); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.essenceoflife), "Will you aid Ballach and retrieve some Essence of Life? [Levels 1-4]"); AddBehaviour(a); a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.essenceoflife)); a.AddAction(eActionType.Talk, "No problem. See you.", Ballach); AddBehaviour(a); a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.essenceoflife)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.essenceoflife), Ballach); a.AddAction(eActionType.Talk, "Thank you very much for offering to help. Here, take this enchanted flask. You will need to find a grave in the Burial Grounds. When you find one, use the flask and capture the essence of life that rests in the buried persons remains.", Ballach); a.AddAction(eActionType.GiveItem, enchantedflask, Ballach); AddBehaviour(a); a = builder.CreateBehaviour(AmbientRatStatua, -1); a.AddTrigger(eTriggerType.ItemUsed, null, enchantedflask); a.AddRequirement(eRequirementType.Distance, AmbientRatStatua, 1000, (eComparator)1); a.AddAction(eActionType.Timer, "flask", 4000); a.AddAction(eActionType.Message, "You fill the flask", (eTextType)1); AddBehaviour(a); a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.Timer, "flask", null); a.AddAction(eActionType.ReplaceItem, enchantedflask, Flaskofetherealessence); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.essenceoflife), null); AddBehaviour(a); a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.Interact, null, Ballach); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.essenceoflife), 2, (eComparator)3); a.AddAction(eActionType.Talk, "Did you collect the essence for me? If so, hand me the flask.", Ballach); AddBehaviour(a); a = builder.CreateBehaviour(Ballach, -1); a.AddTrigger(eTriggerType.GiveItem, Ballach, Flaskofetherealessence); a.AddAction(eActionType.Talk, "Thank you for taking on this task for me. You have replenished my supply. Here, take this small monetary reward.", Ballach); a.AddAction(eActionType.GiveXP, 60, null); a.AddAction(eActionType.GiveGold, 18, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.essenceoflife), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End Ballach.AddQuestToGive(typeof(essenceoflife)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Torold Sterkkriger", (eRealm)2); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(151).IsDisabled) { ToroldSterkkriger = new DOL.GS.GameNPC(); ToroldSterkkriger.Model = 522; ToroldSterkkriger.Name = "Torold Sterkkriger"; if (log.IsWarnEnabled) { log.Warn("Could not find " + ToroldSterkkriger.Name + ", creating ..."); } ToroldSterkkriger.GuildName = "Part of " + questTitle + " Quest"; ToroldSterkkriger.Realm = eRealm.Midgard; ToroldSterkkriger.CurrentRegionID = 151; ToroldSterkkriger.Size = 50; ToroldSterkkriger.Level = 55; ToroldSterkkriger.MaxSpeedBase = 191; ToroldSterkkriger.Faction = FactionMgr.GetFactionByID(0); ToroldSterkkriger.X = 287623; ToroldSterkkriger.Y = 355226; ToroldSterkkriger.Z = 3488; ToroldSterkkriger.Heading = 3788; ToroldSterkkriger.RespawnInterval = -1; ToroldSterkkriger.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; ToroldSterkkriger.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { ToroldSterkkriger.SaveIntoDatabase(); } ToroldSterkkriger.AddToWorld(); } } else { ToroldSterkkriger = npcs[0]; } npcs = WorldMgr.GetNPCsByName("Jorund Bruttstein", (eRealm)2); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(151).IsDisabled) { JorundBruttstein = new DOL.GS.GameNPC(); JorundBruttstein.Model = 513; JorundBruttstein.Name = "Jorund Bruttstein"; if (log.IsWarnEnabled) { log.Warn("Could not find " + JorundBruttstein.Name + ", creating ..."); } JorundBruttstein.GuildName = "Part of " + questTitle + " Quest"; JorundBruttstein.Realm = eRealm.Midgard; JorundBruttstein.CurrentRegionID = 151; JorundBruttstein.Size = 52; JorundBruttstein.Level = 50; JorundBruttstein.MaxSpeedBase = 191; JorundBruttstein.Faction = FactionMgr.GetFactionByID(0); JorundBruttstein.X = 287884; JorundBruttstein.Y = 356307; JorundBruttstein.Z = 3488; JorundBruttstein.Heading = 3163; JorundBruttstein.RespawnInterval = -1; JorundBruttstein.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; JorundBruttstein.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { JorundBruttstein.SaveIntoDatabase(); } JorundBruttstein.AddToWorld(); } } else { JorundBruttstein = npcs[0]; } #endregion #region defineItems marinefungusroot = GameServer.Database.FindObjectByKey <ItemTemplate>("marinefungusroot"); if (marinefungusroot == null) { marinefungusroot = new ItemTemplate(); marinefungusroot.Name = "Marine Fungus Root"; if (log.IsWarnEnabled) { log.Warn("Could not find " + marinefungusroot.Name + ", creating it ..."); } marinefungusroot.Level = 50; marinefungusroot.Weight = 5; marinefungusroot.Model = 546; marinefungusroot.Object_Type = 0; marinefungusroot.Item_Type = 40; marinefungusroot.Id_nb = "marinefungusroot"; marinefungusroot.Hand = 0; marinefungusroot.Price = 0; marinefungusroot.IsPickable = true; marinefungusroot.IsDropable = true; marinefungusroot.IsTradable = true; marinefungusroot.CanDropAsLoot = false; marinefungusroot.Color = 0; marinefungusroot.Bonus = 35; // default bonus marinefungusroot.Bonus1 = 0; marinefungusroot.Bonus1Type = (int)0; marinefungusroot.Bonus2 = 0; marinefungusroot.Bonus2Type = (int)0; marinefungusroot.Bonus3 = 0; marinefungusroot.Bonus3Type = (int)0; marinefungusroot.Bonus4 = 0; marinefungusroot.Bonus4Type = (int)0; marinefungusroot.Bonus5 = 0; marinefungusroot.Bonus5Type = (int)0; marinefungusroot.Bonus6 = 0; marinefungusroot.Bonus6Type = (int)0; marinefungusroot.Bonus7 = 0; marinefungusroot.Bonus7Type = (int)0; marinefungusroot.Bonus8 = 0; marinefungusroot.Bonus8Type = (int)0; marinefungusroot.Bonus9 = 0; marinefungusroot.Bonus9Type = (int)0; marinefungusroot.Bonus10 = 0; marinefungusroot.Bonus10Type = (int)0; marinefungusroot.ExtraBonus = 0; marinefungusroot.ExtraBonusType = (int)0; marinefungusroot.Effect = 0; marinefungusroot.Emblem = 0; marinefungusroot.Charges = 0; marinefungusroot.MaxCharges = 0; marinefungusroot.SpellID = 0; marinefungusroot.ProcSpellID = 0; marinefungusroot.Type_Damage = 0; marinefungusroot.Realm = 0; marinefungusroot.MaxCount = 1; marinefungusroot.PackSize = 1; marinefungusroot.Extension = 0; marinefungusroot.Quality = 99; marinefungusroot.Condition = 50000; marinefungusroot.MaxCondition = 50000; marinefungusroot.Durability = 50000; marinefungusroot.MaxDurability = 50000; marinefungusroot.PoisonCharges = 0; marinefungusroot.PoisonMaxCharges = 0; marinefungusroot.PoisonSpellID = 0; marinefungusroot.ProcSpellID1 = 0; marinefungusroot.SpellID1 = 0; marinefungusroot.MaxCharges1 = 0; marinefungusroot.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(marinefungusroot); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(trialofstrength)); QuestBehaviour a; a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestGivable, typeof(trialofstrength), ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Vikings to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Viking like you by the presence of [Morvaltar].", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Rogue to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Rogue like you by the presence of [Morvaltar].", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "Morvaltar", ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); a.AddAction(eActionType.Talk, "As you may know, the Morvaltar are your wild cousins. We of Midgard do not fear Valkyn like you, for as a group you have more than proven your loyalty to King Goran. Many Valkyn have also proven that they are strong, intelligent, and brave. These are [the qualities] that all Vikings must possess before they can choose where their destiny lies.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Vikings from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Rogues from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "prove your strength", ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); a.AddAction(eActionType.OfferQuest, typeof(trialofstrength), "Will you prove you have the strength to survive in the land of Aegir?"); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength)); a.AddAction(eActionType.Talk, "No problem. See you", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); a.AddAction(eActionType.Talk, "Seek out Jorund Bruttstein in Aegirhamn. Tell him your name when he asks.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Lo, I see a young Viking before me. What is your name? Speak up!", JorundBruttstein); a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "Lo, I see a young Rogue before me. What is your name? Speak up!", JorundBruttstein); a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Whisper, "one of the creatures", JorundBruttstein); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3); a.AddAction(eActionType.Talk, "You must seek out a marine fungus. They may be found in the waters south and southwest of here. Find one and defeat it. Once you have, obtain proof that you have accomplished this test. Return to me here.", JorundBruttstein); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.EnemyKilled, "marine fungus", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3); a.AddAction(eActionType.GiveItem, marinefungusroot, null); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 3, (eComparator)3); a.AddAction(eActionType.Talk, "So, you managed to survive, but anyone can run away. Show me the proof you defeated the marine fungus.", JorundBruttstein); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Well done. I do not like to be so rough with young Vikings, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 230, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "\"Well done. I do not like to be so rough with young Rogues, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 230, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End if (ToroldSterkkriger != null) { ToroldSterkkriger.AddQuestToGive(typeof(trialofstrength)); } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Sir Quait", (eRealm)1); if (npcs.Length == 0) { SirQuait = new DOL.GS.GameNPC(); SirQuait.Model = 40; SirQuait.Name = "Sir Quait"; if (log.IsWarnEnabled) { log.Warn("Could not find " + SirQuait.Name + ", creating ..."); } SirQuait.GuildName = "Part of " + questTitle + " Quest"; SirQuait.Realm = eRealm.Albion; SirQuait.CurrentRegionID = 1; SirQuait.Size = 50; SirQuait.Level = 10; SirQuait.MaxSpeedBase = 100; SirQuait.Faction = FactionMgr.GetFactionByID(0); SirQuait.X = 531971; SirQuait.Y = 478955; SirQuait.Z = 0; SirQuait.Heading = 3570; SirQuait.RespawnInterval = 0; SirQuait.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; SirQuait.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { SirQuait.SaveIntoDatabase(); } SirQuait.AddToWorld(); } else { SirQuait = npcs[0]; } npcs = WorldMgr.GetNPCsByName("Evil Thief of the Shadowclan", (eRealm)0); if (npcs.Length == 0) { EvilThiefoftheShadowclan = new DOL.GS.GameNPC(); EvilThiefoftheShadowclan.Model = 55; EvilThiefoftheShadowclan.Name = "Evil Thief of the Shadowclan"; if (log.IsWarnEnabled) { log.Warn("Could not find " + EvilThiefoftheShadowclan.Name + ", creating ..."); } EvilThiefoftheShadowclan.GuildName = "Part of " + questTitle + " Quest"; EvilThiefoftheShadowclan.Realm = eRealm.None; EvilThiefoftheShadowclan.CurrentRegionID = 1; EvilThiefoftheShadowclan.Size = 50; EvilThiefoftheShadowclan.Level = 1; EvilThiefoftheShadowclan.MaxSpeedBase = 100; EvilThiefoftheShadowclan.Faction = FactionMgr.GetFactionByID(0); EvilThiefoftheShadowclan.X = 532571; EvilThiefoftheShadowclan.Y = 479055; EvilThiefoftheShadowclan.Z = 2200; EvilThiefoftheShadowclan.Heading = 3570; EvilThiefoftheShadowclan.RespawnInterval = 0; EvilThiefoftheShadowclan.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; EvilThiefoftheShadowclan.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { EvilThiefoftheShadowclan.SaveIntoDatabase(); } EvilThiefoftheShadowclan.AddToWorld(); } else { EvilThiefoftheShadowclan = npcs[0]; } #endregion #region defineItems SirQuaitsSword = GameServer.Database.FindObjectByKey <ItemTemplate>("SirQuaitsSword"); if (SirQuaitsSword == null) { SirQuaitsSword = new ItemTemplate(); SirQuaitsSword.Name = "Sir Quait's Sword"; if (log.IsWarnEnabled) { log.Warn("Could not find " + SirQuaitsSword.Name + ", creating it ..."); } SirQuaitsSword.Level = 1; SirQuaitsSword.Weight = 0; SirQuaitsSword.Model = 847; SirQuaitsSword.Object_Type = 0; SirQuaitsSword.Item_Type = 0; SirQuaitsSword.Id_nb = "SirQuaitsSword"; SirQuaitsSword.Hand = 0; SirQuaitsSword.Price = 0; SirQuaitsSword.IsPickable = false; SirQuaitsSword.IsDropable = false; SirQuaitsSword.IsTradable = true; SirQuaitsSword.CanDropAsLoot = true; SirQuaitsSword.Color = 0; SirQuaitsSword.Bonus = 0; // default bonus SirQuaitsSword.Bonus1 = 0; SirQuaitsSword.Bonus1Type = (int)0; SirQuaitsSword.Bonus2 = 0; SirQuaitsSword.Bonus2Type = (int)0; SirQuaitsSword.Bonus3 = 0; SirQuaitsSword.Bonus3Type = (int)0; SirQuaitsSword.Bonus4 = 0; SirQuaitsSword.Bonus4Type = (int)0; SirQuaitsSword.Bonus5 = 0; SirQuaitsSword.Bonus5Type = (int)0; SirQuaitsSword.Bonus6 = 0; SirQuaitsSword.Bonus6Type = (int)0; SirQuaitsSword.Bonus7 = 0; SirQuaitsSword.Bonus7Type = (int)0; SirQuaitsSword.Bonus8 = 0; SirQuaitsSword.Bonus8Type = (int)0; SirQuaitsSword.Bonus9 = 0; SirQuaitsSword.Bonus9Type = (int)0; SirQuaitsSword.Bonus10 = 0; SirQuaitsSword.Bonus10Type = (int)0; SirQuaitsSword.ExtraBonus = 0; SirQuaitsSword.ExtraBonusType = (int)0; SirQuaitsSword.Effect = 0; SirQuaitsSword.Emblem = 0; SirQuaitsSword.Charges = 0; SirQuaitsSword.MaxCharges = 0; SirQuaitsSword.SpellID = 0; SirQuaitsSword.ProcSpellID = 0; SirQuaitsSword.Type_Damage = 0; SirQuaitsSword.Realm = 0; SirQuaitsSword.MaxCount = 1; SirQuaitsSword.PackSize = 1; SirQuaitsSword.Extension = 0; SirQuaitsSword.Quality = 1; SirQuaitsSword.Condition = 1; SirQuaitsSword.MaxCondition = 1; SirQuaitsSword.Durability = 1; SirQuaitsSword.MaxDurability = 1; SirQuaitsSword.PoisonCharges = 0; SirQuaitsSword.PoisonMaxCharges = 0; SirQuaitsSword.PoisonSpellID = 0; SirQuaitsSword.ProcSpellID1 = 0; SirQuaitsSword.SpellID1 = 0; SirQuaitsSword.MaxCharges1 = 0; SirQuaitsSword.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database GameServer.Database.AddObject(SirQuaitsSword); } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(HelpSirQuait)); QuestBehaviour a; a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Interact, null, SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5); a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait); a.AddAction(eActionType.Talk, "Hello adventurer, an [evil thief] has stolen my [sword], can [you help me] get it back?", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Whisper, "sword", SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5); a.AddAction(eActionType.Talk, "I really need it and if [you help me], I will give you a little reward!", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Whisper, "sword", SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null); a.AddAction(eActionType.Talk, "I really need it I am so glad you are helping me!", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Whisper, "evil thief", SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5); a.AddAction(eActionType.Talk, "This evil thief of the shadowclan bastard, he stole it! Kill him and get my [sword] back to me!", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Whisper, "you help me", SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null, (eComparator)5); a.AddAction(eActionType.OfferQuest, typeof(HelpSirQuait), "Do you want to help Sir Quait?"); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Whisper, "find", SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null); a.AddAction(eActionType.Talk, "Really!? Please give it to me!", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.Interact, null, SirQuait); a.AddRequirement(eRequirementType.QuestPending, typeof(HelpSirQuait), null); a.AddAction(eActionType.Talk, "Did you [find] my [sword]?", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(HelpSirQuait)); a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait); a.AddAction(eActionType.Talk, "Oh well, if you change your mind, please come back!", SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(HelpSirQuait)); a.AddRequirement(eRequirementType.QuestGivable, typeof(HelpSirQuait), SirQuait); a.AddAction(eActionType.Talk, "Thank you! Please bring the [sword] back to me!", SirQuait); a.AddAction(eActionType.GiveQuest, typeof(HelpSirQuait), SirQuait); AddBehaviour(a); a = builder.CreateBehaviour(EvilThiefoftheShadowclan, -1); a.AddTrigger(eTriggerType.EnemyKilled, null, EvilThiefoftheShadowclan); a.AddRequirement(eRequirementType.QuestStep, typeof(HelpSirQuait), 1, (eComparator)3); a.AddAction(eActionType.Message, "You defeated the evil thief and quickly pick up Sir Quait's sword!", (eTextType)1); a.AddAction(eActionType.GiveItem, SirQuaitsSword, null); AddBehaviour(a); a = builder.CreateBehaviour(SirQuait, -1); a.AddTrigger(eTriggerType.GiveItem, SirQuait, SirQuaitsSword); a.AddRequirement(eRequirementType.QuestStep, typeof(HelpSirQuait), 1, (eComparator)3); a.AddAction(eActionType.Message, "Sir Quait thanks you for bringing back his holy sword!", (eTextType)1); a.AddAction(eActionType.TakeItem, SirQuaitsSword, null); a.AddAction(eActionType.FinishQuest, typeof(HelpSirQuait), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End SirQuait.AddQuestToGive(typeof(HelpSirQuait)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Lycla", (eRealm)2); if (npcs.Length == 0) { Lycla = new DOL.GS.GameNPC(); Lycla.Model = 178; Lycla.Name = "Lycla"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Lycla.Name + ", creating ..."); } Lycla.GuildName = "Part of " + questTitle + " Quest"; Lycla.Realm = eRealm.Midgard; Lycla.CurrentRegionID = 100; Lycla.Size = 48; Lycla.Level = 50; Lycla.MaxSpeedBase = 191; Lycla.Faction = FactionMgr.GetFactionByID(0); Lycla.X = 749032; Lycla.Y = 814613; Lycla.Z = 4408; Lycla.Heading = 170; Lycla.RespawnInterval = -1; Lycla.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Lycla.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Lycla.SaveIntoDatabase(); } Lycla.AddToWorld(); } else { Lycla = npcs[0]; } npcs = WorldMgr.GetNPCsByName("Amora", (eRealm)2); if (npcs.Length == 0) { Amora = new DOL.GS.GameNPC(); Amora.Model = 216; Amora.Name = "Amora"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Amora.Name + ", creating ..."); } Amora.GuildName = "Part of " + questTitle + " Quest"; Amora.Realm = eRealm.Midgard; Amora.CurrentRegionID = 100; Amora.Size = 49; Amora.Level = 28; Amora.MaxSpeedBase = 191; Amora.Faction = FactionMgr.GetFactionByID(0); Amora.X = 747714; Amora.Y = 814910; Amora.Z = 4636; Amora.Heading = 3456; Amora.RespawnInterval = -1; Amora.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Amora.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Amora.SaveIntoDatabase(); } Amora.AddToWorld(); } else { Amora = npcs[0]; } npcs = WorldMgr.GetNPCsByName("Kari", (eRealm)2); if (npcs.Length == 0) { Kari = new GameHealer(); Kari.Model = 216; Kari.Name = "Kari"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Kari.Name + ", creating ..."); } Kari.GuildName = "Part of " + questTitle + " Quest"; Kari.Realm = eRealm.Midgard; Kari.CurrentRegionID = 100; Kari.Size = 51; Kari.Level = 20; Kari.MaxSpeedBase = 191; Kari.Faction = FactionMgr.GetFactionByID(0); Kari.X = 749114; Kari.Y = 814019; Kari.Z = 4408; Kari.Heading = 3595; Kari.RespawnInterval = -1; Kari.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Kari.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Kari.SaveIntoDatabase(); } Kari.AddToWorld(); } else { Kari = npcs[0]; } #endregion #region defineItems snakevenom = GameServer.Database.FindObjectByKey <ItemTemplate>("snakevenom"); if (snakevenom == null) { snakevenom = new ItemTemplate(); snakevenom.Name = "Snake Venom"; if (log.IsWarnEnabled) { log.Warn("Could not find " + snakevenom.Name + ", creating it ..."); } snakevenom.Level = 1; snakevenom.Weight = 1; snakevenom.Model = 488; snakevenom.Object_Type = 46; snakevenom.Item_Type = -1; snakevenom.Id_nb = "snakevenom"; snakevenom.Hand = 0; snakevenom.Price = 0; snakevenom.IsPickable = true; snakevenom.IsDropable = true; snakevenom.IsTradable = true; snakevenom.CanDropAsLoot = true; snakevenom.Color = 0; snakevenom.Bonus = 0; // default bonus snakevenom.Bonus1 = 0; snakevenom.Bonus1Type = (int)0; snakevenom.Bonus2 = 0; snakevenom.Bonus2Type = (int)0; snakevenom.Bonus3 = 0; snakevenom.Bonus3Type = (int)0; snakevenom.Bonus4 = 0; snakevenom.Bonus4Type = (int)0; snakevenom.Bonus5 = 0; snakevenom.Bonus5Type = (int)0; snakevenom.Bonus6 = 0; snakevenom.Bonus6Type = (int)0; snakevenom.Bonus7 = 0; snakevenom.Bonus7Type = (int)0; snakevenom.Bonus8 = 0; snakevenom.Bonus8Type = (int)0; snakevenom.Bonus9 = 0; snakevenom.Bonus9Type = (int)0; snakevenom.Bonus10 = 0; snakevenom.Bonus10Type = (int)0; snakevenom.ExtraBonus = 0; snakevenom.ExtraBonusType = (int)0; snakevenom.Effect = 0; snakevenom.Emblem = 0; snakevenom.Charges = 0; snakevenom.MaxCharges = 0; snakevenom.SpellID = 0; snakevenom.ProcSpellID = 0; snakevenom.Type_Damage = 0; snakevenom.Realm = 0; snakevenom.MaxCount = 1; snakevenom.PackSize = 1; snakevenom.Extension = 0; snakevenom.Quality = 100; snakevenom.Condition = 100; snakevenom.MaxCondition = 100; snakevenom.Durability = 100; snakevenom.MaxDurability = 100; snakevenom.PoisonCharges = 0; snakevenom.PoisonMaxCharges = 0; snakevenom.PoisonSpellID = 0; snakevenom.ProcSpellID1 = 0; snakevenom.SpellID1 = 0; snakevenom.MaxCharges1 = 0; snakevenom.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(snakevenom); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(Amorasaidmistyc)); QuestBehaviour a; a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.Interact, null, Lycla); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null, (eComparator)5); a.AddAction(eActionType.Talk, "The lady Amora here in Fort Atla has been here for several weeks because she is [unable] to travel.", Lycla); AddBehaviour(a); a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.Whisper, "unable", Lycla); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null, (eComparator)5); a.AddAction(eActionType.Talk, "Her daughter, Magnild has fallen [ill].", Lycla); AddBehaviour(a); a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.Whisper, "ill", Lycla); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null, (eComparator)5); a.AddAction(eActionType.Talk, "They have been staying in one of the homes here in town to keep the poor girl warm. Please help them, they are in great need.", Lycla); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), "The Lady Amora needs your help in curing her sick daughter."); AddBehaviour(a); a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc)); a.AddAction(eActionType.Talk, "No problem. See you.", Lycla); AddBehaviour(a); a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), Lycla); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Interact, null, Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "Be still Magnild, all will be alright soon and you will be well once again.", Amora); a.AddAction(eActionType.Talk, "Hello stranger, may I ask your [name]?", Amora); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Whisper, "name", Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "It is a pleasure to meet you. I am so glad you have come to aid me and [Magnild].", Amora); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Whisper, "Magnild", Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "Yes, my poor darling Magnild was bitten by a [water snake] while traveling into town. Unfortunately, the bite has not healed and she is not feeling very well at all.", Amora); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Whisper, "water snake", Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "Oh, it seems the venom of the snake was very powerful. I have sent word to t he healer and she has told me she needs five vials of [snake venom] to cure the child.", Amora); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Whisper, "snake venom", Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "I do not feel right leaving Magnild [here alone] this ill, so I fear I can't hunt the snakes myself.", Amora); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Whisper, "here alone", Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "Please go outside the city and [collect] the five vials of venom and take them to Kari, the healer.", Amora); AddBehaviour(a); a = builder.CreateBehaviour(Amora, -1); a.AddTrigger(eTriggerType.Whisper, "collect", Amora); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 1, (eComparator)3); a.AddAction(eActionType.Talk, "I am indebted to you always if you do the for me.", Amora); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 2); AddBehaviour(a); a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.EnemyKilled, "water snake", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 2, (eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, snakevenom, 4, (eComparator)1); a.AddAction(eActionType.GiveItem, snakevenom, null); AddBehaviour(a); a = builder.CreateBehaviour(Lycla, -1); a.AddTrigger(eTriggerType.EnemyKilled, "water snake", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 2, (eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, snakevenom, 4, (eComparator)3); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 3); a.AddAction(eActionType.GiveItem, snakevenom, null); AddBehaviour(a); a = builder.CreateBehaviour(Kari, -1); a.AddTrigger(eTriggerType.Interact, null, Kari); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 3, (eComparator)3); a.AddAction(eActionType.Talk, "Ahh, you look as if you have been having a rough time. Have you brought me the vials of snake venom?", Kari); a.AddAction(eActionType.TakeItem, snakevenom, 5); a.AddAction(eActionType.Talk, "\"I shall begin [work] at once in making the potion to cure the sick girl, hopefully all my training will not fail me.", Kari); AddBehaviour(a); a = builder.CreateBehaviour(Kari, -1); a.AddTrigger(eTriggerType.Whisper, "work", Kari); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), 3, (eComparator)3); a.AddAction(eActionType.Talk, "You have aided in this situation beyond what is expected. I thnk you.", Kari); a.AddAction(eActionType.GiveXP, 10, null); a.AddAction(eActionType.GiveGold, 42, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Amorasaidmistyc), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End Lycla.AddQuestToGive(typeof(Amorasaidmistyc)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName("Helen", (eRealm)2); if (npcs.Length == 0) { Helen = new DOL.GS.GameNPC(); Helen.Model = 193; Helen.Name = "Helen"; if (log.IsWarnEnabled) { log.Warn("Could not find " + Helen.Name + ", creating ..."); } Helen.GuildName = "Part of " + questTitle + " Quest"; Helen.Realm = eRealm.Midgard; Helen.CurrentRegionID = 100; Helen.Size = 49; Helen.Level = 41; Helen.MaxSpeedBase = 191; Helen.Faction = FactionMgr.GetFactionByID(0); Helen.X = 805693; Helen.Y = 701160; Helen.Z = 4960; Helen.Heading = 3470; Helen.RespawnInterval = -1; Helen.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; Helen.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { Helen.SaveIntoDatabase(); } Helen.AddToWorld(); } else { Helen = npcs[0]; } #endregion #region defineItems smallmaulerskin = GameServer.Database.FindObjectByKey <ItemTemplate>("smallmaulerskin"); if (smallmaulerskin == null) { smallmaulerskin = new ItemTemplate(); smallmaulerskin.Name = "Small Mauler Skin"; if (log.IsWarnEnabled) { log.Warn("Could not find " + smallmaulerskin.Name + ", creating it ..."); } smallmaulerskin.Level = 1; smallmaulerskin.Weight = 5; smallmaulerskin.Model = 100; smallmaulerskin.Object_Type = 0; smallmaulerskin.Item_Type = 40; smallmaulerskin.Id_nb = "smallmaulerskin"; smallmaulerskin.Hand = 0; smallmaulerskin.Price = 0; smallmaulerskin.IsPickable = true; smallmaulerskin.IsDropable = true; smallmaulerskin.IsTradable = true; smallmaulerskin.CanDropAsLoot = false; smallmaulerskin.Color = 0; smallmaulerskin.Bonus = 35; // default bonus smallmaulerskin.Bonus1 = 0; smallmaulerskin.Bonus1Type = (int)0; smallmaulerskin.Bonus2 = 0; smallmaulerskin.Bonus2Type = (int)0; smallmaulerskin.Bonus3 = 0; smallmaulerskin.Bonus3Type = (int)0; smallmaulerskin.Bonus4 = 0; smallmaulerskin.Bonus4Type = (int)0; smallmaulerskin.Bonus5 = 0; smallmaulerskin.Bonus5Type = (int)0; smallmaulerskin.Bonus6 = 0; smallmaulerskin.Bonus6Type = (int)0; smallmaulerskin.Bonus7 = 0; smallmaulerskin.Bonus7Type = (int)0; smallmaulerskin.Bonus8 = 0; smallmaulerskin.Bonus8Type = (int)0; smallmaulerskin.Bonus9 = 0; smallmaulerskin.Bonus9Type = (int)0; smallmaulerskin.Bonus10 = 0; smallmaulerskin.Bonus10Type = (int)0; smallmaulerskin.ExtraBonus = 0; smallmaulerskin.ExtraBonusType = (int)0; smallmaulerskin.Effect = 0; smallmaulerskin.Emblem = 0; smallmaulerskin.Charges = 0; smallmaulerskin.MaxCharges = 0; smallmaulerskin.SpellID = 0; smallmaulerskin.ProcSpellID = 0; smallmaulerskin.Type_Damage = 0; smallmaulerskin.Realm = 0; smallmaulerskin.MaxCount = 1; smallmaulerskin.PackSize = 1; smallmaulerskin.Extension = 0; smallmaulerskin.Quality = 99; smallmaulerskin.Condition = 100; smallmaulerskin.MaxCondition = 100; smallmaulerskin.Durability = 100; smallmaulerskin.MaxDurability = 100; smallmaulerskin.PoisonCharges = 0; smallmaulerskin.PoisonMaxCharges = 0; smallmaulerskin.PoisonSpellID = 0; smallmaulerskin.ProcSpellID1 = 0; smallmaulerskin.SpellID1 = 0; smallmaulerskin.MaxCharges1 = 0; smallmaulerskin.Charges1 = 0; //You don't have to store the created item in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(smallmaulerskin); } } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(Bearskins)); QuestBehaviour a; a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.Interact, null, Helen); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Bearskins), null, (eComparator)5); a.AddAction(eActionType.Talk, "I have lived in this village since I was a young girl. My father is a great bear hunter you know.", Helen); a.AddAction(eActionType.Talk, "In my years I have learned to work with all kinds of materials, specially [the skin of bears].", Helen); AddBehaviour(a); a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.Whisper, "the skin of bears", Helen); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Bearskins), null, (eComparator)5); a.AddAction(eActionType.Talk, "Hmm...A new person here to Haggerfel. Let me offer you some [advice].", Helen); AddBehaviour(a); a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.Whisper, "advice", Helen); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.Bearskins), null, (eComparator)5); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.Bearskins), "Helen has offered you the Bear skins quest.?Do you accept?"); AddBehaviour(a); a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.Bearskins)); a.AddAction(eActionType.Talk, "No problem. See you", Helen); AddBehaviour(a); a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.Bearskins)); a.AddAction(eActionType.Talk, "If you bring me the hide of a mauler cub I shall pay you well!", Helen); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.Bearskins), Helen); AddBehaviour(a); a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.EnemyKilled, "black mauler cub", null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Bearskins), 1, (eComparator)3); a.AddAction(eActionType.GiveItem, smallmaulerskin, null); a.AddAction(eActionType.SetQuestStep, typeof(DOL.GS.Quests.Midgard.Bearskins), 2); AddBehaviour(a); a = builder.CreateBehaviour(Helen, -1); a.AddTrigger(eTriggerType.Interact, null, Helen); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.Bearskins), 2, (eComparator)3); a.AddAction(eActionType.Talk, "You have returned! Did you bring me the skin?", Helen); a.AddAction(eActionType.TakeItem, smallmaulerskin, null); a.AddAction(eActionType.Talk, "Wonderful, wonderful, you have done well, and brought a good hide.", Helen); a.AddAction(eActionType.Talk, "The hide is small yet sturdy. Here is some coin for your efforts. Thank you.", Helen); a.AddAction(eActionType.GiveXP, 10, null); a.AddAction(eActionType.GiveGold, 105, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.Bearskins), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End Helen.AddQuestToGive(typeof(Bearskins)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } #region defineNPCs GameNPC[] npcs; npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar"), (eRealm)2); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(100).IsDisabled) { BarkeepNognar = new DOL.GS.GameMerchant(); BarkeepNognar.Model = 212; BarkeepNognar.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar"); if (log.IsWarnEnabled) { log.Warn("Could not find " + BarkeepNognar.Name + ", creating ..."); } BarkeepNognar.GuildName = "Part of " + questTitle + " Quest"; BarkeepNognar.Realm = eRealm.Midgard; BarkeepNognar.CurrentRegionID = 100; BarkeepNognar.Size = 58; BarkeepNognar.Level = 15; BarkeepNognar.MaxSpeedBase = 191; BarkeepNognar.Faction = FactionMgr.GetFactionByID(0); BarkeepNognar.X = 805429; BarkeepNognar.Y = 726478; BarkeepNognar.Z = 4717; BarkeepNognar.Heading = 4073; BarkeepNognar.RespawnInterval = -1; BarkeepNognar.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; BarkeepNognar.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { BarkeepNognar.SaveIntoDatabase(); } BarkeepNognar.AddToWorld(); } } else { BarkeepNognar = npcs[0]; } npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar"), (eRealm)2); if (npcs.Length == 0) { if (!WorldMgr.GetRegion(101).IsDisabled) { BarkeepPrugar = new DOL.GS.GameMerchant(); BarkeepPrugar.Model = 213; BarkeepPrugar.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar"); if (log.IsWarnEnabled) { log.Warn("Could not find " + BarkeepPrugar.Name + ", creating ..."); } BarkeepPrugar.GuildName = "Part of " + questTitle + " Quest"; BarkeepPrugar.Realm = eRealm.Midgard; BarkeepPrugar.CurrentRegionID = 101; BarkeepPrugar.Size = 60; BarkeepPrugar.Level = 15; BarkeepPrugar.MaxSpeedBase = 191; BarkeepPrugar.Faction = FactionMgr.GetFactionByID(0); BarkeepPrugar.X = 33230; BarkeepPrugar.Y = 34802; BarkeepPrugar.Z = 8027; BarkeepPrugar.Heading = 1194; BarkeepPrugar.RespawnInterval = -1; BarkeepPrugar.BodyType = 0; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; BarkeepPrugar.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { BarkeepPrugar.SaveIntoDatabase(); } BarkeepPrugar.AddToWorld(); } } else { BarkeepPrugar = npcs[0]; } #endregion #region defineItems rattlingskeletonpendant = GameServer.Database.FindObjectByKey <ItemTemplate>("rattlingskeletonpendant"); if (rattlingskeletonpendant == null) { rattlingskeletonpendant = new ItemTemplate(); rattlingskeletonpendant.Name = "Rattling Skeleton Pendant"; if (log.IsWarnEnabled) { log.Warn("Could not find " + rattlingskeletonpendant.Name + ", creating it ..."); } rattlingskeletonpendant.Level = 50; rattlingskeletonpendant.Weight = 5; rattlingskeletonpendant.Model = 101; rattlingskeletonpendant.Object_Type = 0; rattlingskeletonpendant.Item_Type = 40; rattlingskeletonpendant.Id_nb = "rattlingskeletonpendant"; rattlingskeletonpendant.Hand = 0; rattlingskeletonpendant.Price = 0; rattlingskeletonpendant.IsPickable = true; rattlingskeletonpendant.IsDropable = true; rattlingskeletonpendant.IsTradable = true; rattlingskeletonpendant.CanDropAsLoot = false; rattlingskeletonpendant.Color = 0; rattlingskeletonpendant.Bonus = 35; // default bonus rattlingskeletonpendant.Bonus1 = 0; rattlingskeletonpendant.Bonus1Type = (int)0; rattlingskeletonpendant.Bonus2 = 0; rattlingskeletonpendant.Bonus2Type = (int)0; rattlingskeletonpendant.Bonus3 = 0; rattlingskeletonpendant.Bonus3Type = (int)0; rattlingskeletonpendant.Bonus4 = 0; rattlingskeletonpendant.Bonus4Type = (int)0; rattlingskeletonpendant.Bonus5 = 0; rattlingskeletonpendant.Bonus5Type = (int)0; rattlingskeletonpendant.Bonus6 = 0; rattlingskeletonpendant.Bonus6Type = (int)0; rattlingskeletonpendant.Bonus7 = 0; rattlingskeletonpendant.Bonus7Type = (int)0; rattlingskeletonpendant.Bonus8 = 0; rattlingskeletonpendant.Bonus8Type = (int)0; rattlingskeletonpendant.Bonus9 = 0; rattlingskeletonpendant.Bonus9Type = (int)0; rattlingskeletonpendant.Bonus10 = 0; rattlingskeletonpendant.Bonus10Type = (int)0; rattlingskeletonpendant.ExtraBonus = 0; rattlingskeletonpendant.ExtraBonusType = (int)0; rattlingskeletonpendant.Effect = 0; rattlingskeletonpendant.Emblem = 0; rattlingskeletonpendant.Charges = 0; rattlingskeletonpendant.MaxCharges = 0; rattlingskeletonpendant.SpellID = 0; rattlingskeletonpendant.ProcSpellID = 0; rattlingskeletonpendant.Type_Damage = 0; rattlingskeletonpendant.Realm = 0; rattlingskeletonpendant.MaxCount = 1; rattlingskeletonpendant.PackSize = 1; rattlingskeletonpendant.Extension = 0; rattlingskeletonpendant.Quality = 99; rattlingskeletonpendant.Condition = 50000; rattlingskeletonpendant.MaxCondition = 50000; rattlingskeletonpendant.Durability = 50000; rattlingskeletonpendant.MaxDurability = 50000; rattlingskeletonpendant.PoisonCharges = 0; rattlingskeletonpendant.PoisonMaxCharges = 0; rattlingskeletonpendant.PoisonSpellID = 0; rattlingskeletonpendant.ProcSpellID1 = 0; rattlingskeletonpendant.SpellID1 = 0; rattlingskeletonpendant.MaxCharges1 = 0; rattlingskeletonpendant.Charges1 = 0; GameServer.Database.AddObject(rattlingskeletonpendant); } giftandnoteforprugar = GameServer.Database.FindObjectByKey <ItemTemplate>("giftandnoteforprugar"); if (giftandnoteforprugar == null) { giftandnoteforprugar = new ItemTemplate(); giftandnoteforprugar.Name = "Gift and Note for Prugar"; if (log.IsWarnEnabled) { log.Warn("Could not find " + giftandnoteforprugar.Name + ", creating it ..."); } giftandnoteforprugar.Level = 50; giftandnoteforprugar.Weight = 5; giftandnoteforprugar.Model = 1347; giftandnoteforprugar.Object_Type = 0; giftandnoteforprugar.Item_Type = 40; giftandnoteforprugar.Id_nb = "giftandnoteforprugar"; giftandnoteforprugar.Hand = 0; giftandnoteforprugar.Price = 0; giftandnoteforprugar.IsPickable = true; giftandnoteforprugar.IsDropable = true; giftandnoteforprugar.IsTradable = true; giftandnoteforprugar.CanDropAsLoot = false; giftandnoteforprugar.Color = 0; giftandnoteforprugar.Bonus = 35; // default bonus giftandnoteforprugar.Bonus1 = 0; giftandnoteforprugar.Bonus1Type = (int)0; giftandnoteforprugar.Bonus2 = 0; giftandnoteforprugar.Bonus2Type = (int)0; giftandnoteforprugar.Bonus3 = 0; giftandnoteforprugar.Bonus3Type = (int)0; giftandnoteforprugar.Bonus4 = 0; giftandnoteforprugar.Bonus4Type = (int)0; giftandnoteforprugar.Bonus5 = 0; giftandnoteforprugar.Bonus5Type = (int)0; giftandnoteforprugar.Bonus6 = 0; giftandnoteforprugar.Bonus6Type = (int)0; giftandnoteforprugar.Bonus7 = 0; giftandnoteforprugar.Bonus7Type = (int)0; giftandnoteforprugar.Bonus8 = 0; giftandnoteforprugar.Bonus8Type = (int)0; giftandnoteforprugar.Bonus9 = 0; giftandnoteforprugar.Bonus9Type = (int)0; giftandnoteforprugar.Bonus10 = 0; giftandnoteforprugar.Bonus10Type = (int)0; giftandnoteforprugar.ExtraBonus = 0; giftandnoteforprugar.ExtraBonusType = (int)0; giftandnoteforprugar.Effect = 0; giftandnoteforprugar.Emblem = 0; giftandnoteforprugar.Charges = 0; giftandnoteforprugar.MaxCharges = 0; giftandnoteforprugar.SpellID = 0; giftandnoteforprugar.ProcSpellID = 0; giftandnoteforprugar.Type_Damage = 0; giftandnoteforprugar.Realm = 0; giftandnoteforprugar.MaxCount = 1; giftandnoteforprugar.PackSize = 1; giftandnoteforprugar.Extension = 0; giftandnoteforprugar.Quality = 99; giftandnoteforprugar.Condition = 50000; giftandnoteforprugar.MaxCondition = 50000; giftandnoteforprugar.Durability = 50000; giftandnoteforprugar.MaxDurability = 50000; giftandnoteforprugar.PoisonCharges = 0; giftandnoteforprugar.PoisonMaxCharges = 0; giftandnoteforprugar.PoisonSpellID = 0; giftandnoteforprugar.ProcSpellID1 = 0; giftandnoteforprugar.SpellID1 = 0; giftandnoteforprugar.MaxCharges1 = 0; giftandnoteforprugar.Charges1 = 0; GameServer.Database.AddObject(giftandnoteforprugar); } #endregion #region defineAreas #endregion #region defineQuestParts QuestBuilder builder = QuestMgr.getBuilder(typeof(thebirthdaygift)); QuestBehaviour a; a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Interact, null, BarkeepNognar); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk1"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper1"), BarkeepNognar); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk2"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper2"), BarkeepNognar); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk3"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper3"), BarkeepNognar); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk4"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper4"), BarkeepNognar); a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null, (eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk5"), BarkeepNognar); a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.OfferQuest")); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.thebirthdaygift)); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk6"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.thebirthdaygift)); a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk7"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper5"), BarkeepNognar); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 1, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk8"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.EnemyKilled"), null); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 1, (eComparator)3); a.AddAction(eActionType.GiveItem, rattlingskeletonpendant, null); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Interact, null, BarkeepNognar); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk9"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.GiveItem, BarkeepNognar, rattlingskeletonpendant); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk10"), BarkeepNognar); a.AddAction(eActionType.TakeItem, rattlingskeletonpendant, null); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper6"), BarkeepNognar); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 2, (eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, rattlingskeletonpendant, 0, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk11"), BarkeepNognar); a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null); a.AddAction(eActionType.GiveItem, giftandnoteforprugar, BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepPrugar, -1); a.AddTrigger(eTriggerType.Interact, null, BarkeepPrugar); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk12"), BarkeepPrugar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepPrugar, -1); a.AddTrigger(eTriggerType.GiveItem, BarkeepPrugar, giftandnoteforprugar); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk13"), BarkeepPrugar); a.AddAction(eActionType.TakeItem, giftandnoteforprugar, null); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepPrugar, -1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper7"), BarkeepPrugar); a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), 3, (eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, giftandnoteforprugar, 0, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk14"), BarkeepPrugar); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 27, null); a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null); AddBehaviour(a); #endregion // Custom Scriptloaded Code Begin // Custom Scriptloaded Code End if (BarkeepNognar != null) { BarkeepNognar.AddQuestToGive(typeof(thebirthdaygift)); } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }