Exemplo n.º 1
0
        /// <summary>
        /// Tries to get the hate of the mob.
        /// </summary>
        /// <param name="cpkt"></param>
        private void CM_REQUESTSHOWNPCLOCATION(CMSG_NPCLOCATIONSELECT cpkt)
        {
            List <GuidePoint> guidepoints = this.character.Tag as List <GuidePoint>;

            if (guidepoints != null && cpkt.LocationId < guidepoints.Count)
            {
                GuidePoint    point  = guidepoints[cpkt.LocationId];
                GuideNpc      npoint = point as GuideNpc;
                GuidePosition ppoint = point as GuidePosition;

                if (npoint != null)
                {
                    //Predicated used searching
                    Predicate <MapObject> FindActor = delegate(MapObject actor)
                    {
                        return(actor.ModelId == npoint.Map);
                    };

                    List <MapObject> matchingactors = new List <MapObject>();
                    Regiontree       tree           = this.character.currentzone.Regiontree;
                    matchingactors.AddRange(tree.SearchActors(FindActor, SearchFlags.Npcs));
                    if (matchingactors.Count > 0)
                    {
                        MapObject matchingactor     = matchingactors[0];
                        SMSG_NPCASKLOCATIONSRC spkt = new SMSG_NPCASKLOCATIONSRC();
                        spkt.SessionId    = this.character.id;
                        spkt.Result       = 0;
                        spkt.DialogScript = 0;
                        spkt.NpcId        = npoint.Map;
                        spkt.X            = matchingactor.Position.x;
                        spkt.Y            = matchingactor.Position.y;
                        spkt.Z            = matchingactor.Position.z;
                        this.Send((byte[])spkt);
                    }
                }
                else if (ppoint != null)
                {
                    SMSG_NPCASKLOCATIONSRC spkt = new SMSG_NPCASKLOCATIONSRC();
                    spkt.SessionId    = this.character.id;
                    spkt.Result       = 2;
                    spkt.DialogScript = 0;
                    spkt.NpcId        = ppoint.Npc;
                    spkt.X            = ppoint.x;
                    spkt.Y            = ppoint.y;
                    spkt.Z            = ppoint.z;
                    spkt.Result2      = 6;
                    this.Send((byte[])spkt);
                }
            }
        }
Exemplo n.º 2
0
 public IGuider Make(string elementId, string content, GuidePosition guidePosition = GuidePosition.Right)
 {
     return(Make(new GuideStep(elementId, content, guidePosition)));
 }
Exemplo n.º 3
0
 public IGuider Make(ElementReference element, string content, GuidePosition guidePosition = GuidePosition.Right)
 {
     return(Make(new GuideStep(element, content, guidePosition)));
 }
Exemplo n.º 4
0
 public ValueTask <object> Show(double x, double y, string content, GuidePosition guidePosition = GuidePosition.Right)
 {
     return(_jSRuntime.InvokeAsync <object>("guiderJsFunctions.showWithXY", Setting, Id, x, y, content, guidePosition, DotNetObjectReference.Create(this)));
 }
Exemplo n.º 5
0
 public GuideStep(double x, double y, string content, GuidePosition guidePosition = GuidePosition.Right) : this(content, guidePosition)
 {
     this.X         = x;
     this.Y         = y;
     this.GuideType = GuideType.Coordination;
 }
Exemplo n.º 6
0
 public GuideStep(ElementReference elementRef, string content, GuidePosition guidePosition = GuidePosition.Right) : this(content, guidePosition)
 {
     this.ElementRef = elementRef;
     this.GuideType  = GuideType.Ref;
 }
Exemplo n.º 7
0
 public GuideStep(string elementId, string content, GuidePosition guidePosition = GuidePosition.Right) : this(content, guidePosition)
 {
     this.ElementId = elementId;
     this.GuideType = GuideType.Id;
 }
Exemplo n.º 8
0
 private GuideStep(string content, GuidePosition guidePosition)
 {
     this.Content       = content;
     this.GuidePosition = guidePosition;
 }
Exemplo n.º 9
0
 public IGuider Make(double x, double y, string content, GuidePosition guidePosition = GuidePosition.Right)
 {
     return(Make(new GuideStep(x, y, content, guidePosition)));
 }