Esempio n. 1
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                Unit target = trigger.Args.Target;

                if (target == null)
                {
                    trigger.Reply("No one selected.");
                }
                else
                {
                    PathNode pathNode = (PathNode)null;
                    float    num      = float.MaxValue;
                    foreach (PathNode node in TaxiCommand.GetNodes(trigger))
                    {
                        if (node.MapId == target.Map.Id)
                        {
                            float distanceSq = target.GetDistanceSq(node.Position);
                            if ((double)distanceSq < (double)num)
                            {
                                num      = distanceSq;
                                pathNode = node;
                            }
                        }
                    }

                    if (pathNode == null)
                    {
                        trigger.Reply("No Node found in Map.");
                    }
                    else
                    {
                        target.TeleportTo(pathNode.Map, pathNode.Position);
                    }
                }
            }
Esempio n. 2
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                MapId  mapId = MapId.End;
                string str   = trigger.Text.NextModifiers();

                if (str.Contains("r"))
                {
                    if (str.Contains("c") && trigger.Args.Target != null)
                    {
                        mapId = trigger.Args.Target.Map.Id;
                    }
                    else
                    {
                        mapId = trigger.Text.NextEnum <MapId>(MapId.End);
                        if (mapId == MapId.End)
                        {
                            trigger.Reply("Invalid Map: " + (object)mapId);
                            return;
                        }
                    }
                }

                foreach (PathNode node in TaxiCommand.GetNodes(trigger))
                {
                    if (mapId == MapId.End || node.MapId == mapId)
                    {
                        trigger.Reply(node.ToString());
                    }
                }
            }
Esempio n. 3
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                List <PathNode> nodes  = TaxiCommand.GetNodes(trigger);
                Unit            target = trigger.Args.Target;

                if (target == null)
                {
                    trigger.Reply("No one selected.");
                }
                else
                {
                    PathNode pathNode = nodes.FirstOrDefault <PathNode>();
                    if (pathNode == null)
                    {
                        return;
                    }
                    target.TeleportTo(pathNode.Map, pathNode.Position);
                }
            }