public override void Start(GameLiving target)
 {
     base.Start(target);
     if (target is GameNPC)
     {
         pet = target as GameNPC;
         pbaoe = ScriptMgr.CreateSpellHandler(EffectOwner, petSpell, petSpellLine);
         pulseTimer = new RegionTimer(EffectOwner, new RegionTimerCallback(PulseTimer), 1000);
         GameEventMgr.AddHandler(EffectOwner, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));
     }
 }
Beispiel #2
0
		protected override void SendQuestWindow(GameNPC questNPC, GamePlayer player, DataQuest quest, bool offer)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Dialog));
			ushort QuestID = quest.ClientQuestID;
			pak.WriteShort((offer) ? (byte)0x22 : (byte)0x21); // Dialog
			pak.WriteShort(QuestID);
			pak.WriteShort((ushort)questNPC.ObjectID);
			pak.WriteByte(0x00); // unknown
			pak.WriteByte(0x00); // unknown
			pak.WriteByte(0x00); // unknown
			pak.WriteByte(0x00); // unknown
			pak.WriteByte((offer) ? (byte)0x02 : (byte)0x01); // Accept/Decline or Finish/Not Yet
			pak.WriteByte(0x01); // Wrap
			pak.WritePascalString(quest.Name);

			String personalizedSummary = BehaviourUtils.GetPersonalizedMessage(quest.Description, player);
			if (personalizedSummary.Length > 255)
			{
				pak.WritePascalString(personalizedSummary.Substring(0, 255)); // Summary is max 255 bytes !
			}
			else
			{
				pak.WritePascalString(personalizedSummary);
			}

			if (offer)
			{
				//String personalizedStory = BehaviourUtils.GetPersonalizedMessage(quest.Story, player);
				pak.WriteShort((ushort)quest.Story.Length);
				pak.WriteStringBytes(quest.Story);
			}
			else
			{
				pak.WriteShort((ushort)quest.FinishText.Length);
				pak.WriteStringBytes(quest.FinishText);
			}
			pak.WriteShort(QuestID);
			pak.WriteByte((byte)quest.StepTexts.Count); // #goals count
			foreach (string text in quest.StepTexts)
			{
				pak.WritePascalString(String.Format("{0}\r", text));
			}
			pak.WriteInt((uint)(0));
			pak.WriteByte((byte)0);
			pak.WriteByte((byte)quest.FinalRewards.Count);
			foreach (ItemTemplate reward in quest.FinalRewards)
			{
				WriteItemData(pak, GameInventoryItem.Create<ItemTemplate>(reward));
			}
			pak.WriteByte((byte)quest.NumOptionalRewardsChoice);
			pak.WriteByte((byte)quest.OptionalRewards.Count);
			foreach (ItemTemplate reward in quest.OptionalRewards)
			{
				WriteItemData(pak, GameInventoryItem.Create<ItemTemplate>(reward));
			}
			SendTCP(pak);
		}
Beispiel #3
0
 /// <summary>
 /// Send the quest dialogue for a classic quest to the player
 /// </summary>
 /// <param name="questType"></param>
 /// <param name="sentence"></param>
 /// <param name="player"></param>
 /// <param name="source"></param>
 /// <returns></returns>
 public static bool AbortQuestToPlayer(Type questType, string sentence, GamePlayer player,GameNPC source )
 {
     if (player.IsDoingQuest(questType) != null)
     {
         player.Out.SendQuestAbortCommand(source, QuestMgr.GetIDForQuestType(questType), sentence);
         return true;
     }
     else
     {
         return false;
     }
 }
        /// <summary>
        /// Called when effect is to be started
        /// </summary>
        /// <param name="player">The player to start the effect for</param>
        /// <param name="duration">The effectduration in secounds</param>
        /// <param name="value">The increment of effective level</param>
        public void Start(GamePlayer player, int duration, byte value)
        {
            if (player.ControlledBrain == null)
                return;
            m_living = player.ControlledBrain.Body;
            m_effectDuration = duration;
            m_value = value;

            StartTimers();

            m_living.Size += (byte)m_growSize;
            m_living.Level += m_value;
            m_living.EffectList.Add(this);
        }
Beispiel #5
0
		/// <summary>
		/// Called when effect is to be started
		/// </summary>
		/// <param name="player">The player to start the effect for</param>
		/// <param name="duration">The effectduration in secounds</param>
		/// <param name="value">The increment of effective level</param>
		public void Start(GameLiving living, int duration, byte value)
		{
			if (living.ControlledBrain == null)
				return;
			m_living = living.ControlledBrain.Body;
			m_effectDuration = duration;
			m_value = value;


			StartTimers();

			m_living.Size += (byte)m_growSize;
			m_living.Level = (byte)Math.Min(m_living.Level+m_value, JUGGERNAUT_CAP_EFFECT);
			m_living.EffectList.Add(this);

		}
Beispiel #6
0
		protected override void SendQuestWindow(GameNPC questNPC, GamePlayer player, RewardQuest quest,	bool offer)
		{
			GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Dialog));
			ushort QuestID = QuestMgr.GetIDForQuestType(quest.GetType());
			pak.WriteShort((offer) ? (byte)0x22 : (byte)0x21); // Dialog
			pak.WriteShort(QuestID);
			pak.WriteShort((ushort)questNPC.ObjectID);
			pak.WriteByte(0x00); // unknown
			pak.WriteByte(0x00); // unknown
			pak.WriteByte(0x00); // unknown
			pak.WriteByte(0x00); // unknown
			pak.WriteByte((offer) ? (byte)0x02 : (byte)0x01); // Accept/Decline or Finish/Not Yet
			pak.WriteByte(0x01); // Wrap
			pak.WritePascalString(quest.Name);
			if (quest.Summary.Length > 255)
				pak.WritePascalString(quest.Summary.Substring(0,255));
			else
				pak.WritePascalString(quest.Summary);
			if (offer)
			{
				pak.WriteShort((ushort)quest.Story.Length);
				pak.WriteStringBytes(quest.Story);
			}
			else
			{
				pak.WriteShort((ushort)quest.Conclusion.Length);
				pak.WriteStringBytes(quest.Conclusion);
			}
			pak.WriteShort(QuestID);
			pak.WriteByte((byte)quest.Goals.Count); // #goals count
			foreach (RewardQuest.QuestGoal goal in quest.Goals)
			{
				pak.WritePascalString(String.Format("{0}\r", goal.Description));
			}
			pak.WriteByte((byte)quest.Level);
			pak.WriteByte((byte)quest.Rewards.MoneyPercent);
			pak.WriteByte((byte)quest.Rewards.ExperiencePercent(player));
			pak.WriteByte((byte)quest.Rewards.BasicItems.Count);
			foreach (ItemTemplate reward in quest.Rewards.BasicItems)
				WriteTemplateData(pak, reward, 1);
			pak.WriteByte((byte)quest.Rewards.ChoiceOf);
			pak.WriteByte((byte)quest.Rewards.OptionalItems.Count);
			foreach (ItemTemplate reward in quest.Rewards.OptionalItems)
				WriteTemplateData(pak, reward, 1);
			SendTCP(pak);
		}
        /// <summary>
        /// called when spell effect has to be started and applied to targets
        /// </summary>
        public override bool StartSpell(GameLiving target)
        {
            if (m_charmedNpc == null)
                m_charmedNpc = target as GameNPC; // save target on first start
            else
                target = m_charmedNpc; // reuse for pulsing spells

            if (target == null) return false;
            if (Util.Chance(CalculateSpellResistChance(target)))
            {
                OnSpellResisted(target);
            }
            else
            {
                ApplyEffectOnTarget(target, 1);
            }

            return true;
        }
        public static bool LockRelic()
        {
            //make sure the relic exists before you lock it!
            if (Relic == null)
                return false;

            LockedEffect = new GameNPC();
            LockedEffect.Model = 1583;
            LockedEffect.Name = "LOCKED_RELIC";
            LockedEffect.X = Relic.X;
            LockedEffect.Y = Relic.Y;
            LockedEffect.Z = Relic.Z;
            LockedEffect.Heading = Relic.Heading;
            LockedEffect.CurrentRegionID = Relic.CurrentRegionID;
            LockedEffect.Flags = GameNPC.eFlags.CANTTARGET;
            LockedEffect.AddToWorld();

            return true;
        }
		public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args)
		{

			// What npctemplate should we use for the zonepoint ?
			ushort model;
			NpcTemplate zp;
			try{
				model = (ushort)ServerProperties.Properties.ZONEPOINT_NPCTEMPLATE;
				zp = new NpcTemplate(GameServer.Database.SelectObjects<DBNpcTemplate>("`TemplateId` = @TemplateId", new QueryParameter("@TemplateId", model)).FirstOrDefault());
				if (model <= 0 || zp == null) throw new ArgumentNullException();
			}
			catch {
				return;
			}
			
			// processing all the ZP
			IList<ZonePoint> zonePoints = GameServer.Database.SelectAllObjects<ZonePoint>();
			foreach (ZonePoint z in zonePoints)
			{
				if (z.SourceRegion == 0) continue;
				
				// find target region for the current zonepoint
				Region r = WorldMgr.GetRegion(z.TargetRegion);
				if (r == null)
				{
					log.Warn("Zonepoint Id (" + z.Id +  ") references an inexistent target region " + z.TargetRegion + " - skipping, ZP not created");
					continue;
				}
				
				GameNPC npc = new GameNPC(zp);

				npc.CurrentRegionID = z.SourceRegion;
				npc.X = z.SourceX;
				npc.Y = z.SourceY;
				npc.Z = z.SourceZ;
				npc.Name = r.Description;
				npc.GuildName = "ZonePoint (Open)";			
				if (r.IsDisabled) npc.GuildName = "ZonePoint (Closed)";
				
				npc.AddToWorld();
			}
		}
        public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args)
        {
            // What npctemplate should we use for the zonepoint ?
            ushort model;
            NpcTemplate zp;
            try
            {
                model = (ushort)ServerProperties.Properties.ZONEPOINT_NPCTEMPLATE;
                zp = new NpcTemplate(GameServer.Database.SelectObject<DBNpcTemplate>("TemplateId =" + model.ToString()));
                if (model <= 0 || zp == null) throw new ArgumentNullException();
            }
            catch
            {
                return;
            }

            // processing all the ZP
            IList<ZonePoint> zonePoints = GameServer.Database.SelectAllObjects<ZonePoint>();
            foreach (ZonePoint z in zonePoints)
            {
                if (z.SourceRegion == 0)
                    continue;
                //find region
                Region r = WorldMgr.GetRegion(z.TargetRegion);
                GameNPC npc = new GameNPC(zp);

                npc.CurrentRegionID = z.SourceRegion;
                npc.X = z.SourceX;
                npc.Y = z.SourceY;
                npc.Z = z.SourceZ;

                npc.Name = r.Description;
                if (r.IsDisabled)
                    npc.GuildName = "ZonePoint (Closed)";
                else npc.GuildName = "ZonePoint (Open)";
                npc.AddToWorld();
            }
        }
