Exemple #1
0
 public void OnSupplySelect(Packets.Client.SupplySelect p)
 {
     if (this.Char.CurTarget == null)
     {
         return;
     }
     if (this.Char.CurTarget.type != ActorType.NPC)
     {
         return;
     }
     try
     {
         Npc npc = (Npc)this.Char.CurTarget.e;
         Packets.Server.SendSupplyList p2 = new SagaMap.Packets.Server.SendSupplyList();
         uint supplyID = p.GetSupplyID();
         if (!npc.SupplyMatrials.ContainsKey(supplyID) || !npc.SupplyProducts.ContainsKey(supplyID))
         {
             if (this.Char.GMLevel > 1)
             {
                 SendMessage("System", "Cannot find Supply items for supplyID:" + supplyID + " for this NPC!", SagaMap.Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE);
             }
             return;
         }
         p2.SetActor(npc.Actor.id);
         p2.SetSupplyID(supplyID);
         p2.SetProducts(npc.SupplyProducts[supplyID]);
         p2.SetMatrial(npc.SupplyMatrials[supplyID]);
         this.netIO.SendPacket(p2, this.SessionID);
         npc.NPCChat(this.Char, 0);
     }
     catch (Exception) { }
 }
Exemple #2
0
 public void OnSupplySelect(Packets.Client.SupplySelect p)
 {
     if (this.Char.CurTarget == null) return;
     if (this.Char.CurTarget.type != ActorType.NPC) return;
     try
     {
         Npc npc = (Npc)this.Char.CurTarget.e;
         Packets.Server.SendSupplyList p2 = new SagaMap.Packets.Server.SendSupplyList();
         uint supplyID = p.GetSupplyID();
         if (!npc.SupplyMatrials.ContainsKey(supplyID) || !npc.SupplyProducts.ContainsKey(supplyID))
         {
             if (this.Char.GMLevel > 1)
                 SendMessage("System", "Cannot find Supply items for supplyID:" + supplyID + " for this NPC!", SagaMap.Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE);
             return;
         }
         p2.SetActor(npc.Actor.id);
         p2.SetSupplyID(supplyID);
         p2.SetProducts(npc.SupplyProducts[supplyID]);
         p2.SetMatrial(npc.SupplyMatrials[supplyID]);
         this.netIO.SendPacket(p2, this.SessionID);
         npc.NPCChat(this.Char, 0);
     }
     catch (Exception) { }
 }