Пример #1
0
 public void AddPet(Pet Pet)
 {
     if (Pet != null)
     {
         Pet.PlacedInRoom = false;
         if (!this.InventoryPets.ContainsKey(Pet.PetId))
         {
             this.InventoryPets.Add(Pet.PetId, Pet);
         }
         ServerMessage AddMessage = new ServerMessage(603);
         Pet.SerializeInventory(AddMessage);
         GetClient().SendMessage(AddMessage);
     }
 }
Пример #2
0
 public RoomUser method_4(RoomBot Bot, Pet PetData)
 {
     int num = this.method_5();
     RoomUser user = new RoomUser(Convert.ToUInt32(num + 100000), this.RoomId, this.int_7++, true);
     user.CurrentFurniFX = num;
     this.UserList[num] = user;
     if (Bot.X > 0 && Bot.Y > 0 && Bot.X < this.Model.MapSizeX && Bot.Y < this.Model.MapSizeY)
     {
         user.SetPos(Bot.X, Bot.Y, Bot.Z);
         user.SetRot(Bot.Rot);
     }
     else
     {
         Bot.X = this.Model.DoorX;
         Bot.Y = this.Model.DoorY;
         user.SetPos(this.Model.DoorX, this.Model.DoorY, this.Model.DoorZ);
         user.SetRot(this.Model.DoorOrientation);
     }
     user.BotData = Bot;
     user.BotAI = Bot.GenerateBotAI(user.VirtualId);
     if (user.IsPet)
     {
         user.BotAI.Init((int)Bot.BotId, user.VirtualId, this.RoomId);
         user.PetData = PetData;
         user.PetData.VirtualId = user.VirtualId;
     }
     else
     {
         user.BotAI.Init(-1, user.VirtualId, this.RoomId);
     }
     this.UpdateUserStatus(user, true, true);
     user.UpdateNeeded = true;
     ServerMessage Message = new ServerMessage(28u);
     Message.AppendInt32(1);
     user.Serialize(Message);
     this.SendMessage(Message, null);
     user.BotAI.OnSelfEnterRoom();
     return user;
 }