Beispiel #11
0
		public void NPCManipulateDoorRequest(GameNPC npc, bool open)
		{ }
 /// <summary>
 ///  Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC"></param>
 /// <param name="n"></param>
 /// <param name="v"></param>
 /// <param name="comp"></param>
 public GoldRequirement(GameNPC defaultNPC, object n, object v, eComparator comp)
     : base(defaultNPC, eRequirementType.Gold, n, v, comp)
 {
 }
Beispiel #13
0
        protected void CreateDunwynClone()
        {
            GameNpcInventoryTemplate template;
            if (dunwynClone == null)
            {
                dunwynClone = new GameNPC();
                dunwynClone.Name = "Master Dunwyn";
                dunwynClone.Model = 9;
                dunwynClone.GuildName = "Part of " + questTitle + " Quest";
                dunwynClone.Realm = eRealm.Albion;
                dunwynClone.CurrentRegionID = 1;
                dunwynClone.Size = 50;
                dunwynClone.Level = 14;

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

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

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

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

                dunwynClone.AddToWorld();

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

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

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

                recruits[i].Name = "Recruit";

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

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

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

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

            }

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

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

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

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

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

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

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

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

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i].AddToWorld();
            }
        }
Beispiel #14
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

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

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

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

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

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

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

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

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

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

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

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

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    colm.SaveIntoDatabase();
                }
                colm.AddToWorld();
            }
            else
            {
                colm = npcs[0] as GameStableMaster;
            }

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

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

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

                haruld.EquipmentTemplateID = "11701337";

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                {
                    haruld.SaveIntoDatabase();
                }
                haruld.AddToWorld();
            }
            else
            {
                haruld = npcs[0] as GameStableMaster;
            }

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

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

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

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

            #endregion

            #region defineItems

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

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

                dragonflyWhip.Object_Type = (int)eObjectType.GenericItem;

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

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

                GameServer.Database.AddObject(dragonflyWhip);
            }

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

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

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

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

                recruitsVest.Bonus = 5;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsVest);
            }

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

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

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

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

                recruitsQuiltedVest.Bonus = 5;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsQuiltedVest);
            }

            #endregion

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

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

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

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

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

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

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

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

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

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

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Elvar Ironhand", eRealm.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 12);
                elvarIronhand.Inventory = template.CloseTemplate();
                elvarIronhand.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                elvarIronhand.Size = 54;
                elvarIronhand.Level = 17;
                elvarIronhand.X = 561351;
                elvarIronhand.Y = 510292;
                elvarIronhand.Z = 2400;
                elvarIronhand.Heading = 3982;

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

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

            #endregion

            #region defineItems

            // item db check
            wellPreservedBones = GameServer.Database.FindObjectByKey<ItemTemplate>("well_preserved_bone");
            if (wellPreservedBones == null)
            {
                wellPreservedBones = new ItemTemplate();
                wellPreservedBones.Name = "Well-Preserved Bone";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+wellPreservedBones.Name+", creating it ...");

                wellPreservedBones.Level = 0;
                wellPreservedBones.Weight = 1;
                wellPreservedBones.Model = 497;

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

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

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

                    GameServer.Database.AddObject(wellPreservedBones);
            }

            // item db check
            twoWellPreservedBones = GameServer.Database.FindObjectByKey<ItemTemplate>("two_well_preserved_bones");
            if (twoWellPreservedBones == null)
            {
                twoWellPreservedBones = new ItemTemplate();
                twoWellPreservedBones.Name = "Two Well-Preserved Bones";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+twoWellPreservedBones.Name+", creating it ...");

                twoWellPreservedBones.Level = 0;
                twoWellPreservedBones.Weight = 1;
                twoWellPreservedBones.Model = 497;

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

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

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

                    GameServer.Database.AddObject(twoWellPreservedBones);
            }

            #endregion

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

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

            GameEventMgr.AddHandler(elvarIronhand, GameLivingEvent.Interact, new DOLEventHandler(TalkToElvarIronhand));
            GameEventMgr.AddHandler(elvarIronhand, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToElvarIronhand));

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
        /// <summary>
        /// Generate loot for given mob
        /// </summary>
        /// <param name="mob"></param>
        /// <param name="killer"></param>
        /// <returns></returns>
        public override LootList GenerateLoot(GameNPC mob, GameObject killer)
        {
            LootList loot = base.GenerateLoot(mob, killer);

            try
            {
                GamePlayer player = killer as GamePlayer;
                if (killer is GameNPC && ((GameNPC)killer).Brain is IControlledBrain)
                {
                    player = ((ControlledNpcBrain)((GameNPC)killer).Brain).GetPlayerOwner();
                }
                if (player == null)
                {
                    return(loot);
                }


                ItemTemplate dragonscales = new ItemTemplate(m_dragonscales);

                int killedcon = (int)player.GetConLevel(mob) + 3;

                if (killedcon <= 0)
                {
                    return(loot);
                }

                int lvl = mob.Level + 1;
                if (lvl < 1)
                {
                    lvl = 1;
                }
                int maxcount = 1;

                //Switch pack size
                if (lvl > 0 && lvl < 10)
                {
                    //Single Dragonscales
                    maxcount = (int)Math.Floor((double)(lvl / 2)) + 1;
                }
                else if (lvl >= 10 && lvl < 20)
                {
                    //Double
                    dragonscales.PackSize = 2;
                    maxcount = (int)Math.Floor((double)((lvl - 10) / 2)) + 1;
                }
                else if (lvl >= 20 && lvl < 30)
                {
                    //Triple
                    dragonscales.PackSize = 3;
                    maxcount = (int)Math.Floor((double)((lvl - 20) / 2)) + 1;
                }
                else if (lvl >= 30 && lvl < 40)
                {
                    //Quad
                    dragonscales.PackSize = 4;
                    maxcount = (int)Math.Floor((double)((lvl - 30) / 2)) + 1;
                }
                else if (lvl >= 40 && lvl < 50)
                {
                    //Quint
                    dragonscales.PackSize = 5;
                    maxcount = (int)Math.Floor((double)((lvl - 40) / 2)) + 1;
                }
                else
                {
                    //Cache (x10)
                    dragonscales.PackSize = 10;
                    maxcount = (int)Math.Round((double)(lvl / 10));
                }

                if (!mob.Name.ToLower().Equals(mob.Name))
                {
                    //Named mob, more cash !
                    maxcount = (int)Math.Round(maxcount * ServerProperties.Properties.LOOTGENERATOR_DRAGONSCALES_NAMED_COUNT);
                }

                if (maxcount > 0 && Util.Chance(ServerProperties.Properties.LOOTGENERATOR_DRAGONSCALES_BASE_CHANCE + Math.Max(10, killedcon)))
                {
                    loot.AddFixed(dragonscales, maxcount);
                }
            }
            catch
            {
                return(loot);
            }

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

            /* First thing we do in here is to search for the NPCs inside
             * the world who comes from the 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];
            }

            var point = idora.GetPointFromHeading(idora.Heading, 30);
            locationIdora = new GameLocation(idora.CurrentZone.Description, idora.CurrentRegionID, point.X, point.Y, idora.Position.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;
            }

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

            #endregion

            #region DefineItems

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

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

                noteForNjiedi.Object_Type = (int)eObjectType.GenericItem;

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

                GameServer.Database.AddObject(noteForNjiedi);
            }

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

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

                askefruerPlans.Object_Type = (int)eObjectType.GenericItem;

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

                GameServer.Database.AddObject(askefruerPlans);
            }

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

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

                translatedPlans.Object_Type = (int)eObjectType.GenericItem;

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

                GameServer.Database.AddObject(translatedPlans);
            }

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

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

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

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

                recruitsLegs.Bonus = 5;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsLegs);
            }

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

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

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

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

                recruitsPants.Bonus = 5;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsPants);
            }

            #endregion

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

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

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

            GameEventMgr.AddHandler(annark, GameObjectEvent.Interact, new DOLEventHandler(TalkToAnnark));

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

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

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

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

            if (log.IsInfoEnabled)
            {
                if (log.IsInfoEnabled)
                {
                    log.Info("Quest \"" + questTitle + "\" initialized");
                }
            }
        }
Beispiel #19
0
 /// <summary>
 /// Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC"></param>
 /// <param name="n"></param>
 /// <param name="v"></param>
 /// <param name="comp"></param>
 public QuestPendingRequirement(GameNPC defaultNPC, Object n, Object v, eComparator comp)
     : base(defaultNPC, eRequirementType.QuestPending, n, v, comp)
 {
 }
Beispiel #20
0
 protected virtual int DeleteFairy(RegionTimer callingTimer)
 {
     ireFairy.Delete();
     ireFairy = null;
     return(0);
 }
Beispiel #21
0
		public override void OnEffectStart(GameSpellEffect effect)
		{
			if (effect.Owner == null) return;
			if (!effect.Owner.IsAlive || effect.Owner.ObjectState != GameLiving.eObjectState.Active) return;

			//SendEffectAnimation(effect.Owner, 0, false, 1); //send the effect

			if (effect.Owner is GamePlayer)
			{
				/*
				 *Q: What does the confusion spell do against players?
				 *A: According to the magic man, “Confusion against a player interrupts their current action, whether it's a bow shot or spellcast.
				 */
				if (Spell.Value < 0 || Util.Chance(Convert.ToInt32(Math.Abs(Spell.Value))))
				{
					//Spell value below 0 means it's 100% chance to confuse.
					GamePlayer player = effect.Owner as GamePlayer;

					player.StartInterruptTimer(player.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
				}

				effect.Cancel(false);
			}
			else if (effect.Owner is GameNPC)
			{
				//check if we should do anything at all.

				bool doConfuse = (Spell.Value < 0 || Util.Chance(Convert.ToInt32(Spell.Value)));

				if (!doConfuse)
					return;

				bool doAttackFriend = Spell.Value < 0 && Util.Chance(Convert.ToInt32(Math.Abs(Spell.Value)));
				
				GameNPC npc = effect.Owner as GameNPC;

				npc.IsConfused = true;

				if (log.IsDebugEnabled)
					log.Debug("CONFUSION: " + npc.Name + " was confused(true," + doAttackFriend.ToString() +")");

                if (npc is GamePet && npc.Brain != null && (npc.Brain as IControlledBrain) != null)
				{
					//it's a pet.
					GamePlayer playerowner = (npc.Brain as IControlledBrain).GetPlayerOwner();
					if (playerowner != null && playerowner.CharacterClass.ID == (int)eCharacterClass.Theurgist)
					{
						//Theurgist pets die.
						npc.Die(Caster);
						effect.Cancel(false);
						return;
					}
				}

				targetList.Clear();
				foreach (GamePlayer target in npc.GetPlayersInRadius(1000))
				{
					if (doAttackFriend)
						targetList.Add(target);
					else
					{
						//this should prevent mobs from attacking friends.
						if (GameServer.ServerRules.IsAllowedToAttack(npc, target, true))
							targetList.Add(target);
					}
				}

				foreach (GameNPC target in npc.GetNPCsInRadius(1000))
				{
					//don't agro yourself.
					if (target == npc)
						continue;

					if (doAttackFriend)
						targetList.Add(target);
					else
					{
						//this should prevent mobs from attacking friends.
						if (GameServer.ServerRules.IsAllowedToAttack(npc, target, true) && !GameServer.ServerRules.IsSameRealm(npc,target,true))
							targetList.Add(target);
					}
				}

				//targetlist should be full, start effect pulse.
				if (targetList.Count > 0)
				{
					npc.StopAttack();
					npc.StopCurrentSpellcast();

					GameLiving target = targetList[Util.Random(targetList.Count - 1)] as GameLiving;
					npc.StartAttack(target);
				}
			}
		}
