• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Brain.StandardMobBrain类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DOL.AI.Brain.StandardMobBrain的典型用法代码示例。如果您正苦于以下问题:C# StandardMobBrain类的具体用法?C# StandardMobBrain怎么用?C# StandardMobBrain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StandardMobBrain类属于DOL.AI.Brain命名空间,在下文中一共展示了StandardMobBrain类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ScriptLoaded

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

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Quait", eRealm.Albion);
            npcs = WorldMgr.GetNPCsByName("Sir Quait", (eRealm)1);
            GameNPC SirQuait = null;
            if (npcs.Length == 0)
            {
                SirQuait = new DOL.GS.GameNPC();
                SirQuait.Model = 40;
                SirQuait.Name = "Sir Quait";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + SirQuait.Name + ", creating ...");
                SirQuait.Realm = eRealm.Albion;
                SirQuait.CurrentRegionID = 1;
                SirQuait.Size = 50;
                SirQuait.Level = 10;
                SirQuait.MaxSpeedBase = 100;
                SirQuait.Faction = FactionMgr.GetFactionByID(0);
                SirQuait.X = 531971;
                SirQuait.Y = 478955;
                SirQuait.Z = 0;
                SirQuait.Heading = 3570;
                SirQuait.RespawnInterval = 0;
                SirQuait.BodyType = 0;

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

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

            #endregion defineNPCs

            #region defineBehaviours

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

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

            #endregion defineBehaviours

            log.Info("Simple Test Behaviour added");
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:59,代码来源:TestBehaviour.cs


示例2: ScriptLoaded

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

            #region defineNPCs

            GameNPC[] npcs;

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

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

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

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

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

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

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

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

            #endregion defineNPCs

            #region defineItems
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:Trial_of_Strength.cs


示例3: CreateDunwynClone

        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);
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:Culmination.cs


示例4: GetMasterFrederick

        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;
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:57,代码来源:BaseFrederickQuest.cs


示例5: LoadTemplate


//.........这里部分代码省略.........
				{

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

					string equipid = "";

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

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

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

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

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

			m_ownBrain = new StandardMobBrain
			{
				Body = this,
				AggroLevel = template.AggroLevel,
				AggroRange = template.AggroRange
			};
			this.NPCTemplate = template as NpcTemplate;
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:101,代码来源:GameNPC.cs


示例6: CreateMorgana

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

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

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

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

            Morgana.AddToWorld();
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:35,代码来源:Academy50.cs


示例7: ScriptLoaded


//.........这里部分代码省略.........
                    log.Warn("Could not find " + squireGalune.Name + ", creating him ...");
                squireGalune.GuildName = "Part of " + questTitle + " Quest";
                squireGalune.Realm = eRealm.Albion;
                squireGalune.CurrentRegionID = 21;

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

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

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

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

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

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

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

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

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

                if (SAVE_INTO_DATABASE)
                    smallSpider.SaveIntoDatabase();

                smallSpider.AddToWorld();
            }

            #endregion

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

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

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

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

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

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:ShakenSquire.cs


示例8: Notify

        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

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

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

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

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

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

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

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

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

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

                        new RegionTimer(eowylnAstos, new RegionTimerCallback(BuildNecklace), 5000);
                    }
                }
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:85,代码来源:HeartOfSephucoth.cs


示例9: Notify

        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

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

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

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

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

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

                                slith.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Slith")
                    {
                        GiveItem(gArgs.Target, player, slithsTail);
                        if (slith != null) { slith = null; }
                        FinishQuest();
                    }
                }
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:49,代码来源:HuntForSlith.cs


示例10: SpawnAGuard

		public void SpawnAGuard(int guardX, int guardY, int guardZ, ushort heading)
		{
			GameStairGuard guard = new GameStairGuard();
			guard.Model = 1349;
			guard.Size = 37;
			guard.Level = 80; //level 70 on live
			guard.Name = "daleros ephoros";
			guard.CurrentRegionID = (ushort)Ianetor.playerregion;
			guard.Heading = heading;
			guard.Realm = 0;
			guard.CurrentSpeed = 0;
			guard.MaxSpeedBase = 300;
			guard.GuildName = "";
			guard.X = guardX;
			guard.Y = guardY;
			guard.Z = guardZ;
			guard.RoamingRange = 0;
			guard.RespawnInterval = 0;
			guard.BodyType = 0;
			guard.Strength = 600;

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

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

			return;
		}
开发者ID:boscorillium,项目名称:dol,代码行数:31,代码来源:ML1FireIsland.cs


示例11: initDragonflyHatchling

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

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

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

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

            GameEventMgr.AddHandler(dragonflyHatchling, GameLivingEvent.Interact, new DOLEventHandler(TalkToDragonflyHatchling));
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:29,代码来源:IreFairyIre.cs


示例12: ScriptLoaded

        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);
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:IreFairyIre.cs


示例13: initGrifflet

        protected void initGrifflet()
        {
            grifflet = new GameNPC();

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

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

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

            GameEventMgr.AddHandler(grifflet, GameLivingEvent.Interact, new DOLEventHandler(TalkToGrifflet));
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:29,代码来源:StolenEggs.cs


示例14: ScriptLoaded

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

            #region defineNPCs

            dalikor = GetDalikor();

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

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

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

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

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

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

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

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

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

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

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

            //			npcs = WorldMgr.GetNPCsByName("Askefruer Trainer", eRealm.None);
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:StolenEggs.cs


示例15: ScriptLoaded

        public stati 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Database.DBAbility类代码示例发布时间:2022-05-24
下一篇:
C# DataStreamUtilities.DataOutputStream类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap