当前位置: 首页>>代码示例>>C#>>正文


C# GameNPC.GetPlayersInRadius方法代码示例

本文整理汇总了C#中DOL.GS.GameNPC.GetPlayersInRadius方法的典型用法代码示例。如果您正苦于以下问题:C# GameNPC.GetPlayersInRadius方法的具体用法?C# GameNPC.GetPlayersInRadius怎么用?C# GameNPC.GetPlayersInRadius使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DOL.GS.GameNPC的用法示例。


在下文中一共展示了GameNPC.GetPlayersInRadius方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SpawnEncounter


//.........这里部分代码省略.........
			sunkaio.GuildName = "";
			sunkaio.X = 431865;
			sunkaio.Y = 544121;
			sunkaio.Z = 8311;
			sunkaio.RoamingRange = 0;
			sunkaio.RespawnInterval = 0;
			sunkaio.BodyType = 0;

			SunBrain brain = new SunBrain();
			brain.AggroLevel = 100;
			brain.AggroRange = 350;
			sunkaio.SetOwnBrain(brain);

			sunkaio.AddToWorld();
			BossList.Add(sunkaio);
			Sun = sunkaio;
			GameEventMgr.AddHandler(sunkaio, GameNPCEvent.Dying, new DOLEventHandler(Ianetor.SunHasDied));

			//Next we spawn Zopureo

			GameZopureo zopureo = new GameZopureo();
			zopureo.Model = 1349;
			zopureo.Size = 100;
			zopureo.Level = 70;
			zopureo.Name = "Zopureo";
			zopureo.CurrentRegionID = (ushort)Ianetor.playerregion;
			zopureo.Heading = 1690;
			zopureo.Realm = 0;
			zopureo.CurrentSpeed = 0;
			zopureo.MaxSpeedBase = 0;
			zopureo.GuildName = "";
			zopureo.X = 432767;
			zopureo.Y = 543483;
			zopureo.Z = 8291;
			zopureo.RoamingRange = 0;
			zopureo.RespawnInterval = 0;
			zopureo.BodyType = 0;

			ZopureoBrain zbrain = new ZopureoBrain();
			zbrain.AggroLevel = 100;
			zbrain.AggroRange = 0;
			zopureo.SetOwnBrain(zbrain);

			zopureo.AddToWorld();
			BossList.Add(zopureo);
			Zop = zopureo;
			GameEventMgr.AddHandler(zopureo, GameNPCEvent.Dying, new DOLEventHandler(Ianetor.ZopHasDied));

			//Next we spawn Aithos

			GameAithos aithos = new GameAithos();
			aithos.Model = 1349;
			aithos.Size = 100;
			aithos.Level = 68; //level 65 on live
			aithos.Name = "Aithos";
			aithos.CurrentRegionID = (ushort)Ianetor.playerregion;
			aithos.Heading = 1690;
			aithos.Realm = 0;
			aithos.CurrentSpeed = 0;
			aithos.MaxSpeedBase = 191;
			aithos.GuildName = "";
			aithos.X = 432377;
			aithos.Y = 543728;
			aithos.Z = 8334;
			aithos.RoamingRange = 0;
			aithos.RespawnInterval = 0;
			aithos.BodyType = 0;

			AithosBrain abrain = new AithosBrain();
			abrain.AggroLevel = 100;
			abrain.AggroRange = 350;
			aithos.SetOwnBrain(abrain);

			aithos.AddToWorld();
			BossList.Add(aithos);
			Aith = aithos;
			GameEventMgr.AddHandler(aithos, GameNPCEvent.Dying, new DOLEventHandler(Ianetor.AithosHasDied));
			//Make sure there are not too many players on the island when the encounter starts, if there is too many players
			//sick the stairgards on them.
			List<GamePlayer> islandplayers = new List<GamePlayer>();
			foreach (GamePlayer foundplayer in (Aith.GetPlayersInRadius((ushort) 2300)))
			{
				islandplayers.Add(foundplayer);
			}
			if (islandplayers.Count > 8)
			{
				EncounterMgr.BroadcastMsg(Aith, "You can not have more then one full group of players on the island, you must all die for your mistake!", 2300, true);
				EncounterMgr.BroadcastMsg(Aith, "Guards!!!!!!!!!!!", 2300, true);
				foreach (GameNPC stairgard in StairGuardList)
				{
					IOldAggressiveBrain aggroBrain = stairgard.Brain as IOldAggressiveBrain;
					foreach (GamePlayer foundplayer in islandplayers)
					{
						if (aggroBrain != null && (GameServer.ServerRules.IsAllowedToAttack(stairgard, foundplayer, true)))
							aggroBrain.AddToAggroList(foundplayer, Util.Random(50, 100));
					}
				}
			}
			return;
		}
开发者ID:boscorillium,项目名称:dol,代码行数:101,代码来源:ML1FireIsland.cs


注:本文中的DOL.GS.GameNPC.GetPlayersInRadius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。