Beispiel #22
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }

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

            #region defineNPCS

            masterFrederick = GetMasterFrederick();

            #endregion

            #region defineItems

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

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

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

                emptyMagicBox.IsPickable = true;
                emptyMagicBox.IsDropable = false;

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

                GameServer.Database.AddObject(emptyMagicBox);
            }

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

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

                fullMagicBox.Object_Type = (int)eObjectType.GenericItem;

                fullMagicBox.Id_nb      = "full_wodden_magic_box";
                fullMagicBox.IsPickable = true;
                fullMagicBox.IsDropable = false;

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

                GameServer.Database.AddObject(fullMagicBox);
            }

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

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

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

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

                recruitsShortSword.Bonus = 1;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsShortSword);
            }

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

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

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

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

                recruitsStaff.Bonus = 1;                 // default bonus

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

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

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

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

                GameServer.Database.AddObject(recruitsStaff);
            }

            #endregion

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

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

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

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

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

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

            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
        /// <summary>
        /// Selects and attacks the next target or does nothing
        /// </summary>
        protected override void AttackMostWanted()
        {
            if (!IsActive || m_aggressionState == eAggressionState.Passive)
            {
                return;
            }

            GameNPC owner_npc = GetNPCOwner();

            if (owner_npc != null && owner_npc.Brain is StandardMobBrain)
            {
                if ((owner_npc.IsCasting || owner_npc.IsAttacking) &&
                    owner_npc.TargetObject != null &&
                    owner_npc.TargetObject is GameLiving &&
                    GameServer.ServerRules.IsAllowedToAttack(owner_npc, owner_npc.TargetObject as GameLiving, false))
                {
                    if (!CheckSpells(eCheckSpellType.Offensive))
                    {
                        Body.StartAttack(owner_npc.TargetObject);
                    }
                    return;
                }
            }

            GameLiving target = CalculateNextAttackTarget();

            if (target != null)
            {
                if (!Body.IsAttacking || target != Body.TargetObject)
                {
                    Body.TargetObject = target;

                    if (target is GamePlayer)
                    {
                        Body.LastAttackTickPvP           = Body.CurrentRegion.Time;
                        Owner.LastAttackedByEnemyTickPvP = Body.CurrentRegion.Time;
                    }
                    else
                    {
                        Body.LastAttackTickPvE           = Body.CurrentRegion.Time;
                        Owner.LastAttackedByEnemyTickPvE = Body.CurrentRegion.Time;
                    }

                    List <GameSpellEffect> effects = new List <GameSpellEffect>();

                    lock (Body.EffectList)
                    {
                        foreach (IGameEffect effect in Body.EffectList)
                        {
                            if (effect is GameSpellEffect && (effect as GameSpellEffect).SpellHandler is SpeedEnhancementSpellHandler)
                            {
                                effects.Add(effect as GameSpellEffect);
                            }
                        }
                    }

                    lock (Owner.EffectList)
                    {
                        foreach (IGameEffect effect in Owner.EffectList)
                        {
                            if (effect is GameSpellEffect && (effect as GameSpellEffect).SpellHandler is SpeedEnhancementSpellHandler)
                            {
                                effects.Add(effect as GameSpellEffect);
                            }
                        }
                    }

                    foreach (GameSpellEffect effect in effects)
                    {
                        effect.Cancel(false);
                    }

                    if (!CheckSpells(eCheckSpellType.Offensive))
                    {
                        Body.StartAttack(target);
                    }
                }
            }
            else
            {
                Body.TargetObject = null;

                if (Body.IsAttacking)
                {
                    Body.StopAttack();
                }

                if (Body.SpellTimer != null && Body.SpellTimer.IsAlive)
                {
                    Body.SpellTimer.Stop();
                }

                if (WalkState == eWalkState.Follow)
                {
                    FollowOwner();
                }
                else if (m_tempX > 0 && m_tempY > 0 && m_tempZ > 0)
                {
                    Body.WalkTo(m_tempX, m_tempY, m_tempZ, Body.MaxSpeed);
                }
            }
        }
 /// <summary>
 /// Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC">Parent defaultNPC of this Requirement</param>
 /// <param name="n">First Requirement Variable, meaning depends on RequirementType</param>
 /// <param name="comp">Comparator used if some values are veeing compared</param>
 public GoldRequirement(GameNPC defaultNPC, long n, eComparator comp)
     : this(defaultNPC, (object)n, (object)null, comp)
 {
 }
 /// <summary>
 /// Creates a QuestPart for the given questtype with the default npc.
 /// </summary>
 /// <param name="questType">type of Quest this QuestPart will belong to.</param>
 /// <param name="npc">NPC associated with his questpart typically NPC talking to or mob killing, etc...</param>
 /// <param name="executions">Maximum number of executions the questpart should be execute during one quest for each player</param>
 public QuestBehaviour(Type questType, GameNPC npc, int executions)
     : base(npc)
 {
     this.questType = questType;
     this.maxNumberOfExecutions = executions;
 }
Beispiel #26
0
 /// <summary>
 /// Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC"></param>
 /// <param name="questType"></param>
 /// <param name="comp"></param>
 public QuestPendingRequirement(GameNPC defaultNPC, Type questType, eComparator comp)
     : this(defaultNPC, (object)questType, (object)null, comp)
 {
 }
