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


C# GameNPC.ShowQuestIndicator方法代码示例

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


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

示例1: UpdateQuestIndicator

		/// <summary>
		/// Update the quest indicator
		/// </summary>
		/// <param name="npc"></param>
		/// <param name="player"></param>
		public virtual void UpdateQuestIndicator(GameNPC npc, GamePlayer player)
		{

            eQuestIndicator indicator = eQuestIndicator.None;
            if (npc.ShowQuestIndicator(player))
                indicator = eQuestIndicator.Available;

			player.Out.SendNPCsQuestEffect(npc, indicator);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:14,代码来源:DataQuest.cs

示例2: 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;
			}

			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;

			if( npc.ShowQuestIndicator( m_gameClient.Player ) )
				flags2 |= 0x08;

			pak.WriteByte(flags2); // 4 high bits seems unused (new in 1.71)
			pak.WriteShort(0x00); // new in 1.71
			pak.WriteByte(0x00); // new in 1.71 (region instance ID from StoC_0x20)

            DBLanguageNPC translation = npc.GetTranslation(m_gameClient);

            string name = translation.Name;/*GameServer.ServerRules.GetNPCName(m_gameClient.Player, npc);*/
			if (name.Length + add.Length + 2 > 47) // clients crash with too long names
				name = name.Substring(0, 47 - add.Length - 2);
			if (add.Length > 0)
				name = string.Format("[{0}]{1}", name, add);

			pak.WritePascalString(name);

            string l_npcGuildname = translation.GuildName;/*GameServer.ServerRules.GetNPCGuildName(m_gameClient.Player, npc);;*/
			if (l_npcGuildname.Length > 47)
				pak.WritePascalString(l_npcGuildname.Substring(0, 47));
			else pak.WritePascalString(l_npcGuildname);

			pak.WriteByte(0x00);
//.........这里部分代码省略.........
开发者ID:boscorillium,项目名称:dol,代码行数:101,代码来源:PacketLib171.cs


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