示例#1
0
        /// <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);
        }
示例#2
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                Character target = trigger.Args.Target as Character;

                if (target == null)
                {
                    trigger.Reply("No one selected.");
                }
                else
                {
                    string str = trigger.Text.NextModifiers();
                    if (str.Contains("a"))
                    {
                        target.ActivateAllTaxiNodes();
                    }
                    Map      map;
                    PathNode node;
                    if (str.Contains("r"))
                    {
                        map = World.GetNonInstancedMap(
                            trigger.Text.NextEnum(MapId.End));
                        if (map == null)
                        {
                            trigger.Reply("Invalid Map.");
                            return;
                        }

                        node = map.FirstTaxiNode;
                    }
                    else
                    {
                        map  = target.Map;
                        node = TaxiMgr.GetNearestTaxiNode(target.Position);
                    }

                    if (node != null)
                    {
                        TaxiHandler.ShowTaxiList(target, node);
                    }
                    else
                    {
                        trigger.Reply("There are no Taxis available on this Map ({0})", (object)map.Name);
                    }
                }
            }
示例#3
0
        /// <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;
            }

            // Get the taxi node associated with this Taxi Vendor
            var curNode = taxiVendor.VendorTaxiNode;

            if (curNode == null)
            {
                return;
            }

            // If this taxi node is as yet unknown to the player, activate it for them.
            var nodeMask = chr.TaxiNodes;

            if (!nodeMask.IsActive(curNode))
            {
                if (chr.GodMode)
                {
                    chr.ActivateAllTaxiNodes();
                }
                else
                {
                    nodeMask.Activate(curNode);
                    TaxiHandler.SendTaxiPathActivated(chr.Client);
                    TaxiHandler.SendTaxiPathUpdate(chr.Client, taxiVendor.EntityId, true);

                    // apparently the blizz-like activity is to not send the taxi list until the next
                    // vendor interaction. So we'll ditch this taco stand.
                    return;
                }
            }

            chr.OnInteract(taxiVendor);

            // The character has previously activated this TaxiNode, send the known nodes list to the client
            TaxiHandler.ShowTaxiList(chr, taxiVendor, curNode);
        }