Beispiel #27
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
                * the world who comes from the Albion realm. If we find a the players,
                * this means we don't have to create a new one.
                *
                * NOTE: You can do anything you want in this method, you don't have
                * to search for NPC's ... you could create a custom item, place it
                * on the ground and if a player picks it up, he will get the quest!
                * Just examples, do anything you like and feel comfortable with :)
                */

            #region defineNPCs

            addrir = GetAddrir();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Aethic", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                aethic = new GameNPC();
                aethic.Model = 361;
                aethic.Name = "Aethic";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find" + aethic.Name + " , creating ...");
                aethic.GuildName = "Part of " + questTitle + " Quest";
                aethic.Realm = eRealm.Hibernia;
                aethic.CurrentRegionID = 200;
                aethic.Size = 49;
                aethic.Level = 21;
                aethic.X = GameLocation.ConvertLocalXToGlobalX(23761, 200);
                aethic.Y = GameLocation.ConvertLocalYToGlobalY(45658, 200);
                aethic.Z = 5448;
                aethic.Heading = 320;
                //aethic.EquipmentTemplateID = "1707754";
                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    aethic.SaveIntoDatabase();
                aethic.AddToWorld();
            }
            else
                aethic = npcs[0] as GameStableMaster;

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

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

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

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

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

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

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    truichon.SaveIntoDatabase();
                truichon.AddToWorld();
            }
            else
                truichon = npcs[0] as GameStableMaster;

            #endregion

            #region defineItems

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

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

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

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

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

                sackOfSupplies.Object_Type = (int) eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.IsDropable = false;

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

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

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

                crateOfVegetables.Object_Type = (int) eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.IsDropable = false;

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

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

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

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

                recruitsCloak.Bonus = 1; // default bonus

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

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

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

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

            #endregion

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

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(addrir, GameLivingEvent.Interact, new DOLEventHandler(TalkToAddrir));
            GameEventMgr.AddHandler(addrir, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToAddrir));

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

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

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

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

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Master Ferowl", eRealm.Albion);
            if (npcs.Length == 0)
            {
                Ferowl = new GameNPC();
                Ferowl.Model = 61;
                Ferowl.Name = "Master Ferowl";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Ferowl.Name + " , creating it ...");
                Ferowl.GuildName = "";
                Ferowl.Realm = eRealm.Albion;
                Ferowl.CurrentRegionID = 1;
                Ferowl.Size = 51;
                Ferowl.Level = 40;
                Ferowl.X = 559716;
                Ferowl.Y = 510733;
                Ferowl.Z = 2720;
                Ferowl.Heading = 703;
                Ferowl.AddToWorld();

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

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

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

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

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

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

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

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

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

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

                if (SAVE_INTO_DATABASE)
                    Silcharde.SaveIntoDatabase();

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

            #endregion

            #region Item Declarations

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

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

            ItemTemplate item = null;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

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

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

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

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

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

                    GameServer.Database.AddObject(item);

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                WizardEpicGloves = item;
            }

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

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

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

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

                    GameServer.Database.AddObject(item);

                WizardEpicVest = item;

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

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

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

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

                    GameServer.Database.AddObject(item);

                WizardEpicLegs = item;

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

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

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

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

                    GameServer.Database.AddObject(item);

                WizardEpicArms = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                MinstrelEpicBoots = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                MinstrelEpicHelm = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                MinstrelEpicGloves = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                MinstrelEpicVest = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                MinstrelEpicLegs = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                MinstrelEpicArms = item;
            }

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                SorcerorEpicBoots = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                SorcerorEpicHelm = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                SorcerorEpicGloves = item;

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

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

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

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

                    GameServer.Database.AddObject(item);

                SorcerorEpicVest = item;

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

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

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

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

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

                    GameServer.Database.AddObject(item);

                SorcerorEpicLegs = item;

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

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

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

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

                    GameServer.Database.AddObject(item);

                SorcerorEpicArms = item;
            }
            //Item Descriptions End

            #endregion

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

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

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

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

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

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Hugh Gallen", eRealm.Albion);

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

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

                hughGallen.Size = 49;
                hughGallen.Level = 38;
                hughGallen.X = 574640;
                hughGallen.Y = 531109;
                hughGallen.Z = 2896;
                hughGallen.Heading = 2275;

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

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

            #endregion

            #region defineItems

            // item db check
            beltOfAnimation = GameServer.Database.FindObjectByKey<ItemTemplate>("belt_of_animation");
            if (beltOfAnimation == null)
            {
                beltOfAnimation = new ItemTemplate();
                beltOfAnimation.Name = "Belt of Animation";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+beltOfAnimation.Name+", creating it ...");

                beltOfAnimation.Level = 5;
                beltOfAnimation.Weight = 3;
                beltOfAnimation.Model = 597;

                beltOfAnimation.Object_Type = (int) eObjectType.Magical;
                beltOfAnimation.Item_Type = (int) eEquipmentItems.WAIST;
                beltOfAnimation.Id_nb = "belt_of_animation";
                beltOfAnimation.Price = 0;
                beltOfAnimation.IsPickable = true;
                beltOfAnimation.IsDropable = false; // can't be sold to merchand

                beltOfAnimation.Bonus1 = 6;
                beltOfAnimation.Bonus1Type = (int)eProperty.MaxHealth;

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

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

                    GameServer.Database.AddObject(beltOfAnimation);
            }

            #endregion

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

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

            GameEventMgr.AddHandler(hughGallen, GameLivingEvent.Interact, new DOLEventHandler(TalkToHughGallen));
            GameEventMgr.AddHandler(hughGallen, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToHughGallen));

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #30
0
 public void NPCManipulateDoorRequest(GameNPC npc, bool open)
 {
 }
 /// <summary>
 /// Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC"></param>
 /// <param name="n"></param>
 /// <param name="v"></param>
 /// <param name="comp"></param>
 public HealthMaxRequirement(GameNPC defaultNPC, Object n, Object v, eComparator comp)
     : base(defaultNPC, eRequirementType.HealthMax, n, v, comp)
 {
 }
 /// <summary>
 /// Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC"></param>
 /// <param name="n"></param>
 /// <param name="v"></param>
 /// <param name="comp"></param>
 public RealmRequirement(GameNPC defaultNPC, object n, object v, eComparator comp)
     : base(defaultNPC, eRequirementType.Realm, n, v, comp)
 {
 }
Beispiel #33
0
        public NpcTemplate(GameNPC mob)
        {
            if (mob == null)
            {
                throw new ArgumentNullException("data");
            }

            m_translationId           = mob.TranslationId;
            m_blockChance             = mob.BlockChance;
            m_race                    = (ushort)mob.Race;
            m_bodyType                = mob.BodyType;
            m_charisma                = mob.Charisma;
            m_classType               = mob.GetType().ToString();
            m_constitution            = mob.Constitution;
            m_dexterity               = mob.Dexterity;
            m_empathy                 = mob.Empathy;
            m_equipmentTemplateID     = mob.EquipmentTemplateID;
            m_evadeChance             = mob.EvadeChance;
            m_flags                   = (ushort)mob.Flags;
            m_guildName               = mob.GuildName;
            m_examineArticle          = mob.ExamineArticle;
            m_messageArticle          = mob.MessageArticle;
            m_intelligence            = mob.Intelligence;
            m_maxdistance             = mob.MaxDistance;
            m_maxSpeed                = (short)mob.MaxSpeedBase;
            m_meleeDamageType         = (eDamageType)mob.MeleeDamageType;
            m_model                   = mob.Model.ToString();
            m_leftHandSwingChance     = mob.LeftHandSwingChance;
            m_level                   = mob.Level.ToString();
            m_name                    = mob.Name;
            m_suffix                  = mob.Suffix;
            m_parryChance             = mob.ParryChance;
            m_piety                   = mob.Piety;
            m_quickness               = mob.Quickness;
            m_strength                = mob.Strength;
            m_size                    = mob.Size.ToString();
            m_templateId              = GetNextFreeTemplateId();
            m_tetherRange             = mob.TetherRange;
            m_visibleActiveWeaponSlot = mob.VisibleActiveWeaponSlots;

            if (mob.Abilities != null && mob.Abilities.Count > 0)
            {
                try
                {
                    if (m_abilities == null)
                    {
                        m_abilities = new ArrayList(mob.Abilities.Count);
                    }

                    foreach (Ability mobAbility in mob.Abilities.Values)
                    {
                        m_abilities.Add(mobAbility);
                    }
                }
                catch (Exception ex)
                {
                    log.Error("Trapped Error: ", ex);
                }
            }

            if (mob.Spells != null && mob.Spells.Count > 0)
            {
                try
                {
                    if (m_spells == null)
                    {
                        m_spells = new ArrayList(mob.Spells.Count);
                    }

                    foreach (Spell mobSpell in mob.Spells)
                    {
                        m_spells.Add(mobSpell);
                    }
                }
                catch (Exception ex)
                {
                    log.Error("Trapped Error: ", ex);
                }
            }

            if (mob.Styles != null && mob.Styles.Count > 0)
            {
                try
                {
                    if (m_styles == null)
                    {
                        m_styles = new ArrayList(mob.Styles.Count);
                    }

                    foreach (Style mobStyle in mob.Styles)
                    {
                        m_styles.Add(mobStyle);
                    }
                }
                catch (Exception ex)
                {
                    log.Error("Trapped Error: ", ex);
                }
            }

            AI.Brain.StandardMobBrain brain = mob.Brain as AI.Brain.StandardMobBrain;
            if (brain != null)
            {
                m_aggroLevel = (byte)brain.AggroLevel;
                m_aggroRange = brain.AggroRange;
            }

            if (string.IsNullOrEmpty(ItemsListTemplateID) == false)
            {
                GameMerchant merchant = mob as GameMerchant;

                if (merchant != null)
                {
                    merchant.TradeItems = new MerchantTradeItems(ItemsListTemplateID);
                }
            }
        }
