Ejemplo n.º 1
0
        public static void SendNavPoint(ActorPC pc)
        {
            ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e;
            Packets.Server.SendNavPoint        p  = new SagaMap.Packets.Server.SendNavPoint();
            SagaDB.Quest.Quest quest = GetActiveQuest(pc);
            if (quest == null)
            {
                return;
            }
            if (!WayPoints.ContainsKey(quest.ID))
            {
                return;
            }
            Dictionary <uint, List <WayPointInfo> > list1 = WayPoints[quest.ID];
            uint sid = 0;

            foreach (uint i in quest.Steps.Keys)
            {
                if (quest.Steps[i].Status == 1)
                {
                    sid = i;
                }
                if (sid != 0)
                {
                    break;
                }
            }
            if (sid == 0)
            {
                return;
            }
            if (!list1.ContainsKey(sid))
            {
                return;
            }
            List <WayPointInfo> list2 = list1[sid];
            List <WayPointInfo> list3 = new List <WayPointInfo>();

            foreach (WayPointInfo j in list2)
            {
                if (j.mapID == pc.mapID)
                {
                    list3.Add(j);
                }
            }
            if (list3.Count == 0)
            {
                return;
            }
            p.SetQuestID(quest.ID);
            p.SetPosition(list3);
            eh.C.netIO.SendPacket(p, eh.C.SessionID);
        }
Ejemplo n.º 2
0
 public static void SendNavPoint(ActorPC pc)
 {
     ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e;
     Packets.Server.SendNavPoint p = new SagaMap.Packets.Server.SendNavPoint();
     SagaDB.Quest.Quest quest = GetActiveQuest(pc);
     if (quest == null) return;
     if (!WayPoints.ContainsKey(quest.ID)) return;
     Dictionary<uint, List<WayPointInfo>> list1 = WayPoints[quest.ID];
     uint sid = 0;
     foreach (uint i in quest.Steps.Keys)
     {
         if (quest.Steps[i].Status == 1) sid = i;
         if (sid != 0) break;
     }
     if (sid == 0) return;
     if (!list1.ContainsKey(sid)) return;
     List<WayPointInfo> list2 = list1[sid];
     List<WayPointInfo> list3 = new List<WayPointInfo>();
     foreach (WayPointInfo j in list2)
     {
         if (j.mapID == pc.mapID)
             list3.Add(j);
     }
     if (list3.Count == 0) return;
     p.SetQuestID(quest.ID);
     p.SetPosition(list3);
     eh.C.netIO.SendPacket(p, eh.C.SessionID);
 }