本文整理汇总了C#中Packets.GetActorID方法的典型用法代码示例。如果您正苦于以下问题:C# Packets.GetActorID方法的具体用法?C# Packets.GetActorID怎么用?C# Packets.GetActorID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packets
的用法示例。
在下文中一共展示了Packets.GetActorID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNPCChat
public void OnNPCChat(Packets.Client.NPCChat p)
{
Actor aActor = map.GetActor(p.GetActorID());
if (aActor == null || aActor.type == ActorType.PC) return;
this.Char.CurTarget = aActor;
ActorNPC CurNpc = (ActorNPC)aActor;
Npc npc = (Npc)CurNpc.e;
byte[] tmp = null;
SagaDB.Quest.Quest q = Quest.QuestsManager.GetActiveQuest(this.Char);
if (q != null)
{
if (npc.Questtable.ContainsKey(q.ID))
{
foreach (SagaDB.Quest.Step s in npc.Questtable[q.ID].Steps.Values)
{
if (s.Status == Quest.QuestsManager.GetQuestStepStatus(this.Char, q.ID, s.ID))
{
tmp = new byte[CurNpc.Attribute.icons.Length + 1];
CurNpc.Attribute.icons.CopyTo(tmp, 0);
tmp[CurNpc.Attribute.icons.Length] = (byte)Npc.Functions.OfficialQuest;
}
}
}
}
q = Quest.QuestsManager.GetActivePersonalQuest(this.Char);
if (q != null)
{
if (npc.PersonalQuesttable.ContainsKey(q.ID))
{
foreach (SagaDB.Quest.Step s in npc.PersonalQuesttable[q.ID].Steps.Values)
{
if (s.Status == Quest.QuestsManager.GetQuestStepStatus(this.Char, q.ID, s.ID))
{
tmp = new byte[CurNpc.Attribute.icons.Length + 1];
CurNpc.Attribute.icons.CopyTo(tmp, 0);
tmp[CurNpc.Attribute.icons.Length] = (byte)Npc.Functions.PersonalQuest;
}
}
}
}
Npc.QuestReqirement pq = npc.GetAvaluablePersonalQuest(this.Char);
if (pq != null)
{
if (tmp != null)
{
byte[] tmp2 = new byte[tmp.Length + 1];
tmp.CopyTo(tmp2, 0);
tmp2[tmp.Length] = (byte)Npc.Functions.AcceptPersonalRequest;
tmp = tmp2;
}
else
{
tmp = new byte[CurNpc.Attribute.icons.Length + 1];
CurNpc.Attribute.icons.CopyTo(tmp, 0);
tmp[CurNpc.Attribute.icons.Length] = (byte)Npc.Functions.AcceptPersonalRequest;
}
}
if (tmp == null)
{
tmp = CurNpc.Attribute.icons;
}
Packets.Server.NPCChat sendPacket = new SagaMap.Packets.Server.NPCChat();
sendPacket.SetActor(p.GetActorID());
sendPacket.SetScript(CurNpc.Attribute.script);
sendPacket.SetIcons((byte)tmp.Length, tmp);
sendPacket.SetUnknown(1);
this.netIO.SendPacket(sendPacket, this.SessionID);
}