Beispiel #34
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
            {
                return;
            }
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            }


            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.WhenGoodBrowniesGoBad.ScriptLoaded.Text1"), eRealm.Albion);

            if (npcs.Length == 0)
            {
                MasterKless       = new GameNPC();
                MasterKless.Model = 64;
                MasterKless.Name  = LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "Alb.WhenGoodBrowniesGoBad.ScriptLoaded.Text1");
                if (log.IsWarnEnabled)
                {
                    log.Warn("Could not find " + MasterKless.Name + ", creating him ...");
                }
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //MasterKless.GuildName = "Part of " + questTitle + " Quest";
                MasterKless.Realm           = eRealm.Albion;
                MasterKless.CurrentRegionID = 1;

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

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

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

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

            #endregion

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

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

            MasterKless.AddQuestToGive(typeof(WhenGoodBrowniesGoBad));

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

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Apprentice Dunan", eRealm.Albion);
            if (npcs.Length == 0)
            {
                dunan = new GameNPC();
                dunan.Model = 49;
                dunan.Name = "Apprentice Dunan";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + dunan.Name + ", creating ...");
                dunan.GuildName = "Part of " + questTitle + " Quest";
                dunan.Realm = eRealm.Albion;
                dunan.CurrentRegionID = 1;
                dunan.Size = 49;
                dunan.Level = 21;
                dunan.X = 531663;
                dunan.Y = 479785;
                dunan.Z = 2200;
                dunan.Heading = 1579;
                dunan.EquipmentTemplateID = "1707754";
                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    dunan.SaveIntoDatabase();
                dunan.AddToWorld();
            }
            else
                dunan = npcs[0];

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

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

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

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

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

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

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

            #endregion

            #region defineItems

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

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

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

                sackOfSupplies.Object_Type = (int) eObjectType.GenericItem;

                sackOfSupplies.Id_nb = "sack_of_supplies";
                sackOfSupplies.IsPickable = true;
                sackOfSupplies.IsDropable = false;

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

                    GameServer.Database.AddObject(sackOfSupplies);
            }

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

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

                crateOfVegetables.Object_Type = (int) eObjectType.GenericItem;

                crateOfVegetables.Id_nb = "crate_of_vegetables";
                crateOfVegetables.IsPickable = true;
                crateOfVegetables.IsDropable = false;

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

                    GameServer.Database.AddObject(crateOfVegetables);
            }

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

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

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

                recruitsCloak.Bonus = 1; // default bonus

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

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

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

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

                    GameServer.Database.AddObject(recruitsCloak);
            }

            #endregion

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

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

            //We want to be notified whenever a player enters the world
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterFrederick));
            GameEventMgr.AddHandler(masterFrederick, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterFrederick));

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

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

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

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

            #region defineNPCs
            GameNPC[] npcs;

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

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

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

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


            #endregion

            #region defineItems

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

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

                GameServer.Database.AddObject(blackmaulercubpelt);
            }


            #endregion

            #region defineAreas

            #endregion

            #region defineQuestParts

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

            #endregion

            // Custom Scriptloaded Code Begin

            // Custom Scriptloaded Code End

            VikingKreimhilde.AddQuestToGive(typeof(Abearybadproblem));
            if (log.IsInfoEnabled)
            {
                log.Info("Quest \"" + questTitle + "\" initialized");
            }
        }
Beispiel #37
0
        public static GameNPC GetMasterFrederick()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("Master Frederick", eRealm.Albion);

            GameNPC masterFrederick = null;

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

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

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

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

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

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

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

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

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Laridia the Minstrel", eRealm.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137, 9);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138, 9);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134, 9);
                template.AddNPCEquipment(eInventorySlot.Cloak, 96, 72);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 140, 43);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 141, 43);
                laridiaTheMinstrel.Inventory = template.CloseTemplate();
                laridiaTheMinstrel.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                laridiaTheMinstrel.Size = 49;
                laridiaTheMinstrel.Level = 25;
                laridiaTheMinstrel.X = 562280;
                laridiaTheMinstrel.Y = 512243;
                laridiaTheMinstrel.Z = 2448 ;
                laridiaTheMinstrel.Heading = 3049;

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

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

            npcs = WorldMgr.GetNPCsByName("Farmer Asma", eRealm.Albion);
            if (npcs.Length == 0)
            {
                farmerAsma = new GameNPC();
                farmerAsma.Model = 82;
                farmerAsma.Name = "Farmer Asma";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + farmerAsma.Name + ", creating him ...");
                farmerAsma.GuildName = "Part of " + questTitle + " Quest";
                farmerAsma.Realm = eRealm.Albion;
                farmerAsma.CurrentRegionID = 1;

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

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

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

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

            #endregion

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

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

            GameEventMgr.AddHandler(laridiaTheMinstrel, GameLivingEvent.Interact, new DOLEventHandler(TalkToLaridiaTheMinstrel));
            GameEventMgr.AddHandler(laridiaTheMinstrel, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLaridiaTheMinstrel));

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

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
 public TakeItemAction(GameNPC defaultNPC, object p, object q)
     : base(defaultNPC, eActionType.TakeItem, p, q)
 {
 }
 /// <summary>
 /// Creates a new QuestRequirement and does some basich compativilite checks for the parameters
 /// </summary>
 /// <param name="defaultNPC">Parent defaultNPC of this Requirement</param>
 /// <param name="n">First Requirement Variable, meaning depends on RequirementType</param>
 /// <param name="comp">Comparator used if some values are veeing compared</param>
 public HealthMaxRequirement(GameNPC defaultNPC, int n, eComparator comp)
     : this(defaultNPC, (object)n, (object)null, comp)
 {
 }
        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)
            {
                questGiver = new GameNPC();
                questGiver.Model = 386;
                questGiver.Name = questGiverName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questGiver.Name + ", creating her ...");
                questGiver.Realm = eRealm.Hibernia;
                questGiver.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 813, 0);		//Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 814, 0);			//Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 810, 0);		//Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0);				//Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 811, 0);			//Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 812, 0);			//Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Size = 50;
                questGiver.Level = 70;
                questGiver.X = 357695;
                questGiver.Y = 363457;
                questGiver.Z = 5340;
                questGiver.Heading = 3117;

                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.Model = 350;
                questTarget.Name = questTargetName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questTarget.Name + ", creating him ...");
                questTarget.Realm = eRealm.Hibernia;
                questTarget.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 391, 0);		//Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 392, 0);			//Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 667, 0);		//Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0);				//Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 389, 0);			//Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 390, 0);			//Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Size = 50;
                questTarget.Level = 65;
                questTarget.X = 356932;
                questTarget.Y = 363575;
                questTarget.Z = 5248;
                questTarget.Heading = 2912;

                if (SAVE_INTO_DATABASE)
                    questTarget.SaveIntoDatabase();

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

            #endregion defineNPCS

            #region defineAreas

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

            #endregion defineAreas

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

            questGiver.AddQuestToGive(typeof(MovementAndInteraction));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
 public TakeItemAction(GameNPC defaultNPC, ItemTemplate itemTemplate, int quantity)
     : this(defaultNPC, (object)itemTemplate, (object)quantity)
 {
 }
Beispiel #43
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Lady Grynoch", eRealm.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);    //Slot 25
                LadyGrynoch.Inventory = template.CloseTemplate();
                LadyGrynoch.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                LadyGrynoch.Size = 51;
                LadyGrynoch.Level = 38;
                LadyGrynoch.X = 559698;
                LadyGrynoch.Y = 513578;
                LadyGrynoch.Z = 2428;
                LadyGrynoch.Heading = 2742;

                if (SAVE_INTO_DATABASE)
                    LadyGrynoch.SaveIntoDatabase();

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

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

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

            GameEventMgr.AddHandler(LadyGrynoch, GameLivingEvent.Interact, new DOLEventHandler(TalkToLadyGrynoch));
            GameEventMgr.AddHandler(LadyGrynoch, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToLadyGrynoch));

            LadyGrynoch.AddQuestToGive(typeof(ToReachTheBreach));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #44
0
 public AttackAction(GameNPC defaultNPC, object p, object q)
     : base(defaultNPC, eActionType.Attack, p, q)
 {
 }
