コード例 #1
0
ファイル: NPCMgr.cs プロジェクト: uvbs/Asda2-Server
        /// <summary>
        /// Checks which nodes are currently activated by the player and sends the results to the client.
        /// </summary>
        public static void TalkToFM(this NPC taxiVendor, Character chr)
        {
            if (!taxiVendor.CheckVendorInteraction(chr))
            {
                return;
            }
            PathNode vendorTaxiNode = taxiVendor.VendorTaxiNode;

            if (vendorTaxiNode == null)
            {
                return;
            }
            TaxiNodeMask taxiNodes = chr.TaxiNodes;

            if (!taxiNodes.IsActive(vendorTaxiNode))
            {
                if (chr.GodMode)
                {
                    chr.ActivateAllTaxiNodes();
                }
                else
                {
                    taxiNodes.Activate(vendorTaxiNode);
                    TaxiHandler.SendTaxiPathActivated(chr.Client);
                    TaxiHandler.SendTaxiPathUpdate((IPacketReceiver)chr.Client, taxiVendor.EntityId, true);
                    return;
                }
            }

            chr.OnInteract((WorldObject)taxiVendor);
            TaxiHandler.ShowTaxiList(chr, (IEntity)taxiVendor, vendorTaxiNode);
        }