示例#1
0
        private void Handle_UserSelectNpc(WvsGameClient c, CInPacket p)
        {
            var dwNpcId = p.Decode4();
            var nPosX   = p.Decode2();
            var nPosY   = p.Decode2();

            if (c.NpcScript != null)
            {
                Logger.Write(LogLevel.Warning, "Npc script already in progress?");
            }

            var field = c.GetCharField();
            var npc   = field.Npcs.Get(dwNpcId);

            if (npc != null)
            {
                //if (npc.hasShop())
                //{
                //    chr.setConversation(1);
                //    npc.sendShop(c);
                //}
                //else
                {
                    c.NpcScript = NpcScript.GetScript(npc.Id, c);
                    c.NpcScript.Execute();
                }
            }
            else
            {
                Logger.Write(LogLevel.Warning, "Unable to find NPC {0}", dwNpcId);
            }
        }