Beispiel #45
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region NPC Declarations

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Brigit", eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Brigit , creating it ...");
                Brigit = new GameNPC();
                Brigit.Model = 384;
                Brigit.Name = "Brigit";
                Brigit.GuildName = "";
                Brigit.Realm = eRealm.Hibernia;
                Brigit.CurrentRegionID = 201;
                Brigit.Size = 51;
                Brigit.Level = 50;
                Brigit.X = 33131;
                Brigit.Y = 32922;
                Brigit.Z = 8008;
                Brigit.Heading = 3254;
                Brigit.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Brigit.SaveIntoDatabase();
                }

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

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

            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Caithor , creating it ...");
                Caithor = new GameNPC();
                Caithor.Model = 339;
                Caithor.Name = "Caithor";
                Caithor.GuildName = "";
                Caithor.Realm = eRealm.None;
                Caithor.CurrentRegionID = 200;
                Caithor.Size = 60;
                Caithor.Level = 65;
                Caithor.X = 470547;
                Caithor.Y = 531497;
                Caithor.Z = 4984;
                Caithor.Heading = 3319;
                Caithor.AddToWorld();
                if (SAVE_INTO_DATABASE)
                {
                    Caithor.SaveIntoDatabase();
                }

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

            #endregion

            #region Item Declarations

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

            }
            // end item
            BardEpicBoots = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicBoots");
            if (BardEpicBoots == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Boots , creating it ...");
                BardEpicBoots = new ItemTemplate();
                BardEpicBoots.Id_nb = "BardEpicBoots";
                BardEpicBoots.Name = "Moonsung Boots";
                BardEpicBoots.Level = 50;
                BardEpicBoots.Item_Type = 23;
                BardEpicBoots.Model = 738;
                BardEpicBoots.IsDropable = true;
                BardEpicBoots.IsPickable = true;
                BardEpicBoots.DPS_AF = 100;
                BardEpicBoots.SPD_ABS = 19;
                BardEpicBoots.Object_Type = 37;
                BardEpicBoots.Quality = 100;
                BardEpicBoots.Weight = 22;
                BardEpicBoots.Bonus = 35;
                BardEpicBoots.MaxCondition = 50000;
                BardEpicBoots.MaxDurability = 50000;
                BardEpicBoots.Condition = 50000;
                BardEpicBoots.Durability = 50000;

                BardEpicBoots.Bonus1 = 15;
                BardEpicBoots.Bonus1Type = (int) eStat.QUI;

                BardEpicBoots.Bonus2 = 10;
                BardEpicBoots.Bonus2Type = (int) eResist.Matter;

                BardEpicBoots.Bonus3 = 4;
                BardEpicBoots.Bonus3Type = (int) eProperty.PowerRegenerationRate;

                BardEpicBoots.Bonus4 = 33;
                BardEpicBoots.Bonus4Type = (int) eProperty.MaxHealth;

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

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

                BardEpicHelm.Bonus1 = 18;
                BardEpicHelm.Bonus1Type = (int) eStat.CHR;

                BardEpicHelm.Bonus2 = 4;
                BardEpicHelm.Bonus2Type = (int) eProperty.PowerRegenerationRate;

                BardEpicHelm.Bonus3 = 3;
                BardEpicHelm.Bonus3Type = (int) eProperty.Skill_Regrowth;

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

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

            }
            //end item
            //Moonsung Gloves
            BardEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicGloves");
            if (BardEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Gloves , creating it ...");
                BardEpicGloves = new ItemTemplate();
                BardEpicGloves.Id_nb = "BardEpicGloves";
                BardEpicGloves.Name = "Moonsung Gloves ";
                BardEpicGloves.Level = 50;
                BardEpicGloves.Item_Type = 22;
                BardEpicGloves.Model = 737;
                BardEpicGloves.IsDropable = true;
                BardEpicGloves.IsPickable = true;
                BardEpicGloves.DPS_AF = 100;
                BardEpicGloves.SPD_ABS = 19;
                BardEpicGloves.Object_Type = 37;
                BardEpicGloves.Quality = 100;
                BardEpicGloves.Weight = 22;
                BardEpicGloves.Bonus = 35;
                BardEpicGloves.MaxCondition = 50000;
                BardEpicGloves.MaxDurability = 50000;
                BardEpicGloves.Condition = 50000;
                BardEpicGloves.Durability = 50000;

                BardEpicGloves.Bonus1 = 3;
                BardEpicGloves.Bonus1Type = (int) eProperty.Skill_Nurture;

                BardEpicGloves.Bonus2 = 3;
                BardEpicGloves.Bonus2Type = (int) eProperty.Skill_Music;

                BardEpicGloves.Bonus3 = 12;
                BardEpicGloves.Bonus3Type = (int) eStat.DEX;

                BardEpicGloves.Bonus4 = 33;
                BardEpicGloves.Bonus4Type = (int) eProperty.MaxHealth;

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

            }
            //Moonsung Hauberk
            BardEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicVest");
            if (BardEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bards Epic Vest , creating it ...");
                BardEpicVest = new ItemTemplate();
                BardEpicVest.Id_nb = "BardEpicVest";
                BardEpicVest.Name = "Moonsung Hauberk";
                BardEpicVest.Level = 50;
                BardEpicVest.Item_Type = 25;
                BardEpicVest.Model = 734;
                BardEpicVest.IsDropable = true;
                BardEpicVest.IsPickable = true;
                BardEpicVest.DPS_AF = 100;
                BardEpicVest.SPD_ABS = 19;
                BardEpicVest.Object_Type = 37;
                BardEpicVest.Quality = 100;
                BardEpicVest.Weight = 22;
                BardEpicVest.Bonus = 35;
                BardEpicVest.MaxCondition = 50000;
                BardEpicVest.MaxDurability = 50000;
                BardEpicVest.Condition = 50000;
                BardEpicVest.Durability = 50000;

                BardEpicVest.Bonus1 = 3;
                BardEpicVest.Bonus1Type = (int) eProperty.Skill_Regrowth;

                BardEpicVest.Bonus2 = 3;
                BardEpicVest.Bonus2Type = (int) eProperty.Skill_Nurture;

                BardEpicVest.Bonus3 = 13;
                BardEpicVest.Bonus3Type = (int) eStat.CON;

                BardEpicVest.Bonus4 = 15;
                BardEpicVest.Bonus4Type = (int) eStat.CHR;

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

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

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

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

                BardEpicLegs.Bonus3 = 10;
                BardEpicLegs.Bonus3Type = (int) eResist.Body;

                BardEpicLegs.Bonus4 = 10;
                BardEpicLegs.Bonus4Type = (int) eResist.Matter;

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

            }
            //Moonsung Sleeves
            BardEpicArms = GameServer.Database.FindObjectByKey<ItemTemplate>("BardEpicArms");
            if (BardEpicArms == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Bard Epic Arms , creating it ...");
                BardEpicArms = new ItemTemplate();
                BardEpicArms.Id_nb = "BardEpicArms";
                BardEpicArms.Name = "Moonsung Sleeves";
                BardEpicArms.Level = 50;
                BardEpicArms.Item_Type = 28;
                BardEpicArms.Model = 736;
                BardEpicArms.IsDropable = true;
                BardEpicArms.IsPickable = true;
                BardEpicArms.DPS_AF = 100;
                BardEpicArms.SPD_ABS = 19;
                BardEpicArms.Object_Type = 37;
                BardEpicArms.Quality = 100;
                BardEpicArms.Weight = 22;
                BardEpicArms.Bonus = 35;
                BardEpicArms.MaxCondition = 50000;
                BardEpicArms.MaxDurability = 50000;
                BardEpicArms.Condition = 50000;
                BardEpicArms.Durability = 50000;

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

                BardEpicArms.Bonus2 = 12;
                BardEpicArms.Bonus2Type = (int) eStat.CHR;

                BardEpicArms.Bonus3 = 10;
                BardEpicArms.Bonus3Type = (int) eStat.CON;

                BardEpicArms.Bonus4 = 12;
                BardEpicArms.Bonus4Type = (int) eResist.Energy;

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

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

                ChampionEpicBoots.Bonus1 = 33;
                ChampionEpicBoots.Bonus1Type = (int) eProperty.MaxHealth;

                ChampionEpicBoots.Bonus2 = 10;
                ChampionEpicBoots.Bonus2Type = (int) eResist.Heat;

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

                ChampionEpicBoots.Bonus4 = 15;
                ChampionEpicBoots.Bonus4Type = (int) eStat.DEX;

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

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

                ChampionEpicHelm.Bonus1 = 3;
                ChampionEpicHelm.Bonus1Type = (int) eProperty.Skill_Valor;

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

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

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

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

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

                ChampionEpicGloves.Bonus1 = 3;
                ChampionEpicGloves.Bonus1Type = (int) eProperty.Skill_Parry;

                ChampionEpicGloves.Bonus2 = 15;
                ChampionEpicGloves.Bonus2Type = (int) eStat.STR;

                ChampionEpicGloves.Bonus3 = 15;
                ChampionEpicGloves.Bonus3Type = (int) eStat.QUI;

                ChampionEpicGloves.Bonus4 = 10;
                ChampionEpicGloves.Bonus4Type = (int) eResist.Crush;

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

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

                ChampionEpicVest.Bonus1 = 4;
                ChampionEpicVest.Bonus1Type = (int) eProperty.Skill_Valor;

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

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

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

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

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

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

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

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

                ChampionEpicLegs.Bonus4 = 18;
                ChampionEpicLegs.Bonus4Type = (int) eProperty.MaxHealth;

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

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

                ChampionEpicArms.Bonus1 = 3;
                ChampionEpicArms.Bonus1Type = (int) eProperty.Skill_Large_Weapon;

                ChampionEpicArms.Bonus2 = 10;
                ChampionEpicArms.Bonus2Type = (int) eStat.STR;

                ChampionEpicArms.Bonus3 = 10;
                ChampionEpicArms.Bonus3Type = (int) eStat.QUI;

                ChampionEpicArms.Bonus4 = 33;
                ChampionEpicArms.Bonus4Type = (int) eProperty.MaxHealth;

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

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

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

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

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

                NightshadeEpicBoots.Bonus4 = 24;
                NightshadeEpicBoots.Bonus4Type = (int) eProperty.MaxHealth;

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

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

                NightshadeEpicHelm.Bonus1 = 9;
                NightshadeEpicHelm.Bonus1Type = (int) eStat.STR;

                NightshadeEpicHelm.Bonus2 = 9;
                NightshadeEpicHelm.Bonus2Type = (int) eStat.DEX;

                NightshadeEpicHelm.Bonus3 = 9;
                NightshadeEpicHelm.Bonus3Type = (int) eStat.QUI;

                NightshadeEpicHelm.Bonus4 = 39;
                NightshadeEpicHelm.Bonus4Type = (int) eProperty.MaxHealth;

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

            }
            //end item
            //Moonlit Gloves
            NightshadeEpicGloves = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicGloves");
            if (NightshadeEpicGloves == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Gloves , creating it ...");
                NightshadeEpicGloves = new ItemTemplate();
                NightshadeEpicGloves.Id_nb = "NightshadeEpicGloves";
                NightshadeEpicGloves.Name = "Moonlit Gloves ";
                NightshadeEpicGloves.Level = 50;
                NightshadeEpicGloves.Item_Type = 22;
                NightshadeEpicGloves.Model = 749;
                NightshadeEpicGloves.IsDropable = true;
                NightshadeEpicGloves.IsPickable = true;
                NightshadeEpicGloves.DPS_AF = 100;
                NightshadeEpicGloves.SPD_ABS = 10;
                NightshadeEpicGloves.Object_Type = 33;
                NightshadeEpicGloves.Quality = 100;
                NightshadeEpicGloves.Weight = 22;
                NightshadeEpicGloves.Bonus = 35;
                NightshadeEpicGloves.MaxCondition = 50000;
                NightshadeEpicGloves.MaxDurability = 50000;
                NightshadeEpicGloves.Condition = 50000;
                NightshadeEpicGloves.Durability = 50000;

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

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

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

                NightshadeEpicGloves.Bonus4 = 5;
                NightshadeEpicGloves.Bonus4Type = (int) eProperty.Skill_Envenom;

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

            }
            //Moonlit Hauberk
            NightshadeEpicVest = GameServer.Database.FindObjectByKey<ItemTemplate>("NightshadeEpicVest");
            if (NightshadeEpicVest == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Nightshade Epic Vest , creating it ...");
                NightshadeEpicVest = new ItemTemplate();
                NightshadeEpicVest.Id_nb = "NightshadeEpicVest";
                NightshadeEpicVest.Name = "Moonlit Leather Jerking";
                NightshadeEpicVest.Level = 50;
                NightshadeEpicVest.Item_Type = 25;
                NightshadeEpicVest.Model = 746;
                NightshadeEpicVest.IsDropable = true;
                NightshadeEpicVest.IsPickable = true;
                NightshadeEpicVest.DPS_AF = 100;
                NightshadeEpicVest.SPD_ABS = 10;
                NightshadeEpicVest.Object_Type = 33;
                NightshadeEpicVest.Quality = 100;
                NightshadeEpicVest.Weight = 22;
                NightshadeEpicVest.Bonus = 35;
                NightshadeEpicVest.MaxCondition = 50000;
                NightshadeEpicVest.MaxDurability = 50000;
                NightshadeEpicVest.Condition = 50000;
                NightshadeEpicVest.Durability = 50000;

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

                NightshadeEpicVest.Bonus2 = 10;
                NightshadeEpicVest.Bonus2Type = (int) eStat.DEX;

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

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

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

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

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

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

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

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

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

                NightshadeEpicArms.Bonus1 = 4;
                NightshadeEpicArms.Bonus1Type = (int) eProperty.Skill_Celtic_Dual;

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

                NightshadeEpicArms.Bonus3 = 15;
                NightshadeEpicArms.Bonus3Type = (int) eStat.DEX;

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

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

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

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

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

                EnchanterEpicBoots.Bonus3 = 12;
                EnchanterEpicBoots.Bonus3Type = (int) eResist.Body;

                EnchanterEpicBoots.Bonus4 = 39;
                EnchanterEpicBoots.Bonus4Type = (int) eProperty.MaxHealth;

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

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

                EnchanterEpicHelm.Bonus1 = 21;
                EnchanterEpicHelm.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicHelm.Bonus2 = 8;
                EnchanterEpicHelm.Bonus2Type = (int) eResist.Energy;

                EnchanterEpicHelm.Bonus3 = 4;
                EnchanterEpicHelm.Bonus3Type = (int) eProperty.Skill_Enchantments;

                EnchanterEpicHelm.Bonus4 = 18;
                EnchanterEpicHelm.Bonus4Type = (int) eStat.INT;

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

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

                EnchanterEpicGloves.Bonus1 = 30;
                EnchanterEpicGloves.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicGloves.Bonus2 = 4;
                EnchanterEpicGloves.Bonus2Type = (int) eProperty.Skill_Mana;

                EnchanterEpicGloves.Bonus3 = 6;
                EnchanterEpicGloves.Bonus3Type = (int) eStat.INT;

                EnchanterEpicGloves.Bonus4 = 13;
                EnchanterEpicGloves.Bonus4Type = (int) eStat.DEX;

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

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

                EnchanterEpicVest.Bonus1 = 30;
                EnchanterEpicVest.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicVest.Bonus2 = 15;
                EnchanterEpicVest.Bonus2Type = (int) eStat.INT;

                EnchanterEpicVest.Bonus3 = 15;
                EnchanterEpicVest.Bonus3Type = (int) eStat.DEX;

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

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

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

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

                EnchanterEpicLegs.Bonus3 = 10;
                EnchanterEpicLegs.Bonus3Type = (int) eResist.Heat;

                EnchanterEpicLegs.Bonus4 = 10;
                EnchanterEpicLegs.Bonus4Type = (int) eResist.Cold;

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

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

                EnchanterEpicArms.Bonus1 = 27;
                EnchanterEpicArms.Bonus1Type = (int) eProperty.MaxHealth;

                EnchanterEpicArms.Bonus2 = 10;
                EnchanterEpicArms.Bonus2Type = (int) eStat.INT;

                EnchanterEpicArms.Bonus3 = 5;
                EnchanterEpicArms.Bonus3Type = (int) eProperty.Skill_Light;

                EnchanterEpicArms.Bonus4 = 10;
                EnchanterEpicArms.Bonus4Type = (int) eStat.DEX;

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

            }

            //Champion Epic Sleeves End
            //Item Descriptions End

            #endregion

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

            GameEventMgr.AddHandler(Brigit, GameObjectEvent.Interact, new DOLEventHandler(TalkToBrigit));
            GameEventMgr.AddHandler(Brigit, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBrigit));

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

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

            #region defineNPCs

            masterFrederick = GetMasterFrederick();

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

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

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

                if (SAVE_INTO_DATABASE)
                    queenTatiana.SaveIntoDatabase();

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

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

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

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

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

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

            #endregion

            #region defineItems

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

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

                queenTatianasHead.Object_Type = (int) eObjectType.GenericItem;

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

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

                    GameServer.Database.AddObject(queenTatianasHead);
            }

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

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

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

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

                recruitsGauntlets.Bonus = 5; // default bonus

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

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

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

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

                    GameServer.Database.AddObject(recruitsGauntlets);
            }

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

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

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

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

                recruitsGloves.Bonus = 5; // default bonus

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

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

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

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

                    GameServer.Database.AddObject(recruitsGloves);
            }

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

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

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

                recruitsJewel.Bonus = 5; // default bonus

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

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

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

                    GameServer.Database.AddObject(recruitsJewel);
            }

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

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

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

                recruitsJewelCloth.Bonus = 5; // default bonus

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

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

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

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

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

                    GameServer.Database.AddObject(recruitsJewelCloth);
            }

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

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

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

                recruitsBracer.Bonus = 5; // default bonus

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

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

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

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

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

                    GameServer.Database.AddObject(recruitsBracer);
            }

            #endregion

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

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

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

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

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

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #48
0
 public DropItemAction(GameNPC defaultNPC, Object p, Object q)
     : base(defaultNPC, eActionType.DropItem, p, q)
 {
 }
