Esempio n. 1
0
 private void LoadNpc()
 {
     //NPC's are shown always, they don't dissapear from sectors
     foreach (var spawn in MapInfo.NPCs)
     {
         Npc npc = new Npc(spawn);
         if(npc == null)
             Log.WriteLine(LogLevel.Warn, "NULL value for {0} {1}:{2} of mob {3}", spawn.Map, spawn.CoordX, spawn.CoordY, spawn.MobName);
             else
             FullAddObject(npc);
     }
 }
Esempio n. 2
0
        public static void SendItemShopWeapon(Npc npc, Packet packet, ZoneCharacter character)
        {
            using (packet = new Packet(SH15Type.HandlerWeapon))
            {
                if (npc.Point.VendorItems != null)
                {
                    int count = npc.Point.VendorItems.Count;

                    packet.WriteByte((byte)count);
                    packet.WriteInt(0);//unk
                    foreach (var items in npc.Point.VendorItems)
                    {

                        packet.WriteUShort(items.ItemID);
                        packet.WriteByte(items.InvSlot);//unk
                    }

                }
                else
                {

                    packet.WriteByte(0);
                    packet.WriteInt(0);//unk
                    packet.WriteUShort(0);
                    packet.WriteByte(0);//unk
                }
                character.Client.SendPacket(packet);
            }
        }
Esempio n. 3
0
 public static void SendNpcInteraction(ZoneClient client, Npc npc)
 {
     switch (npc.Point.RoleArg0)
     {
         case "Guild":
             if (npc.Point.Role == "NPCMenu")
             {
                 using (var packet = new Packet(SH15Type.GuildNpcReqest))
                 {
                     client.SendPacket(packet);
                 }
             }
             else
             {
                 using (var packet = new Packet(SH8Type.Interaction))
                 {
                     packet.WriteUShort(npc.ID);
                     client.SendPacket(packet);
                 }
             }
             break;
         case "Quest":
             //:TODO Quest Proggresion
             using (var packet = new Packet(SH8Type.Interaction))
             {
                 packet.WriteUShort(npc.ID);
                 client.SendPacket(packet);
             }
             Console.WriteLine(npc.Point.RoleArg0);
             break;
         default:
             using (var packet = new Packet(SH8Type.Interaction))
             {
                 packet.WriteUShort(npc.ID);
                 client.SendPacket(packet);
             }
             break;
     }
 }
Esempio n. 4
0
 public static void SendItemShopStones(Npc npc, Packet packet, ZoneCharacter character)
 {
     using (packet = new Packet(SH15Type.HandlerStone))
     {
         packet.WriteInt(character.BaseStats.HPStoneEffectID);//useeffectid
         packet.WriteInt(character.BaseStats.MaxSoulHP);//maxhpstones
         packet.WriteInt(character.BaseStats.PriceHPStone);//hp stines price
         packet.WriteInt(character.BaseStats.SPStoneEffectID);//useeffectid
         packet.WriteInt(character.BaseStats.MaxSoulSP);//sp max stones
         packet.WriteInt(character.BaseStats.PriceSPStone);//spstones price
         character.Client.SendPacket(packet);
     }
 }