コード例 #1
0
ファイル: GossipHandler.cs プロジェクト: pallmall/WCell
		public static void HandleGossipHello(IRealmClient client, RealmPacketIn packet)
		{
			var targetEntityId = packet.ReadEntityId();

			var chr = client.ActiveCharacter;
			var target = chr.Region.GetObject(targetEntityId) as Unit;

			if (target == null)
				return;

			if (chr.GossipConversation != null)
			{
				chr.GossipConversation = null;
			}

			var menu = target.GossipMenu;
			if (menu == null)
				return;

			if (target is NPC)
			{
				if (!((NPC)target).CanInteractWith(chr))
				{
					return;
				}
			}
			else if (!chr.Role.IsStaff)
			{
				return;
			}
			chr.OnInteract(target);
			var conversation = new GossipConversation(menu, chr, target, menu.KeepOpen);
			client.ActiveCharacter.GossipConversation = conversation;
			conversation.DisplayCurrentMenu();
		}
コード例 #2
0
ファイル: Character.Fields.cs プロジェクト: remixod/netServer
		/// <summary>
		/// Lets the Character gossip with herself
		/// </summary>
		public void StartGossip(GossipMenu menu)
		{
			GossipConversation = new GossipConversation(menu, this, this, menu.KeepOpen);
			GossipConversation.DisplayCurrentMenu();
		}
コード例 #3
0
ファイル: Character.Fields.cs プロジェクト: remixod/netServer
		/// <summary>
		/// Lets the Character gossip with the given speaker
		/// </summary>
		public void StartGossip(GossipMenu menu, WorldObject speaker)
		{
			GossipConversation = new GossipConversation(menu, this, speaker, menu.KeepOpen);
			GossipConversation.DisplayCurrentMenu();
		}