public static GameNPC GetAddrir() { GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Addrir", eRealm.Hibernia); GameNPC addrir = null; if (npcs.Length == 0) { addrir = new GameNPC(); addrir.Model = 335; addrir.Name = "Addrir"; if (log.IsWarnEnabled) { log.Warn("Could not find " + addrir.Name + ", creating him ..."); } addrir.GuildName = "Part of Addrir Quests"; addrir.Realm = eRealm.Hibernia; addrir.CurrentRegionID = 200; GameNpcInventoryTemplate template = new GameNpcInventoryTemplate(); template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 35); template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32); template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 1173); addrir.Inventory = template.CloseTemplate(); addrir.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard); // addrir.AddNPCEquipment((byte) eVisibleItems.TORSO, 58, 35, 0, 0); // addrir.AddNPCEquipment((byte) eVisibleItems.CLOAK, 57, 32, 0, 0); // addrir.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 1173, 0, 0, 0); addrir.Size = 50; addrir.Level = 50; addrir.X = GameLocation.ConvertLocalXToGlobalX(26955, 200); addrir.Y = GameLocation.ConvertLocalYToGlobalY(7789, 200); addrir.Z = 5196; addrir.Heading = 22; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; addrir.SetOwnBrain(brain); // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { addrir.SaveIntoDatabase(); } addrir.AddToWorld(); } else { addrir = npcs[0]; } return(addrir); }
public void StartPlanting() { IsPlanting = true; //To start the chain we simply walk the seedsman to the first x y z. if (TreeNumber < 1) { TreenumberWhilePlanting = TreeNumber; int x = GameLocation.ConvertLocalXToGlobalX(Tree[0, 0], tempZoneID); int y = GameLocation.ConvertLocalYToGlobalY(Tree[0, 1], tempZoneID); int z = Tree[0, 2]; WalkTo(x, y, z, (WalkSpeed + 50)); //x y z speed } }
public override void Notify(DOLEvent e, object sender) { base.Notify(e, sender); // When seedsman gets to a plant spot, plant a tree. if (e == GameNPCEvent.ArriveAtTarget) { if ((!IsPlanting) || (InCombat) || (IsStunned) || (IsMezzed) || (AttackState)) { return; } //disregard if not planting or in combat int x, y, z; //Treemnumber is the current index if (TreenumberWhilePlanting < Tree.GetLength(0)) { x = GameLocation.ConvertLocalXToGlobalX(Tree[TreenumberWhilePlanting, 0], tempZoneID); y = GameLocation.ConvertLocalYToGlobalY(Tree[TreenumberWhilePlanting, 1], tempZoneID); z = Tree[TreenumberWhilePlanting, 2]; //Increases Treenumber by 1 PlantTree(x, y, z); } //Treenumber was increased if (TreenumberWhilePlanting < Tree.GetLength(0)) { x = GameLocation.ConvertLocalXToGlobalX(Tree[TreenumberWhilePlanting, 0], tempZoneID); y = GameLocation.ConvertLocalYToGlobalY(Tree[TreenumberWhilePlanting, 1], tempZoneID); z = Tree[TreenumberWhilePlanting, 2]; WalkTo(x, y, z, WalkSpeed); //walk to next tree } else { //Last Tree was planted, so stop Planting IsPlanting = false; if (!IsPlanting && !InCombat) //back at spawn loc, turn toward field of trees. { TurnTo(UndeadSeedsmanWalks[0, 0], UndeadSeedsmanWalks[0, 1]); } } } return; }
protected virtual void CreateFairy() { ireFairy = new GameNPC(); ireFairy.Model = 603; ireFairy.Name = "Ire Fairy"; ireFairy.GuildName = "Part of " + questTitle + " Quest"; ireFairy.Realm = eRealm.None; ireFairy.CurrentRegionID = 1; ireFairy.Size = 50; ireFairy.Level = 4; ireFairy.X = GameLocation.ConvertLocalXToGlobalX(12336, 0) + Util.Random(-150, 150); ireFairy.Y = GameLocation.ConvertLocalYToGlobalY(22623, 0) + Util.Random(-150, 150); ireFairy.Z = 2405; ireFairy.Heading = 226; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 20; brain.AggroRange = 200; ireFairy.SetOwnBrain(brain); ireFairy.AddToWorld(); }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } /* First thing we do in here is to search for the NPCs inside * the world who comes from the Albion realm. If we find a the players, * this means we don't have to create a new one. * * NOTE: You can do anything you want in this method, you don't have * to search for NPC's ... you could create a custom item, place it * on the ground and if a player picks it up, he will get the quest! * Just examples, do anything you like and feel comfortable with :) */ addrir = GetAddrir(); GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Aethic", eRealm.Hibernia); if (npcs.Length == 0) { aethic = new GameNPC(); aethic.Model = 361; aethic.Name = "Aethic"; if (log.IsWarnEnabled) { log.Warn("Could not find" + aethic.Name + " , creating ..."); } aethic.GuildName = "Part of " + questTitle + " Quest"; aethic.Realm = eRealm.Hibernia; aethic.CurrentRegionID = 200; aethic.Size = 49; aethic.Level = 21; aethic.X = GameLocation.ConvertLocalXToGlobalX(23761, 200); aethic.Y = GameLocation.ConvertLocalYToGlobalY(45658, 200); aethic.Z = 5448; aethic.Heading = 320; // aethic.EquipmentTemplateID = "1707754"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { aethic.SaveIntoDatabase(); } aethic.AddToWorld(); } else { aethic = npcs[0]; } npcs = WorldMgr.GetObjectsByName <GameNPC>("Freagus", eRealm.Hibernia); if (npcs.Length == 0) { freagus = new GameStableMaster(); freagus.Model = 361; freagus.Name = "Freagus"; if (log.IsWarnEnabled) { log.Warn("Could not find " + freagus.Name + ", creating ..."); } freagus.GuildName = "Stable Master"; freagus.Realm = eRealm.Hibernia; freagus.CurrentRegionID = 200; freagus.Size = 48; freagus.Level = 30; freagus.X = 341008; freagus.Y = 469180; freagus.Z = 5200; freagus.Heading = 1934; freagus.EquipmentTemplateID = "3800664"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { freagus.SaveIntoDatabase(); } freagus.AddToWorld(); } else { freagus = npcs[0]; } npcs = WorldMgr.GetObjectsByName <GameNPC>("Rumdor", eRealm.Hibernia); if (npcs.Length == 0) { if (log.IsWarnEnabled) { log.Warn("Could not find Rumdor, creating ..."); } rumdor = new GameStableMaster(); rumdor.Model = 361; rumdor.Name = "Rumdor"; rumdor.GuildName = "Stable Master"; rumdor.Realm = eRealm.Hibernia; rumdor.CurrentRegionID = 200; rumdor.Size = 53; rumdor.Level = 33; rumdor.X = 347175; rumdor.Y = 491836; rumdor.Z = 5226; rumdor.Heading = 1262; rumdor.EquipmentTemplateID = "3800664"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { rumdor.SaveIntoDatabase(); } rumdor.AddToWorld(); } else { rumdor = npcs[0] as GameStableMaster; } npcs = WorldMgr.GetObjectsByName <GameStableMaster>("Truichon", eRealm.Hibernia); if (npcs.Length == 0) { truichon = new GameStableMaster(); truichon.Model = 361; truichon.Name = "Truichon"; if (log.IsWarnEnabled) { log.Warn("Could not find " + truichon.Name + ", creating ..."); } truichon.GuildName = "Stable Master"; truichon.Realm = eRealm.Hibernia; truichon.CurrentRegionID = 1; truichon.Size = 50; truichon.Level = 33; truichon.X = 343464; truichon.Y = 526708; truichon.Z = 5448; truichon.Heading = 68; // truichon.EquipmentTemplateID = "5448"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { truichon.SaveIntoDatabase(); } truichon.AddToWorld(); } else { truichon = npcs[0] as GameStableMaster; } ticketToTirnamBeo = GameServer.Database.FindObjectByKey <ItemTemplate>("hs_magmell_tirnambeo"); if (ticketToTirnamBeo == null) { ticketToTirnamBeo = CreateTicketTo("Tir na mBeo", "hs_magmell_tirnambeo"); } ticketToArdee = GameServer.Database.FindObjectByKey <ItemTemplate>("hs_tirnambeo_ardee"); if (ticketToArdee == null) { ticketToArdee = CreateTicketTo("Ardee", "hs_tirnambeo_ardee"); } recruitsDiary = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_diary"); if (recruitsDiary == null) { recruitsDiary = new ItemTemplate(); recruitsDiary.Name = "Recruits Diary"; if (log.IsWarnEnabled) { log.Warn("Could not find " + recruitsDiary.Name + " , creating it ..."); } recruitsDiary.Weight = 3; recruitsDiary.Model = 500; recruitsDiary.Object_Type = (int)eObjectType.GenericItem; recruitsDiary.Id_nb = "recruits_diary"; recruitsDiary.IsPickable = true; recruitsDiary.IsDropable = false; if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(recruitsDiary); } } sackOfSupplies = GameServer.Database.FindObjectByKey <ItemTemplate>("sack_of_supplies"); if (sackOfSupplies == null) { sackOfSupplies = new ItemTemplate(); sackOfSupplies.Name = "Sack of Supplies"; if (log.IsWarnEnabled) { log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ..."); } sackOfSupplies.Weight = 10; sackOfSupplies.Model = 488; sackOfSupplies.Object_Type = (int)eObjectType.GenericItem; sackOfSupplies.Id_nb = "sack_of_supplies"; sackOfSupplies.IsPickable = true; sackOfSupplies.IsDropable = false; // You don't have to store the created item in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(sackOfSupplies); } } crateOfVegetables = GameServer.Database.FindObjectByKey <ItemTemplate>("crate_of_vegetables"); if (crateOfVegetables == null) { crateOfVegetables = new ItemTemplate(); crateOfVegetables.Name = "Crate of Vegetables"; if (log.IsWarnEnabled) { log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ..."); } crateOfVegetables.Weight = 15; crateOfVegetables.Model = 602; crateOfVegetables.Object_Type = (int)eObjectType.GenericItem; crateOfVegetables.Id_nb = "crate_of_vegetables"; crateOfVegetables.IsPickable = true; crateOfVegetables.IsDropable = false; // You don't have to store the created item in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(crateOfVegetables); } } // item db check recruitsCloak = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_cloak_hib"); if (recruitsCloak == null) { if (log.IsWarnEnabled) { log.Warn("Could not find Recruit's Cloak, creating it ..."); } recruitsCloak = new ItemTemplate(); recruitsCloak.Name = "Recruit's Cloak (Hib)"; recruitsCloak.Level = 3; recruitsCloak.Weight = 3; recruitsCloak.Model = 57; recruitsCloak.Object_Type = (int)eObjectType.Cloth; recruitsCloak.Item_Type = (int)eEquipmentItems.CLOAK; recruitsCloak.Id_nb = "recruits_cloak_hib"; recruitsCloak.Price = Money.GetMoney(0, 0, 0, 1, 0); recruitsCloak.IsPickable = true; recruitsCloak.IsDropable = true; recruitsCloak.Color = 69; recruitsCloak.Bonus = 1; // default bonus recruitsCloak.Bonus1 = 1; recruitsCloak.Bonus1Type = (int)eStat.CON; recruitsCloak.Bonus2 = 1; recruitsCloak.Bonus2Type = (int)eResist.Slash; recruitsCloak.Quality = 100; recruitsCloak.Condition = 1000; recruitsCloak.MaxCondition = 1000; recruitsCloak.Durability = 1000; recruitsCloak.MaxDurability = 1000; // You don't have to store the created item in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(recruitsCloak); } } /* Now we add some hooks to the npc we found. * Actually, we want to know when a player interacts with him. * So, we hook the right-click (interact) and the whisper method * of npc and set the callback method to the "TalkToXXX" * method. This means, the "TalkToXXX" method is called whenever * a player right clicks on him or when he whispers to him. */ GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest)); // We want to be notified whenever a player enters the world GameEventMgr.AddHandler(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir)); GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir)); GameEventMgr.AddHandler(freagus, GameLivingEvent.Interact, new DOLEventHandler(TalkToFreagus)); GameEventMgr.AddHandler(freagus, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToFreagus)); GameEventMgr.AddHandler(aethic, GameLivingEvent.Interact, new DOLEventHandler(TalkToAethic)); GameEventMgr.AddHandler(aethic, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAethic)); /* Now we bring to addrir the possibility to give this quest to players */ addrir.AddQuestToGive(typeof(ImportantDelivery)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } /* First thing we do in here is to search for the NPCs inside * the world who comes from the Albion realm. If we find a the players, * this means we don't have to create a new one. * * NOTE: You can do anything you want in this method, you don't have * to search for NPC's ... you could create a custom item, place it * on the ground and if a player picks it up, he will get the quest! * Just examples, do anything you like and feel comfortable with :) */ dalikor = GetDalikor(); GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>("Abohas", eRealm.Midgard); if (npcs.Length == 0) { abohas = new GameNPC(); abohas.Model = 215; abohas.Name = "Abohas"; if (log.IsWarnEnabled) { log.Warn("Could not find" + abohas.Name + " , creating her ..."); } abohas.GuildName = "Part of " + questTitle + " Quest"; abohas.Realm = eRealm.Midgard; abohas.CurrentRegionID = 100; abohas.Size = 49; abohas.Level = 21; abohas.X = GameLocation.ConvertLocalXToGlobalX(52274, 100); abohas.Y = GameLocation.ConvertLocalYToGlobalY(29985, 100); abohas.Z = 4960; abohas.Heading = 123; // abohas.EquipmentTemplateID = "1707754"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { abohas.SaveIntoDatabase(); } abohas.AddToWorld(); } else { abohas = npcs[0]; } npcs = WorldMgr.GetObjectsByName <GameNPC>("Harlfug", eRealm.Midgard); if (npcs.Length == 0) { harlfug = new GameStableMaster(); harlfug.Model = 215; harlfug.Name = "Harlfug"; if (log.IsWarnEnabled) { log.Warn("Could not find " + harlfug.Name + ", creating her ..."); } harlfug.GuildName = "Stable Master"; harlfug.Realm = eRealm.Midgard; harlfug.CurrentRegionID = 100; harlfug.Size = 52; harlfug.Level = 41; harlfug.X = 773458; harlfug.Y = 754240; harlfug.Z = 4600; harlfug.Heading = 2707; harlfug.EquipmentTemplateID = "5100798"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { harlfug.SaveIntoDatabase(); } harlfug.AddToWorld(); } else { harlfug = npcs[0]; } npcs = WorldMgr.GetObjectsByName <GameNPC>("Gularg", eRealm.Midgard); if (npcs.Length == 0) { gularg = new GameStableMaster(); gularg.Model = 212; gularg.Name = "Gularg"; if (log.IsWarnEnabled) { log.Warn("Could not find " + gularg.Name + ", creating her ..."); } gularg.GuildName = "Stable Master"; gularg.Realm = eRealm.Midgard; gularg.CurrentRegionID = 100; gularg.Size = 50; gularg.Level = 41; gularg.X = 803766; gularg.Y = 721959; gularg.Z = 4686; gularg.Heading = 3925; gularg.EquipmentTemplateID = "5100798"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { gularg.SaveIntoDatabase(); } gularg.AddToWorld(); } else { gularg = npcs[0]; } npcs = WorldMgr.GetObjectsByName <GameNPC>("Yolafson", eRealm.Midgard); if (npcs.Length == 0) { yolafson = new GameStableMaster(); yolafson.Model = 214; yolafson.Name = "Yolafson"; if (log.IsWarnEnabled) { log.Warn("Could not find " + yolafson.Name + ", creating her ..."); } yolafson.GuildName = "Stable Master"; yolafson.Realm = eRealm.Midgard; yolafson.CurrentRegionID = 100; yolafson.Size = 51; yolafson.Level = 41; yolafson.X = 805721; yolafson.Y = 700414; yolafson.Z = 4960; yolafson.Heading = 1206; yolafson.EquipmentTemplateID = "5100798"; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { yolafson.SaveIntoDatabase(); } yolafson.AddToWorld(); } else { yolafson = npcs[0]; } ticketToHaggerfel = CreateTicketTo("Haggerfel", "hs_src_haggerfel"); ticketToVasudheim = CreateTicketTo("Vasudheim", "hs_src_vasudheim"); sackOfSupplies = GameServer.Database.FindObjectByKey <ItemTemplate>("sack_of_supplies"); if (sackOfSupplies == null) { sackOfSupplies = new ItemTemplate(); sackOfSupplies.Name = "Sack of Supplies"; if (log.IsWarnEnabled) { log.Warn("Could not find " + sackOfSupplies.Name + " , creating it ..."); } sackOfSupplies.Weight = 10; sackOfSupplies.Model = 488; sackOfSupplies.Object_Type = (int)eObjectType.GenericItem; sackOfSupplies.Id_nb = "sack_of_supplies"; sackOfSupplies.IsPickable = true; sackOfSupplies.IsDropable = false; // You don't have to store the created item in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(sackOfSupplies); } } crateOfVegetables = GameServer.Database.FindObjectByKey <ItemTemplate>("crate_of_vegetables"); if (crateOfVegetables == null) { crateOfVegetables = new ItemTemplate(); crateOfVegetables.Name = "Crate of Vegetables"; if (log.IsWarnEnabled) { log.Warn("Could not find " + crateOfVegetables.Name + " , creating it ..."); } crateOfVegetables.Weight = 15; crateOfVegetables.Model = 602; crateOfVegetables.Object_Type = (int)eObjectType.GenericItem; crateOfVegetables.Id_nb = "crate_of_vegetables"; crateOfVegetables.IsPickable = true; crateOfVegetables.IsDropable = false; // You don't have to store the created item in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(crateOfVegetables); } } // item db check recruitsCloak = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_cloak_mid"); if (recruitsCloak == null) { recruitsCloak = new ItemTemplate(); recruitsCloak.Name = "Recruit's Cloak (Mid)"; if (log.IsWarnEnabled) { log.Warn("Could not find " + recruitsCloak.Name + ", creating it ..."); } recruitsCloak.Level = 3; recruitsCloak.Weight = 3; recruitsCloak.Model = 57; recruitsCloak.Object_Type = (int)eObjectType.Cloth; recruitsCloak.Item_Type = (int)eEquipmentItems.CLOAK; recruitsCloak.Id_nb = "recruits_cloak_mid"; recruitsCloak.Price = Money.GetMoney(0, 0, 0, 1, 0); recruitsCloak.IsPickable = true; recruitsCloak.IsDropable = true; recruitsCloak.Color = 44; // brown recruitsCloak.Bonus = 1; // default bonus recruitsCloak.Bonus1 = 1; recruitsCloak.Bonus1Type = (int)eStat.CON; recruitsCloak.Bonus2 = 1; recruitsCloak.Bonus2Type = (int)eResist.Slash; recruitsCloak.Quality = 100; recruitsCloak.Condition = 1000; recruitsCloak.MaxCondition = 1000; recruitsCloak.Durability = 1000; recruitsCloak.MaxDurability = 1000; // You don't have to store the created item in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { GameServer.Database.AddObject(recruitsCloak); } } /* Now we add some hooks to the npc we found. * Actually, we want to know when a player interacts with him. * So, we hook the right-click (interact) and the whisper method * of npc and set the callback method to the "TalkToXXX" * method. This means, the "TalkToXXX" method is called whenever * a player right clicks on him or when he whispers to him. */ // We want to be notified whenever a player enters the world GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(dalikor, GameLivingEvent.Interact, new DOLEventHandler(TalkToDalikor)); GameEventMgr.AddHandler(dalikor, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDalikor)); GameEventMgr.AddHandler(harlfug, GameLivingEvent.Interact, new DOLEventHandler(TalkToHarlfug)); GameEventMgr.AddHandler(harlfug, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHarlfug)); GameEventMgr.AddHandler(abohas, GameLivingEvent.Interact, new DOLEventHandler(TalkToAbohas)); GameEventMgr.AddHandler(abohas, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAbohas)); /* Now we bring to dalikor the possibility to give this quest to players */ dalikor.AddQuestToGive(typeof(ImportantDelivery)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } /* First thing we do in here is to search for the NPCs inside * the world who comes from the Albion realm. If we find a the players, * this means we don't have to create a new one. * * NOTE: You can do anything you want in this method, you don't have * to search for NPC's ... you could create a custom item, place it * on the ground and if a player picks it up, he will get the quest! * Just examples, do anything you like and feel comfortable with :) */ dalikor = GetDalikor(); GameNPC[] npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCVikingHyndla"), eRealm.Midgard); if (npcs.Length == 0) { hyndla = new GameNPC(); hyndla.Model = 9; hyndla.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCVikingHyndla"); if (log.IsWarnEnabled) { log.Warn("Could not find " + hyndla.Name + ", creating ..."); } hyndla.GuildName = "Part of " + questTitle + " Quest"; hyndla.Realm = eRealm.Midgard; hyndla.CurrentRegionID = 100; hyndla.Size = 50; hyndla.Level = 40; hyndla.X = GameLocation.ConvertLocalXToGlobalX(53049, 100); hyndla.Y = GameLocation.ConvertLocalYToGlobalY(58068, 100); hyndla.Z = 4985; hyndla.Heading = 150; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { hyndla.SaveIntoDatabase(); } hyndla.AddToWorld(); } else { hyndla = npcs[0]; } npcs = WorldMgr.GetObjectsByName <GameStableMaster>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCGriffinHandlerNjiedi"), eRealm.Midgard); if (npcs.Length == 0) { njiedi = new GameStableMaster(); njiedi.Model = 158; njiedi.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCGriffinHandlerNjiedi"); if (log.IsWarnEnabled) { log.Warn("Could not find " + njiedi.Name + ", creating ..."); } njiedi.GuildName = "Stable Master"; njiedi.Realm = eRealm.Midgard; njiedi.CurrentRegionID = 100; njiedi.Size = 51; njiedi.Level = 50; GameNpcInventoryTemplate template = new GameNpcInventoryTemplate(); template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81, 10); template.AddNPCEquipment(eInventorySlot.LegsArmor, 82, 10); template.AddNPCEquipment(eInventorySlot.FeetArmor, 84); template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32); njiedi.Inventory = template.CloseTemplate(); // njiedi.AddNPCEquipment(Slot.TORSO, 81, 10, 0, 0); // njiedi.AddNPCEquipment(Slot.LEGS, 82, 10, 0, 0); // njiedi.AddNPCEquipment(Slot.FEET, 84, 10, 0, 0); // njiedi.AddNPCEquipment(Slot.CLOAK, 57, 32, 0, 0); njiedi.X = GameLocation.ConvertLocalXToGlobalX(55561, 100); njiedi.Y = GameLocation.ConvertLocalYToGlobalY(58225, 100); njiedi.Z = 5005; njiedi.Heading = 126; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; njiedi.SetOwnBrain(brain); // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { njiedi.SaveIntoDatabase(); } njiedi.AddToWorld(); } else { njiedi = npcs[0] as GameStableMaster; } // npcs = WorldMgr.GetObjectsByName<GameNPC>("Askefruer Trainer", eRealm.None); npcs = WorldMgr.GetObjectsByName <GameNPC>(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCAskefruerTrainer"), eRealm.None); if (npcs.Length == 0) { askefruerTrainer = new GameNPC(); askefruerTrainer.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.StolenEggs.NPCAskefruerTrainer"); askefruerTrainer.X = GameLocation.ConvertLocalXToGlobalX(54739, 100); askefruerTrainer.Y = GameLocation.ConvertLocalYToGlobalY(18264, 100); askefruerTrainer.Z = 5195; askefruerTrainer.Heading = 79; askefruerTrainer.Model = 678; // askefruerTrainer.GuildName = "Part of " + questTitle + " Quest"; askefruerTrainer.Realm = eRealm.None; askefruerTrainer.CurrentRegionID = 100; askefruerTrainer.Size = 49; askefruerTrainer.Level = 3; // Leave at default values to be one the save side ... // fairyDragonflyHandler.AggroLevel = 80; // fairyDragonflyHandler.AggroRange = 1000; // You don't have to store the created mob in the db if you don't want, // it will be recreated each time it is not found, just comment the following // line if you rather not modify your database if (SAVE_INTO_DATABASE) { askefruerTrainer.SaveIntoDatabase(); } askefruerTrainer.AddToWorld(); } else { askefruerTrainer = npcs[0]; } trainerWhip = GameServer.Database.FindObjectByKey <ItemTemplate>("askefruer_whip"); if (trainerWhip == null) { trainerWhip = new ItemTemplate(); trainerWhip.Name = "Askefruer Trainer's Whip"; if (log.IsWarnEnabled) { log.Warn("Could not find " + trainerWhip.Name + " , creating it ..."); } trainerWhip.Weight = 15; trainerWhip.Model = 859; trainerWhip.Object_Type = (int)eObjectType.GenericItem; trainerWhip.Id_nb = "askefruer_whip"; trainerWhip.IsPickable = true; trainerWhip.IsDropable = false; GameServer.Database.AddObject(trainerWhip); } // item db check recruitsVest = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_studded_vest_mid"); if (recruitsVest == null) { recruitsVest = new ItemTemplate(); recruitsVest.Name = "Recruit's Studded Vest (Mid)"; if (log.IsWarnEnabled) { log.Warn("Could not find " + recruitsVest.Name + ", creating it ..."); } recruitsVest.Level = 8; recruitsVest.Weight = 60; recruitsVest.Model = 81; // studded vest recruitsVest.DPS_AF = 12; // Armour recruitsVest.SPD_ABS = 19; // Absorption recruitsVest.Object_Type = (int)eObjectType.Studded; recruitsVest.Item_Type = (int)eEquipmentItems.TORSO; recruitsVest.Id_nb = "recruits_studded_vest_mid"; recruitsVest.Price = Money.GetMoney(0, 0, 0, 9, 0); recruitsVest.IsPickable = true; recruitsVest.IsDropable = true; recruitsVest.CanDropAsLoot = false; recruitsVest.Color = 14; // blue leather recruitsVest.Bonus = 5; // default bonus recruitsVest.Bonus1 = 3; recruitsVest.Bonus1Type = (int)eStat.STR; recruitsVest.Bonus2 = 4; recruitsVest.Bonus2Type = (int)eStat.CON; recruitsVest.Bonus3 = 1; recruitsVest.Bonus3Type = (int)eResist.Body; recruitsVest.Quality = 100; recruitsVest.Condition = 1000; recruitsVest.MaxCondition = 1000; recruitsVest.Durability = 1000; recruitsVest.MaxDurability = 1000; GameServer.Database.AddObject(recruitsVest); } // item db check recruitsQuiltedVest = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_quilted_vest"); if (recruitsQuiltedVest == null) { recruitsQuiltedVest = new ItemTemplate(); recruitsQuiltedVest.Name = "Recruit's Quilted Vest"; if (log.IsWarnEnabled) { log.Warn("Could not find " + recruitsQuiltedVest.Name + ", creating it ..."); } recruitsQuiltedVest.Level = 8; recruitsQuiltedVest.Weight = 20; recruitsQuiltedVest.Model = 151; // studded vest recruitsQuiltedVest.DPS_AF = 6; // Armour recruitsQuiltedVest.SPD_ABS = 0; // Absorption recruitsQuiltedVest.Object_Type = (int)eObjectType.Cloth; recruitsQuiltedVest.Item_Type = (int)eEquipmentItems.TORSO; recruitsQuiltedVest.Id_nb = "recruits_quilted_vest"; recruitsQuiltedVest.Price = Money.GetMoney(0, 0, 0, 9, 0); recruitsQuiltedVest.IsPickable = true; recruitsQuiltedVest.IsDropable = true; recruitsQuiltedVest.Color = 36; recruitsQuiltedVest.Bonus = 5; // default bonus recruitsQuiltedVest.Bonus1 = 4; recruitsQuiltedVest.Bonus1Type = (int)eStat.INT; recruitsQuiltedVest.Bonus2 = 3; recruitsQuiltedVest.Bonus2Type = (int)eStat.DEX; recruitsQuiltedVest.Quality = 100; recruitsQuiltedVest.Condition = 1000; recruitsQuiltedVest.MaxCondition = 1000; recruitsQuiltedVest.Durability = 1000; recruitsQuiltedVest.MaxDurability = 1000; GameServer.Database.AddObject(recruitsQuiltedVest); } /* Now we add some hooks to the npc we found. * Actually, we want to know when a player interacts with him. * So, we hook the right-click (interact) and the whisper method * of npc and set the callback method to the "TalkToXXX" * method. This means, the "TalkToXXX" method is called whenever * a player right clicks on him or when he whispers to him. */ // We want to be notified whenever a player enters the world GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld)); GameEventMgr.AddHandler(dalikor, GameLivingEvent.Interact, new DOLEventHandler(TalkToDalikor)); GameEventMgr.AddHandler(dalikor, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDalikor)); GameEventMgr.AddHandler(njiedi, GameLivingEvent.Interact, new DOLEventHandler(TalkToNjiedi)); GameEventMgr.AddHandler(njiedi, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToNjiedi)); GameEventMgr.AddHandler(hyndla, GameLivingEvent.Interact, new DOLEventHandler(TalkToHyndla)); GameEventMgr.AddHandler(hyndla, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHyndla)); GameEventMgr.AddHandler(askefruerTrainer, GameNPCEvent.OnAICallback, new DOLEventHandler(CheckNearAskefruerTrainer)); /* Now we bring to dalikor the possibility to give this quest to players */ dalikor.AddQuestToGive(typeof(StolenEggs)); if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } }
public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) { if (!ServerProperties.Properties.LOAD_QUESTS) { return; } if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initializing ..."); } /* First thing we do in here is to search for the NPCs inside * the world who comes from the Albion realm. If we find a the players, * this means we don't have to create a new one. * * NOTE: You can do anything you want in this method, you don't have * to search for NPC's ... you could create a custom item, place it * on the ground and if a player picks it up, he will get the quest! * Just examples, do anything you like and feel comfortable with :) */ #region DefineNPCs dalikor = GetDalikor(); GameNPC[] npcs = WorldMgr.GetNPCsByName("Stor Gothi Annark", eRealm.Midgard); if (npcs.Length == 0) { if (log.IsWarnEnabled) { log.Warn("Could not find Stor Gothi Annark, creating ..."); } annark = new GameNPC(); annark.Model = 215; annark.Name = "Stor Gothi Annark"; annark.GuildName = "Part of " + questTitle + " Quest"; annark.Realm = eRealm.Midgard; annark.CurrentRegionID = 100; annark.Size = 51; annark.Level = 66; annark.X = 765357; annark.Y = 668790; annark.Z = 5759; annark.Heading = 7711; //annark.AddNPCEquipment((byte)eEquipmentItems.TORSO, 798, 0, 0, 0); //annark.AddNPCEquipment((byte)eEquipmentItems.RIGHT_HAND, 19, 0, 0, 0); annark.EquipmentTemplateID = "5100090"; //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { annark.SaveIntoDatabase(); } annark.AddToWorld(); } else { annark = npcs[0]; } npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCScryerIdora"), eRealm.Midgard); if (npcs.Length == 0) { if (log.IsWarnEnabled) { log.Warn("Could not find Scryer Idora, creating ..."); } idora = new GameNPC(); idora.Model = 227; idora.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCScryerIdora"); idora.GuildName = "Part of " + questTitle + " Quest"; idora.Realm = eRealm.Midgard; idora.CurrentRegionID = 234; idora.Size = 52; idora.Level = 50; idora.X = 558081; idora.Y = 573988; idora.Z = 8640; GameNpcInventoryTemplate template = new GameNpcInventoryTemplate(); template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81); template.AddNPCEquipment(eInventorySlot.LegsArmor, 82); template.AddNPCEquipment(eInventorySlot.FeetArmor, 84); template.AddNPCEquipment(eInventorySlot.Cloak, 91); template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 3); idora.Inventory = template.CloseTemplate(); idora.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard); // idora.AddNPCEquipment(Slot.TORSO, 81, 0, 0, 0); // idora.AddNPCEquipment(Slot.LEGS, 82, 0, 0, 0); // idora.AddNPCEquipment(Slot.FEET, 84, 0, 0, 0); // idora.AddNPCEquipment(Slot.CLOAK, 91, 0, 0, 0); // idora.AddNPCEquipment(Slot.RIGHTHAND, 3, 0, 0, 0); idora.Heading = 1558; idora.MaxSpeedBase = 200; idora.EquipmentTemplateID = "200292"; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 500; idora.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { idora.SaveIntoDatabase(); } idora.AddToWorld(); } else { idora = npcs[0]; } Point2D point = idora.GetPointFromHeading(idora.Heading, 30); locationIdora = new GameLocation(idora.CurrentZone.Description, idora.CurrentRegionID, point.X, point.Y, idora.Z); ticketToSvasudFaste = CreateTicketTo("Svasud Faste", "hs_mularn_svasudfaste"); ticketToMularn = CreateTicketTo("Mularn", "hs_svasudfaste_mularn"); npcs = (GameNPC[])WorldMgr.GetObjectsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGriffinHandlerNjiedi"), eRealm.Midgard, typeof(GameStableMaster)); if (npcs.Length == 0) { njiedi = new GameStableMaster(); njiedi.Model = 158; njiedi.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGriffinHandlerNjiedi"); if (log.IsWarnEnabled) { log.Warn("Could not find " + njiedi.Name + ", creating ..."); } njiedi.GuildName = "Stable Master"; njiedi.Realm = eRealm.Midgard; njiedi.CurrentRegionID = 100; njiedi.Size = 51; njiedi.Level = 50; GameNpcInventoryTemplate template = new GameNpcInventoryTemplate(); template.AddNPCEquipment(eInventorySlot.TorsoArmor, 81, 10); template.AddNPCEquipment(eInventorySlot.LegsArmor, 82, 10); template.AddNPCEquipment(eInventorySlot.FeetArmor, 84, 10); template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32); njiedi.Inventory = template.CloseTemplate(); // njiedi.AddNPCEquipment(Slot.TORSO, 81, 10, 0, 0); // njiedi.AddNPCEquipment(Slot.LEGS, 82, 10, 0, 0); // njiedi.AddNPCEquipment(Slot.FEET, 84, 10, 0, 0); // njiedi.AddNPCEquipment(Slot.CLOAK, 57, 32, 0, 0); njiedi.X = GameLocation.ConvertLocalXToGlobalX(55561, 100); njiedi.Y = GameLocation.ConvertLocalYToGlobalY(58225, 100); njiedi.Z = 5005; njiedi.Heading = 126; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; njiedi.SetOwnBrain(brain); //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { njiedi.SaveIntoDatabase(); } njiedi.AddToWorld(); } else { njiedi = npcs[0] as GameStableMaster; } njiedi.TradeItems = new MerchantTradeItems(null); if (!njiedi.TradeItems.AddTradeItem(1, eMerchantWindowSlot.FirstEmptyInPage, ticketToSvasudFaste)) { if (log.IsWarnEnabled) { log.Warn("ticketToSvasudFaste not added"); } } foreach (GameNPC npc in njiedi.GetNPCsInRadius(400)) { if (npc.Name == LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.Frontiers.NPCGryphon")) { griffin = npc; break; } } if (griffin == null) { griffin = new GameNPC(); griffin.Model = 1236; // //819; griffin.Name = "tamed gryphon"; if (log.IsWarnEnabled) { log.Warn("Could not find " + griffin.Name + ", creating ..."); } griffin.GuildName = "Part of " + questTitle + " Quest"; griffin.Realm = eRealm.Midgard; griffin.CurrentRegionID = njiedi.CurrentRegionID; griffin.Size = 50; griffin.Level = 50; griffin.X = njiedi.X + 80; griffin.Y = njiedi.Y + 100; griffin.Z = njiedi.Z; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; griffin.SetOwnBrain(brain); griffin.Heading = 93; griffin.MaxSpeedBase = 400; //dragonfly.EquipmentTemplateID = 200276; //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { griffin.SaveIntoDatabase(); } griffin.AddToWorld(); } npcs = (GameNPC[])WorldMgr.GetObjectsByName("Vorgar", eRealm.Midgard, typeof(GameStableMaster)); if (npcs.Length == 0) { vorgar = new GameStableMaster(); vorgar.Model = 52; vorgar.Name = "Vorgar"; if (log.IsWarnEnabled) { log.Warn("Could not find " + vorgar.Name + ", creating ..."); } vorgar.GuildName = "Stable Master"; vorgar.Realm = eRealm.Midgard; vorgar.CurrentRegionID = 100; vorgar.Size = 51; vorgar.Level = 50; vorgar.X = GameLocation.ConvertLocalXToGlobalX(10660, 100); vorgar.Y = GameLocation.ConvertLocalYToGlobalY(3437, 100); vorgar.Z = 5717; vorgar.Heading = 327; vorgar.MaxSpeedBase = 200; StandardMobBrain brain = new StandardMobBrain(); brain.AggroLevel = 0; brain.AggroRange = 0; vorgar.SetOwnBrain(brain); //ulliam.EquipmentTemplateID = 200276; //You don't have to store the created mob in the db if you don't want, //it will be recreated each time it is not found, just comment the following //line if you rather not modify your database if (SAVE_INTO_DATABASE) { vorgar.SaveIntoDatabase(); } vorgar.AddToWorld(); } else { vorgar = npcs[0] as GameStableMaster; } Point2D vorgarloc = vorgar.GetPointFromHeading(vorgar.Heading, 30); locationVorgar = new GameLocation(vorgar.CurrentZone.Description, vorgar.CurrentRegionID, vorgarloc.X, vorgarloc.Y, vorgar.Z); #endregion #region DefineItems // item db check noteForNjiedi = GameServer.Database.FindObjectByKey <ItemTemplate>("njiedi_note"); if (noteForNjiedi == null) { if (log.IsWarnEnabled) { log.Warn("Could not find Njiedi's Note, creating it ..."); } noteForNjiedi = new ItemTemplate(); noteForNjiedi.Name = "Njiedi's Note"; noteForNjiedi.Weight = 3; noteForNjiedi.Model = 498; noteForNjiedi.Object_Type = (int)eObjectType.GenericItem; noteForNjiedi.Id_nb = "njiedi_note"; noteForNjiedi.IsPickable = true; noteForNjiedi.IsDropable = false; GameServer.Database.AddObject(noteForNjiedi); } // item db check askefruerPlans = GameServer.Database.FindObjectByKey <ItemTemplate>("askefruer_plans"); if (askefruerPlans == null) { askefruerPlans = new ItemTemplate(); askefruerPlans.Name = "Askefruer Plans"; if (log.IsWarnEnabled) { log.Warn("Could not find " + askefruerPlans.Name + ", creating it ..."); } askefruerPlans.Weight = 3; askefruerPlans.Model = 498; askefruerPlans.Object_Type = (int)eObjectType.GenericItem; askefruerPlans.Id_nb = "askefruer_plans"; askefruerPlans.IsPickable = true; askefruerPlans.IsDropable = false; GameServer.Database.AddObject(askefruerPlans); } translatedPlans = GameServer.Database.FindObjectByKey <ItemTemplate>("translated_askefruer_plans"); if (translatedPlans == null) { translatedPlans = new ItemTemplate(); translatedPlans.Name = "Translated Askefruer Plans"; if (log.IsWarnEnabled) { log.Warn("Could not find " + translatedPlans.Name + ", creating it ..."); } translatedPlans.Weight = 3; translatedPlans.Model = 498; translatedPlans.Object_Type = (int)eObjectType.GenericItem; translatedPlans.Id_nb = "translated_askefruer_plans"; translatedPlans.IsPickable = true; translatedPlans.IsDropable = false; GameServer.Database.AddObject(translatedPlans); } // item db check recruitsLegs = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_studded_legs_mid"); if (recruitsLegs == null) { recruitsLegs = new ItemTemplate(); recruitsLegs.Name = "Recruit's Studded Legs (Mid)"; if (log.IsWarnEnabled) { log.Warn("Could not find " + recruitsLegs.Name + ", creating it ..."); } recruitsLegs.Level = 7; recruitsLegs.Weight = 42; recruitsLegs.Model = 82; // Studded Legs recruitsLegs.DPS_AF = 10; // Armour recruitsLegs.SPD_ABS = 19; // Absorption recruitsLegs.Object_Type = (int)eObjectType.Studded; recruitsLegs.Item_Type = (int)eEquipmentItems.LEGS; recruitsLegs.Id_nb = "recruits_studded_legs_mid"; recruitsLegs.Price = Money.GetMoney(0, 0, 0, 10, 0); recruitsLegs.IsPickable = true; recruitsLegs.IsDropable = true; recruitsLegs.Color = 14; // blue leather recruitsLegs.Bonus = 5; // default bonus recruitsLegs.Bonus1 = 12; recruitsLegs.Bonus1Type = (int)eProperty.MaxHealth; // hit recruitsLegs.Bonus2 = 2; recruitsLegs.Bonus2Type = (int)eResist.Slash; recruitsLegs.Bonus3 = 1; recruitsLegs.Bonus3Type = (int)eResist.Cold; recruitsLegs.Quality = 100; recruitsLegs.Condition = 1000; recruitsLegs.MaxCondition = 1000; recruitsLegs.Durability = 1000; recruitsLegs.MaxDurability = 1000; GameServer.Database.AddObject(recruitsLegs); } // item db check recruitsPants = GameServer.Database.FindObjectByKey <ItemTemplate>("recruits_quilted_pants"); if (recruitsPants == null) { recruitsPants = new ItemTemplate(); recruitsPants.Name = "Recruit's Quilted Pants"; if (log.IsWarnEnabled) { log.Warn("Could not find " + recruitsPants.Name + ", creating it ..."); } recruitsPants.Level = 7; recruitsPants.Weight = 14; recruitsPants.Model = 152; // cloth Legs recruitsPants.DPS_AF = 5; // Armour recruitsPants.SPD_ABS = 0; // Absorption recruitsPants.Object_Type = (int)eObjectType.Cloth; recruitsPants.Item_Type = (int)eEquipmentItems.LEGS; recruitsPants.Id_nb = "recruits_quilted_pants"; recruitsPants.Price = Money.GetMoney(0, 0, 0, 10, 0); recruitsPants.IsPickable = true; recruitsPants.IsDropable = true; recruitsPants.Color = 36; recruitsPants.Bonus = 5; // default bonus recruitsPants.Bonus1 = 12; recruitsPants.Bonus1Type = (int)eProperty.MaxHealth; // hit recruitsPants.Bonus2 = 2; recruitsPants.Bonus2Type = (int)eResist.Slash; recruitsPants.Bonus3 = 1; recruitsPants.Bonus3Type = (int)eResist.Cold; recruitsPants.Quality = 100; recruitsPants.Condition = 1000; recruitsPants.MaxCondition = 1000; recruitsPants.Durability = 1000; recruitsPants.MaxDurability = 1000; GameServer.Database.AddObject(recruitsPants); } #endregion /* Now we add some hooks to the npc we found. * Actually, we want to know when a player interacts with him. * So, we hook the right-click (interact) and the whisper method * of npc and set the callback method to the "TalkToXXX" * method. This means, the "TalkToXXX" method is called whenever * a player right clicks on him or when he whispers to him. */ //We want to be notified whenever a player enters the world GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest)); GameEventMgr.AddHandler(GamePlayerEvent.GameEntered, new DOLEventHandler(PlayerEnterWorld)); GameEventMgr.AddHandler(dalikor, GameLivingEvent.Interact, new DOLEventHandler(TalkToDalikor)); GameEventMgr.AddHandler(dalikor, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToDalikor)); GameEventMgr.AddHandler(annark, GameObjectEvent.Interact, new DOLEventHandler(TalkToAnnark)); GameEventMgr.AddHandler(njiedi, GameObjectEvent.Interact, new DOLEventHandler(TalkToNjiedi)); GameEventMgr.AddHandler(idora, GameObjectEvent.Interact, new DOLEventHandler(TalkToIdora)); GameEventMgr.AddHandler(idora, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToIdora)); GameEventMgr.AddHandler(vorgar, GameObjectEvent.Interact, new DOLEventHandler(TalkToVorgar)); GameEventMgr.AddHandler(vorgar, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToVorgar)); /* Now we bring to dalikor the possibility to give this quest to players */ dalikor.AddQuestToGive(typeof(Frontiers)); if (log.IsInfoEnabled) { if (log.IsInfoEnabled) { log.Info("Quest \"" + questTitle + "\" initialized"); } } }