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


C# GameNPC.GetQuestIndicator方法代码示例

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


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

示例1: SendNPCCreate

		public override void SendNPCCreate(GameNPC npc)
		{

			if (m_gameClient.Player == null || npc.IsVisibleTo(m_gameClient.Player) == false)
				return;

			//Added by Suncheck - Mines are not shown to enemy players
			if (npc is GameMine)
			{
				if (GameServer.ServerRules.IsAllowedToAttack((npc as GameMine).Owner, m_gameClient.Player, true))
				{
					return;
				}
			}

			if (npc is GameMovingObject)
			{
				SendMovingObjectCreate(npc as GameMovingObject);
				return;
			}

			using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.NPCCreate)))
			{
				int speed = 0;
				ushort speedZ = 0;
				if (npc == null)
					return;
				if (!npc.IsAtTargetPosition)
				{
					speed = npc.CurrentSpeed;
					speedZ = (ushort)npc.TickSpeedZ;
				}
				pak.WriteShort((ushort)npc.ObjectID);
				pak.WriteShort((ushort)(speed));
				pak.WriteShort(npc.Heading);
				pak.WriteShort((ushort)npc.Z);
				pak.WriteInt((uint)npc.X);
				pak.WriteInt((uint)npc.Y);
				pak.WriteShort(speedZ);
				pak.WriteShort(npc.Model);
				pak.WriteByte(npc.Size);
				byte level = npc.GetDisplayLevel(m_gameClient.Player);
				if((npc.Flags&GameNPC.eFlags.STATUE)!=0)
				{
					level |= 0x80;
				}
				pak.WriteByte(level);
	
				byte flags = (byte)(GameServer.ServerRules.GetLivingRealm(m_gameClient.Player, npc) << 6);
				if ((npc.Flags & GameNPC.eFlags.GHOST) != 0) flags |= 0x01;
				if (npc.Inventory != null) flags |= 0x02; //If mob has equipment, then only show it after the client gets the 0xBD packet
				if ((npc.Flags & GameNPC.eFlags.PEACE) != 0) flags |= 0x10;
				if ((npc.Flags & GameNPC.eFlags.FLYING) != 0) flags |= 0x20;
				if((npc.Flags & GameNPC.eFlags.TORCH) != 0) flags |= 0x04;
				
				pak.WriteByte(flags);
				pak.WriteByte(0x20); //TODO this is the default maxstick distance
	
				string add = "";
				byte flags2 = 0x00;
				IControlledBrain brain = npc.Brain as IControlledBrain;
				if (m_gameClient.Version >= GameClient.eClientVersion.Version187)
				{
					if (brain != null)
					{
						flags2 |= 0x80; // have Owner
					}
				}
				if ((npc.Flags & GameNPC.eFlags.CANTTARGET) != 0)
					if (m_gameClient.Account.PrivLevel > 1) add += "-DOR"; // indicates DOR flag for GMs
				else flags2 |= 0x01;
				if ((npc.Flags & GameNPC.eFlags.DONTSHOWNAME) != 0)
					if (m_gameClient.Account.PrivLevel > 1) add += "-NON"; // indicates NON flag for GMs
				else flags2 |= 0x02;
	
				if( ( npc.Flags & GameNPC.eFlags.STEALTH ) > 0 )
					flags2 |= 0x04;
	
				eQuestIndicator questIndicator = npc.GetQuestIndicator(m_gameClient.Player);
	
				if (questIndicator == eQuestIndicator.Available)
					flags2 |= 0x08;//hex 8 - quest available
				if (questIndicator == eQuestIndicator.Finish)
					flags2 |= 0x10;//hex 16 - quest finish
				//flags2 |= 0x20;//hex 32 - water mob?
				//flags2 |= 0x40;//hex 64 - unknown
				//flags2 |= 0x80;//hex 128 - has owner
				
	
				pak.WriteByte(flags2); // flags 2
	
				byte flags3 = 0x00;
				if (questIndicator == eQuestIndicator.Lesson)
					flags3 |= 0x01;
				if (questIndicator == eQuestIndicator.Lore)
					flags3 |= 0x02;
				pak.WriteByte(flags3); // new in 1.71 (region instance ID from StoC_0x20) OR flags 3?
				pak.WriteShort(0x00); // new in 1.71 unknown
	
				string name = npc.Name;
//.........这里部分代码省略.........
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:101,代码来源:PacketLib171.cs

示例2: UpdateQuestIndicator

 /// <summary>
 /// Update the quest indicator
 /// </summary>
 /// <param name="npc"></param>
 /// <param name="player"></param>
 public virtual void UpdateQuestIndicator(GameNPC npc, GamePlayer player)
 {
     player.Out.SendNPCsQuestEffect(npc, npc.GetQuestIndicator(player));
 }
开发者ID:mynew4,项目名称:DAoC,代码行数:9,代码来源:DataQuest.cs


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