Beispiel #49
0
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;

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

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

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

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

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

                if (SAVE_INTO_DATABASE)
                    questGiver.SaveIntoDatabase();

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

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

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

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

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

                if (SAVE_INTO_DATABASE)
                    questTarget.SaveIntoDatabase();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            questGiver.AddQuestToGive(typeof(BonesToBlades));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
Beispiel #50
0
 public DropItemAction(GameNPC defaultNPC, ItemTemplate itemTemplate)
     : this(defaultNPC, (object)itemTemplate, (object)null)
 {
 }
 /// <summary>
 /// Creates a QuestPart for the given questtype with the default npc.
 /// </summary>
 /// <param name="questType">type of Quest this QuestPart will belong to.</param>
 /// <param name="npc">NPC associated with his questpart typically NPC talking to or mob killing, etc...</param>
 public QuestBehaviour(Type questType, GameNPC npc)
     : this(questType, npc, -1) { }
 public TakeGoldAction(GameNPC defaultNPC, Object p, Object q)
     : base(defaultNPC, eActionType.TakeGold, p, q)
 {
 }
		public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
		{
			if (!ServerProperties.Properties.LOAD_QUESTS)
				return;

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

			/* First thing we do in here is to search for the NPCs inside
			* the world who comes from the certain Realm. If we find the npc
			* this means we don't have to create a new one.
			* 
			* NOTE: You can do anything you want in this method, you don't have
			* to search for NPC's ... you could create a custom item, place it
			* on the ground and if a player picks it up, he will get the quest!
			* Just examples, do anything you like and feel comfortable with :)
			*/

			#region defineNPCS

			GameNPC[] npcs = WorldMgr.GetNPCsByName("Baeth", eRealm.Hibernia);

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

				npcBaeth.Size = 52;
				npcBaeth.Level = 30;
				npcBaeth.X = 356650;
				npcBaeth.Y = 355078;
				npcBaeth.Z = 5015;
				npcBaeth.Heading = 2959;

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

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

			npcs = WorldMgr.GetNPCsByName("Jessica", eRealm.Hibernia);

			if (npcs.Length == 0)
			{
				npcJessica = new GameNPC();
				npcJessica.Model = 366;
				npcJessica.Name = "Jessica";
				if (log.IsWarnEnabled)
				{
					log.Warn("Could not find " + npcJessica.Name + ", creating him ...");
				}
				npcJessica.GuildName = "Part of " + questTitle + " Quest";
				npcJessica.Realm = eRealm.Hibernia;
				npcJessica.CurrentRegionID = 27;

				npcJessica.Size = 38;
				npcJessica.Level = 1;
				npcJessica.X = 358068;
				npcJessica.Y = 347553;
				npcJessica.Z = 5491;
				npcJessica.Heading = 49;

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

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


			#endregion

			#region defineItems

			// item db check
			reedFlute = GameServer.Database.FindObjectByKey<ItemTemplate>("quest_reed_flute");
			if (reedFlute == null)
			{
				reedFlute = new ItemTemplate();
				reedFlute.Name = "Reed Flute";
				if (log.IsWarnEnabled)
				{
					log.Warn("Could not find " + reedFlute.Name + ", creating it ...");
				}
				
				reedFlute.Level = 1;
				reedFlute.Weight = 1;
				reedFlute.Model = 325;
				
				reedFlute.Object_Type = (int)eObjectType.Magical;
				reedFlute.Item_Type = (int)eInventorySlot.FirstBackpack;
				reedFlute.Id_nb = "quest_reed_flute";
				reedFlute.Price = 0;
				reedFlute.IsPickable = false;
				reedFlute.IsDropable = false;
				reedFlute.IsTradable = false;
				
				reedFlute.Quality = 100;
				reedFlute.Condition = 5000;
				reedFlute.MaxCondition = 5000;
				reedFlute.Durability = 5000;
				reedFlute.MaxDurability = 5000;

				reedFlute.SpellID = 65001;
				reedFlute.CanUseEvery = 300;

				GameServer.Database.AddObject(reedFlute);
			}

			// Add spell and npctemplate to the DB
			/*

			insert into spell (`Spell_ID`, `SpellID`, `ClientEffect`, `Icon`, `Name`, `Description`, `Target`, `Range`, `Power`, `CastTime`,
			`Damage`, `DamageType`, `Type`, `Duration`, `Frequency`, `Pulse`, `PulsePower`, `Radius`, `Value`, `LifeDrainReturn`, `Message1`, `PackageID`)
			values ('summon_dragonfly', 65001, 0, 0, 'Call Dragonfly', 'Summons a dragonfly to travel at your side, but cannot be used in the battlegrounds or the frontier regions.',
			'Self', 0, 0, 0, 1, 0, 'SummonNoveltyPet', 65535, 0, 0, 0, 0, 1, 65001, 'A small dragonfly appears as the sound of the whistle fades.', 'NoveltyPets');

			insert into npctemplate (`NpcTemplate_ID`, `TemplateId`, `Name`, `GuildName`, `Model`, `Size`, `MaxSpeed`, `Flags`, `Level`, `ClassType`, `PackageID`)
			values ('quest_pet_dragonfly', 65001, 'Dragonfly', '', 819, 12, 250, 48, 1, '', 'NoveltyPets');

			*/


			#endregion


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

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

			GameEventMgr.AddHandler(npcBaeth, GameLivingEvent.Interact, new DOLEventHandler(TalkToBaeth));
			GameEventMgr.AddHandler(npcBaeth, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBaeth));
			GameEventMgr.AddHandler(npcJessica, GameLivingEvent.Interact, new DOLEventHandler(TalkToJessica));
			GameEventMgr.AddHandler(npcJessica, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToJessica));

			npcBaeth.AddQuestToGive(typeof(WingsOfTheIsleHibernia));

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

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Godeleva Dowden", eRealm.Albion);

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                godelevaDowden.Inventory = template.CloseTemplate();
                godelevaDowden.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                godelevaDowden.Size = 48;
                godelevaDowden.Level = 40;
                godelevaDowden.X = 559528;
                godelevaDowden.Y = 510953;
                godelevaDowden.Z = 2488;
                godelevaDowden.Heading = 1217;

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

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

            #endregion

            #region defineItems

            // item db check
            woodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("wooden_bucket");
            if (woodenBucket == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wooden Bucket, creating it ...");
                woodenBucket = new ItemTemplate();
                woodenBucket.Name = "Wooden Bucket";
                woodenBucket.Level = 1;
                woodenBucket.Weight = 10;
                woodenBucket.Model = 1610;

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

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

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

                    GameServer.Database.AddObject(woodenBucket);
            }

            // item db check
            fullWoodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("full_wooden_bucket");
            if (fullWoodenBucket == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Full Wooden Bucket, creating it ...");
                fullWoodenBucket = new ItemTemplate();
                fullWoodenBucket.Name = "Full Wooden Bucket";
                fullWoodenBucket.Level = 1;
                fullWoodenBucket.Weight = 250;
                fullWoodenBucket.Model = 1610;

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

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

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

                    GameServer.Database.AddObject(fullWoodenBucket);
            }

            // item db check
            reedBracer = GameServer.Database.FindObjectByKey<ItemTemplate>("reed_bracer");
            if (reedBracer == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Reed Bracer of Health creating it ...");
                reedBracer = new ItemTemplate();
                reedBracer.Name = "Reed Bracer";
                reedBracer.Level = 3;
                reedBracer.Weight = 1;
                reedBracer.Model = 598;

                reedBracer.Object_Type = (int)eObjectType.Magical;
                reedBracer.Item_Type = (int)eEquipmentItems.L_BRACER;
                reedBracer.Id_nb = "reed_bracer";

                reedBracer.Price = Money.GetMoney(0,0,0,0,30);
                reedBracer.IsPickable = true;
                reedBracer.IsDropable = true;

                reedBracer.Bonus = 1;
                reedBracer.Bonus1Type = (int)eProperty.MaxHealth;
                reedBracer.Bonus1 = 8;
                reedBracer.Bonus2Type = (int)eProperty.Resist_Cold;
                reedBracer.Bonus2 = 1;

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

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

                    GameServer.Database.AddObject(reedBracer);
            }

            #endregion

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

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

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

            GameEventMgr.AddHandler(godelevaDowden, GameLivingEvent.Interact, new DOLEventHandler(TalkToGodelevaDowden));
            GameEventMgr.AddHandler(godelevaDowden, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToGodelevaDowden));

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
 /// <summary>
 /// Constructs a new HorseStartAction
 /// </summary>
 /// <param name="actionSource"></param>
 public HorseRideAction(GameNPC actionSource)
     : base(actionSource)
 {
 }
        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("Blercyn", eRealm.Hibernia);

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

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

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

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

                if (SAVE_INTO_DATABASE)
                    Blercyn.SaveIntoDatabase();

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

            //Pompin The Crier
            npcs = WorldMgr.GetNPCsByName("Epona", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                Epona = new GameNPC();
                Epona.Model = 10;
                Epona.Name = "Epona";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Epona.Name + ", creating him ...");
                //Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Epona.Realm = eRealm.Hibernia;
                Epona.CurrentRegionID = 200;

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

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

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

                if (SAVE_INTO_DATABASE)
                    Epona.SaveIntoDatabase();

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

            #endregion defineNPCS

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

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

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

            Blercyn.AddQuestToGive(typeof(SearchForKnowledge));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
            /// <summary>
            /// Called on every timer tick
            /// </summary>
            protected override void OnTick()
            {
                GameNPC horse = (GameNPC)m_actionSource;

                horse.MoveOnPath(horse.MaxSpeed);
            }
Beispiel #59
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

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

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

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

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

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

                                mulgrutMaggot.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Mulgrut Maggot")
                    {
                        GiveItem(gArgs.Target, player, beltOfAnimation);
                        if(mulgrutMaggot != null) { mulgrutMaggot = null; }
                        FinishQuest();
                    }
                }
            }
        }
Beispiel #60
0
 public override void SendQuestOfferWindow(GameNPC questNPC, GamePlayer player, RewardQuest quest)
 {
     SendQuestWindow(questNPC, player, quest, true);
 }